Commit Graph

1 Commits

Author SHA1 Message Date
525e555884 test(lib): add golden regression suite for mouse + scroll
64 parametrised cases (8 routes/scrolls x 4 seeds each) compare the
rewritten ORT/NumPy pipeline against captures from the pre-migration
PyTorch implementation.

The pre-migration captures used torch.manual_seed + torch.randn for the
flow-ODE noise; the rewrite uses np.random.default_rng. These RNGs
produce different random numbers for the same seed, so the per-point
trajectories cannot match bit-for-bit. The suite therefore guards
*structural* equivalence:

  * mouse: identical shape, start/end snapping, xy diff within
    max(30 px, 20% of move distance), timestamp diff within 700 ms
  * scroll: identical shape (skip with reason on quantum boundary
    drift), identical deltaMode, identical total signed scroll
    distance, per-event delta within 2 wheel quanta, timestamp diff
    within 700 ms

Observed worst-case in this run: ~170 px xy diff on a 1681 px move
(~10% of distance, well under the 20% envelope) and ~600 ms timestamp
drift. All 64 cases pass; 0 skipped.

Goldens stored as compressed .npz under tests/unit/data/ and tracked
via Git LFS-free vanilla blobs (each file is ~kB).
2026-05-12 01:19:58 +08:00