PHASE_TRIGGER_ITERATOR_BOX_LEGACY · branch loop/it46 · base 4ec0b9ef1 · candidate 1adfda210 · took 1h 17m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,787,875,139 | 21,789,451,619 | 4,000 | 5,447,166 | 3,014 | 2,670 |
| optimized | 21,778,195,224 | 21,781,550,501 | 4,000 | 5,444,968 | 2,689 | 2,562 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -4.44% — cycles-neutral (same-arm spread 4.89%) | same within noise |
| IPC (instructions per cycle, higher is better) | 1.008 / 0.969 | same |
| backend stall / frontend stall (share of cycles) | 16.1% / 15.5% · 44.6% / 46.7% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 12.86 / 12.83 · 11.13 / 11.50 | same |
| branch mispredicts per 1k instructions | 5.759 / 5.830 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 78,513,936,728 | 78,505,707,516 | 11,418 | 6,875,970 | 19,376 | 13,234 |
| optimized | 78,383,413,495 | 78,408,337,089 | 11,418 | 6,865,990 | 18,948 | 12,394 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.92% — cycles-neutral (same-arm spread 3.26%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.893 / 0.895 | same |
| backend stall / frontend stall (share of cycles) | 21.5% / 19.9% · 43.4% / 45.1% | more waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 17.30 / 17.31 · 13.86 / 13.70 | same |
| branch mispredicts per 1k instructions | 5.178 / 5.084 | same |
Mechanism. At functioning_abilities.rs:440–483, active_trigger_definitions allocates a boxed iterator for each functioning source. Return a concrete borrowed iterator, carrying the original boxed implementation as its legacy variant. Preserve definition gating and occurrence construction.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4904, measures collect_matching_triggers_inner at 1.6% inclusive CPU. Its linked bench/reports/uprof-xn565-20260923-owners-alloc.txt attributes approximately 0.2% CPU each to allocation/copy work owned by collect_matching_triggers_inner and check_state_triggers. These are containing bounds, not isolated boxing costs. The profile predates subsequent retained changes. This targets triggers separately from the previously tried static iterator optimization; loop history contains only unchosen proposals for this mechanism.
Counter and kill threshold. Existing xn5.67 collect_matching_triggers_inner inclusive row and trigger allocation-owner rows bound the opportunity. Expected instruction reduction: 0.3–0.6% per action at 4,000 actions, an uncertain planning hypothesis. Expect the marginal band because instruction counts under-report allocation savings.
Invariant. Both paths yield identical ordered live_index, occurrence-bearing definition_ref and borrowed definition values. Preserve eliminated-owner, phasing, Room-door and command-zone gates; enumerate before filtering. Intervening-if evaluation remains at existing callers. Permanent differential tests must compare complete identities and partial-consumption behavior, including duplicate payloads with distinct occurrences.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 6m 42s | 0 | 2,399,155 / 8,941 | |
| executor | codex / gpt-6-luna | 52m 33s | 0 | 6,558,094 / 16,246 | |
| reviewer | codex / gpt-6.1-sol | 0m 27s | 0 | 24,206 / 459 |
| 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 it46-build |
| ir1k | pass | 0 | Ir -0.04% within +/-1%, same-arm spread 0.0163% | optimized 21,780,500,418 vs legacy 21,789,018,113 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.14% within +/-1%, same-arm spread 0.0320% | optimized 78,400,083,039 vs legacy 78,510,843,855 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_TRIGGER_ITERATOR_BOX_LEGACY, mechanism class allocation. Mechanism: At functioning_abilities.rs:440–483, active_trigger_definitions allocates a boxed iterator for each functioning source. Return a concrete borrowed iterator, carrying the original boxed implementation as its legacy variant. Preserve definition gating and occurrence construction. Invariant: Both paths yield identical ordered live_index, occurrence-bearing definition_ref and borrowed definition values. Preserve eliminated-owner, phasing, Room-door and command-zone gates; enumerate before filtering. Intervening-if evaluation remains at existing callers. Permanent differential tests must compare complete identities and partial-consumption behavior, including duplicate payloads with distinct occurrences.
| 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.04% within +/-1%, same-arm spread 0.0163% |
| ir4k | NO | Ir -0.14% within +/-1%, same-arm spread 0.0320% |
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:09 · read-only · refreshes every 30 s