Test-time compute allocation, endogenous retry crossing, and runtime stopping value for open-weight Gemma 4 coding agents
Author: Yan Su (hi@yansu.me)
Paper PDF (6 pages, A4; locked Writeup #125540, see ERRATA.md) | Methodological Erratum (Section 4) | 5-Second Verification Notebook (reproduce.ipynb) | Manuscript Source (writeup.md) | Analysis & Build Guide | License (MIT)
The locked Kaggle Writeup #125540 PDF (paper/gemma4_queue_value_paper.pdf, SHA-256 3da6eccdd1f3a8592962d7cf9f1fffaaa57858ef5948937278f7f03ecd31e9fe) and manuscript (paper/writeup.md) are preserved byte-for-byte unchanged as submitted before the 2026-11-12 23:59 UTC deadline. Full details appear in ERRATA.md; three scope boundaries govern Section 4's breaker replay sentence (paper/writeup.md, line 99):
-
Conditional sensitivity counterfactual, not measured 60-minute trajectories. All
228Gemma 4 31B A100 attempts ran under a600scap (actual_60min_counterfactual: null,breaker_is_simulation: trueinevidence/results/gemma4_sandbox_and_schema_audit.json). The+10.71 [2.0, 19.0](0% late recovery),+9.04 [1.0, 18.0](25%), and+3.97 [-4.0, 12.0](100%, 95% CI spans zero) deltas extend observed600stimeouts to an assumed3600swith Bernoulli late recovery. -
Negative control against the observed
600scap baseline. Relative to the actually observed600scap baseline (cap_600, mean29.71solved tasks), addingfuse_schema_3yields-1.904 [-6.0, +2.0]solved tasks (27.806vs.29.71; point replay29vs.30; triggers37attempts including7eventual wins).fuse_schema_2yields-1.874 [-6.0, +2.0],fuse_edit_3yields-1.423 [-5.0, +2.025], andfuse_schema_5yields+0.779 [-1.0, +3.0]. Thus 3-strike schema breaking does not show a positive gain on top of the600scap baseline. -
Single-policy code scope (
fuse_schema_3only). The queue replay inanalysis/gemma4_sandbox_and_schema_audit.pyevaluatesfuse_schema_3alone and does not jointly simulate a5-identical-callbreaker (exact_loop_flagis evaluated separately via the13-task matched sign test,9failures vs.0successes,$p = 0.00391$ ).
Deployed coding agents serve finite issue queues under shared budgets, where every retry displaces an unattempted issue. Across six open and frontier configurations spanning 162,506 trajectories, one failure cuts next-attempt success to 0.203 to 0.529 of equal-issue base rate. Breadth-first scheduling repairs 43.2% to 78.9% more issues than immediate retries at 30% call budget and adds 816 repairs across 5,056 Qwen3.8-27B tasks. Without verifiers, low-cost first failures overtake weak fresh tail tasks for +30.8 held-out repairs (95% CI 5.2 to 56.8) at 30% budget and +48.2 at 35%. An independent 67,074-trajectory Qwen3-Coder-480B corpus adds 68.1 held-out repairs under repository-ranked breadth and withholds retries when conditional yield falls to 0.203. Replaying 228 Gemma 4 31B A100 trajectories reproduces a 70.1% breadth gain, separates 76 default-passing from 53 container-blocked tasks, and exposes 1,988 schema-rejected edit_file calls across 7,157.4 seconds of preceding event intervals (see ERRATA.md for the counter-exclusion observational boundary). Finally, a closed-form fluid-queue stopping-value identity predicts finite-queue replay with 105 settings, whereas ROC AUC selection forfeits 13.8 held-out repairs across four systems.
Across six model configurations, a failed attempt cuts next-attempt success to Llama 3 8B from 0.489 to 1.05. Once repository-ranked breadth clears high-yield codebases, first-failure call-cost terciles (<=49 calls yielding 5.45 repairs per 1,000 calls) overtake low-yield fresh tail repositories (Kotlin 1.99, Scala 3.36), adding +30.8 held-out repairs at 30% budget and +48.2 at 35% without external verifiers.
Auditing all 129 public benchmark tasks separates 76 default-passing tasks (p = 0.298, q/p = 0.440) from 53 container-blocked tasks (23 missing inline_snapshot or dirty_equals wheels; 30 needing per-task environment calibration), preventing zero-imputed denominator distortion (p = 0.176). Across 228 Gemma 4 31B A100 trajectories, truncated edit_file calls missing old_string trigger 1,988 observed schema rejections across 7,157.4 seconds of preceding intervals (238 schema rejects vs. 69 final counted tools in rich_2943 R3; 242 schema rejects vs. 13 final counted tools in rich_3882 R3; per-call counter transitions are not logged in ATIF traces, so direct counter-exclusion proof is marked null in the audit JSON and requires harness source inspection). Under a conditional 3600s sensitivity counterfactual replay (not measured 60-minute runs), single-policy fuse_schema_3 shows +10.71 [2.0, 19.0] at 0% late recovery and +3.97 [-4.0, 12.0] at 100% late recovery, while showing -1.904 [-6.0, 2.0] against the observed 600s cap baseline (see ERRATA.md).
For a queue with total cost 1,000-order finite-queue replay with MAE = 0.148 vs 1.643 for naive linear +13.8 held-out repairs across four agent systems (OpenHands step-5 gate: Held-out AUC = 0.493, yet 40 stops save 1,164 calls and add +3.31 net repairs).
| Dimension | Corpus / System Scope | Core Finding | Held-Out / Replay Gain |
|---|---|---|---|
| Breadth vs. Immediate Retry |
5,056 Qwen3.8-27B / 6,282 Qwen3-Coder-480B / 76 Gemma 4 31B tasks |
Equal-issue 30% budget |
+43.2% to +78.9% (+816 Qwen3.8 repairs) |
| Endogenous Queue Crossing |
2,464 held-out Qwen3.8-27B / 3,151 held-out Qwen3-Coder-480B tasks |
Cheap first failures (<=49 calls) overtake weak fresh tail repos; 480B abstains at |
+30.8 at 30%, +48.2 at 35% (+68.1 ranked breadth on 480B) |
| Gemma 4 Sandbox & Breakers |
129 public reference checks + 228 Gemma 4 31B A100 ATIF v1.7 rollouts |
76/129 default-evaluable; 1,988 observed edit_file schema rejects across 7,157.4s; 9 vs 0 exact-loop sign test ( |
Conditional 3600s counterfactual fuse_schema_3: +10.71 [2, 19] (0%) to +3.97 [-4, 12] (100%); vs. observed 600s cap: -1.904 [-6, 2]
|
| Stopping-Value Identity |
105 policies across 4 systems on Verified (465), Lite (192), Multilingual (300) |
97.1% sign match |
+13.8 held-out repairs over CV ROC AUC selection |
To keep verification boundaries transparent, reproduction is split into three explicit tiers (full commands in analysis/README.md):
Runs directly in a fresh clone of this repository in < 5 seconds, verifying all 158/158 numeric table cells against paper/writeup.md and rebuilding all 3 vector plates (analysis/requirements-confirmation.txt includes numpy, pandas, pyarrow, duckdb, scipy, matplotlib, Pillow, pypdf, and pymupdf):
python3 -m pip install -r analysis/requirements-confirmation.txt
python3 analysis/reproduce_confirmation.py
python3 analysis/publication_tables.py
python3 analysis/build_publication_figures.pyRecomputes Gemma 4 31B p/q, 76/129 sandbox audit, 1,988 schema rejections, 7,157.4s preceding gaps, the 13-task matched sign test (9 vs 0), observed 600s-cap negative controls (-1.904), and 3600s conditional sensitivity replays directly from the public CSV ledgers (gemma4_sandbox_and_schema_audit_{attempts,events,reference}.csv):
python3 -B analysis/gemma4_sandbox_and_schema_audit.py --mode public --bootstrap 1000To recompile and verify the 6-page PDF (paper/gemma4_queue_value_paper.pdf, requires Pandoc, pdfLaTeX with Times and New TX math, Ghostscript gs, qpdf, plus pymupdf from analysis/requirements-confirmation.txt):
python3 analysis/build_paper_pdf.py
python3 analysis/verify_paper_pdf.pyRe-extracting raw prefix tables requires cloning the pinned SWE-bench/experiments commit and running fetch_swebench.py, fetch_multilingual.py, and fetch_mini_verified.py (with AWS CLI access to public s3://swe-bench-submissions). Running analysis/gemma4_sandbox_and_schema_audit.py --mode raw requires unbundled local raw ATIF archives (evidence/gemma_a100/legacy_summary.json, evidence/gemma_a100/attempts.json, .ai/gpu/runs/full76/results/r*/.../trace_*.json, and analysis/analyze_stability.py). See analysis/README.md for exact hashes and commands.
ERRATA.md: Methodological clarification on Section 4's conditional 3600s counterfactual sensitivity replay, observed 600s negative controls, and single-policyfuse_schema_3scope.LICENSE: MIT License for all repository code and analysis scripts.paper/gemma4_queue_value_paper.pdf: Locked 6-page A4 paper with embedded vector plates and stripped top-level PDF info dictionary (SHA-2563da6eccdd1f3a8592962d7cf9f1fffaaa57858ef5948937278f7f03ecd31e9fe; seeERRATA.mdfor Section 4 scope).paper/reproduce.ipynb: Self-contained 5-second verification notebook checking all four tables (158numeric cells) and displaying the three vector figures.paper/writeup.md&paper/gemma4_queue_value_paper.tex: Locked Markdown manuscript and synchronized LaTeX source.paper/figures/: Vector plates (fig1..3.pdf), high-resolution previews (fig1..3.png), and SHA-256 provenance receipt (publication_figures_provenance.json).analysis/: Reproducible evaluation, table verification, figure generation, and PDF build scripts (seeanalysis/README.md).evidence/: Frozen compact ledgers (evidence/results/),228Gemma 4 31B A100 rollouts and129-task sandbox audit (evidence/gemma_a100/), and runtime prefix tables (evidence/data/).
All original repository code, analysis scripts, documentation, and derived compact ledgers in this repository are released under the MIT License. Upstream public datasets and models (SWE-bench Verified/Lite/Multilingual, Nebius SWE-agent and OpenHands trajectory corpora, and Google Gemma 4) remain subject to their respective upstream licenses.


