PHASE_MANA_SELECTION_LOCAL_LEGACY · branch loop/it17 · base 4ec0b9ef1 · candidate 28439dd71 · took 1h 21m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,797,282,230 | 4,000 | 5,449,321 | 2,463 | 2,374 | |
| optimized | 21,758,747,685 | 4,000 | 5,439,687 | 2,311 | 2,317 |
perf: indicative only, not a clean timing.Mechanism. At mana_sources.rs:840, preflight_tap_land_action builds every battlefield mana action before counting matches for one submitted selection. At :609, live_mana_source_option_for_selection similarly enumerates every source, then enumerates the selected source again. Replace these whole-battlefield membership scans with source-local enumeration using the existing option producers and exact semantic-selection comparisons.
Evidence. The xn5.59 memo section at L4524 attributes 200.2 ms across 582 TapLandForMana raw validations in the two 4,000-action workloads. This bounds that action's entire validation family, not just preflight. Source inspection confirms redundant enumeration, but its exclusive share is unmeasured. The historical timings predate subsequent optimizations and are opportunity bounds.
Counter and kill threshold. Existing xn5.59 raw-validation row TapLandForMana: 582 calls, 200.2 ms. Expected 4,000-action instruction reduction: 0.4–0.9% per action, a hypothesis likely to enter the marginal tier. No separate measurement prerequisite.
Invariant. Preserve acceptance, error variants, ambiguity detection, and validation-before-mutation. A selection includes source identity, so another permanent cannot match it. Preserve battlefield membership and duplicate-source multiplicity explicitly; retain the existing option producers, controller checks, incarnation comparison, and deferred-color canonicalization.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 12m 3s | 0 | 4,203,288 / 15,061 | |
| executor | codex / gpt-6-luna | 57m 35s | 0 | 14,118,105 / 24,553 | |
| reviewer | codex / gpt-6.1-sol | 1m 3s | 0 | 22,062 / 1,201 |
| 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 it17-build |
| ir1k | FAIL | 1 | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode ab -Instrument perf -Legacy PHASE_MANA_SELECTION_LOCAL_LEGACY -Actions 1000 -Seed 91 -Workers 1 -Timeout 1800 -Repeats 3 -CargoProfile bench-fast-inc -Label it17-ir1k -IrThresholdPercent 1.0 -IrDeterminismPercent 0.05 -VerdictJson /data/mtgbench/loop/reports/it17/ir1k.verdict.json -PerfSudo |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_MANA_SELECTION_LOCAL_LEGACY, mechanism class compute. Mechanism: At mana_sources.rs:840, preflight_tap_land_action builds every battlefield mana action before counting matches for one submitted selection. At :609, live_mana_source_option_for_selection similarly enumerates every source, then enumerates the selected source again. Replace these whole-battlefield membership scans with source-local enumeration using the existing option producers and exact semantic-selection comparisons. Invariant: Preserve acceptance, error variants, ambiguity detection, and validation-before-mutation. A selection includes source identity, so another permanent cannot match it. Preserve battlefield membership and duplicate-source multiplicity explicitly; retain the existing option producers, controller checks, incarnation comparison, and deferred-color canonicalization.
| gate | passed | detail |
|---|---|---|
| fmt | yes | cargo fmt --all -- --check |
| build | yes | pwsh -NoProfile -File scripts/bench_phase.ps1 -Mode build -CargoProfile bench-fa |
| ir1k | NO | INVALID A/B: seat=$($game.candidate_seat) differs … |
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