MTGBench improvement loop

Overview · Experiment index

Iteration 3: Share captured stack-push entries across journal forks

state deferred — (process failure, redo allowed) review rejected after fix rounds: [{"severity": "HIGH", "summary": "The artifact does not implement sharing or establish the planned stop condition.", "evidence": "ResolvedStackPushCommand.entry remains Box<StackEntry>, and both clone branches call self.entry.clone(). stack_push_snapshot_legacy is registered but never consulted. No 4,000-action counter screen or overhead-debited gate outcome is supplied; the included report measur
switch · branch loop/it3 · base 3f4ca44ee · candidate · took 2h 7m

Results

No measurement recorded for this iteration yet.

Where the time went

planner: 5 minexecutor: 60 minexecutor: 9 minexecutor: 42 minreviewer: 0 minexecutor: 6 minreviewer: 0 minnot attributed: 3 min
planner 5mexecutor 60mexecutor 9mexecutor 42mreviewer 0mexecutor 6mreviewer 0mnot attributed 3m
executor: 22,388,400 in / 34,729 out tokensreviewer: 129,004 in / 1,766 out tokens

Mechanism. engines/phase/crates/engine/src/types/resolved_commands.rs:1106-1110 stores ResolvedStackPushCommand.entry as Box<StackEntry> with derived deep Clone. ResolvedRulesJournal::clone at :1923 copies every historical command, repeatedly copying captured stack entries and their nested resolved abilities. Share only this captured payload; retain the existing journal containers and complete history.

Evidence. Memo section '2026-09-23 — xn5.67' attributes 7.45% inclusive process CPU to journal cloning, including 5.7% to its entry vector; these nested shares are not additive. This specific payload's share is unmeasured, and the profile predates xn5.71, so it supplies an instrumentation target, not a savings estimate. The proposal differs from closed frozen-chunk and journal-free experiments. The broader field-sharing issue edh-play-xn5.23 remains open.

Counter and kill threshold. First add opt-in counters around the existing Box<StackEntry> copy in ResolvedStackPushCommand::clone: journal-origin clone calls, calls carrying a resolved ability, and payload-copy nanoseconds. Scope attribution to ResolvedRulesJournal::clone during contract/apply, excluding serialization and initial capture. Kill before changing representation if attributable payload-copy time, after recorder-overhead debit, is below 1.5% of summed contract_ms + apply_ms on the 4,000-action seed-91 workload. Counts alone cannot pass the gate.

Invariant. journal_stack_push at game/stack.rs:254 captures an owned snapshot independently of the live stack. apply_resolved_stack_push at :318 clones that snapshot into live state. Sharing the captured snapshot preserves every value, ordinal, provenance field and replay precondition. Explicit Arc::make_mut preserves isolation if a captured command is edited. Permanent regressions must verify shared versus legacy clone allocation identity, equal serialized values, and root/sibling isolation after live-stack mutation, captured-payload mutation and replay.

Agent steps

RoleHarness / modelTimeExitTokens in / outNote
plannercodex / gpt-6.1-sol5m 7s0 /
executorcodex / gpt-6-luna1h 0m124 / timeout
executorcodex / gpt-6-luna9m 1s143 / stopped by operator to fix scope policy; session resumable
executorcodex / gpt-6-luna42m 34s021,478,074 / 28,855
reviewercodex / gpt-6.1-sol0m 37s064,502 / 899
executorcodex / gpt-6-luna6m 39s0910,326 / 5,874
reviewercodex / gpt-6.1-sol0m 35s064,502 / 867

Gates

GateResultExitDetail

Write-up: 2026-09-29 - Loop iteration 3: Share captured stack-push entries across journal forks (deferred)

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

Automated loop result on homelab (aarch64). Switch PHASE_STACK_PUSH_SNAPSHOT_LEGACY, mechanism class None. Mechanism: engines/phase/crates/engine/src/types/resolved_commands.rs:1106-1110 stores ResolvedStackPushCommand.entry as Box<StackEntry> with derived deep Clone. ResolvedRulesJournal::clone at :1923 copies every historical command, repeatedly copying captured stack entries and their nested resolved abilities. Share only this captured payload; retain the existing journal containers and complete history. Invariant: journal_stack_push at game/stack.rs:254 captures an owned snapshot independently of the live stack. apply_resolved_stack_push at :318 clones that snapshot into live state. Sharing the captured snapshot preserves every value, ordinal, provenance field and replay precondition. Explicit Arc::make_mut preserves isolation if a captured command is edited. Permanent regressions must verify shared versus legacy clone allocation identity, equal serialized values, and root/sibling isolation after live-stack mutation, captured-payload mutation and replay.

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:17 · read-only · refreshes every 30 s