Repository navigation
fix(reconcile): stage membership and entity transitions through appenders, not a million-tuple VALUES literal (#558) - #1511
Merged
Conversation
…ders, not a million-tuple VALUES literal (#558) After #1508 capped reconcile's DuckDB at a third of the class limit, the 10M run's reconcile was still OOMKilled at class L's 26Gi, 53 s in. Measured locally in release with the #558 corpus and model: 1M records: reconcile 45.7 s, peak RSS 8.3 GB (231k scores, so the edges don't explain it) The cause: reconcile wrote membership as one 'create temp table __mem_src as select * from (values (…), (…), …)' with a tuple per assigned record, and the entity transitions the same way (__ent_src). DuckDB parsed a million-tuple literal, a parse tree of several KB per row, so at 10M about 80 GB. Both are now created with a schema and filled through a DuckDB appender, as #1409 did for events. The declared upsert_from_src statements are unchanged. Measured after: 1M records: reconcile 5.1 s, peak RSS 3.26 GB 2M records: reconcile 12.6 s, peak RSS 4.73 GB That's about 1.5 GB per million plus 1.8 GB, so about 16.5 GB at 10M, inside class L's 26Gi with reconcile's DuckDB at 6 GB (#1508). Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 30, 2026 13:22 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Closes #558
What
Reconcile stages membership (
__mem_src) and entity transitions (__ent_src) through DuckDB appenders. Before, each was onecreate … as select * from (values (…), …)with a tuple per record. The declared upserts are unchanged.Why
The 10M run's reconcile was OOMKilled at 26Gi even after #1508. Locally at 1M records, reconcile peaked at 8.3 GB RSS with only 231k scores, from parsing a million-tuple literal. At 10M that's about 80 GB.
Proof
Release build, #558 corpus and model,
/usr/bin/time -lon reconcile alone:About 1.5 GB per million plus 1.8 GB, so about 16.5 GB at 10M, inside class L's 26Gi.
make checkexit 0, which includes the reconcile goldens and lake e2e. The live proof is the 10M rerun from reconcile onward, recorded in this ledger.Risk & rollback
Same rows, same statements, different staging. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: unclosed
mainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not:
imagesbuilt, or correctly never ran because nothing that goes intoan image changed:
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion:
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change:
Donethrough the automation rather than byhand, and the issue closed:
(a skill, a reference, memory) — or nothing new was learned:
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
🤖 Generated with Claude Code