PHASE_MANA_PRODUCTION_RECEIPT_LEGACY · branch loop/it41 · base 4ec0b9ef1 · candidate 78037158e · took 51m 2s| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,747,458,123 | 21,740,922,730 | 4,000 | 5,436,048 | 2,401 | 2,282 |
| optimized | 21,742,458,273 | 21,741,849,884 | 4,000 | 5,435,539 | 2,703 | 2,627 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +4.76% — cycles-neutral (same-arm spread 12.80%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.966 / 0.985 | same |
| backend stall / frontend stall (share of cycles) | 18.0% / 21.0% · 44.8% / 40.9% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 12.86 / 12.89 · 11.21 / 11.41 | same |
| branch mispredicts per 1k instructions | 5.676 / 5.793 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 78,046,477,251 | 78,046,080,260 | 11,418 | 6,835,372 | 18,291 | 12,148 |
| optimized | 78,050,410,949 | 78,038,558,870 | 11,418 | 6,835,215 | 21,085 | 13,066 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +3.79% — cycles-neutral (same-arm spread 1.91%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.859 / 0.892 | same |
| backend stall / frontend stall (share of cycles) | 18.1% / 27.3% · 49.3% / 37.9% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 17.33 / 17.39 · 13.71 / 13.69 | same |
| branch mispredicts per 1k instructions | 4.973 / 4.997 | same |
Mechanism. mana_abilities.rs::produce_mana_from_ability ignores the Vec<ManaUnit> returned by mana_payment.rs::produce_mana_with_attributes_from_source_quality. Nevertheless, production allocates that vector, and GameState::add_mana_to_pool clones each unit into its journal command while retaining the original for the return value. Add an internal production path that deposits and journals mana without retaining a receipt. Keep replacement processing, pool insertion and event emission shared with the existing implementation.
Evidence. docs/profiles/uprof-20261002-1125/summary.md attributes 0.7–1.6% directly owned CPU to produce_mana_with_attributes_from_source_quality across five windows, including 1.5% in window 0. Its w0-owners-alloc.txt attributes 0.5% allocation/copy CPU one caller level above that function. These are enclosing bounds, not isolated receipt costs. The older xn5.67 memo section at docs/stage0-decision-memo.md:4904 independently identifies this production path. The captures predate subsequent loop changes.
Counter and kill threshold. Existing workstation profile rows: produce_mana_with_attributes_from_source_quality, 1.5% owned CPU in window 0; allocation/copy attribution one level above it, 0.5%. Expected instruction reduction: 0.3–0.7% per action at 4,000 actions, an unmeasured estimate likely to enter the marginal band. Allocation savings may exceed their instruction-count effect.
Invariant. Preserve pooled units, pip allocation, producer identities, journal commands, emitted event order, layer dirtiness and replacement outcomes exactly. Preserve the existing pip-counter advance even for an unknown recipient. Public receipt-returning APIs keep their current behavior. Permanent differential tests compare complete resulting states and events for ordinary, restricted, snow, multiplied, prevented and unknown-recipient production, including fork isolation.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 10m 46s | 0 | 5,057,283 / 13,384 | |
| executor | codex / gpt-6-luna | 23m 8s | 0 | 4,898,542 / 13,374 | |
| reviewer | codex / gpt-6.1-sol | 0m 40s | 0 | 21,783 / 889 |
| 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 it41-build |
| ir1k | pass | 0 | Ir -0.02% within +/-1%, same-arm spread 0.0321% | optimized 21,742,126,677 vs legacy 21,745,430,161 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.01% within +/-1%, same-arm spread 0.0454% | optimized 78,034,655,625 vs legacy 78,044,303,452 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_MANA_PRODUCTION_RECEIPT_LEGACY, mechanism class allocation. Mechanism: mana_abilities.rs::produce_mana_from_ability ignores the Vec<ManaUnit> returned by mana_payment.rs::produce_mana_with_attributes_from_source_quality. Nevertheless, production allocates that vector, and GameState::add_mana_to_pool clones each unit into its journal command while retaining the original for the return value. Add an internal production path that deposits and journals mana without retaining a receipt. Keep replacement processing, pool insertion and event emission shared with the existing implementation. Invariant: Preserve pooled units, pip allocation, producer identities, journal commands, emitted event order, layer dirtiness and replacement outcomes exactly. Preserve the existing pip-counter advance even for an unknown recipient. Public receipt-returning APIs keep their current behavior. Permanent differential tests compare complete resulting states and events for ordinary, restricted, snow, multiplied, prevented and unknown-recipient production, including fork isolation.
| 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.02% within +/-1%, same-arm spread 0.0321% |
| ir4k | NO | Ir -0.01% within +/-1%, same-arm spread 0.0454% |
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:10 · read-only · refreshes every 30 s