PHASE_MANA_COLOR_CAPABILITY_LEGACY · branch loop/it43 · base 4ec0b9ef1 · candidate 2e3d19326 · took 1h 8m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,564,879,440 | 21,563,260,259 | 4,000 | 5,391,017 | 2,769 | 2,595 |
| optimized | 21,560,139,840 | 21,558,670,094 | 4,000 | 5,389,851 | 2,639 | 2,518 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -3.43% — cycles-neutral (same-arm spread 5.73%) | same within noise |
| IPC (instructions per cycle, higher is better) | 1.026 / 0.992 | same |
| backend stall / frontend stall (share of cycles) | 19.3% / 17.8% · 40.9% / 43.9% | more waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 13.03 / 13.04 · 11.34 / 11.44 | same |
| branch mispredicts per 1k instructions | 5.850 / 5.935 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,558,347,749 | 77,555,297,895 | 11,418 | 6,792,505 | 19,395 | 13,430 |
| optimized | 77,521,976,946 | 77,523,716,539 | 11,418 | 6,789,529 | 17,603 | 11,561 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.39% — cycles-neutral (same-arm spread 2.97%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.886 / 0.883 | same |
| backend stall / frontend stall (share of cycles) | 18.7% / 18.3% · 46.8% / 47.4% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 17.49 / 17.52 · 14.01 / 13.95 | same |
| branch mispredicts per 1k instructions | 5.259 / 5.206 | same |
Mechanism. At mana_sources.rs:3128–3190, source_could_produce_two_or_more_colors and mana_production_could_produce_two_or_more_colors allocate vectors to answer a Boolean question. Use a stack-resident, saturating two-distinct-color accumulator. Feed literal production variants directly from their existing color slices; retain mana_options_from_production for dynamic variants.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4904, profiles auto_tap_mana_sources_inner at 18.1% inclusive. Its saved workload report, bench/reports/uprof-xn565-20260923-workload.json, records source discovery at 122/7155 ms, or 1.70% of contract+apply. The saved owners report attributes another 1.5% of process CPU to produce_mana_with_attributes_from_source_quality, which also performs the capability query. These are separate parent bounds, not additive savings; the capability query itself is not isolated.
Counter and kill threshold. Existing auto_tap_source_discovery_ms and xn5.67 mana-production owner row bound the affected regions. Expected instruction reduction: 0.3–0.8% per action, with substantial uncertainty about the removable fraction. Allocation savings may be under-reported; expect a marginal result requiring workstation wall-clock confirmation.
Invariant. Return exactly whether the existing capability calculation finds at least two distinct non-colorless colors. Preserve its treatment of production counts, duplicate colors, basic-land subtypes and dynamic production; do not substitute current activation legality for capability. Permanent differential tests compare both helpers against the legacy implementation.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 10m 4s | 0 | 2,304,640 / 12,485 | |
| executor | codex / gpt-6-luna | 33m 22s | 0 | 4,109,527 / 14,335 | |
| reviewer | codex / gpt-6.1-sol | 0m 46s | 0 | 97,021 / 734 |
| 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 it43-build |
| ir1k | pass | 0 | Ir -0.03% within +/-1%, same-arm spread 0.0152% | optimized 21,558,558,915 vs legacy 21,564,292,488 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.04% within +/-1%, same-arm spread 0.0101% | optimized 77,520,526,276 vs legacy 77,554,897,169 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_MANA_COLOR_CAPABILITY_LEGACY, mechanism class allocation. Mechanism: At mana_sources.rs:3128–3190, source_could_produce_two_or_more_colors and mana_production_could_produce_two_or_more_colors allocate vectors to answer a Boolean question. Use a stack-resident, saturating two-distinct-color accumulator. Feed literal production variants directly from their existing color slices; retain mana_options_from_production for dynamic variants. Invariant: Return exactly whether the existing capability calculation finds at least two distinct non-colorless colors. Preserve its treatment of production counts, duplicate colors, basic-land subtypes and dynamic production; do not substitute current activation legality for capability. Permanent differential tests compare both helpers against the legacy implementation.
| 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.03% within +/-1%, same-arm spread 0.0152% |
| ir4k | NO | Ir -0.04% within +/-1%, same-arm spread 0.0101% |
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:15 · read-only · refreshes every 30 s