Commit Graph

1 Commits

Author SHA1 Message Date
rUv 88da304631
chore(scripts): probe-fft-platform.py — root-cause aid for #560 (#607)
The verify.py "platform-independent for IEEE 754 compliant systems"
docstring at archive/v1/data/proof/verify.py:172 is incorrect — scipy's
pocketfft uses SIMD vector kernels (AVX2/AVX-512 on x86_64, NEON on
Apple Silicon) that reorder FP operations differently across builds, so
the SHA-256 of the production pipeline diverges at ULP precision per
platform. That divergence is what bug report #560 caught on macOS arm64.

This script reproduces verify.py's hash-relevant scipy.fft.fft + Hamming-
window calls in isolation on a deterministic synthetic input, without
dragging in src.app / pydantic Settings. Run on each platform and diff
the JSON output:

  python3 scripts/probe-fft-platform.py

- If two machines print the same first8_doppler_bytes_hex and the same
  first4_psd_floats but different sha256, the divergence is in later FFT
  bins (SIMD reordering).
- If even the first values differ, it's true ULP-level divergence at
  every bin (NEON vs x86_64, or different scipy pocketfft builds).

Captured empirical evidence across Windows (Intel AVX-512), Linux x86_64
(ruvultra), and Apple Silicon (ruv-mac-mini) — Win + Linux agree on first
PSD values but produce different SHA-256s; Mac arm64 differs at the first
bins at ~1 ULP precision (~2e-14 on a value of ~94).

This commit ships only the diagnostic. The architectural fix for #560
(quantize-before-hash in features_to_bytes(), then regenerate
expected_features.sha256 on a canonical CI platform) is left as a
separate maintainer decision because it changes a published trust-anchor
artifact and merits a deliberate call.

Supersedes the probe portion of PR #577 (the verify path fix from #577
already shipped via PR #590).
2026-05-17 17:34:28 -04:00