PHASE_TRIGGER_REBUILD_TRANSIENT_LEGACY · branch loop/it50 · base 4ec0b9ef1 · candidate 834ce9e10 · took 1h 5m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,555,047,991 | 21,558,208,982 | 4,000 | 5,389,157 | 3,510 | 2,767 |
| optimized | 21,557,496,007 | 21,559,149,667 | 4,000 | 5,389,581 | 2,434 | 2,322 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -2.73% — cycles-neutral (same-arm spread 3.20%) | same within noise |
| IPC (instructions per cycle, higher is better) | 1.026 / 1.010 | same |
| backend stall / frontend stall (share of cycles) | 17.6% / 17.1% · 42.2% / 43.3% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 12.95 / 12.99 · 11.30 / 11.36 | same |
| branch mispredicts per 1k instructions | 5.578 / 5.795 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,471,683,008 | 77,478,941,270 | 11,418 | 6,785,366 | 17,317 | 11,359 |
| optimized | 77,489,690,256 | 77,497,662,493 | 11,418 | 6,786,975 | 18,997 | 13,065 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +0.63% — cycles-neutral (same-arm spread 4.36%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.901 / 0.900 | same |
| backend stall / frontend stall (share of cycles) | 24.1% / 21.7% · 40.0% / 42.8% | more waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 17.52 / 17.50 · 14.05 / 13.97 | same |
| branch mispredicts per 1k instructions | 5.235 / 5.026 | same |
Mechanism. In trigger_index.rs:1136, accumulate rebuild buckets in std::collections::HashMap<TriggerEventKey, SmallVec<[ObjectId; 4]>>, then convert once into the existing im::HashMap. This replaces repeated persistent-map entry traversals during reconstruction while preserving the stored representation and incremental add/remove paths.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4947, attributes 0.80% inclusive process CPU to TriggerIndex::rebuild_from_battlefield. That bounds the whole rebuild, not bucket insertion alone, and predates the pending trigger-index borrowing change; the remaining opportunity is smaller.
Counter and kill threshold. Existing xn5.67 TriggerIndex::rebuild_from_battlefield profile row: 0.80% inclusive CPU. Expected instruction reduction: 0.3–0.6% per action at 4,000 actions, an unverified marginal-band expectation.
Invariant. Every key retains the same ordered, duplicate-free object IDs, and unclassified retains identical contents and order. Preserve keys_from_trigger_def, synthetic-keyword admission, phased-out exclusion and duplicate handling. Compare complete buckets and event candidate lists between both rebuild implementations.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 8m 31s | 0 | 2,750,014 / 8,942 | |
| executor | codex / gpt-6-luna | 41m 40s | 0 | 11,745,112 / 21,090 | |
| reviewer | codex / gpt-6.1-sol | 0m 47s | 0 | 23,645 / 802 |
| 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 it50-build |
| ir1k | pass | 0 | Ir -+0.00% within +/-1%, same-arm spread 0.0232% | optimized 21,557,549,521 vs legacy 21,557,765,485 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir +0.02% within +/-1%, same-arm spread 0.0187% | optimized 77,494,554,255 vs legacy 77,478,921,245 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_TRIGGER_REBUILD_TRANSIENT_LEGACY, mechanism class compute. Mechanism: In trigger_index.rs:1136, accumulate rebuild buckets in std::collections::HashMap<TriggerEventKey, SmallVec<[ObjectId; 4]>>, then convert once into the existing im::HashMap. This replaces repeated persistent-map entry traversals during reconstruction while preserving the stored representation and incremental add/remove paths. Invariant: Every key retains the same ordered, duplicate-free object IDs, and unclassified retains identical contents and order. Preserve keys_from_trigger_def, synthetic-keyword admission, phased-out exclusion and duplicate handling. Compare complete buckets and event candidate lists between both rebuild implementations.
| 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.00% within +/-1%, same-arm spread 0.0232% |
| ir4k | NO | Ir +0.02% within +/-1%, same-arm spread 0.0187% |
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:17 · read-only · refreshes every 30 s