When Agents Outpace Their Infrastructure
Rebuilding our OpenSWE RL validation pipeline with content-hashed caching, workload pools, and resumable state
Published Nov 12, 2026 · 8 min read
When building reinforcement learning (RL) environments for coding agents, getting an agent to diagnose a broken repository or patch a test script is no longer the bottleneck. Agents already inspect codebases, trace dependency failures, and repair environment setups at a speed and scale no human team can match. The bottleneck, now, is all of the validation infrastructure built for human-scale experiments: fresh git clones, uncached container builds, coarse resource locks, upstream API quotas, and brittle export scripts.
In late September 2026, our OpenSWE pipeline validated tasks in batches of 15 to 100. By late October, we were running 500- and 1,000-task batches—processing 3,100 tasks in total and shipping 785 verified, containerized RL environments (~752 GB of artifacts) to production storage. We don’t expect this demand to slow down anytime soon. The latent demand for trustworthy RL environments is practically infinite, and every infrastructure bottleneck we remove immediately translates into more verified training data.
1.The validation bottleneck & grader design
Before making the pipeline fast, we had to define what it was not allowed to break. If an RL grader has a loophole, the policy learns to exploit the grader rather than fix the underlying bug. An agent claiming “I fixed it” means nothing until an independent validator proves it.
Our pipeline pairs repair and review agents—which inspect failure logs, align tests with issue descriptions, and patch broken Dockerfiles—with a deterministic six-stage validator (L0 through L5). Every task must pass progressive gates: static checks and source pinning, semantic review, container builds, red-to-green differential testing, and four-way repeatability runs.
Fig. 01Validation stages and the repair loop
That strictness defined our central constraint: we needed 1,000-task throughput without deleting slow tests, weakening assertions, or leaking reference answers into the container. Speed had to come from eliminating wasted work, not lowering the bar.
2.Why naive concurrency multiplies waste
When we first tried to scale from 15 tasks to 1,000, our instinct was simple: spin up more agents. It failed immediately. At thousand-task scale, higher agent concurrency amplified redundant compute, starved local containers, and triggered cascading API rate limits.
The first culprit was self-inflicted rework during iterative repairs. Whenever a repair agent changed a single flag in an evaluation script, the pipeline responded by re-downloading the repository, rebuilding the entire Docker image from scratch, and re-running a full LLM semantic review. More agents meant more repair loops fighting over the same local CPU and disk I/O to repeat identical setup steps.
3.Fresh git clones break layer caches
Even when a container rebuild was genuinely required, Docker’s layer cache was mysteriously failing. Across 1,747 build steps in an early rerun batch, only 48 hit the cache—a 2.7% hit rate.
The culprit wasn’t Docker; it was our source-pinning stage (L1). Re-cloning a repository touched filesystem metadata inside .git, altering the checksum of the COPY layer and invalidating every expensive dependency installation beneath it. What looked like a slow container daemon was actually a cache bust we caused before docker build even started.
4.The fix: Content-hashed incremental runs
We broke through the build wall with two changes: preserving the verified L1 source checkout across repair revisions, and making stage invalidation dependency-aware.
Instead of wiping state on every edit, we lock each stage to cryptographic content hashes across the source tree, runtime configuration, and image ID:
- Evaluation-script edits reuse both the verified source tree and the built container image.
- Dockerfile edits reuse the verified source checkout and rebuild only from the modified image layer onward.
- Incremental semantic reviews inspect only setup or evaluation diffs whenever the issue statement and code patches remain unchanged.
Fig. 02Invalidate only what changed
Crucially, we cache verified setup, never a stale passing verdict. In our initial pilot, three evaluation-script revisions required zero extra Docker builds, while a task whose git metadata had drifted was automatically caught and forced to rebuild. Preserving source identity restored Docker’s layer cache, cutting individual task rebuilds from 119–260 seconds down to 2–3 seconds. Across a 500-task run, incremental semantic review bypassed full re-reviews 58 times.
Fig. 03Build-cache results from individual revisions
5.Separating pools unlocks idle silicon
Eliminating redundant builds shifted the bottleneck to job queuing and upstream API quotas. Early on, we controlled concurrency with a single global knob. In reality, the pipeline mixes three distinct resource profiles: LLM semantic reviews block on network I/O, container builds saturate local CPU and disk bandwidth, and static script repairs need no container at all. Splitting these into dedicated concurrency pools exposed three hidden throttling layers:
- Paper saturation in the scheduler: During a 100-task run, host CPU sat at 24.9% while build jobs waited over 11 minutes (664 seconds median) for admission. Reserving 3.5 cores per build (
L2) and 3 cores per test run against a 15-core budget filled our accounting ledger at 4 concurrent builds while leaving physical silicon idle. Right-sizing reservations to measured usage—2 cores for builds, 1.5 for tests—unlocked a 5th build slot and cut median admission wait by 68%, down to 213 seconds.
Fig. 04Smaller reservations, shorter admission waits
- Container throttling on an idle host: Conversely, some jobs crawled while the host looked 70% idle. Inspecting Linux
cgroupsshowed a container with a 4-core quota averaging 3.8 cores and getting throttled in 91% of its kernel scheduling periods while overall host utilization read 21–35%. Host-wide averages hid per-container starvation, so we wired per-containercgroupthrottling, Linux PSI pressure, and disk IOPS directly into runtime telemetry. - Adaptive backpressure for API 429s: Once local compute flowed freely, traffic slammed into the shared LLM gateway. Thirty-two concurrent agents sustained ~126 requests per minute cleanly, but 48 agents triggered a 17% HTTP
429rate—even across a second EC2 instance sharing the same upstream quota. We built a local proxy using additive-increase/multiplicative-decrease (AIMD) congestion control: any429immediately multiplies the in-flight cap by0.8, while sustained error-free utilization above 80% steps the cap up by1, queuing excess requests locally. To prevent deadlock—since an AIMD window only grows while traffic flows—any automatic dispatch pause wakes on an independent cooldown timer or lightweight probe.
Fig. 05Match request concurrency to service capacity
6.Stop silent stalls via checkpointing
At thousand-task scale, a loud crash is a gift. Our costliest outages came from silent stalls: live processes reporting healthy heartbeats while burning hours without advancing a single task. Three production failures in our 500-task run proved that recovery engineering is throughput engineering:
Fig. 06Three ways to lose useful execution time
- Database locks around file I/O: A repair worker hashed an 857 MB, 89,000-file source tree inside an open SQLite write transaction, blocking the database for 94 seconds until the supervisor timed out and exited. Moving file hashing outside transactions with optimistic reference checks eliminated the lock.
- Phantom worker leases: When that supervisor died, two terminated
L2build workers stayed markedRUNNINGin SQLite, silently holding 2 of 5 build slots and 240 GiB of disk reservations for four hours. Our watchdog now cross-checks worker PIDs, active containers, and lease timestamps before reclaiming stranded capacity. - Idempotent vs. resumable exports: After validation completed, a single 5+ GiB container image exceeded S3’s single-
PUTlimit and raised aSystemExitthat bypassed standard exception handling. Treating export as a monolithic step, the control loop retried the entire batch 26 times—re-running 21 minutes of deep checksum verification each cycle and wasting nine hours.
Idempotency (using If-None-Match so retries don’t corrupt S3) kept our data safe, but only resumability saved our wall-clock time. We broke batch delivery into checkpointed substeps (assemble, verify, upload, cleanup), cached per-sample verification markers, routed oversize artifacts into 4 GiB multipart uploads, and enforced bounded retries with explicit alerts.
7.Why raw task throughput misleads
Running 1,000-task batches reliably forced us to change how we keep score. Raw task throughput flatters a pipeline; accepted environments delivered to S3 tell the truth.
In a 500-task batch completed in ~9.3 hours (~54 tasks/hour), strict quality gates automatically closed 305 tasks (61.0%)—catching subtle flaws like tests asserting on private helper names from the reference patch—held 57 ambiguous tasks (11.4%) aside without blocking the batch, and yielded 138 verified RL environments (27.6%). With an 87.2% prompt-cache hit rate, our $223.75 model API bill looked like $0.45 per task processed, but the honest unit cost was $1.62 per accepted environment before EC2 compute and storage.
Fig. 07Outcomes from a 500-task batch
“Validation complete” is also only halfway to dataset delivery. In our 1,000-task run, producing 299 accepted environments (~309 GB of compressed artifacts) took ~15 hours of validation, followed by another 7 hours and 11 minutes to package tarballs, verify checksums, upload 33,227 objects to S3, and prune 373 GB of local Docker images before the next run.
Fig. 08Post-validation work for a 1,000-task batch
Today, we evaluate pipeline changes by three numbers: accepted environments in S3, stage queueing versus execution time, and hours lost to stalls. Next, we are moving from batch-end drains to streaming S3 exports as individual tasks clear L5, overlapping disk cleanup with incoming batch startups, and testing structured failure memory so repair agents resolve recurring environment bugs in fewer turns.
We deliberately avoid claiming a single headline speedup across batches because task difficulty and shared API load shift daily. Instead, we stand behind concrete systems mechanisms: 260-second builds reduced to 3 seconds via source-identity preservation, 664-second queue waits cut to 213 seconds via calibrated reservations, and nine-hour export loops eliminated via substep checkpointing. We started out thinking agent scaling was a prompt-engineering problem; at 1,000-task scale, classic systems engineering is what lets agents work at agent speed.