PHASE_MANA_INSTEAD_MOVE_LEGACY · branch loop/it25 · base 4ec0b9ef1 · candidate 363a1617d · took 1h 49m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,551,259,607 | 21,549,017,577 | 4,000 | 5,387,535 | 4,178 | 3,248 |
| optimized | 21,534,223,242 | 21,533,259,512 | 4,000 | 5,383,435 | 2,731 | 2,686 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +3.93% — cycles-neutral (same-arm spread 6.36%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.989 / 1.002 | same |
| backend stall / frontend stall (share of cycles) | 16.3% / 16.6% · 44.5% / 44.2% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 13.06 / 12.99 · 11.31 / 11.30 | same |
| branch mispredicts per 1k instructions | 5.861 / 5.780 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,460,574,936 | 77,454,671,871 | 11,418 | 6,783,817 | 18,888 | 12,934 |
| optimized | 77,371,660,760 | 77,383,632,106 | 11,418 | 6,776,813 | 19,955 | 12,223 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.44% — cycles-neutral (same-arm spread 4.44%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.881 / 0.893 | same |
| backend stall / frontend stall (share of cycles) | 18.7% / 19.4% · 46.9% / 45.6% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 17.49 / 17.51 · 13.84 / 13.77 | same |
| branch mispredicts per 1k instructions | 5.148 / 5.046 | same |
Mechanism. In mana_abilities.rs::apply_condition_instead_mana_swap, ordinary mana abilities return ability.clone() even though all three production callers already own the ResolvedAbility. Add a consuming helper that returns its input unchanged on those branches. Preserve the existing authoritative swap for a true ConditionInstead; on a false condition, move the else chain into the owned parent.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4904, measured auto-tap at 18.1% inclusive CPU. The newer docs/profiles/perf-20261002-1221/w0-owners-all.txt attributes 0.7% CPU to ResolvedAbility::clone and 0.4% to its destruction; clone shares reach 1.1% in window 2 and 1.4% in window 8. These are family bounds, not isolated measurements of this helper. Source inspection identifies an unconditional extra deep copy at each caller.
Counter and kill threshold. Existing profile rows: ResolvedAbility::clone and drop_in_place<ResolvedAbility>; xn5.67 auto_tap_mana_sources_inner. Expected instruction reduction: 0.4–0.9% per action at 4,000 actions, an unmeasured planning estimate. Copy savings may appear marginal in instructions despite a larger wall-clock effect.
Invariant. The returned resolved ability must match the old helper field-for-field, including source, controllers, chosen X, cost-paid snapshots, effect-shape fields and chain tails. Permanent differential regressions cover no subchain, an ordinary subchain, both ConditionInstead outcomes, and a true condition whose subeffect is not mana; production tests compare pools and complete ordered events.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 8m 20s | 0 | 2,695,203 / 10,226 | |
| executor | codex / gpt-6-luna | 1h 18m | 0 | 12,716,384 / 22,740 | |
| reviewer | codex / gpt-6.1-sol | 0m 30s | 0 | 21,282 / 616 |
| 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 it25-build |
| ir1k | pass | 0 | Ir -0.07% within +/-1%, same-arm spread 0.0274% | optimized 21,533,679,984 vs legacy 21,548,547,306 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.10% within +/-1%, same-arm spread 0.0155% | optimized 77,377,498,300 vs legacy 77,458,077,995 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_MANA_INSTEAD_MOVE_LEGACY, mechanism class copy. Mechanism: In mana_abilities.rs::apply_condition_instead_mana_swap, ordinary mana abilities return ability.clone() even though all three production callers already own the ResolvedAbility. Add a consuming helper that returns its input unchanged on those branches. Preserve the existing authoritative swap for a true ConditionInstead; on a false condition, move the else chain into the owned parent. Invariant: The returned resolved ability must match the old helper field-for-field, including source, controllers, chosen X, cost-paid snapshots, effect-shape fields and chain tails. Permanent differential regressions cover no subchain, an ordinary subchain, both ConditionInstead outcomes, and a true condition whose subeffect is not mana; production tests compare pools and complete ordered events.
| 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.07% within +/-1%, same-arm spread 0.0274% |
| ir4k | NO | Ir -0.10% within +/-1%, same-arm spread 0.0155% |
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