PHASE_MANA_CONCESSION_CONDITION_PREFILTER_LEGACY · branch loop/it24 · base 4ec0b9ef1 · candidate 5d6b7ff6f · took 4h 53m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 22,088,057,696 | 22,086,481,904 | 4,000 | 5,521,817 | 2,664 | 2,489 |
| optimized | 22,036,572,701 | 22,033,882,148 | 4,000 | 5,508,807 | 2,712 | 2,644 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.61% — cycles-neutral (same-arm spread 4.58%) | same within noise |
| IPC (instructions per cycle, higher is better) | 1.021 / 1.025 | same |
| backend stall / frontend stall (share of cycles) | 18.8% / 17.9% · 41.8% / 42.7% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 12.72 / 12.65 · 10.86 / 11.10 | same |
| branch mispredicts per 1k instructions | 6.040 / 5.658 | more |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 80,975,733,698 | 81,009,396,912 | 11,418 | 7,093,411 | 18,933 | 12,407 |
| optimized | 79,723,483,073 | 79,716,587,801 | 11,418 | 6,981,961 | 20,265 | 12,869 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +1.38% — cycles-neutral (same-arm spread 2.78%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.906 / 0.935 | same |
| backend stall / frontend stall (share of cycles) | 20.6% / 23.1% · 44.1% / 40.3% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 16.87 / 16.74 · 13.47 / 13.32 | same |
| branch mispredicts per 1k instructions | 5.105 / 4.979 | same |
Mechanism. In static_abilities.rs:1070 and :1108, replace game_active_statics iteration with game_functioning_statics, select the relevant SpendManaAsAnyColor shape, then evaluate its condition through the existing layers authority. This avoids evaluating unrelated static conditions on every scoped mana-payment query.
Evidence. xn5.67, docs/stage0-decision-memo.md:4904, identifies allocator costs inside static_abilities::player_can_spend_as_any_color_for_activation_source. bench/reports/uprof-xn565-20260923-owners-alloc.txt attributes 0.4% of process CPU directly to this caller. That bounds an allocation component; the complete query and removable condition-evaluation share were not measured separately.
Counter and kill threshold. Existing xn5.67 allocator-owner row: player_can_spend_as_any_color_for_activation_source, 0.4% process CPU. Expected reduction: 0.4–0.9% instructions per action at 4,000 actions, an unmeasured planning estimate.
Invariant. Both scoped queries must return identical booleans. For SpendManaAsAnyColor definitions, game_functioning_statics preserves the same source, phasing and zone gates; evaluate the condition with exactly the controller/source arguments used by active_static_definitions. Preserve the unfiltered base query and scope distinctions. Add a permanent differential regression covering irrelevant conditional statics, true/false matching conditions, phased sources, command-zone opt-in, and spell-only versus activation-only concessions.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 9m 40s | 0 | 3,249,781 / 10,621 | |
| executor | codex / gpt-6-luna | 1h 33m | 0 | 13,221,264 / 23,166 | |
| reviewer | codex / gpt-6.1-sol | 0m 34s | 0 | 24,030 / 627 |
| Gate | Result | Exit | Detail |
|---|---|---|---|
| fmt | pass | 0 | cargo fmt --all -- --check |
| build | pass | 0 | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode build -CargoProfile bench-fast-inc -Label it24-build |
| ir1k | pass | 0 | Ir -0.24% within +/-1%, same-arm spread 0.0122% | optimized 22,034,907,512 vs legacy 22,087,716,602 instructions; fingerprints match: True |
| ir4k | pass | 0 | Ir -1.56% (threshold -1%), same-arm spread 0.0416% | optimized 79,725,361,940 vs legacy 80,990,658,011 instructions; fingerprints match: True |
| check | pass | 0 | |
| focused | pass | 0 | |
| parity | pass | 0 | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode parity -Seeds 1,2,3,5,7,11,13 -Actions 1000 -CargoProfile bench-fast-inc -Label it24-parity |
Status: unknown (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_MANA_CONCESSION_CONDITION_PREFILTER_LEGACY, mechanism class compute. Mechanism: In static_abilities.rs:1070 and :1108, replace game_active_statics iteration with game_functioning_statics, select the relevant SpendManaAsAnyColor shape, then evaluate its condition through the existing layers authority. This avoids evaluating unrelated static conditions on every scoped mana-payment query. Invariant: Both scoped queries must return identical booleans. For SpendManaAsAnyColor definitions, game_functioning_statics preserves the same source, phasing and zone gates; evaluate the condition with exactly the controller/source arguments used by active_static_definitions. Preserve the unfiltered base query and scope distinctions. Add a permanent differential regression covering irrelevant conditional statics, true/false matching conditions, phased sources, command-zone opt-in, and spell-only versus activation-only concessions.
| gate | passed | detail |
|---|---|---|
| fmt | yes | cargo fmt --all -- --check |
| build | yes | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode build -CargoProfile bench-fa |
| ir1k | yes | Ir -0.24% within +/-1%, same-arm spread 0.0122% |
| ir4k | yes | Ir -1.56% (threshold -1%), same-arm spread 0.0416% |
| check | yes | |
| focused | yes | |
| parity | yes | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode parity -Seeds 1,2,3,5,7,11,1 |
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:16 · read-only · refreshes every 30 s