PHASE_REPLACEMENT_EVENT_BUCKET_LEGACY · branch loop/it33 · base 4ec0b9ef1 · candidate 1329f0600 · took 4h 37m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,573,060,147 | 21,572,283,530 | 4,000 | 5,393,168 | 2,602 | 2,331 |
| optimized | 21,583,207,630 | 21,584,306,213 | 4,000 | 5,395,939 | 2,456 | 2,520 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.67% — cycles-neutral (same-arm spread 4.96%) | same within noise |
| IPC (instructions per cycle, higher is better) | 1.012 / 1.010 | same |
| backend stall / frontend stall (share of cycles) | 22.7% / 19.0% · 38.2% / 42.2% | more waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 13.09 / 12.98 · 11.65 / 11.15 | same |
| branch mispredicts per 1k instructions | 5.789 / 5.620 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,539,470,599 | 77,531,935,385 | 11,418 | 6,790,655 | 17,988 | 11,898 |
| optimized | 77,268,145,780 | 77,267,753,272 | 11,418 | 6,767,205 | 19,245 | 12,673 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +1.11% — cycles-neutral (same-arm spread 2.96%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.906 / 0.910 | same |
| backend stall / frontend stall (share of cycles) | 26.8% / 27.2% · 37.7% / 37.1% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 17.64 / 17.49 · 13.97 / 13.73 | same |
| branch mispredicts per 1k instructions | 5.309 / 5.093 | same |
Mechanism. At game/replacement.rs::rebuild_replacement_index, enumerate active replacements in the existing order but insert only definitions whose event key belongs to replacement_event_keys_for_event(proposed). Keep the current persistent bucket representation and original ordinals. Record which keys the partial index covers; consultations for uncovered keys use the existing direct scan.
Evidence. docs/stage0-decision-memo.md:L5379 (xn5.69) measured bucket assembly at 1.141%/1.207% of contract+apply and assembly plus drop plus clone at 1.302%/1.370%. The newer docs/profiles/perf-20261002-1221/summary.md shows replacement preparation at 2.2–3.7% across five windows. These bound the family, not the fraction attributable to irrelevant buckets; the profile predates the later loop candidates.
Counter and kill threshold. Existing replacement_index_bucket_assembly_ns, replacement_index_bucket_drop_ns and replacement_index_clone_ns; xn5.69's representation-sensitive ceiling is approximately 1.3%. Expected instruction reduction: 0.3–0.7% per action at 4,000 actions, an unmeasured forecast. Allocation savings may exceed the instruction result.
Invariant. Ordered replacement candidates, proposed-event transitions, prompts and all three fingerprints remain identical. Preserve enumeration ordinals before filtering, virtual and floating candidates, liminal self-replacements, and rebuilding at every pipeline entry. An uncovered event key must trigger the direct scan, never imply absence.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 8m 51s | 0 | 2,638,662 / 10,316 | |
| executor | codex / gpt-6-luna | 1h 5m | 0 | 8,350,665 / 18,280 | |
| reviewer | codex / gpt-6.1-sol | 1m 1s | 0 | 25,362 / 1,563 | |
| executor | codex / gpt-6-luna | 1356h 15m | / | ||
| executor | codex / gpt-6-luna | 14m 14s | 0 | 4,965,642 / 7,842 | |
| reviewer | codex / gpt-6.1-sol | 1m 10s | 0 | 25,362 / 1,256 | |
| executor | codex / gpt-6-luna | 37m 0s | 0 | 9,490,326 / 22,092 | |
| reviewer | codex / gpt-6.1-sol | 1m 17s | 0 | 25,362 / 1,429 |
| 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 it33-build |
| ir1k | pass | 0 | Ir +0.05% within +/-1%, same-arm spread 0.0092% | optimized 21,583,998,221 vs legacy 21,572,141,299 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.35% within +/-1%, same-arm spread 0.0097% | optimized 77,267,646,231 vs legacy 77,536,256,678 instructions; fingerprints match: True |
| check | pass | 0 | |
| focused | FAIL | 101 |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_REPLACEMENT_EVENT_BUCKET_LEGACY, mechanism class allocation. Mechanism: At game/replacement.rs::rebuild_replacement_index, enumerate active replacements in the existing order but insert only definitions whose event key belongs to replacement_event_keys_for_event(proposed). Keep the current persistent bucket representation and original ordinals. Record which keys the partial index covers; consultations for uncovered keys use the existing direct scan. Invariant: Ordered replacement candidates, proposed-event transitions, prompts and all three fingerprints remain identical. Preserve enumeration ordinals before filtering, virtual and floating candidates, liminal self-replacements, and rebuilding at every pipeline entry. An uncovered event key must trigger the direct scan, never imply absence.
| 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.05% within +/-1%, same-arm spread 0.0092% |
| ir4k | marginal: workstation check | Ir -0.35% within +/-1%, same-arm spread 0.0097% |
| check | yes | |
| focused | NO |
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