Skip to content

test(site): judge s18 own commands by the fuse heat model - #1944

Merged
frahlg merged 1 commit into
masterfrom
rig-s18-heat-judge
Oct 28, 2026
Merged

frahlg merged 1 commit into
masterfrom
rig-s18-heat-judge

Conversation

@frahlg

@frahlg frahlg commented Oct 28, 2026

Copy link
Copy Markdown
Member

Problem

On master 575152e (beta v0.157.3-beta.1) the local rig short set failed s18-16 (s18-car-first-battery-charge-16A) on one criterion, "own commands stay inside the rated fuse":

  • max_i_own_commands 16.011 A against the judge's fixed bound of 16.01 A (16 A fuse, safety margin 0 since fix(config): fuse safety_margin_a defaults to 0 #1914).
  • The 60 s heat at that reading was 14.95 A, and it stayed under 15.56 A for the whole own-command window.
  • Every other criterion passed, and the fuse held.

At margin 0 Core holds the phases at the 16 A line, so readings jitter a few mA either side of it. A fixed bound 0.01 A over the fuse fails on that jitter. That bound also breaks the owner rule (27 Oct 2026): the working limit is the fuse rating, readings between In and 1.2 x In are judged by the I²t heat model (tau 60 s), and anything over 1.2 x In fails at once.

Change

judgeS18 (go/test/site/ev_battery_priority_test.go) now judges own-command readings with the shared warm() / heatOver() helpers that the random and R5a judges already use. A reading fails only when it is over the fuse while its phase's 60 s heat is also over the fuse, or when it is over 1.2 x the fuse. The fuse comes from the run's meta, not a literal. The 10 s skip after the house's 0.1 A step stays: that stretch belongs to the house, not to Core. The new metric own_commands_over_fuse_heat_samples counts the failing readings, and max_i_own_commands stays as a metric.

Tests

  • New TestS18OwnCommandsJudgedByHeat:
    • 16.011 A for 5 s at the line passes.
    • 16.5 A for 30 s at the line heats past the fuse and fails.
    • 16.5 A for 5 s from a cool fuse passes.
    • One reading at 19.1 A passes.
    • One reading at 19.3 A (over 1.2 x 16 A) fails.
  • TestS18OwnCommandsSkipTheHouseStep still passes, now with the fuse in meta. Its phases sit at the fuse from the start, so the heat is at the fuse and 16.1 A outside the house step still fails.
  • Re-judged a copy of the failed run with FTW_SITE_JUDGE=<copy> go test -run '^TestJudge$' ./test/site/. The result is s18-16: pass, with max_i_own_commands 16.011 and own_commands_over_fuse_heat_samples 0.
  • go test -race ./test/site/ (unit only), go vet ./test/site/ and gofmt -l are clean.

Test-only change, so it carries no-changeset.

🤖 Generated with Claude Code

At margin 0 Core holds the phases at the 16 A line, and simulator jitter
put one reading at 16.011 A against the fixed 16.01 A bound. Own-command
readings over the fuse now fail only while the 60 s heat is over the fuse
too, or at once over 1.2 x the fuse (heatOver), as the owner rule says.

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 Oct 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-10-28T11:08:08.899275Z 25c0770 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.

@frahlg
frahlg merged commit 1c2ffbc into master Oct 28, 2026
22 of 23 checks passed
@frahlg
frahlg deleted the rig-s18-heat-judge branch November 11, 2026 09:22
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