Skip to content
PathGuided

Parallel AI Coding Is a Filesystem Problem

Running coding agents concurrently does not bottleneck on prompt engineering. It bottlenecks on write-set ownership, kernel overlay mounts, and deterministic AST merging.

3 min read
Email

Running multiple AI coding agents in parallel is usually framed as an orchestration problem: spawn several workers, give them clear prompts, and watch wall-clock time fall. In practice, once you run concurrent waves inside real repositories, the bottlenecks turn out to be physical. They live in file ownership, container filesystem layers, and how Git reconciles simultaneous edits.

1. Parallelism Is Won at Write-Set Planning

We measured 23 completed spec packages comprising 165 steps to see how much concurrency existed if two steps were treated as dependent whenever they touched a shared file. File-disjointness alone collapsed 165 serial steps into 99 waves (0.60x). One 14-step UI package collapsed to 6 waves—and with deliberate ownership rules, down to 4 waves of widths 3, 5, 5, and 1.

What serialized the remaining steps was rarely a real behavioral dependency. It was five recurring hotspot files: a committed generated asset (dashboard.html, touched 115 times in 60 days), shared browser-check scripts, destination UI shells, monolithic test files, and shared stylesheets. Meanwhile, 62% of step reviews (124 of 200) required a fix, which serialized against a single package writer.

Moving review and repair into per-step checkouts removes that wait immediately. Declaring disjoint write-sets at plan time—and deferring generated assets and wiring to a single fan-in integration step—unlocks concurrency without adding a single prompt trick.

2. Container I/O and Mount Mechanics Matter

When you scale from one checkout to several isolated worker sandboxes on Linux, filesystem overhead compounds quickly.

In rootless Podman, the single largest runtime penalty is fuse-overlayfs, which routes every git status, rg, tsc, and pytest syscall through /dev/fuse in user space. Switching to native kernel overlay on Linux 5.13+ removes those context switches. Pairing native overlay with crun instead of runc (30 to 80 ms faster startup), keeping systemd cgroups v2 (since rootless cgroupfs breaks memory and CPU limits), and aligning container UIDs via --userns=keep-id:uid=1000,gid=1000 avoids tens of seconds of recursive chown stalls on large image trees. Where AppArmor blocks unprivileged overlay mounts on a host, plain git worktrees still provide clean isolation without waiting for host-level mount changes.

70-85% Resolved (under 200ms, 0 LLM) Residual Semantic Conflict Immutable Wave Base SHA Worker 1 Checkout (Disjoint Write-Set) Worker 2 Checkout (Disjoint Write-Set) Worker 3 Checkout (Disjoint Write-Set) Tier-0a/0b In-Memory Merge (merge-tree + Mergiraf AST) Tier-0 Syntax / Typecheck / Unit Gates Tier-1 Surgical LLM Packet (zdiff3 + Intent) Fan-In Integration Step

3. Line-Based Git Fails Concurrent Agents

Even with disciplined write-sets, parallel agents constantly collide on adjacent lines: two imports at the top of a file, two test blocks at the bottom, two JSON keys, or one branch running a formatter while another edits an argument. Git's default ort + Myers merge flags these as conflicts and wakes an LLM repair loop. Yet benchmarks like SWE-Git-Bench show frontier models achieve under 30% exact-match on whole-file conflict resolution when handed raw two-way conflict markers that erase the common ancestor.

We verified locally that Git's in-memory merge-tree --write-tree natively honors custom merge drivers passed via -c flags—executing purely in memory with zero files modified in the repository. By cascading histogram diff and zdiff3 into Mergiraf (a Rust Tree-sitter AST merge driver) plus deterministic lockfile regeneration, 70% to 85% of mechanical conflicts resolve in under 200 milliseconds with zero tokens. Mandatory post-merge syntax, typecheck, and unit-test gates catch the rare 2% to 5% silent semantic collision, leaving only genuine semantic conflicts for a compact, ancestor-aware LLM packet.

Concurrent AI coding is not magic. It is disciplined file ownership, native kernel I/O, and deterministic merge plumbing—so models spend their tokens writing code instead of untangling filesystems.

Join the PathGuided Closed Beta

Onboard your repositories with local-to-cloud spec execution, split-tier model routing, and commit-bound Work Tours.

Request beta access