PHASE_SPELL_POPULATION_STREAM_LEGACY · branch loop/it35 · base 4ec0b9ef1 · candidate 36719278a · took 1h 13m| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 22,093,588,394 | 22,096,079,665 | 4,000 | 5,523,709 | 2,551 | 2,328 |
| optimized | 22,087,325,018 | 22,084,648,115 | 4,000 | 5,521,497 | 2,709 | 2,537 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +2.04% — cycles-neutral (same-arm spread 1.88%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.982 / 0.999 | same |
| backend stall / frontend stall (share of cycles) | 18.0% / 18.4% · 43.4% / 42.5% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 12.73 / 12.70 · 11.28 / 11.09 | same |
| branch mispredicts per 1k instructions | 6.216 / 5.994 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 81,076,830,054 | 81,076,647,904 | 11,418 | 7,100,783 | 18,313 | 12,034 |
| optimized | 81,038,257,935 | 81,024,532,507 | 11,418 | 7,096,812 | 20,713 | 13,600 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +0.14% — cycles-neutral (same-arm spread 4.31%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.897 / 0.907 | same |
| backend stall / frontend stall (share of cycles) | 22.1% / 22.4% · 42.5% / 41.8% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 16.77 / 16.73 · 13.53 / 13.45 | same |
| branch mispredicts per 1k instructions | 5.349 / 5.263 | same |
Mechanism. At casting.rs::spell_objects_available_to_cast and ai_support/candidates.rs::priority_actions_with_probe, replace the temporary aggregate Vec<ObjectId> with a private visitor that delivers IDs directly to the existing candidate-building body. Preserve every zone producer, restriction predicate, duplicate and emission order. Keep the public Vec-returning API unchanged.
Evidence. xn5.67, docs/stage0-decision-memo.md:L4904, names the reference capture. Its bench/reports/uprof-xn565-20260923-owners-all.txt attributes 1.6% of process CPU to spell_objects_available_to_cast; owners-alloc.txt attributes 0.9% to its allocation family. These are historical family bounds, not measurements of the removable aggregate vector; later retained changes may have reduced them.
Counter and kill threshold. Existing xn5.67 spell_objects_available_to_cast owner rows: 1.6% CPU overall, 0.9% allocation family, nested rather than additive. Expected instruction reduction: 0.3–0.7% per action at 4,000 actions, an unmeasured forecast likely to be marginal. The loop's existing instruction and fingerprint gates decide it.
Invariant. The visitor must emit exactly the legacy ID sequence, including duplicates, and invoke castability and payment-mode checks equally often in the same order. Add a permanent differential regression comparing emitted IDs and complete priority candidates across hand, commander, overlapping graveyard/exile permissions, temporary prohibitions, missing objects and split second; include positive permission cases and compare all fingerprint families.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 16m 1s | 0 | 3,926,731 / 12,188 | |
| executor | codex / gpt-6-luna | 40m 53s | 0 | 5,565,090 / 16,651 | |
| reviewer | codex / gpt-6.1-sol | 1m 28s | 0 | 24,448 / 1,419 |
| 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 it35-build |
| ir1k | pass | 0 | Ir -0.04% within +/-1%, same-arm spread 0.0215% | optimized 22,086,364,899 vs legacy 22,096,002,467 instructions; fingerprints match: True |
| ir4k | FAIL | 0 | Ir -0.06% within +/-1%, same-arm spread 0.0199% | optimized 81,030,963,163 vs legacy 81,082,085,426 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_SPELL_POPULATION_STREAM_LEGACY, mechanism class allocation. Mechanism: At casting.rs::spell_objects_available_to_cast and ai_support/candidates.rs::priority_actions_with_probe, replace the temporary aggregate Vec<ObjectId> with a private visitor that delivers IDs directly to the existing candidate-building body. Preserve every zone producer, restriction predicate, duplicate and emission order. Keep the public Vec-returning API unchanged. Invariant: The visitor must emit exactly the legacy ID sequence, including duplicates, and invoke castability and payment-mode checks equally often in the same order. Add a permanent differential regression comparing emitted IDs and complete priority candidates across hand, commander, overlapping graveyard/exile permissions, temporary prohibitions, missing objects and split second; include positive permission cases and compare all fingerprint families.
| 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.04% within +/-1%, same-arm spread 0.0215% |
| ir4k | NO | Ir -0.06% within +/-1%, same-arm spread 0.0199% |
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:11 · read-only · refreshes every 30 s