Repository navigation
Tooling: batch exact rows for the quadratic-affine rank witness (8.4x faster check, no new kappa) - #1076
Conversation
…ank witness (no new kappa) Replace the per-pair inner loop in scripts/experiments/quadratic_affine.py rank_witness with an exact bit-sliced batched orthogonality engine: lane-packed character masks, even-lane SWAR zero test, collision-free stride-8 gather. scripts/audit_quadratic_affine.py (make verify-certificates) drops from 89.1s to 10.6s on the same host; all 14,662 witness rows are byte-identical to the base-commit reference engine and the regenerated certificate differs only in this source file's recorded hash. Evidence and negative controls in research/quadratic-affine-performance (differential benchmark, 11 tests, red-green verified). No mathematical claim, bound, or kappa value changes. Prepared with help from opencode.
|
100-PR batch review at This remains open after scoped triage. Next review step: Engine regressions pass and fixtures 0–10 compare exactly, but the full benchmark reached 180 seconds during the heavy fixture. Complete all 14,662 row comparisons and the fresh certificate/hash-only comparison before changing the default checker. This is a specific continuation point, not a rejection or a request to redo already recorded checks. Completed local evidence is retained separately from outstanding whole-head obligations. Batch review, attribution and evidence. Thank you for the contribution. |
|
Continuation run for the outstanding whole-head obligations, at head Environment: Windows 11, CPython 3.13.15. The 1. Full differential benchmark — all 14,662 row comparisonsTotal wall time 103.3 s. Per-fixture row comparisons of the shipped batched engine against the verbatim base-commit reference (
Totals: 14,662 rows compared, 0 mismatches, including every one of the 12,623 rows of the heavy fixture that the earlier run reached its 180-second cap on. Row-construction totals across all fixtures: reference 68.719 s vs batched 3.491 s. The heavy fixture's full Both negative controls behaved as required: the odd-lane SWAR false positive was demonstrated on a borrow chain, and a dropped gather stage was caught by the same row comparison. Timings above are measurements on this host, not acceptance thresholds; they differ from the host recorded in research/quadratic-affine-performance/README.md. 2. Fresh certificate recomputation and hash-only comparisonThe certificate was recomputed through the package's own flow (
No other certificate field differs. The same one-line diff is what 3. Regression re-runs11 tests pass in 1.28 s (wall 1.7 s): Wall 13.2 s, output: Obligations from the batch review docNow satisfied for #1076:
Still open, and not claimed here:
Attribution: Aaron Wang / navinor, with help from opencode. |
… hotspot Identity/speedup evidence stands (~9× CrocSwap#752 packed lanes). Do not open a competing CrocSwap PR while navinor CrocSwap#1076 rewrites the same production path.
Tooling improvement; no new kappa. Verification engineering (track 85-94, seed 89). Base commit
2921874911956718fcaaaf9396fe8267b3cfa9f0. Prepared with help from opencode.What changes
scripts/audit_quadratic_affine.py(part ofmake verify-certificates) builds twelve exact quadratic-affine rank witnesses; its hot pathrank_witnessinscripts/experiments/quadratic_affine.pyconstructed each row with oneinnercall per (row, column) pair (160,135,378 calls in the heavy fixture). This replaces that loop with an exact bit-sliced batched engine (lane-packed character masks, even-lane SWAR zero test, collision-free staged stride-8 gather).inner, the fixtures and all mathematical outputs are unchanged.Measured on the same host and input (CPython 3.13.15, Windows):
scripts/audit_quadratic_affine.pyat basescripts/audit_quadratic_affine.pywith this changeThe regenerated
certificates/quadratic-affine-vectors.jsondiffers from the base commit in exactly one line: the recorded hash of the edited source file. Every case record, row digest, binary rank and span control is byte-identical.Verification
sh python3 -B research/quadratic-affine-performance/benchmark.py --out /tmp/qa-benchmark.jsonExpected final line:
PASS identical rows (14662 rows, 0 mismatches); certificate equals committed; controls: odd-lane false positive demonstrated, dropped gather stage detected.All 14,662 witness rows (including all 12,623 rows of the heavy fixture) are compared against the verbatim base-commit reference engine; the full certificate is recomputed and required to equal the committed file, and the committed base-commit snapshot
evidence/base-certificate.jsonmust differ only in the edited source's hash.research/quadratic-affine-performance/test_engine.py(11 tests) adds brute-force primitive comparisons with borrow-chain adversaries, randomized family samples, unchanged rejection paths, and negative controls (odd-lane SWAR false positive; dropped gather stage; one-bit row corruption changing the digest). The suite was red-green verified: a deliberately dropped gather stage fails 5 tests.tests/test_quadratic_affine.pypasses unchanged andpython3 -B scripts/verify_selected_result.pystill reports the selected kappa.Overlap
PR 752 (Curtis Dransfield, seed 92) reached this hotspot first with a non-invasive packed-lane adapter (73.4 s -> 10.96 s on macOS arm64). Credit to them. This PR is an independent second implementation that additionally (1) wires the speedup into the shipped check so the default
make verify-certificatesrun gets faster, (2) machine-checks the one-line certificate diff against a committed base-commit snapshot, and (3) corroborates the packed-lane conclusion from a different lane design with red-green verified negative controls.Scope
No certificate content, bound, kappa value, patch, generator, proof supplement, pinned source or
upstream/file changes; onlyscripts/experiments/quadratic_affine.py, its regenerated certificate (one line), and the evidence packageresearch/quadratic-affine-performance/. This is a finite-check speedup, not a formal proof of any theorem. The unchanged GF(2) elimination is now the runtime floor. Fullmake verify, the selected cold replay, Lean and remote Linux CI were not run; only the affected checks above were. Apache-2.0.