MTGBench improvement loop

Overview · Experiment index

Iteration 14: Validate ordinary CancelCast candidates without simulation

state rejected — failed gate ir4k
switch PHASE_CANCEL_CAST_VALIDATION_LEGACY · branch loop/it14 · base 4ec0b9ef1 · candidate 37d2c5d4a · took 1h 13m

Results

Verdict: TOO SMALL: only 0.03% fewer instructions, under the 0.3% floor. Cycles moved -2.46%, within this machine's noise (±3.0%): the time effect is too small to see here; only the PC wall-clock can say. Cache misses and branch mispredicts per instruction are about unchanged, so no hidden cost shows up. The final word is always the PC wall-clock.
Gate: 1,000 actions (screen) — -0.03% instructions, same-arm spread 0.016%, equal work: yes, fingerprints match: yes-1% retain-0.3% kill0-0.03%
ArmRun 1 instructionsRun 2ActionsInstr / actioncontract msapply ms
legacy22,065,383,03422,061,860,0014,0005,515,9052,6832,498
optimized22,056,642,90322,056,782,7164,0005,514,1782,9832,669
Instruction counts are deterministic and machine-specific (aarch64 homelab). contract and apply ms are wall time under perf: indicative only, not a clean timing.
Hardware counters (optimized / legacy)ValueReading
cycles, minimum of the repeats-2.46% — cycles-neutral (same-arm spread 3.05%)same within noise
IPC (instructions per cycle, higher is better)1.013 / 1.001same
backend stall / frontend stall (share of cycles)19.0% / 18.2%  ·  42.1% / 43.4%same
L1D / L2D refills per 1k instructions (cache misses)12.68 / 12.78  ·  11.41 / 11.26same
branch mispredicts per 1k instructions6.009 / 6.098same
Green = better, red = worse, grey = about the same (5% band). Cycles are the closest thing to time that the shared VM does not distort. Fewer instructions with more cycles means the saving does not show up as time; such a candidate goes to the workstation wall-clock instead of being retained.
Verdict: TOO SMALL: only 0.03% fewer instructions, under the 0.3% floor. Cycles moved -1.08%, within this machine's noise (±5.1%): the time effect is too small to see here; only the PC wall-clock can say. Cache misses and branch mispredicts per instruction are about unchanged, so no hidden cost shows up. The final word is always the PC wall-clock.
Gate: 4,000 actions (verdict) — -0.03% instructions, same-arm spread 0.006%, equal work: yes, fingerprints match: yes
Gate FAILED: the harness refused this A/B (exit 0); see the write-up below. These counts are not a valid measurement.
-1% retain-0.3% kill0-0.03%
ArmRun 1 instructionsRun 2ActionsInstr / actioncontract msapply ms
legacy80,988,335,84780,990,612,45911,4187,093,14021,53314,465
optimized80,964,105,33780,959,192,40811,4187,090,70318,87012,164
Instruction counts are deterministic and machine-specific (aarch64 homelab). contract and apply ms are wall time under perf: indicative only, not a clean timing.
Hardware counters (optimized / legacy)ValueReading
cycles, minimum of the repeats-1.08% — cycles-neutral (same-arm spread 5.14%)same within noise
IPC (instructions per cycle, higher is better)0.904 / 0.887same
backend stall / frontend stall (share of cycles)24.0% / 20.2%  ·  40.5% / 45.4%more waiting
L1D / L2D refills per 1k instructions (cache misses)16.76 / 16.73  ·  13.64 / 13.75same
branch mispredicts per 1k instructions5.699 / 5.429same
Green = better, red = worse, grey = about the same (5% band). Cycles are the closest thing to time that the shared VM does not distort. Fewer instructions with more cycles means the saving does not show up as time; such a candidate goes to the workstation wall-clock instead of being retained.

Where the time went

