flybrain/services/flysim/crates/fly-legacy-session
acamilo 3ea56ef3f8 tests: service_parity waits for the idle header instead of racing the pause
The idle-headers check failed 8 of 12 runs on a loaded build box (main
46e25ef: 3 of 4). The script paused and resumed 2 ms apart, so whether the
loop published a header-only idle snapshot in that window (due at 2 Hz) was
wall-clock luck, and legacy and session often disagreed. Not a product race:
the cadence is the protocol's.

The recorder now holds the resume until the first idle header has been seen
(bounded wait, 30 s), and the compare requires BOTH runtimes to have published
one, rather than merely agreeing on whether any did. The first idle header is
compared as before except for its `events` list: which publish carries the
pause's events is wall clock, and the events are compared in the running
snapshots and the event log.

Also fixed, found once the first was gone (1 in 20 under load): the two
sugars sent at one frame must be drained together; when the loop publishes
a snapshot while they are being sent the run is flagged incomplete and
repeated, like a missed frame.

What it proves, unchanged: a pause makes each runtime publish header-only
idle snapshots (status paused, no attachments) whose fields match the legacy
loop, and the script's responses, feed, event log, journal and final
checkpoint are identical between runtimes.

Under load (build box, load ~25 on 6 cores), toy_raw_service_contracts:
before 4/12 pass, after 40/40.
2026-10-02 01:12:56 +00:00
..
examples Merge port/shadow-01 (SHADOW-01) into v0.7.0 release candidate 2026-09-30 10:09:01 +00:00
src session: pin the sweep workers one per cpu in flysim-session (PERF-02) 2026-10-01 12:16:59 +00:00
tests tests: service_parity waits for the idle header instead of racing the pause 2026-10-02 01:12:56 +00:00
Cargo.toml Merge port/shadow-01 (SHADOW-01) into v0.7.0 release candidate 2026-09-30 10:09:01 +00:00