Skip to content

test(site): drop r3 and r4 known lines fixed on master, give r4 room for a restart - #1960

Open
frahlg wants to merge 2 commits into
masterfrom
test/rig-r3-r4-known
Open

frahlg wants to merge 2 commits into
masterfrom
test/rig-r3-r4-known

Conversation

@frahlg

@frahlg frahlg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Problem

siterig/full has failed every master commit since 28 Oct on r3-25 and r4-25:

r3-25 fail: "no discharge ordered below the planner floor" passes now: delete its known line (A4 …);
            "the battery order swings at most 100 W over the last 5 min" passes now: delete its known line (A3, A4 …)
r4-25 fail: "session energy counts again after each restart" passes now: delete its known line (E1 …)

The fixes for A3 (#1876), A4 (#1878, #1916) and E1 (#1787) merged before the R1–R5 scenarios (#1888), so nobody deleted the known lines. The rig fails a known line once it passes.

The known lines

The recorded runs show that r3 and r4 pass for the right reason. In each of five full runs (c6f757b, f3b48e4, 875240e, a75b76b, be11e36):

  • r3: 0 samples with discharge ordered below the floor, a 0 W order swing over the last 5 min, the battery at the 10 % floor (setup check passes), and 61–62 s over the fuse against 67 s allowed.
  • r4: session energy 121–125 Wh 90 s after each restart, so the 1.6 transaction is taken up.

Judging the be11e36 recording again with this branch passes both.

r4's Home use check

In 1 run of 5 (f3b48e4), r4 also failed "the day's Home use kept within 1 % across the first kill". After the restart, the day total was null for the rest of the run.

The cause is in the test, not Core. The day may have 10 % unknown time (maxSourceDayUnknownShare), counted in whole ledger minutes. After the restart, the car's power is unknown for about 10 s. In that run those seconds crossed a minute boundary, so two minutes were marked. That made 86 s unknown plus 42 s unrecorded, 12.2 % of a 1 054 s day. The other four runs marked one minute and stayed at 6.5 %. On a real day, a restart costs at most about 2 minutes of the 2.4 h allowance.

r4 now waits 25 min instead of 10 before the battery hold, as s7 already waits 15 min for the same rule. The worst case of about 140 s is then about 7 % of a 1 950 s day. The run takes about 15 min longer.

Evidence

  • go vet ./test/site/... and go test ./test/site/... pass.
  • The rig judged the recorded runs again with this branch (make siterig-judge): be11e36 r3 and r4 pass; f3b48e4 r4 still fails, as expected, because it was recorded with the 10 min wait.
  • A real run of r3-25,r4-25 with this branch on an M5 laptop, two lanes: both pass. r3 took 11 m 30 s, with 0 discharge samples below the floor, a 0 W swing, and 62 s over the fuse against 67 s allowed. r4 took 39 m 41 s, with Home use 4 161 → 4 351 Wh across the first kill, never null, and 23 s unknown plus 45 s unrecorded, 3.5 % of a 1 953 s day.

Review

An independent review (Sonnet) checked:

  • that the four fixes are on master and each comes with unit tests;
  • r3's plant trace: SoC reaches 10.0 % at 147 s, and Core then orders 0 W to the end;
  • the 10 % arithmetic: a worst case of about 7.4 % after this change;
  • that nothing else depends on the 600 s wait. The judge windows use marks, and the 1 800 s hold outlasts the 860 s it needs.

It found no blocking issue. Changes made from it:

  • r3 judges the measured SoC (6d73e66). With the known lines gone, the two floor criteria are gates, and both read Core's order. A battery handed back to the inverter reads as a 0 W order and would pass while it runs on to the inverter's 5 %. The new criterion "the battery stays at or above the planner floor" needs SoC ≥ floor − 0.5. Its unit test fails on the old judge. The recorded be11e36 run and this branch's run still pass, at 10.0 %.
  • The r4 comment now says that the 128 s includes 42 s while Core was down or starting.

Left as they are:

Test only, no changeset.

🤖 Generated with Claude Code

…for a restart

A3 and A4 (#1876, #1878, #1916) and E1 (#1787) merged before the R1-R5
scenarios did, so r3-25 and r4-25 failed every full run since 28 Oct with
"passes now: delete its known line".

r4 also failed "the day's Home use kept within 1 %" in 1 run of 5. The
day may have 10 % unknown time, counted in whole ledger minutes; when the
car's unknown reading after the restart crossed a minute boundary, two
minutes were marked and the 17 min day reached 12.2 %. r4 now waits
25 min instead of 10 before the hold, as s7 waits 15 min.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frahlg frahlg added the no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping) label Nov 3, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T19:36:54.999288Z e01e422 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

With its known lines gone, r3's floor criteria are gates, and both read
Core's order. A battery handed back to the inverter reads as a 0 W order
and would pass while it runs on to the inverter's 5 %. The measured SoC
must now stay at or above the floor too. Review of #1960.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant