WIP: fix InstanceNorm large-mean cancellation; CUDA regeneration pending

#1
by Elfsong - opened

InstanceNorm computes fp32 variance as E[x^2] - mean^2, which loses accuracy on shifted inputs. Use a second reduction over centered squared differences and add deterministic positive/negative large-mean suites. Keep the official reference, original suites, launch and tolerances unchanged.

Validation: all 11 local tests pass, including actual-kernel-body CPU numerical regressions and source-bound witness export checks. Original shifted cases fail with errors 0.161/0.222; fixed errors are 2.94e-5/6.00e-5. An independent code review found no remaining serious issues.

DO NOT MERGE YET: no NVIDIA GPU is available locally. CUDA admission, hardware precision/performance checks and fresh mutation/witness/matrix measurements remain pending. The changed source generates 84 syntactic candidates; the old 66 witness records and summary must not be treated as new measurements. The dataset card and repair note mark those records historical. A dedicated fresh-journal CUDA runner is included to finish verification and export consistent witnesses before merging.

Cannot merge
This branch has merge conflicts in the following files:
  • substrates/candidate_instancenorm.py

Sign up or log in to comment