PHASE_PERMANENT_TYPE_SCAN_LEGACY · branch loop/it29 · base 4ec0b9ef1 · candidate a81f94bdf · took 1h 5m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 21,784,210,163 | 21,783,181,073 | 4,000 | 5,445,924 | 2,759 | 2,582 |
| optimized | 21,782,556,217 | 21,782,507,330 | 4,000 | 5,445,633 | 3,931 | 3,966 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.80% — cycles-neutral (same-arm spread 11.82%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.973 / 0.987 | same |
| backend stall / frontend stall (share of cycles) | 16.0% / 17.5% · 45.1% / 43.2% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 12.93 / 12.95 · 11.18 / 11.19 | same |
| branch mispredicts per 1k instructions | 5.621 / 6.069 | fewer |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 78,428,575,535 | 78,454,918,065 | 11,418 | 6,870,008 | 19,735 | 13,332 |
| optimized | 78,420,534,284 | 78,402,292,095 | 11,418 | 6,867,351 | 20,436 | 12,852 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +4.88% — cycles-neutral (same-arm spread 2.87%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.862 / 0.901 | same |
| backend stall / frontend stall (share of cycles) | 17.6% / 22.1% · 48.3% / 41.8% | less waiting |
| L1D / L2D refills per 1k instructions (cache misses) | 17.36 / 17.33 · 13.83 / 13.83 | same |
| branch mispredicts per 1k instructions | 5.329 / 5.349 | same |
Mechanism. In game/filter.rs, replace the six successive core_types.contains checks in TypeFilter::Permanent with one iteration using the existing CoreType::is_permanent_type authority. Apply the same mechanism to live objects, zone-change records and spell-cast records. matches_type_filter_against_face already uses this implementation.
Evidence. docs/profiles/perf-20261002-1221/w0-owners-all.txt attributes 1.6% of process CPU to type_filter_matches; other windows show 0.3–0.9%. The profile used clean Phase 4ec0b9ef1, whose deck-rotation provenance is recorded in docs/stage0-decision-memo.md:L5986. These are sampled CPU shares, not instruction savings. Permanent-specific time is unmeasured, so 1.6% is a family ceiling.
Counter and kill threshold. Existing profile row: type_filter_matches, 1.6% CPU in the seed-91/default-deck window. Expected instruction reduction: approximately 0.3–0.7% per action at 4,000 actions, conditional on Permanent's unmeasured fraction of that row. The loop decides retention using its existing tiers.
Invariant. The predicate remains true exactly when the stored type vector contains Artifact, Battle, Creature, Enchantment, Land or Planeswalker. Preserve the existing zone-independent interpretation. Add permanent differential tests over all CoreType subsets, empty and duplicate vectors, permutations, and Non/AnyOf wrappers; exercise live objects and both record readers.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 12m 15s | 0 | 5,235,320 / 14,487 | |
| executor | codex / gpt-6-luna | 37m 45s | 0 | 6,276,690 / 15,006 | |
| reviewer | codex / gpt-6.1-sol | 0m 16s | 0 | 23,235 / 300 |
| 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 it29-build |
| ir1k | pass | 0 | Ir -0.01% within +/-1%, same-arm spread 0.0107% | optimized 21,781,762,657 vs legacy 21,783,486,642 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.04% within +/-1%, same-arm spread 0.0336% | optimized 78,408,150,872 vs legacy 78,441,129,792 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_PERMANENT_TYPE_SCAN_LEGACY, mechanism class compute. Mechanism: In game/filter.rs, replace the six successive core_types.contains checks in TypeFilter::Permanent with one iteration using the existing CoreType::is_permanent_type authority. Apply the same mechanism to live objects, zone-change records and spell-cast records. matches_type_filter_against_face already uses this implementation. Invariant: The predicate remains true exactly when the stored type vector contains Artifact, Battle, Creature, Enchantment, Land or Planeswalker. Preserve the existing zone-independent interpretation. Add permanent differential tests over all CoreType subsets, empty and duplicate vectors, permutations, and Non/AnyOf wrappers; exercise live objects and both record readers.
| 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.01% within +/-1%, same-arm spread 0.0107% |
| ir4k | NO | Ir -0.04% within +/-1%, same-arm spread 0.0336% |
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