PHASE_QUANTITY_TYPED_POPULATION_LEGACY · branch loop/it32 · base 4ec0b9ef1 · candidate 4a4611786 · took 57m 15s| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 20,682,423,559 | 20,677,561,820 | 4,000 | 5,169,998 | 2,659 | 2,329 |
| optimized | 20,677,784,967 | 20,682,199,376 | 4,000 | 5,169,998 | 2,750 | 2,709 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | +2.12% — cycles-neutral (same-arm spread 4.16%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.974 / 1.007 | same |
| backend stall / frontend stall (share of cycles) | 18.3% / 19.1% · 44.5% / 42.4% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 13.54 / 13.61 · 11.85 / 11.55 | same |
| branch mispredicts per 1k instructions | 5.846 / 5.858 | same |
| Arm | Run 1 instructions | Run 2 | Actions | Instr / action | contract ms | apply ms |
|---|---|---|---|---|---|---|
| legacy | 77,332,918,113 | 77,314,020,610 | 11,418 | 6,772,068 | 18,229 | 11,855 |
| optimized | 77,252,807,451 | 77,240,479,740 | 11,418 | 6,765,339 | 21,429 | 14,664 |
perf: indicative only, not a clean timing.| Hardware counters (optimized / legacy) | Value | Reading |
|---|---|---|
| cycles, minimum of the repeats | -0.41% — cycles-neutral (same-arm spread 4.82%) | same within noise |
| IPC (instructions per cycle, higher is better) | 0.887 / 0.896 | same |
| backend stall / frontend stall (share of cycles) | 20.8% / 20.7% · 44.8% / 44.6% | same |
| L1D / L2D refills per 1k instructions (cache misses) | 17.58 / 17.53 · 13.85 / 13.90 | same |
| branch mispredicts per 1k instructions | 5.047 / 5.031 | same |
Mechanism. At game/quantity.rs:3202, matching_object_ids_in_filter_universe sends a Typed leaf through disjunctive-branch construction, filter cloning, population anchoring and union deduplication. Add a Typed-only path that obtains candidates through the existing filter_zone_object_ids helper, applies matches_target_filter and preserves stable deduplication. Keep object_count_matching_candidate_ids authoritative for the final predicate and triggering-object exclusion.
Evidence. xn5.67, memo L4904, identifies the saved profile artifacts. uprof-xn565-20260923-owners-all.txt attributes 0.9% of process CPU to filter_population_anchor_ids; owners-alloc.txt attributes 0.5% to that allocator owner and separately lists matching_object_ids_in_filter_universe. These overlapping views must not be added. Typed-leaf coverage within these rows is unmeasured, but the proposed shortcut directly removes population preparation in that measured family.
Counter and kill threshold. Existing xn5.67 filter_population_anchor_ids CPU and allocation-owner rows. Expected instruction reduction: 0.4–0.9% per action at 4,000 actions, an unmeasured forecast likely to enter the marginal band. Instruction counts may under-report allocation savings.
Invariant. For a Typed leaf, the normalized algorithm has one predicate branch and the same explicit-zone population, or the battlefield default. Preserve the ordered, deduplicated matching IDs, phased-out exclusion and OtherThanTriggerObject handling. Permanent differential tests must compare complete ordered vectors and resolved counts with the legacy algorithm.
| Role | Harness / model | Time | Exit | Tokens in / out | Note |
|---|---|---|---|---|---|
| planner | codex / gpt-6.1-sol | 10m 32s | 0 | 4,039,309 / 12,895 | |
| executor | codex / gpt-6-luna | 29m 38s | 0 | 6,076,854 / 13,217 | |
| reviewer | codex / gpt-6.1-sol | 0m 59s | 0 | 23,090 / 1,180 |
| 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 it32-build |
| ir1k | pass | 0 | Ir -0.01% within +/-1%, same-arm spread 0.0235% | optimized 20,679,270,856 vs legacy 20,680,578,376 instructions; fingerprints match: True |
| ir4k | FAIL | 2 | same-arm Ir spread 0.0509% exceeds 0.05%; no verdict | optimized 77,251,299,587 vs legacy 77,333,444,555 instructions; fingerprints match: True |
Status: rejected (loop, instruction-count gate; wall-clock not yet confirmed)
Automated loop result on homelab (aarch64). Switch PHASE_QUANTITY_TYPED_POPULATION_LEGACY, mechanism class allocation. Mechanism: At game/quantity.rs:3202, matching_object_ids_in_filter_universe sends a Typed leaf through disjunctive-branch construction, filter cloning, population anchoring and union deduplication. Add a Typed-only path that obtains candidates through the existing filter_zone_object_ids helper, applies matches_target_filter and preserves stable deduplication. Keep object_count_matching_candidate_ids authoritative for the final predicate and triggering-object exclusion. Invariant: For a Typed leaf, the normalized algorithm has one predicate branch and the same explicit-zone population, or the battlefield default. Preserve the ordered, deduplicated matching IDs, phased-out exclusion and OtherThanTriggerObject handling. Permanent differential tests must compare complete ordered vectors and resolved counts with the legacy algorithm.
| 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.0235% |
| ir4k | NO | same-arm Ir spread 0.0509% exceeds 0.05%; no verdict |
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:07 · read-only · refreshes every 30 s