Skip to content

closed-loop-report: apply bridge-3.4 start_frame in the idx check - #278

Merged
1 commit merged into
mainfrom
fix/closed-loop-report-start-frame
Oct 28, 2026
Merged

1 commit merged into
mainfrom
fix/closed-loop-report-start-frame

Conversation

@mbreiser

@mbreiser mbreiser commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Found during the LAB-338 extraction QC on ww18 (2026-10-27); the report script is also what the start_frame runs of LAB-303 rigs are judged with.

scripts/closed-loop-report.py predicted every closed-loop row as
round((coupling·Δheading + offset + bias)/deg_per_frame) mod frames, taking offset from the
browser's config echo. Since Studio v0.91 / bridge 3.4, each startClosedLoop config also carries
start_frame. For that message the bridge sets offset = (start_frame mod frames) × deg_per_frame,
but the logged browser config still says offset: 0. The result was 100 % idx mismatch on
every epoch that opens off frame 0
.

The bridge's [cfg] applied … line goes only to stderr, and the ROS node uses the same
make_dispatcher. Neither log records the offset the bridge actually applied, so the report
replays the config echoes in order, the way bridge.py handles them (apply_config):

  • the message's offset is applied first; start_frame then overrides it, using the same message's
    deg_per_frame and frames (taken mod frames, like Pipeline.start_frame_to_offset);
  • the next config's offset replaces it (one-shot: the stopClosedLoop push resets it to 0);
  • logs without start_frame (≤ 3.3) give the same results as before.

The epoch JSON gains start_frame and offset_deg. In the markdown table the frames column now
reads 200 @25, and the legend explains the start_frame offset. docs/development/closed-loop-bias.md
(the offline reconstruction recipe) now describes the same rule.

Evidence: two runs of protocols/validation/bench_closed_loop_2x10.yaml on reiserlab-ww18
(2026-10-27, bridge 3.4; epochs open on frames 25 and 75). Before this change: 100 % / 100 % on both runs.
After: 0.00 % on all 4 epochs.

Tier

next candidate

Release notes

none

Test plan

  • pixi run test: 72/72 files passed (Windows)
  • tests/test-fictrac-sim.py new "start_frame (bridge 3.4)" block:
    • apply_config matches bridge.Pipeline.start_frame_to_offset, including mod frames
    • one-shot reset, and use of the same message's pitch and frame count
    • a synthetic three-epoch run (start 25, start 275 → 75, none): 0 % mismatch, 200 @25 / 200 @75 and start_frame appear in the markdown
    • a log whose idx ignored start_frame is still flagged (100 % on those epochs, 0 % on the plain one)
  • Both ww18 logs re-run: 0.00 % on all four epochs (100 % with the script on main)

🤖 Generated with Claude Code

Since Studio v0.91 / bridge 3.4 every startClosedLoop config carries
start_frame, and the bridge sets offset = (start_frame mod frames) x
deg_per_frame for that message. The logged browser config still says
offset: 0 and the bridge's "[cfg] applied" line goes to stderr only, so
the report predicted every start_frame epoch from frame 0 and flagged
100 % idx mismatch (ww18 2026-10-27, bench_closed_loop_2x10.yaml).

The report now replays the config echoes in order the way bridge.py's
handler does (apply_config): offset from the message, overridden by
start_frame using the same message's pitch and frame count, cleared by
the next message's offset (one-shot). Logs without start_frame are
unchanged. The table shows "frames @start" and the legend names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mbreiser mbreiser closed this pull request by merging all changes into main in 8d5b952 Oct 28, 2026
@mbreiser
mbreiser deleted the fix/closed-loop-report-start-frame branch October 28, 2026 20:35
taylorlm88 pushed a commit to taylorlm88/webDisplayTools that referenced this pull request Nov 6, 2026
taylorlm88 pushed a commit to taylorlm88/webDisplayTools that referenced this pull request Nov 6, 2026
Candidate for Production. PRs: reiserlab#274, reiserlab#278, reiserlab#273.

Release-Manifest: releases/2026-10-27.json
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