diff --git a/.github/workflows/verify-pipeline.yml b/.github/workflows/verify-pipeline.yml index 3e647e43..87a3728c 100644 --- a/.github/workflows/verify-pipeline.yml +++ b/.github/workflows/verify-pipeline.yml @@ -58,6 +58,20 @@ jobs: 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 working-directory: archive/v1 env: diff --git a/archive/v1/data/proof/verify.py b/archive/v1/data/proof/verify.py index f771f285..4f63f7a8 100644 --- a/archive/v1/data/proof/verify.py +++ b/archive/v1/data/proof/verify.py @@ -185,7 +185,14 @@ def frame_to_csi_data(frame, signal_meta): # 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 # 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):