PHASE_REPLACEMENT_BUCKET_HASH_LEGACY · branch loop/it47 · base 4ec0b9ef1 · candidate 3005d6315 · took 2h 54m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,548,926,725 | 21,545,360,325 | 4,000 | 5,386,786 | 2,430 | 2,548 |
| optimized | 21,463,380,170 | 21,459,803,635 | 4,000 | 5,365,398 | 3,828 | 3,560 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +0.05% — cycles-neutral (same-arm spread 8.00%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.996 / 1.016 | same |
| backend stall / frontend stall (share of cycles) | 17.8% / 17.3% · 43.4% / 43.0% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 13.21 / 13.06 · 11.26 / 11.20 | same |
| branch mispredicts per 1k instructions | 5.930 / 5.849 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,426,279,320 | 77,437,196,941 | 11,418 | 6,781,550 | 20,160 | 12,805 |
| optimized | 77,085,060,460 | 77,060,666,444 | 11,418 | 6,750,119 | 20,203 | 13,495 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.11% — cycles-neutral (same-arm spread 2.20%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.884 / 0.886 | same |
| backend stall / frontend stall (share of cycles) | 18.4% / 18.7% · 47.0% / 46.6% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 17.65 / 17.62 · 13.80 / 13.85 | same |
| branch mispredicts per 1k instructions | 5.107 / 5.165 | same |
Mechanism. Replace RandomState hashing with FxBuildHasher only for ReplacementIndex.by_event. Keep the existing persistent map, vectors, full rebuild cadence, and ordinal-based candidate ordering. A private bucket wrapper carries both map types so the legacy arm retains the original implementation.
Evidence. xn5.69, docs/stage0-decision-memo.md:L5379, measured bucket assembly at 97.717/92.427 ms, or 1.141%/1.207% of contract+apply for seeds 91/42. xn5.67:L4904 also recorded sip::write at 0.110 seconds. Hashing's exclusive contribution inside bucket assembly is unmeasured; the assembly share is a ceiling, not a predicted saving.
Counter and kill threshold. Existing replacement_index_bucket_assembly_ns bounds the affected build region. Expected instruction reduction: 0.3–0.7% per action, an unverified marginal-band hypothesis. The loop's standard gates decide retention.
Invariant. Hash choice changes lookup representation, not key equality or bucket contents. Consults restore source order using stored ordinals and re-read live replacement predicates. Permanent differential tests must compare ordered candidates across both hashers, including multiple event keys, distinct Other(String) keys, and same-revision replacement mutations.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 8m 30s | 0 | 2,548,429 / 10,365 | |
| executor | codex / gpt-6-luna | 38m 55s | 0 | 4,179,783 / 12,506 | |
| reviewer | codex / gpt-6.1-sol | 0m 57s | 0 | 21,388 / 1,308 |
| 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 it47-build |
| ir1k | pass | 0 | Ir -0.40% within +/-1%, same-arm spread 0.0168% | optimized 21,461,517,395 vs legacy 21,547,758,677 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.46% within +/-1%, same-arm spread 0.0316% | optimized 77,076,267,733 vs legacy 77,430,187,138 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 it47-parity |
Status: unknown (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_REPLACEMENT_BUCKET_HASH_LEGACY, mechanism class compute. Mechanism: Replace RandomState hashing with FxBuildHasher only for ReplacementIndex.by_event. Keep the existing persistent map, vectors, full rebuild cadence, and ordinal-based candidate ordering. A private bucket wrapper carries both map types so the legacy arm retains the original implementation. Invariant: Hash choice changes lookup representation, not key equality or bucket contents. Consults restore source order using stored ordinals and re-read live replacement predicates. Permanent differential tests must compare ordered candidates across both hashers, including multiple event keys, distinct Other(String) keys, and same-revision replacement mutations.
| 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.40% within +/-1%, same-arm spread 0.0168% |
| ir4k | marginal: workstation check | Ir -0.46% within +/-1%, same-arm spread 0.0316% |
| 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:13 · read-only · refreshes every 30 s