Repository navigation
perf(compile): delta-compile dynamic columns, audit factories and model rules - #1201
Merged
Merged
Conversation
…entity Delta compile reported one message for any invocation, runtime, search path, environment, settings or module change. Name the first component that differs instead. SQLBUILD_VERIFY_DELTA_COMPILE was a tracked variable, so turning it on for one compile changed the reuse identity and made the very edit it was meant to verify fall back. It does not change compile output, so it no longer invalidates a stored compile.
…tories and model rules Three project shapes made every edit compile in full: - Any enforced model declaring dynamic_columns ruled out the project image. The image now keeps the analysis request's families and a delta injects them for models it does not analyse; an edit that changes a model's own families still falls back. - A delta saw only the rerun models' headers, so every audit factory attached elsewhere was reported as orphaned and the delta fell back. The image keeps each model's attached factories. - Any custom rule that had to run again ruled out the delta, so editing a model a model-subject rule reads always compiled in full. A delta now runs model-subject rules for its own models when their recorded reads are limited to those models' SQL, columns and contract, project files, and the source list (kept in full when a rule reads it). It checks the stored read sets before starting and the new ones after, and falls back otherwise. The image format moves to v9.
… a folder tree.resources_under is listed from the project's models, not the filesystem, and a delta compile holds only the models it reruns. A model-subject rule reading it for an edited model ran on the partial list and could report different findings than a full compile. Treat it as a read beyond the changed models so the delta falls back.
kvlonge
enabled auto-merge (squash)
October 21, 2026 16:45
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.
Why
On a large project, every edit compiled in full. The fallback message blamed the invocation or environment, but that came from turning on
SQLBUILD_VERIFY_DELTA_COMPILEitself. Three project shapes ruled delta compiles out: a model withdynamic_columns, audit factories attached by unchanged models, and model-subject custom rules that had to run again for the edited model.Changes
SQLBUILD_VERIFY_DELTA_COMPILEno longer invalidates a stored compile.tree.resources_underread (listed from the project's models, which a delta holds only partly) makes the delta fall back.Verification
test_compile_delta.py: dynamic columns, an audit factory, a per-model rule, all shapes together underSQLBUILD_VERIFY_DELTA_COMPILE=1, and fallback messages for a families edit and for a new tracked variable. All 24 delta tests pass.-D warnings, fensu, ruff.