docs(spec): sharded, two-wave L4 for #112 step 4 - #145
Open
rahlk wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec for #112 Step 4, extended with a second wave that recovers what plain sharding drops. Committed as provenance; no code.
The argument, in three measurements
Why restructuring cannot fix whole-vscode L4. On
vscode/srcat-a 4, RSS is already 21.33 GB when the interprocedural phase begins, and that phase's entire retained state is 0.48 GB (datas0.34,ddg0.09,summaries0.05). L4 is the cheapest phase in the run by retained bytes. The rest is tsc's own parse/bind/check state. Six restructurings were measured and none moved the ceiling, because they were all targeting fractions of a gigabyte against a ~10 GB gap.Why sharding by program works.
can://<lang>/<app>/<fileKey>/<sig>embeds no program identity, so with--inputand--app-namepinned the same file yields a byte-identical id in any shard.ownerProgramassigns each file to exactly one program, so modules are disjoint and the union is concatenation. Neo4j alreadyMERGEs on the id, so it unions shards with no new code. Peak becomes the largest program — measured at 28.75 GB for vscode'ssrc.What plain sharding costs, and why wave 2 exists. Measured on the whole-vscode
-a 3output by replicatingownerProgram's rule over the repo's 99 tsconfig scope dirs: 97.4% of in-project call edges are same-program, 2.6% (28,345) cross. Wave 2 recovers those — and it needs no tsc state at all, only ~1 GB of graph IR, which is why it is affordable.What the spec commits to
wave1 + wave2must be byte-identical to a single-process L4 on any repo where that completes (vscode/src, the fixture apps, superset)--program,--emit-ir,--stitch) and a 4-unit decomposition, both flagged as needing sign-offCaveats it states plainly
fileKeyand break the unioncopilot → src5,420,src → copilot2,416), so real SCCs span programs — wave 2 must redo the fixpoint, not just compose callee summaries into callersOpen
The decomposition and CLI surface are proposals. Units are listed to be filed just-in-time as each is picked up, not up front.