# Independent replica audit of P Audited commit `79f068cef81dadee171531f3381e207c193c959a`. No repository source file changed. The only delivered file is this result; audit scripts, checkpoints, logs and runtime state stayed under ignored `scratch/`. ## Method After benchmarking, a scratch-only driver imported the materialized `replica2`, `qmref`, `twocomp` and `combo` modules directly. It ran `replica2.run(seed, fresh_policy)` and checkpointed the unrounded edge after every seed. `ammfast.run` was used for each gate and spot seed; `ammfast.run_batch` recomputed every bank row. The 384 gate pairs are seeds 10000..10063 and 64000..64063 for each policy. For each bank starting at `s`, the independent 64-seed spot rule is **s+64..s+127**, outside the first 64 rows. Full-precision comparisons use absolute tolerance 1e-9. Bank comparisons require exact `format(edge, ".6f")` equality; the numeric error column below is `abs(ammfast_edge - float(bank_string))`. The zero-head check compares 16 COMBO seeds (10064..10071, 64064..64071) for bit-for-bit float equality. ## Audit results | Policy | Gate (passed/total; max abs error) | Independent bank spots (passed/total; max abs error) | All bank rows (passed/total; max abs error) | Zero head (passed/total; max abs error) | |---|---:|---:|---:|---:| | qt1-ref | 128/128; 9.6633812063373625e-12 | 192/192; 8.7538865045644343e-12 | 4096/4096; 4.9998675422102679e-07 | N/A (COMBO hook only) | | TwoComp | 128/128; 1.0004441719502211e-11 | 192/192; 7.9580786405131221e-12 | 4096/4096; 4.9949528602155624e-07 | N/A (COMBO hook only) | | COMBO | 128/128; 1.1937117960769683e-11 | 192/192; 7.503331289626658e-12 | 4096/4096; 4.9996776851912728e-07 | 16/16; 0 | Totals: 384/384 gate pairs; 576/576 independent spot pairs, each also matching its bank string at six decimals; 12,288/12,288 bank rows; 16/16 zero-head comparisons. **Every mismatch list is empty**: there are no seeds or values to enumerate. The bank numeric differences reflect decimal rounding; all bank strings match exactly. ## Timing Warm measurements used one worker and three ordered `run_batch` calls of 128 runs per policy. The cold number is the first `run_batch([20000])` call in a fresh process for that policy; the JIT disk cache may have been warmed by a previous policy process. | Policy | Cold first call (s) | Warm runs/s/core | Three warm batch times (s) | |---|---:|---:|---| | qt1-ref | 10.753831 | 158.926 | 0.832312, 0.838478, 0.745424 | | TwoComp | 1.369497 | 150.904 | 0.851828, 0.863883, 0.828956 | | COMBO | 1.421949 | 135.286 | 0.921249, 0.994966, 0.922224 | ## Real scorer runs ### COMBO vs qt1-ref, `--bar 0.1` Seeds actually run: 64000..64127 (128 of 1024); stop reason: `above_bar`. The following are the scorer’s complete round lines and status, including `worst5`: ```json {"n": 128, "mean_diff": 0.6032781235549249, "se": 0.06127636328447672, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64072, "diff": -0.6198054615002775}, {"seed": 64116, "diff": -0.597635677910489}, {"seed": 64053, "diff": -0.5087297450996289}, {"seed": 64094, "diff": -0.5067866716556182}]} {"status": {"reason": "above_bar", "n": 128, "available": 1024}} ``` ### COMBO vs qt1-ref, no bar Seeds actually run: 64000..65023 (1024 of 1024); stop reason: `exhausted`. The following are the scorer’s complete round lines and status, including `worst5`: ```json {"n": 128, "mean_diff": 0.6032781235549249, "se": 0.06127636328447672, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64072, "diff": -0.6198054615002775}, {"seed": 64116, "diff": -0.597635677910489}, {"seed": 64053, "diff": -0.5087297450996289}, {"seed": 64094, "diff": -0.5067866716556182}]} {"n": 256, "mean_diff": 0.592568795780237, "se": 0.040683261129947565, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64138, "diff": -0.8757036904939923}, {"seed": 64072, "diff": -0.6198054615002775}, {"seed": 64116, "diff": -0.597635677910489}, {"seed": 64245, "diff": -0.5304750317758362}]} {"n": 384, "mean_diff": 0.5892513400853803, "se": 0.032111033854672455, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64374, "diff": -1.0234333901615855}, {"seed": 64138, "diff": -0.8757036904939923}, {"seed": 64269, "diff": -0.692669296933218}, {"seed": 64348, "diff": -0.624802784677172}]} {"n": 512, "mean_diff": 0.596927888554222, "se": 0.02745639322802415, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64374, "diff": -1.0234333901615855}, {"seed": 64138, "diff": -0.8757036904939923}, {"seed": 64509, "diff": -0.7672916459392809}, {"seed": 64269, "diff": -0.692669296933218}]} {"n": 640, "mean_diff": 0.5911634924858777, "se": 0.024765251394875558, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64374, "diff": -1.0234333901615855}, {"seed": 64555, "diff": -0.9461894175531711}, {"seed": 64138, "diff": -0.8757036904939923}, {"seed": 64509, "diff": -0.7672916459392809}]} {"n": 768, "mean_diff": 0.5868008860868126, "se": 0.022599550406557756, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64374, "diff": -1.0234333901615855}, {"seed": 64555, "diff": -0.9461894175531711}, {"seed": 64138, "diff": -0.8757036904939923}, {"seed": 64718, "diff": -0.7922819769553371}]} {"n": 896, "mean_diff": 0.6028000949989074, "se": 0.020855468385768267, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64845, "diff": -1.1638687642927152}, {"seed": 64374, "diff": -1.0234333901615855}, {"seed": 64795, "diff": -0.9831710731371004}, {"seed": 64555, "diff": -0.9461894175531711}]} {"n": 1024, "mean_diff": 0.6096046435481457, "se": 0.01940052280490829, "worst5": [{"seed": 64101, "diff": -2.7769827132076443}, {"seed": 64845, "diff": -1.1638687642927152}, {"seed": 64374, "diff": -1.0234333901615855}, {"seed": 64795, "diff": -0.9831710731371004}, {"seed": 64555, "diff": -0.9461894175531711}]} {"status": {"reason": "exhausted", "n": 1024, "available": 1024}} ``` ### qt1-ref vs TwoComp Seeds actually run: 64000..64127 (128 of 1024); stop reason: `worse`. The following are the scorer’s complete round lines and status, including `worst5`: ```json {"n": 128, "mean_diff": -0.45793851553302556, "se": 0.05126589261357239, "worst5": [{"seed": 64075, "diff": -2.6413071770435863}, {"seed": 64110, "diff": -2.1995749792307606}, {"seed": 64003, "diff": -2.115551326949344}, {"seed": 64074, "diff": -1.880154590738698}, {"seed": 64031, "diff": -1.6257569077095013}]} {"status": {"reason": "worse", "n": 128, "available": 1024}} ``` ## Tests and failures - `tests/test_ammfast.py`: 23 tests, all passed, no skips. - `tests/test_replica_banks.py`: 14 tests, all passed, no skips. - `baselines/replica/validate.py --recompute 8`: `ok: true`, `complete: true`, 9 banks, 12,288 rows, 384 gate pairs, 576 spot pairs, 72 recomputed rows. - One scratch harness invocation failed before any benchmark or audit row ran. Verbatim exception: `ModuleNotFoundError: No module named 'ammfast'` at `scratch/audit.py:78` (`import ammfast`), called from `scratch/audit.py:176`. The runner was fixed to set the repository on `PYTHONPATH`; the same benchmark then passed. No product test or audit comparison failed. ## Command record Commands below ran with the sourced replica-only environment after setup. Times are elapsed seconds; every audit command was capped at 465 seconds. Setup reported 9.454 seconds, four pinned downloads, and OK; materialization reported 35 verified originals. Inspection commands (`pwd`, `git rev-parse`, `git status --short`, `rg`, `ls`, `sed`, `tail`, `cat`, `wc`) also exited 0 and each took under one second. | Command | Exit | Seconds | Reported result | |---|---:|---:|---| | `bash setup_fast.sh --platform linux-x86_64 --cache "$PWD/scratch/cache" --scratch "$PWD/scratch" --replica-only` | 0 | 9.48 | OK, replica runtime | | `. scratch/env.sh; python3 -B reference/materialize.py --out scratch/reference` | 0 | 0.15 | 35 verified originals | | `python3 -B scratch/audit.py benchmark --policy qt1-ref` (initial) | 1 | 0.03 | ModuleNotFoundError at scratch/audit.py:78; fixed runner and retried | | `python3 -B scratch/audit.py benchmark --policy qt1-ref` | 0 | 13.59 | cold and warm timings recorded | | `python3 -B scratch/audit.py benchmark --policy TwoComp` | 0 | 4.19 | cold and warm timings recorded | | `python3 -B scratch/audit.py benchmark --policy COMBO` | 0 | 4.52 | cold and warm timings recorded | | `python3 -B scratch/audit.py cpython --policy qt1-ref --group gate10000` | 0 | 7.61 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy qt1-ref --group gate64000` | 0 | 7.64 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy qt1-ref --group spot60000` | 0 | 7.75 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy qt1-ref --group spot64000` | 0 | 8.75 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy qt1-ref --group spot10000` | 0 | 7.63 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy TwoComp --group gate10000` | 0 | 11.04 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy TwoComp --group gate64000` | 0 | 10.09 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy TwoComp --group spot60000` | 0 | 11.04 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy TwoComp --group spot64000` | 0 | 9.25 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy TwoComp --group spot10000` | 0 | 9.89 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy COMBO --group gate10000` | 0 | 12.39 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy COMBO --group gate64000` | 0 | 12.61 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy COMBO --group spot60000` | 0 | 11.44 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy COMBO --group spot64000` | 0 | 12.37 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py cpython --policy COMBO --group spot10000` | 0 | 12.00 | 64 CPython edges checkpointed | | `python3 -B scratch/audit.py compare --policy qt1-ref` | 0 | 28.64 | gate, spots and banks passed | | `python3 -B scratch/audit.py compare --policy TwoComp` | 0 | 33.33 | gate, spots and banks passed | | `python3 -B scratch/audit.py compare --policy COMBO` | 0 | 35.82 | gate, spots and banks passed; zero head passed | | `python3 -B score.py --baseline baselines/replica/qt1-ref-64000-65023.json --replica --policy COMBO --bar 0.1` | 0 | 2.50 | above_bar; 128 seeds | | `python3 -B score.py --baseline baselines/replica/qt1-ref-64000-65023.json --replica --policy COMBO` | 0 | 10.21 | exhausted; 1,024 seeds | | `python3 -B score.py --baseline baselines/replica/TwoComp-64000-65023.json --replica --policy qt1-ref` | 0 | 2.33 | worse; 128 seeds | | `python3 -B -m unittest discover -s tests -p test_ammfast.py -v` | 0 | 4.55 | 23 tests passed | | `python3 -B -m unittest discover -s tests -p test_replica_banks.py -v` | 0 | 25.00 | 14 tests passed | | `python3 -B baselines/replica/validate.py --recompute 8` | 0 | 2.46 | ok; 72 rows recomputed | | `git status --short` | 0 | 0.01 | empty; required artifact is excluded from status by repository-local ignore rule | ## Scope This item covers the replica implementation and its nine banks only. It did not exercise the engine bank, HA data, macOS runtime, or work from other items in this wave.