PHASE_REPLACEMENT_FLAT_INDEX_LEGACY · branch loop/it10 · base 4ec0b9ef1 · candidate dc34b10bd · took 4h 12m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,778,210,903 | 21,778,597,296 | 4,000 | 5,444,601 | 2,559 | 2,298 |
| optimized | 21,568,575,072 | 21,567,553,366 | 4,000 | 5,392,016 | 2,369 | 2,397 |
perf: indicative only, not a clean timing.| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 78,429,261,373 | 78,427,972,459 | 11,418 | 6,868,858 | 19,082 | 12,508 |
| optimized | 77,569,327,847 | 77,564,823,873 | 11,418 | 6,793,403 | 18,699 | 11,958 |
perf: indicative only, not a clean timing.Mechanism. At replacement.rs:7233, rebuild a contiguous Vec<(ReplacementEvent, ReplacementIndexEntry)> in active-replacement scan order. At indexed_object_replacement_candidates_from_index, select entries whose event matches any requested key and retain the existing live applicability checks. This removes persistent HAMT/vector bucket construction and naturally produces ordinal order without sorting.
Evidence. xn5.69, docs/stage0-decision-memo.md:L5379, measured bucket assembly at 1.141%/1.207% of contract+apply and assembly+drop+index-clone at 1.302%/1.370% for seeds 91/42. Reports: bench/reports/xn569-counter-s91-20260924-131701-* and xn569-counter-s42-20260924-132036-*. These bound representation work, not scan work. The measurements predate subsequent retained changes.
Counter and kill threshold. Existing replacement_index_bucket_assembly_ns, replacement_index_bucket_drop_ns and replacement_index_clone_ns bound the opportunity. Expected instruction reduction: 0.4–0.8% per action at 4,000 actions, a hypothesis in the marginal band. Allocation savings can exceed their instruction-count effect; linear lookup overhead could erase them. Apply the loop's existing tiers.
Invariant. The ordered replacement candidates, virtual-candidate prefix, liminal-entry suffix and dynamic applicability predicates remain identical. Rebuild at every pipeline entry and preserve invalidation after replacement application; ReplacementIndex::clone must still return an uninitialized index. Add a permanent differential regression covering multiple event keys, candidate ordering, floating/virtual replacements, liminal entries, same-revision definition mutation and fork isolation.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 10m 56s | 0 | 2,132,991 / 10,968 | |
| executor | codex / gpt-6-luna | 1h 20m | 0 | 11,904,897 / 23,119 | |
| reviewer | codex / gpt-6.1-sol | 0m 59s | 0 | 24,337 / 1,107 | |
| executor | codex / gpt-6-luna | 37m 42s | 0 | 7,345,532 / 17,691 | |
| reviewer | codex / gpt-6.1-sol | 1m 5s | 0 | 26,149 / 1,114 |
| 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 it10-build |
| ir1k | pass | 0 | Ir -0.97% within +/-1%, same-arm spread 0.0047% | optimized 21,568,064,219 vs legacy 21,778,404,100 instructions; fingerprints match: True |
| ir4k | pass | 0 | Ir -1.10% (threshold -1%), same-arm spread 0.0058% | optimized 77,567,075,860 vs legacy 78,428,616,916 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_FLAT_INDEX_LEGACY, mechanism class allocation. Mechanism: At replacement.rs:7233, rebuild a contiguous Vec<(ReplacementEvent, ReplacementIndexEntry)> in active-replacement scan order. At indexed_object_replacement_candidates_from_index, select entries whose event matches any requested key and retain the existing live applicability checks. This removes persistent HAMT/vector bucket construction and naturally produces ordinal order without sorting. Invariant: The ordered replacement candidates, virtual-candidate prefix, liminal-entry suffix and dynamic applicability predicates remain identical. Rebuild at every pipeline entry and preserve invalidation after replacement application; ReplacementIndex::clone must still return an uninitialized index. Add a permanent differential regression covering multiple event keys, candidate ordering, floating/virtual replacements, liminal entries, same-revision definition mutation and fork isolation.
| 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.97% within +/-1%, same-arm spread 0.0047% |
| ir4k | yes | Ir -1.10% (threshold -1%), same-arm spread 0.0058% |
| 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:14 · read-only · refreshes every 30 s