PHASE_STATE_TRIGGER_PREFILTER_LEGACY · branch loop/it34 · base 4ec0b9ef1 · candidate cb88817bd · took 2h 16m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 22,098,844,075 | 22,100,865,907 | 4,000 | 5,524,964 | 2,442 | 2,311 |
| optimized | 22,047,544,995 | 22,051,245,433 | 4,000 | 5,512,349 | 2,515 | 2,419 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +2.47% — cycles-neutral (same-arm spread 6.15%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.991 / 1.004 | same |
| backend stall / frontend stall (share of cycles) | 16.6% / 17.8% · 43.8% / 42.2% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 12.67 / 12.71 · 11.02 / 11.09 | same |
| branch mispredicts per 1k instructions | 5.793 / 5.797 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 81,059,165,454 | 81,055,310,939 | 11,418 | 7,099,075 | 18,208 | 11,954 |
| optimized | 80,333,203,521 | 80,333,174,121 | 11,418 | 7,035,662 | 20,245 | 12,638 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.64% — cycles-neutral (same-arm spread 5.29%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.914 / 0.904 | same |
| backend stall / frontend stall (share of cycles) | 20.8% / 19.9% · 42.9% / 44.5% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 16.64 / 16.76 · 13.46 / 13.44 | same |
| branch mispredicts per 1k instructions | 5.196 / 4.964 | same |
Mechanism. In game/triggers.rs:10897, check_state_triggers clones every active trigger into a Vec, then discards definitions whose mode is not StateCondition. Apply that mode filter before cloning, retaining the existing condition evaluation and pending-trigger construction.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4904, references bench/reports/uprof-xn565-20260923-owners-all.txt: check_state_triggers owns 0.8% of process CPU. owners-alloc.txt attributes 0.2% directly to its allocations. These overlap; clone descendants may have other owners. The ordinary-trigger fraction is unmeasured, and the profile predates subsequent loop changes.
Counter and kill threshold. Existing xn5.67 check_state_triggers owner rows: 0.8% CPU, including 0.2% allocator ownership. Expected instruction reduction: 0.3–0.8% per action at 4,000 actions, an unmeasured forecast likely to enter the marginal band. Instruction counts can under-report clone and allocation savings.
Invariant. Only StateCondition definitions reach the existing evaluation body. Preserve functioning-ability gates, definition order, source snapshots, already-on-stack suppression and APNAP placement. A permanent explicit-arm regression must compare serialized state and stack for mixed ordinary/state definitions, true and false conditions, phased-out sources and an already-stacked state trigger.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 9m 6s | 0 | 2,758,210 / 9,715 | |
| executor | codex / gpt-6-luna | 56m 30s | 0 | 23,233,544 / 30,608 | |
| reviewer | codex / gpt-6.1-sol | 0m 43s | 0 | 20,528 / 680 |
| 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 it34-build |
| ir1k | pass | 0 | Ir -0.24% within +/-1%, same-arm spread 0.0269% | optimized 22,048,033,525 vs legacy 22,100,923,816 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.90% within +/-1%, same-arm spread 0.0128% | optimized 80,332,143,590 vs legacy 81,060,066,376 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 it34-parity |
Status: unknown (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_STATE_TRIGGER_PREFILTER_LEGACY, mechanism class copy. Mechanism: In game/triggers.rs:10897, check_state_triggers clones every active trigger into a Vec, then discards definitions whose mode is not StateCondition. Apply that mode filter before cloning, retaining the existing condition evaluation and pending-trigger construction. Invariant: Only StateCondition definitions reach the existing evaluation body. Preserve functioning-ability gates, definition order, source snapshots, already-on-stack suppression and APNAP placement. A permanent explicit-arm regression must compare serialized state and stack for mixed ordinary/state definitions, true and false conditions, phased-out sources and an already-stacked state trigger.
| 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.24% within +/-1%, same-arm spread 0.0269% |
| ir4k | marginal: workstation check | Ir -0.90% within +/-1%, same-arm spread 0.0128% |
| 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:14 · read-only · refreshes every 30 s