Skip to content

WWMSYNC-M1-HRGT1: high-rate (20Hz) ground-truth WALK capture (acquisition only) - #6

Merged
PNHD merged 1 commit into
feature/wwm-native-sync-v2from
feat/wwmsync-highrate-gt-capture
Aug 20, 2026
Merged

WWMSYNC-M1-HRGT1: high-rate (20Hz) ground-truth WALK capture (acquisition only)#6
PNHD merged 1 commit into
feature/wwm-native-sync-v2from
feat/wwmsync-highrate-gt-capture

Conversation

@PNHD

@PNHD PNHD commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Acquisition-only evidence builder for WWMSYNC-M1-HRGT1. Adds a distinct developer-only mode, ?gt-motion-fixture=1&gt-highrate=1, that captures one 20Hz WALK run with independent manual start/end ground truth, so the causal question ROB4 left open — does a shorter real inter-frame interval reduce temporal decorrelation? — can be tested offline. This PR does not touch the tracker/estimator, does not fit anything from the WALK outcome, and does not change ordinary application or GT-fixture behavior.

  • New Core.HighRateWalkRecorder in gt-motion-fixture-core.js: absolute monotonic tick schedule (target = captureStart + n*50ms, not a drifting sleep), 24s/480-sample bound, strict per-frame monotonic + sample-index validation, and a fresh-instance-per-"Select start" reset contract so an aborted/completed run can never leak frames, hashes, or a stale end anchor into the next one.
  • New high-rate UI block appended to gt-motion-fixture.js (existing WALK/RUN/SPRINT IIFE is untouched byte-for-byte): raw ROI canvases are held in memory and PNG-encoded only after recording stops, keeping compression off the 50ms capture-critical path.
  • New #gtHighRateMotionPanel in index.html, reusing existing CSS classes (no new CSS).
  • Fixed a pre-existing bug in the shared storedZip() writer: the central-directory record was missing the mod-date field and truncated external-attributes from 4 bytes to 2, shifting every later field by 4 bytes per entry. The app's own reader tolerated it; standard tools did not. This also benefits the existing WALK/RUN/SPRINT export.
  • Export contract: wwmsync-ground-truth-motion-hires-v1.zip with manifest.json + run.json + frames/*.png, per-frame SHA-256, provenance flags (trackerUsedForTruth, walkOutcomeUsedForTransform, scaleFittedFromWalk, orientationFittedFromWalk, all false), lateness/interval/duplicate-source-frame diagnostics.
  • CI: extends the focused GT-motion workflow with the new test file and a standard-ZIP-tool verification step (unzip -tq, zipinfo, Python zipfile) on a synthetic archive; extends the deploy workflow's runtime-source grep checks and 3-mode browser smoke to a 4th highrate mode.

Full implementation report (canonical-base verification, architecture, validation results): WWMSync-HighRate-GT-Capture-Implementation.md (kept outside the repo per task instructions).

Test plan

  • node --test tools/test-gt-motion-fixture.mjs tools/test-gt-motion-fixture-highrate.mjs — 18/18 passing
  • node --check on all changed/loaded JS
  • Synthetic ZIP validated with Python zipfile + unzip -tq + zipinfo
  • Real browser end-to-end: recorded a live 45-frame WALK (mocked capture bridge, real canvas.toBlob/timer scheduling), exported, and validated the actual downloaded ZIP with the same standard tools — mean capture interval 50.2ms / median 47.1ms against a 50ms target, 0 duplicate frames, correct 270×270 lossless PNGs
  • Browser smoke across all 4 modes (ordinary / motion / poi / highrate): each panel visible only in its own mode, no page errors
  • vision-sync.js diff is empty; ordinary ?gt-motion-fixture=1 (no gt-highrate) behavior unchanged

Production not touched. PR #1 not touched. Not deploying to production. Not merging.

🤖 Generated with Claude Code

Adds a developer-only ?gt-motion-fixture=1&gt-highrate=1 acquisition mode
that captures one WALK run at a 20Hz absolute-monotonic tick schedule
(target = captureStart + n*50ms, not a drifting post-capture sleep), so
offline replay can test whether reducing the real inter-frame interval
resolves the temporal decorrelation ROB4 flagged. Capture only: no
vision-sync estimation runs during acquisition, and ground truth stays
the independently selected manual start/end map anchors.

Raw 270x270 ROI canvases are held in memory and PNG-encoded only after
recording stops, keeping PNG compression off the 50ms capture-critical
path. Bounded to 24s / 480 samples. Owner flow is start anchor -> record
(auto 2s pre-roll) -> stop (auto 2s post-roll) -> end anchor -> export;
every "Select start" click constructs a fresh recorder instance so an
aborted or completed run can never leak frames, hashes, tick index, or a
stale end anchor into the next one. Export blocks with an actionable
error if the recorded sequence isn't strictly ordered by both capture
timestamp and sample index, and duplicate source frames (identical PNG
hash) are counted and kept, never silently dropped.

Also fixes gt-motion-fixture-core.js's shared storedZip() writer: the
central-directory record was missing the mod-date field and truncated
external-attributes from 4 bytes to 2, shifting every later field by 4
bytes per entry. This module's own reader tolerated it, but standard
tools did not. Verified with Python's zipfile and unzip/zipinfo on both
a synthetic archive and a real browser-generated export. This fix also
benefits the existing WALK/RUN/SPRINT fixture export, which is otherwise
unchanged.

Ordinary GT fixture mode (no gt-highrate) and vision-sync.js are
untouched. CI: extends the focused GT-motion workflow with the new test
file plus a standard-ZIP-tool verification step, and extends the deploy
workflow's runtime-source checks and 3-mode browser smoke to a 4th
"highrate" mode.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@PNHD
PNHD marked this pull request as ready for review August 20, 2026 04:37
@PNHD
PNHD merged commit 051e9a5 into feature/wwm-native-sync-v2 Aug 20, 2026
4 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