PHASE_PERMISSION_EXPIRY_WRITES_LEGACY · branch loop/it30 · base 4ec0b9ef1 · candidate 0886252ed · took 1h 37m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 20,978,013,290 | 20,978,973,407 | 4,000 | 5,244,623 | 3,455 | 3,283 |
| optimized | 20,356,549,032 | 20,356,821,835 | 4,000 | 5,089,171 | 2,500 | 2,167 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -8.06% — cycles-neutral (same-arm spread 5.90%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.982 / 0.953 | same |
| backend stall / frontend stall (share of cycles) | 16.8% / 17.2% · 45.2% / 45.9% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 13.09 / 13.38 · 11.45 / 11.62 | same |
| branch mispredicts per 1k instructions | 6.131 / 5.919 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 79,850,008,560 | 79,846,397,966 | 11,418 | 6,993,186 | 21,955 | 14,521 |
| optimized | 78,263,425,504 | 78,273,439,475 | 11,418 | 6,854,829 | 20,412 | 12,705 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -4.40% — cycles-faster (same-arm spread 1.47%) | faster |
| IPC (instructions per cycle, higher is better) | 0.882 / 0.862 | same |
| backend stall / frontend stall (share of cycles) | 17.1% / 18.9% · 48.8% / 47.7% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 16.81 / 16.97 · 13.55 / 13.54 | same |
| branch mispredicts per 1k instructions | 5.014 / 4.948 | same |
Mechanism. At game/layers.rs:566 and :639, turn/step expiry and untap arming acquire mutable access to every object before inspecting its permissions. Discover affected IDs through immutable iteration, then acquire mutable access only when an existing permission will expire or be armed.
Evidence. docs/profiles/uprof-20261002-1125/w0-owners-all.txt attributes 1.4% CPU directly to prune_casting_permissions_at; w0-owners-alloc.txt attributes 0.5% allocation-family CPU to that owner, overlapping the first number. ObjectStore::iter_mut calls Arc::make_mut for every object. These captures precede some loop changes. The indexed xn5.5 section at memo L1339 covers host-departure pruning, a separate site with a neutral whole-engine result.
Counter and kill threshold. Existing prune_casting_permissions_at profile rows: 1.4% nearest-owner CPU and overlapping 0.5% allocation CPU. Expected reduction: 0.5–1.0% instructions per action at 4,000 actions; this is an unmeasured hypothesis. Untap arming has no separate measured share and receives no additional credit.
Invariant. Use CastingPermission::lifetime and permission_duration_expires_at unchanged. Preserve retained permission order, keyed-player selection, untap arming before expiry, and all fingerprints. Permanent explicit-arm regressions must compare every expiry seam, matching and nonmatching players, permanent and host-bound permissions, and fork isolation; no-op expiry must preserve object_ptr sharing.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 7m 57s | 0 | 2,534,695 / 9,510 | |
| executor | codex / gpt-6-luna | 44m 24s | 0 | 18,421,720 / 26,241 | |
| reviewer | codex / gpt-6.1-sol | 0m 51s | 0 | 23,978 / 1,128 |
| 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 it30-build |
| ir1k | pass | 0 | Ir -2.97% (threshold -1%), same-arm spread 0.0076% | optimized 20,356,212,013 vs legacy 20,978,842,524 instructions; fingerprints match: True |
| ir4k | pass | 0 | Ir -1.98% (threshold -1%), same-arm spread 0.0136% | optimized 78,266,561,980 vs legacy 79,850,992,760 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 it30-parity |
Status: unknown (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_PERMISSION_EXPIRY_WRITES_LEGACY, mechanism class copy. Mechanism: At game/layers.rs:566 and :639, turn/step expiry and untap arming acquire mutable access to every object before inspecting its permissions. Discover affected IDs through immutable iteration, then acquire mutable access only when an existing permission will expire or be armed. Invariant: Use CastingPermission::lifetime and permission_duration_expires_at unchanged. Preserve retained permission order, keyed-player selection, untap arming before expiry, and all fingerprints. Permanent explicit-arm regressions must compare every expiry seam, matching and nonmatching players, permanent and host-bound permissions, and fork isolation; no-op expiry must preserve object_ptr sharing.
| 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 -2.97% (threshold -1%), same-arm spread 0.0076% |
| ir4k | yes | Ir -1.98% (threshold -1%), same-arm spread 0.0136% |
| 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:12 · read-only · refreshes every 30 s