planner: 9 minexecutor: 48 minreviewer: 0 mingate fmt: 0 mingate build: 9 mingate ir1k: 1 mingate ir4k: 3 min
planner 9mexecutor 48mreviewer 0mgate fmt 0mgate build 9mgate ir1k 1mgate ir4k 3m
executor: 8,095,737 in / 14,478 out tokensplanner: 4,055,519 in / 11,015 out tokensreviewer: 20,370 in / 1,153 out tokens

Mechanism. At ai_support/filter.rs:143–194, CancelCast falls through to clone-and-apply validation. Add a sufficient immutable validator for ordinary casting prompts, sharing the reducer's cancellation refusal predicates. Certified cancellations bypass fallback_simulation in both accept methods; unsupported prompts and parked continuation states retain simulation.

Evidence. docs/stage0-decision-memo.md L4524, xn5.59: CancelCast consumed 179.6 ms across 802 raw-validation simulations in the combined 4,000-action seed-91/42 attribution. This bounds an actual action-specific component rather than the entire 9.4% fallback_simulation family in xn5.67. Coverage by the proposed conservative validator remains unmeasured.

Counter and kill threshold. Existing xn5.59 raw-validation action-kind timing for CancelCast: 802 calls, 179.6 ms. Expected instruction reduction per action: 0.4–0.9% at 4,000 actions, an estimate requiring the loop's A/B.

Invariant. The complete ordered legal domain must match clone-and-apply validation. Certification must preserve authenticated actor and semantic-owner authorization, committed-cost refusals, and the fallback's post-action pending-spell check. A permanent differential regression compares certified answers with fallback_simulation and verifies that enumeration leaves the input state unchanged.

Agent steps

RoleHarness / modelTimeExitTokens in / outNote
plannercodex / gpt-6.1-sol9m 6s04,055,519 / 11,015
executorcodex / gpt-6-luna48m 22s08,095,737 / 14,478
reviewercodex / gpt-6.1-sol0m 46s020,370 / 1,153

Gates

GateResultExitDetail
fmtpass0cargo fmt --all -- --check
buildpass0pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode build -CargoProfile bench-fast-inc -Label it14-build
ir1kpass0Ir -0.02% within +/-1%, same-arm spread 0.0292% | optimized 22,057,921,136 vs legacy 22,062,062,721 instructions; fingerprints match: True
ir4kFAIL0Ir -0.03% within +/-1%, same-arm spread 0.0271% | optimized 80,961,952,023 vs legacy 80,982,525,398 instructions; fingerprints match: True

Write-up: 2026-10-01 - Loop iteration 14: Validate ordinary CancelCast candidates without simulation (rejected)

Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)

Automated loop result on homelab (aarch64). Switch PHASE_CANCEL_CAST_VALIDATION_LEGACY, mechanism class compute. Mechanism: At ai_support/filter.rs:143–194, CancelCast falls through to clone-and-apply validation. Add a sufficient immutable validator for ordinary casting prompts, sharing the reducer's cancellation refusal predicates. Certified cancellations bypass fallback_simulation in both accept methods; unsupported prompts and parked continuation states retain simulation. Invariant: The complete ordered legal domain must match clone-and-apply validation. Certification must preserve authenticated actor and semantic-owner authorization, committed-cost refusals, and the fallback's post-action pending-spell check. A permanent differential regression compares certified answers with fallback_simulation and verifies that enumeration leaves the input state unchanged.

gatepasseddetail
fmtyescargo fmt --all -- --check
buildyespwsh -NoProfile -File scripts/bench_phase.ps1 -Mode build -CargoProfile bench-fa
ir1kyesIr -0.02% within +/-1%, same-arm spread 0.0292%
ir4kNOIr -0.03% within +/-1%, same-arm spread 0.0271%

Wall-clock confirmation on the workstation is required before this counts as a speedup; instruction count is a screen, not a time prediction.

generated 2026-11-28 18:17:17 · read-only · refreshes every 30 s