From 3042607009467df1389563694c986d1911802258 Mon Sep 17 00:00:00 2001 From: Michael B Reiser Date: Sun, 13 Sep 2026 11:22:44 -0400 Subject: [PATCH 01/67] =?UTF-8?q?feat(studio):=20SD-card=20stall=20visibil?= =?UTF-8?q?ity=20=E2=80=94=20per-trial=20stimulus=20quality,=20card=20iden?= =?UTF-8?q?tity=20(0xCD),=20ring-v2=20FRAME=20latency=20fields,=20telemetr?= =?UTF-8?q?y=20report=20=E2=80=94=20Studio=20v0.77?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The controller's SD card stalls 23–89 ms every ~24.5k reads of a large pattern (card-internal read-count maintenance; 712/716 stalls on the 813 KB pattern, none on the 81 KB one; measured displayed-frame gap = stall + ~2 ms). Acceptable freeze: 5 ms target / 10 ms worst case. - js/arena-telemetry.js: FRAME extras from ring-v2 firmware (req_age_us u32, superseded, flags → sdRead/contiguous), STATE kinds 11 sd_layout / 12 sd_slow_ctx / 13 sd_reads, sd_slow phase byte; cf rows gain three optional trailing fields; STREAM_SCHEMA updated; drainer per-poll budget 40 → 200 chunks (background-tab 1 Hz polling could not keep up with 26 B FRAMEs at 200–286 Hz). - js/arena-wire-g6.js: 0xCB flags bit 5 sdFastPath (+ ' sdfast' label), GET_SD_INFO 0xCD encoder/decoder (CID manufacturer/product/serial/date, capacity, FAT type, cluster size, label). - js/trial-quality.js (new, dual-export, tested): per-trial pass / fail / unknown from ring records in seq order — trial = successful sd_open; fail = sd_slow read or FRAME req_age over 10 ms; coverage gaps (seq gap, reboot, ring overrun, poller paused) → unknown, never pass; dedup by seq; display_gap events; reads/commands/index-change accounting. - arena_studio.html v0.77: reads 0xCD at link-up → Studio.sdCard → run_metadata.sd_card; feeds the drainer's records to trial-quality; display_gap events + trial_quality event at run end after a final drain; banner naming flagged trials (flag only — exclusion is the experimenter's call); FRAME dump lines show age/superseded/contiguous. - scripts/telemetry-report.py (new, tested): reads accounting per pattern, SD read cost by index step class, stall clusters with spacing in commands / index changes / seconds, request→presentation percentiles, per-trial verdict table; consumes Studio logs and sd_stall_test.py logs alike. - scripts/wedge-scan.py: kinds 11–13 (sd_layout labelled contig/FRAGMENTED + spc). - tests: arena-telemetry (v1 + v2 FRAME, kinds 11–13), arena-wire (bit 5, 0xCD fixture), trial-quality (21), telemetry-report (37); pixi test task wired. Release notes v0.77; CLAUDE.md rule. Co-Authored-By: Claude Fable 5.1 --- arena_studio.html | 67 ++- .../development/arena-studio-release-notes.md | 20 + js/arena-telemetry.js | 71 ++- js/arena-wire-g6.js | 108 +++- js/trial-quality.js | 304 +++++++++++ pixi.toml | 2 +- scripts/telemetry-report.py | 477 ++++++++++++++++++ scripts/wedge-scan.py | 5 + tests/test-arena-telemetry.js | 90 +++- tests/test-arena-wire-g6.js | 73 +++ tests/test-telemetry-report.py | 178 +++++++ tests/test-trial-quality.js | 178 +++++++ 12 files changed, 1555 insertions(+), 18 deletions(-) create mode 100644 js/trial-quality.js create mode 100644 scripts/telemetry-report.py create mode 100644 tests/test-telemetry-report.py create mode 100644 tests/test-trial-quality.js diff --git a/arena_studio.html b/arena_studio.html index 82511ea3..db1c7be1 100644 --- a/arena_studio.html +++ b/arena_studio.html @@ -2959,7 +2959,7 @@

Import error