PHASE_COPY_GATHER_SPECIALIZATION_LEGACY · branch loop/it40 · base 4ec0b9ef1 · candidate 8dddb0fa4 · took 1h 23m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,542,581,187 | 21,549,403,892 | 4,000 | 5,386,498 | 2,376 | 2,285 |
| optimized | 21,526,199,323 | 21,527,965,494 | 4,000 | 5,381,771 | 2,433 | 2,376 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +6.19% — cycles-neutral (same-arm spread 4.46%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.965 / 1.016 | worse |
| backend stall / frontend stall (share of cycles) | 17.6% / 19.4% · 44.5% / 41.3% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 13.07 / 12.98 · 11.43 / 11.45 | same |
| branch mispredicts per 1k instructions | 6.012 / 5.953 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,440,018,058 | 77,440,729,636 | 11,418 | 6,782,306 | 19,182 | 12,713 |
| optimized | 77,289,044,066 | 77,290,069,064 | 11,418 | 6,769,098 | 20,907 | 14,030 |
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 8.33%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.873 / 0.869 | same |
| backend stall / frontend stall (share of cycles) | 22.4% / 20.5% · 43.1% / 45.5% | more waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 17.55 / 17.54 · 14.16 / 13.96 | same |
| branch mispredicts per 1k instructions | 5.589 / 5.233 | more |
Mechanism. At layers.rs:6283, gather_active_effects_for_layer collects every active continuous effect and then discards effects outside the requested layer. Its production caller is the copy fixed-point pass. Add a copy-specific collection mode that skips ordinary non-copy modifications before cloning their payloads. Keep expanding grant forms on the existing expansion path and filter their emitted effects afterward.
Evidence. docs/stage0-decision-memo.md:L4904, xn5.67, measures evaluate_layers at 11.6% inclusive CPU and attributes allocator traffic to that family. Current source performs the all-layer collection for copy discovery and subsequently gathers effects again after layer 1. The profile bounds the containing family, but does not isolate the removable materialization cost; this is a ceiling, not a measured saving. Later loop optimizations make the profile historical.
Counter and kill threshold. Existing xn5.67 evaluate_layers inclusive profile row: 11.6%; allocator-owner report also attributes 1.1% CPU one level above allocations to evaluate_layers. These overlap and must not be added. Expected instruction reduction: 0.6–1.4% per action at 4,000 actions, an unmeasured hypothesis; allocation savings may be understated by instructions.
Invariant. The specialized collector must return exactly the legacy collector's Layer::Copy subsequence, preserving emission order, definition/modification indices, provenance, conditions and payloads. It must gather from the current board on every fixed-point generation. Expansion forms cannot be screened solely by their outer modification's layer.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 5m 34s | 0 | 1,817,729 / 6,496 | |
| executor | codex / gpt-6-luna | 40m 48s | 0 | 7,657,635 / 18,427 | |
| reviewer | codex / gpt-6.1-sol | 0m 55s | 0 | 25,501 / 1,308 | |
| executor | codex / gpt-6-luna | 19m 58s | 0 | 2,960,183 / 7,034 | |
| reviewer | codex / gpt-6.1-sol | 0m 42s | 0 | 23,309 / 905 |
| 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 it40-build |
| ir1k | pass | 0 | Ir -0.09% within +/-1%, same-arm spread 0.0317% | optimized 21,525,711,710 vs legacy 21,545,637,706 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.19% within +/-1%, same-arm spread 0.0169% | optimized 77,286,895,370 vs legacy 77,436,123,519 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_COPY_GATHER_SPECIALIZATION_LEGACY, mechanism class allocation. Mechanism: At layers.rs:6283, gather_active_effects_for_layer collects every active continuous effect and then discards effects outside the requested layer. Its production caller is the copy fixed-point pass. Add a copy-specific collection mode that skips ordinary non-copy modifications before cloning their payloads. Keep expanding grant forms on the existing expansion path and filter their emitted effects afterward. Invariant: The specialized collector must return exactly the legacy collector's Layer::Copy subsequence, preserving emission order, definition/modification indices, provenance, conditions and payloads. It must gather from the current board on every fixed-point generation. Expansion forms cannot be screened solely by their outer modification's layer.
| 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.09% within +/-1%, same-arm spread 0.0317% |
| ir4k | NO | Ir -0.19% within +/-1%, same-arm spread 0.0169% |
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:10 · read-only · refreshes every 30 s