PHASE_CONTRACT_PROOF_PROBE_LEGACY · branch loop/it4 · base 3f4ca44ee · candidate e77deab12 · took 3h 0m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,311,898,519 | 4,000 | 5,327,975 | 2,623 | 2,216 | |
| optimized | 20,844,575,944 | 4,000 | 5,211,144 | 2,978 | 2,833 |
perf: indicative only, not a clean timing.| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 22,417,136,927 | 22,413,729,250 | 4,000 | 5,603,858 | 2,938 | 2,375 |
| optimized | 21,945,787,262 | 21,946,371,148 | 4,000 | 5,486,520 | 2,843 | 2,586 |
perf: indicative only, not a clean timing.| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 83,035,091,474 | 83,048,682,811 | 11,418 | 7,272,893 | 20,749 | 11,720 |
| optimized | 81,213,300,026 | 81,197,667,766 | 11,418 | 7,112,058 | 20,526 | 12,270 |
perf: indicative only, not a clean timing.| When | Commit | Seed | Verdict | Detail |
|---|---|---|---|---|
| 20260930 | 4bf20cf24 | 91 | retained-candidate | |-2.8%| exceeds 1.5x the 1.0% floor; all pairs and 100% of games agree in sign |
| 20260930 | 4bf20cf24 | 42 | retained-candidate | |-1.8%| exceeds 1.5x the 0.2% floor; all pairs and 100% of games agree in sign |
| 20260930 | 4bf20cf24 | 91 | retained-candidate | |-2.9%| exceeds 1.5x the 0.5% floor; all pairs and 100% of games agree in sign |
| 20260930 | 96ebc3713 | 91 | neutral | |-2.7%| is within the 2.9% same-arm spread |
| 20260930 | 96ebc3713 | 42 | retained-candidate | |-3.3%| exceeds 1.5x the 0.8% floor; all pairs and 100% of games agree in sign |
| 20260930 | 96ebc3713 | 91 | neutral | |-1.5%| is within the 4.4% same-arm spread |
| 20260930 | 96ebc3713 | 42 | neutral | |-1.1%| is within the 3.7% same-arm spread |
Mechanism. At ai_support/context.rs:45–52, AiDecisionContract::issue runs single_candidate_affordability_probe_with_gate before authoritative enumeration, even when affordability attribution is disabled. Run this probe only when attribution or the new legacy switch is enabled. Its result feeds diagnostic counters, never candidate selection.
Evidence. The xn5.75 final memo section records probe time by first exit gate. Summing those intervals gives 289.413 ms / 8,937 ms = 3.24% of contract+apply for seed 91 and 216.493 ms / 8,022 ms = 2.70% for seed 42. This bounds the actual removable computation, rather than the much larger pass-only contract family. Recorded reports: bench/reports/xn575-overlap-s91-20260925-145328-* and xn575-overlap-s42-20260925-145544-*.
Counter and kill threshold. Use the existing affordability proof-probe gate timers as the component bound. Drop below a 1.5% reduction in instructions/action at the final 4,000-action A/B. The 1,000-action run is an initial screen; fingerprint divergence kills the change immediately.
Invariant. The ordered candidate domain, authorized actor, action stream, auto-tap selection and final state remain identical. Preserve the existing probe when attribution is enabled; when it is skipped, do not report a successful proof. Add a permanent differential regression comparing complete contracts with the probe enabled and disabled across pass-only, playable-land, mana-source and non-priority fixtures, including same-revision state mutation.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 9m 54s | 0 | 1,929,469 / 12,632 | |
| executor | codex / gpt-6-luna | 48m 28s | 0 | 5,891,684 / 14,666 | |
| reviewer | codex / gpt-6.1-sol | 0m 23s | 0 | 20,678 / 561 |
| Gate | Result | Exit | Detail |
|---|---|---|---|
| fmt | pass | 0 | cargo fmt --all -- --check |
| check | pass | 0 | |
| focused | pass | 0 | |
| build | pass | 0 | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode build -CargoProfile bench-fast-inc -Label it4-build |
| ir1k | FAIL | 1 | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode ab -Instrument perf -Legacy PHASE_CONTRACT_PROOF_PROBE_LEGACY -Actions 1000 -Seed 91 -Workers 1 -Timeout 1800 -Repeats 2 -SkipBuild -Label it4-ir1k -IrThresholdPercent 1.0 -IrDeterminismPercent 0.05 -VerdictJson /data/mtgbench/loop/reports/it4/ir1k.verdict.json -PerfSudo |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_CONTRACT_PROOF_PROBE_LEGACY, mechanism class compute. Mechanism: At ai_support/context.rs:45–52, AiDecisionContract::issue runs single_candidate_affordability_probe_with_gate before authoritative enumeration, even when affordability attribution is disabled. Run this probe only when attribution or the new legacy switch is enabled. Its result feeds diagnostic counters, never candidate selection. Invariant: The ordered candidate domain, authorized actor, action stream, auto-tap selection and final state remain identical. Preserve the existing probe when attribution is enabled; when it is skipped, do not report a successful proof. Add a permanent differential regression comparing complete contracts with the probe enabled and disabled across pass-only, playable-land, mana-source and non-priority fixtures, including same-revision state mutation.
| gate | passed | detail |
|---|---|---|
| fmt | yes | cargo fmt --all -- --check |
| check | yes | |
| focused | yes | |
| build | yes | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode build -CargoProfile bench-fa |
| ir1k | NO | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode ab -Instrument perf -Legacy |
Wall-clock confirmation on the workstation is required before this counts as a speedup; instruction count is a screen, not a time prediction.
Status: rejected (as recorded by the gate; the harness refused the A/B as invalid). Follow-up needed: see Decision.
What the harness said. INVALID A/B: seat=2 differs in auto_tap_selection_hash; no measurement at ir1k (1,000 actions, seed 91), so no timing or instruction verdict was produced.
Why. The auto-tap selection hash is a rotate-and-xor over every auto-tap call in the process (casting_costs.rs:187, :241, :12318), including the simulated auto-taps the diagnostic affordability probe performs. Candidate PHASE_CONTRACT_PROOF_PROBE_LEGACY skips that probe when attribution is off, so the hash differs by construction whatever the game does. On the same seed-91 workload, at 4,000 actions, the two arms matched on action-stream hash, final-state hash, total actions and turns in all four seats; the auto-tap hash differed in seats 2 and 3 only (seats 0 and 1 matched, because the probe made no selections there).
Direct measurement, NOT a valid A/B. This bypasses the harness's fingerprint validation and is recorded as information only. perf stat -e instructions:u, seed 91, 4,000 actions/seat, one binary built from the candidate commit ee5c738 (branch loop/it4), switch off vs on (PHASE_CONTRACT_PROOF_PROBE_LEGACY=1 is the legacy arm): 80,126,551,639 optimized vs 81,949,983,199 legacy, -2.23%. One pair, no repeats; counts on this host repeat to about 0.02%. The planner's expectation from the xn5.75 timings was 2.7-3.2% of contract+apply time.
Decision needed (not taken by the loop). AGENTS.md rule 3 says a fingerprint difference voids the delta, and this candidate cannot satisfy it as the fingerprint is defined. Options: (a) make the selection hash skip calls made under a diagnostic-probe scope, so probe removal can be validated while any change to a decision-path selection is still caught (an engine measurement-instrumentation change, needs a Phase commit and patch record); (b) document an exemption for probe-removal candidates that requires equal action stream and final state plus a 7-seed parity sweep. The loop keeps rejecting this class until one is chosen.
Status: unknown (validated on the homelab instruction-count screen: retained-ir; workstation wall-clock, the full integration target and the patch record are still pending)
Resolves the decision recorded in the addendum above by taking option (a). Two Phase commits on the homelab branch fp-probe-scope (base 3f4ca44):
1. 862d07f perf(bench): keep diagnostic-probe auto-tap selections out of the selection fingerprint. AutoTapSelectionDiagnosticScope in casting_costs.rs; one helper, record_auto_tap_selection, now serves the three recording sites (planner, empty selection, replay). Selections made inside the scope still count in calls and selected_sources but do not enter selection_hash or the replay trace. The affordability probe call in ai_support/context.rs runs inside the scope. Two regression tests (diagnostic_scope_tests): counted-but-not-hashed, and nesting plus the replay trace. cargo check --lib passes; the new tests have NOT been compiled or run yet (the homelab test compile was not repeated for this commit). 2. 4bf20cf perf: Gate the diagnostic affordability proof probe (loop iteration 4), the candidate, cherry-picked onto (1). The probe runs only when affordability attribution or PHASE_CONTRACT_PROOF_PROBE_LEGACY is on. The candidate's own focused gate (11 resolved-command tests, 135 stack tests among others) passed on the original loop branch, before commit (1).
Validation (host: homelab aarch64, one bench-fast-inc binary, -Instrument perf, seed 91, -Repeats 2, exact command in /data/mtgbench/fp_run.sh):
| run | instructions optimized vs legacy | same-arm spread | fingerprints |
|---|---|---|---|
| 1,000 actions | 21,946,079,205 vs 22,415,433,088 = -2.09% | 0.0152% | all three match |
| 4,000 actions | 81,205,483,896 vs 83,041,887,142 = -2.21% | 0.0193% | all three match |
parity, 7 seeds (1,2,3,5,7,11,13), 1,000 actions, bench-fast-inc | 7 matched, 0 diverged, 0 arm failures |
Before commit (1) the same A/B was refused: INVALID A/B: seat=2 differs in auto_tap_selection_hash, with the action stream and final state equal in every seat (see the addendum). A first parity attempt exited 1 because the script used the default server-release profile, which was not built; that was a script error, not a divergence, and the rerun above is the result.
Not done, required before this counts as a retained speedup: the full cargo test -p phase-engine --test integration run (the loop ran only --lib filters), cargo check of the test targets on the merged pair, the workstation wall-clock ABBA at 4,000 actions on seeds 91 and 42, and scripts/write_phase_patch.ps1 after the Phase commits land in the workstation checkout. Instruction count under-reports savings from allocation and copy changes but this is a compute change, so a wall-clock effect near -2% is the expectation, not a claim.
generated 2026-11-28 18:17:06 · read-only · refreshes every 30 s