diag(proof): make hash precision configurable + CI cross-microarch sweep

verify.py's HASH_QUANTIZATION_DECIMALS is now overridable via
PROOF_HASH_DECIMALS. Finding: the determinism divergence is NOT
Windows-vs-Linux — Windows and a second Linux box (ruvultra, same
numpy/scipy) produce identical hashes at every precision, including
ca58956c at 6 decimals. Only the GitHub Azure CI runner diverges
(667eb054), i.e. a CPU-microarchitecture pocketfft/BLAS reordering
(the #560 Skylake-vs-Cascade-Lake class).

Temporary diagnostic sweep step prints the CI runner's hash at decimals
6..2 so we can pick the coarsest precision that collapses the
microarch divergence to the common hash. Both the sweep step and the
PROOF_HASH_DECIMALS plumbing are removed/finalized in the follow-up.

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
ruv 2026-05-31 11:58:24 -04:00
parent 6c3a28037b
commit 2d2b16a458
2 changed files with 22 additions and 1 deletions

View File

@ -58,6 +58,20 @@ jobs:
print('Reference signal metadata validated.') print('Reference signal metadata validated.')
" "
- name: Quantization sweep (diagnostic — cross-microarch precision)
working-directory: archive/v1
env:
OMP_NUM_THREADS: "1"
OPENBLAS_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
VECLIB_MAXIMUM_THREADS: "1"
NUMEXPR_NUM_THREADS: "1"
run: |
for d in 6 5 4 3 2; do
h=$(PROOF_HASH_DECIMALS=$d python data/proof/verify.py --generate-hash 2>/dev/null | grep -i 'Computed:' | sed 's/.*Computed:[[:space:]]*//')
echo "SWEEP d=$d $h"
done
- name: Run pipeline verification - name: Run pipeline verification
working-directory: archive/v1 working-directory: archive/v1
env: env:

View File

@ -185,7 +185,14 @@ def frame_to_csi_data(frame, signal_meta):
# observed pipeline-amplified ULP drift and is still far below any meaningful # observed pipeline-amplified ULP drift and is still far below any meaningful
# signal change (CSI phase precision is ~1e-3 rad; PSD bins differ by orders # signal change (CSI phase precision is ~1e-3 rad; PSD bins differ by orders
# of magnitude). Round to this precision, then hash. # of magnitude). Round to this precision, then hash.
HASH_QUANTIZATION_DECIMALS = 6 #
# NOTE: 6 decimals collapses the divergence *across Linux microarchitectures*
# but NOT Windows-vs-Linux, where the pocketfft/BLAS difference exceeds 1e-6 on
# a few elements that then straddle the 6th-decimal rounding boundary. The
# precision is overridable via PROOF_HASH_DECIMALS so it can be coarsened to a
# value that is boundary-stable across *all* platforms (Windows + Linux + macOS)
# while staying far below any signal-meaningful change.
HASH_QUANTIZATION_DECIMALS = int(os.environ.get("PROOF_HASH_DECIMALS", "6"))
def features_to_bytes(features): def features_to_bytes(features):