MTGBench improvement loop

Overview · Experiment index

Iteration 9: Certify absent ProduceMana replacements through ObjectStore mutations

state deferred — review rejected after fix rounds: [{"severity": "HIGH", "summary": "The legacy arm changes floating ProduceMana replacement behavior.", "evidence": "produce_mana_applier now reads pending_damage_replacements when rid.source == ObjectId(0), unconditionally in both arms. Previously it looked only in state.objects. The floating recolor test compares two arms sharing this behavior change, so it cannot establish equivalence with the or
switch PHASE_PRODUCE_MANA_ABSENCE_LEGACY · branch loop/it9 · base 4ec0b9ef1 · candidate · took 3h 34m

Results

No measurement recorded for this iteration yet.

Where the time went

planner: 9 minexecutor: 104 minreviewer: 1 minexecutor: 98 minreviewer: 1 min
planner 9mexecutor 104mreviewer 1mexecutor 98mreviewer 1m
executor: 47,158,505 in / 70,018 out tokensplanner: 2,044,926 in / 10,578 out tokensreviewer: 50,224 in / 2,548 out tokens

Mechanism. At game/replacement.rs::replace_event, return the unchanged ProduceMana event when no object or floating definition can replace it. Maintain a conservative object-definition presence summary inside ObjectStore: mutable access records touched IDs, the next query refreshes those objects, and bulk mutable iteration requires a full refresh. Initial and deserialized stores are unknown. Check pending_damage_replacements live on every query. This avoids broad replacement-index preparation without trusting state_revision or layer cleanliness.

Evidence. Memo xn5.67, L4904: prepare_replacement_index_for_pipeline is 4.3% inclusive process CPU, with mana production its leading caller. Memo xn5.69, L5379: active scan/staging costs 322.749/309.324 ms at 4,000 actions; complete builds cost 435.396/415.626 ms. Affordability attribution, L5242, observed no active ProduceMana/Tap replacements on either reference seed. Already overlaps open edh-play-xn5.78, but replaces its proposed layer-refreshed bit with mutation tracking. Cache refresh frequency remains unmeasured.

Counter and kill threshold. Existing replacement_index_build_ns and replacement_index_active_scan_ns bound the affected family; xn5.67 supplies its 4.3% CPU ceiling. Expected instruction reduction: 1–2% per action at 4,000 actions, as a prediction rather than a measured result. Mutation bookkeeping and refreshes may reduce that benefit; the loop's existing tiers decide.

Invariant. Absence is a superset proof: inspect all object-carried ProduceMana definitions regardless of zone, phase status or condition, and all floating definitions. Every ObjectStore mutation surface must invalidate the affected contribution before exposing mutable access. Preserve record_proposed_event and pipeline cleanup. Permanent differential regressions compare production results, emitted events, pip IDs and serialized state across direct same-revision writes, IndexMut, insertion/removal, bulk iteration, face-up changes, floating replacements, deserialization and divergent forks.

Agent steps

RoleHarness / modelTimeExitTokens in / outNote
plannercodex / gpt-6.1-sol9m 29s02,044,926 / 10,578
executorcodex / gpt-6-luna1h 44m028,847,980 / 36,168
reviewercodex / gpt-6.1-sol1m 19s024,934 / 1,323
executorcodex / gpt-6-luna1h 38m018,310,525 / 33,850
reviewercodex / gpt-6.1-sol1m 10s025,290 / 1,225

Gates

GateResultExitDetail

Write-up: 2026-10-01 - Loop iteration 9: Certify absent ProduceMana replacements through ObjectStore mutations (deferred)

Status: deferred (loop, instruction-count gate; wall-clock not yet confirmed)

Automated loop result on homelab (aarch64). Switch PHASE_PRODUCE_MANA_ABSENCE_LEGACY, mechanism class compute. Mechanism: At game/replacement.rs::replace_event, return the unchanged ProduceMana event when no object or floating definition can replace it. Maintain a conservative object-definition presence summary inside ObjectStore: mutable access records touched IDs, the next query refreshes those objects, and bulk mutable iteration requires a full refresh. Initial and deserialized stores are unknown. Check pending_damage_replacements live on every query. This avoids broad replacement-index preparation without trusting state_revision or layer cleanliness. Invariant: Absence is a superset proof: inspect all object-carried ProduceMana definitions regardless of zone, phase status or condition, and all floating definitions. Every ObjectStore mutation surface must invalidate the affected contribution before exposing mutable access. Preserve record_proposed_event and pipeline cleanup. Permanent differential regressions compare production results, emitted events, pip IDs and serialized state across direct same-revision writes, IndexMut, insertion/removal, bulk iteration, face-up changes, floating replacements, deserialization and divergent forks.

gatepasseddetail

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