PHASE_STATIC_ITERATOR_BOX_LEGACY · branch loop/it19 · base 4ec0b9ef1 · candidate 1b94e59da · took 2h 3m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 20,740,315,241 | 20,742,934,456 | 4,000 | 5,185,406 | 2,595 | 2,408 |
| optimized | 20,568,084,264 | 20,571,162,637 | 4,000 | 5,142,406 | 2,646 | 2,579 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.50% — cycles-neutral (same-arm spread 2.53%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.991 / 1.006 | same |
| backend stall / frontend stall (share of cycles) | 21.7% / 22.5% · 39.8% / 38.5% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 13.57 / 13.46 · 11.74 / 11.60 | same |
| branch mispredicts per 1k instructions | 6.035 / 5.960 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,615,786,706 | 77,614,520,162 | 11,418 | 6,797,614 | 18,707 | 11,762 |
| optimized | 76,388,888,865 | 76,391,188,541 | 11,418 | 6,690,317 | 19,835 | 12,708 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -1.03% — cycles-neutral (same-arm spread 2.06%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.896 / 0.897 | same |
| backend stall / frontend stall (share of cycles) | 26.4% / 22.9% · 37.9% / 41.8% | more waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 17.49 / 17.33 · 14.01 / 13.86 | same |
| branch mispredicts per 1k instructions | 5.564 / 5.355 | same |
Mechanism. At functioning_abilities.rs:248–281, active_static_definitions allocates a Box<dyn Iterator> for each ordinary object visit. Return a concrete iterator that walks the borrowed definition slice with the identical functioning predicate. Carry the original boxed iterator as the legacy variant of the same iterator wrapper.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4904, identifies allocation traffic as a remaining cost. Its linked uprof-xn565-20260923-owners-all.txt attributes 1.6% of process CPU to spell_objects_available_to_cast; owners-alloc.txt attributes 0.9% specifically to its allocation/copy family. That function reaches active_static_definitions through graveyard and library permission scans. These are enclosing bounds; the Box allocation itself has no exclusive timer. The profile predates subsequent loop changes.
Counter and kill threshold. Existing xn5.67 owner rows: spell_objects_available_to_cast 1.6% CPU, including 0.9% allocation/copy ownership. Expected instruction reduction: 0.4–0.9% per action, a hypothesis likely to enter the marginal band because instructions under-report allocator savings. Apply the loop's existing 1,000/4,000-action gates.
Invariant. Both iterator variants yield the same ordered definition references and evaluate the same conditions in the same order. Preserve phasing, CDA zone admission, command-zone opt-ins, Room door gates and self-referential stack prohibitions. Add a permanent differential regression comparing full iteration and short-circuit find/any results across these cases, including empty collections and same-revision definition mutation.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 10m 26s | 0 | 4,781,556 / 11,233 | |
| executor | codex / gpt-6-luna | 39m 3s | 0 | 4,489,432 / 14,688 | |
| reviewer | codex / gpt-6.1-sol | 0m 36s | 0 | 21,467 / 721 |
| 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 it19-build |
| ir1k | pass | 0 | Ir -0.83% within +/-1%, same-arm spread 0.0150% | optimized 20,569,797,130 vs legacy 20,741,141,255 instructions; fingerprints match: True |
| ir4k | pass | 0 | Ir -1.57% (threshold -1%), same-arm spread 0.0122% | optimized 76,391,778,710 vs legacy 77,612,212,970 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 it19-parity |
Status: unknown (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_STATIC_ITERATOR_BOX_LEGACY, mechanism class allocation. Mechanism: At functioning_abilities.rs:248–281, active_static_definitions allocates a Box<dyn Iterator> for each ordinary object visit. Return a concrete iterator that walks the borrowed definition slice with the identical functioning predicate. Carry the original boxed iterator as the legacy variant of the same iterator wrapper. Invariant: Both iterator variants yield the same ordered definition references and evaluate the same conditions in the same order. Preserve phasing, CDA zone admission, command-zone opt-ins, Room door gates and self-referential stack prohibitions. Add a permanent differential regression comparing full iteration and short-circuit find/any results across these cases, including empty collections and same-revision definition mutation.
| 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.83% within +/-1%, same-arm spread 0.0150% |
| ir4k | yes | Ir -1.57% (threshold -1%), same-arm spread 0.0122% |
| 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:15 · read-only · refreshes every 30 s