Skip to content

SF-05: gate on relative l2 only, peak distance reported - #87

Merged
stedrew merged 1 commit into
feature/babelbrain-flfrom
bbfl/sf-05-l2-gate
Oct 17, 2026
Merged

stedrew merged 1 commit into
feature/babelbrain-flfrom
bbfl/sf-05-l2-gate

Conversation

@stedrew

@stedrew stedrew commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Steve decided on 2026-10-16, after the meeting named L2 error as the primary metric, that the evaluation gate decides on relative l2 only.

  • Default gate: {"enabled": true, "max_rel_l2_increase": 0.0, "max_peak_distance_increase_mm": null}. Any rise in mean relative l2 blocks the candidate.
  • Peak distance, SSIM, PSNR, peak amplitude error and the -3 dB centroid distance are still in eval_report.json, overall and per region, but do not block.
  • max_peak_distance_increase_mm is now an opt-in check. A config that sets it to a number behaves as before.
  • This supersedes answer T8 of 2026-09-27. With T8, a workbench round was rejected even though peak distance fell from 1.81 to 0.80 mm.
  • gate.py docstring and TASK_GUIDE.md updated.

Tests

  • New DecideTest cases:
    • the demo case: relative l2 falls while peak distance rises, which is accepted;
    • a slight rise in relative l2, which is rejected;
    • a non-finite peak distance, which does not block by default;
    • the opt-in peak distance check.
  • manage.py test starfish.controller.tasks.babel_brain_fno: 143 tests, OK. Run locally on Python 3.12 with CPU torch and a fakeredis server.
  • Full controller suite: 583 tests. All pass except 47 R task tests, 19 failures and 28 errors. Those fail because this machine's R lacks jsonlite and mice; they touch no gate code. CI installs the R packages.

Follow-up

The demo on #86, workbench/babelbrain-demo/run_demo.py, still describes the old rule: its intro line, its --peak-margin-mm help text, which says "default 0, answer T8". Its README still reads correctly, since --peak-margin-mm now opts into the peak check. Its gate narration itself reads eval_report.json and will show the new decisions correctly.

🤖 Generated with Claude Code

Steve decided on 2026-10-16, from the meeting naming L2 error as the
primary metric, that the evaluation gate blocks only a rise in mean
relative l2, with a default margin of zero. This supersedes answer T8,
which also blocked any rise in peak distance and held the model back on
a noisy focal metric, such as the workbench round that was rejected while
peak distance fell from 1.81 to 0.80 mm.

max_peak_distance_increase_mm now defaults to None, which skips the check.
A config that sets it to a number still gets the peak distance check as
before. All six metrics stay in eval_report.json, overall and per region.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stedrew added a commit that referenced this pull request Oct 17, 2026
The gate now decides on relative l2 alone, D8, so the intro no longer says
peak distance blocks by default; --peak-margin-mm adds it back as an opt-in.
Gate-approved models now wait in the registry as pending, D7: the demo lists
them, signs off the newest as the coordinator and shows it approved.

Needs PR #87 and PR #88 merged first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stedrew
stedrew merged commit 8cdcef9 into feature/babelbrain-fl Oct 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant