PHASE_OPTIONAL_LAYER_WRITES_LEGACY · branch loop/it39 · base 4ec0b9ef1 · candidate 0888d9790 · took 59m 44s| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 22,090,901,077 | 22,092,234,024 | 4,000 | 5,522,892 | 2,817 | 2,589 |
| optimized | 22,086,490,474 | 22,084,613,862 | 4,000 | 5,521,388 | 2,814 | 2,845 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +1.22% — cycles-neutral (same-arm spread 5.17%) | same within noise |
| IPC (instructions per cycle, higher is better) | 1.009 / 0.996 | same |
| backend stall / frontend stall (share of cycles) | 17.3% / 17.7% · 43.4% / 43.3% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 12.63 / 12.65 · 11.11 / 11.15 | same |
| branch mispredicts per 1k instructions | 5.830 / 6.299 | fewer |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 81,028,995,364 | 81,008,173,627 | 11,418 | 7,095,690 | 18,242 | 11,852 |
| optimized | 80,949,583,770 | 80,956,161,239 | 11,418 | 7,089,935 | 19,001 | 12,091 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -2.11% — cycles-neutral (same-arm spread 4.07%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.925 / 0.910 | same |
| backend stall / frontend stall (share of cycles) | 21.0% / 20.8% · 42.8% / 43.4% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 16.74 / 16.70 · 13.47 / 13.50 | same |
| branch mispredicts per 1k instructions | 5.315 / 5.369 | same |
Mechanism. In layers.rs, derive_room_battlefield_names, apply_prototype_characteristics and apply_pt_counter_modifications acquire ObjectStore::get_mut before determining whether they have work. Inspect the object immutably, compute the existing name, prototype payload or counter deltas, and acquire mutable access only when the existing code would write.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4904, attributes 2.20% inclusive process CPU to ObjectStore::get_mut beneath evaluate_layers. This bounds the containing mutable-access work; the three fixups have no isolated timer. xn5.46 at L3311 rejected a more expensive whole-characteristics reset predicate. The profile predates subsequent loop changes, so its share is historical attribution.
Counter and kill threshold. Existing xn5.67 evaluate_layers -> ObjectStore::get_mut profile row: 2.20% inclusive CPU. Expected instruction reduction: 0.5–1.0% per action at 4,000 actions, an unmeasured hypothesis. Most full-pass objects have already been detached by reset; the expected benefit is fewer mutable lookups and Arc::make_mut checks, not guaranteed clone elimination.
Invariant. These helpers mutate only their supplied object's fields and do not change population membership. Immutable preparation must retain every existing guard, write, arithmetic operation and checkpoint. Add permanent differential tests covering ordinary objects, prototype payloads, locked/unlocked and copied Rooms, face-down objects, copy-name exceptions, sticker ordering, zero counters, non-P/T counters, cancelling P/T deltas and saturating arithmetic. Include positive fixtures proving each write branch executes.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 10m 26s | 0 | 3,460,544 / 13,782 | |
| executor | codex / gpt-6-luna | 33m 52s | 0 | 5,282,952 / 15,965 | |
| reviewer | codex / gpt-6.1-sol | 0m 39s | 0 | 23,369 / 873 |
| 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 it39-build |
| ir1k | pass | 0 | Ir -0.03% within +/-1%, same-arm spread 0.0159% | optimized 22,085,076,732 vs legacy 22,090,621,970 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.08% within +/-1%, same-arm spread 0.0257% | optimized 80,953,000,521 vs legacy 81,018,386,509 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_OPTIONAL_LAYER_WRITES_LEGACY, mechanism class compute. Mechanism: In layers.rs, derive_room_battlefield_names, apply_prototype_characteristics and apply_pt_counter_modifications acquire ObjectStore::get_mut before determining whether they have work. Inspect the object immutably, compute the existing name, prototype payload or counter deltas, and acquire mutable access only when the existing code would write. Invariant: These helpers mutate only their supplied object's fields and do not change population membership. Immutable preparation must retain every existing guard, write, arithmetic operation and checkpoint. Add permanent differential tests covering ordinary objects, prototype payloads, locked/unlocked and copied Rooms, face-down objects, copy-name exceptions, sticker ordering, zero counters, non-P/T counters, cancelling P/T deltas and saturating arithmetic. Include positive fixtures proving each write branch executes.
| 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.03% within +/-1%, same-arm spread 0.0159% |
| ir4k | NO | Ir -0.08% within +/-1%, same-arm spread 0.0257% |
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:06 · read-only · refreshes every 30 s