Repository navigation
Conversation
kvlonge
enabled auto-merge (squash)
October 3, 2026 05:12
Model attachment (config layering, declaration and macro expansion, hook expansion, header columns and reference extraction) was recomputed for every model on every compile. Each model's result is now stored in the compile cache under a key covering the model file and path, its matched path defaults, project defaults, vars, target, adapter and dialect, settings, the shared macro and declaration sources, hook and audit-factory definitions, project-local adapter sources, and the installed code identity. Editing any macro or declaration re-attaches every model. Models whose config, hooks or SQL read an environment variable or run.id are always recomputed; environment values referenced by the target config are part of the key instead. Diagnostics reported during attachment are stored and replayed on a hit, and project-wide reference checks re-run so adding or removing a model only attaches that model. compile_cache = false and --no-cache disable the cache. Macros are documented as deterministic, along with which project files the reuse check covers. Refs CHI-442
kvlonge
force-pushed
the
perf/chi-442-attachment-cache
branch
from
October 3, 2026 05:24
722c48c to
89eb40c
Compare
Contributor
Author
|
Shelving this PR. After #919 (speculative lint stop) and #922 (cold-compile GC pause) landed, the gain shrank to about 1–2% on the dense benchmarks and about 0.6 s on a ~1,400-model project, while cold compiles got ~1.7% slower and the fresh-process cache guard passes only narrowly. Most of the attachment time in the original profile came from GIL contention with the speculative lint, and unpickling cached attachment facts costs nearly as much as recomputing them. The branch stays available if attachment becomes a bottleneck again. |
auto-merge was automatically disabled
October 3, 2026 18:43
Pull request was closed
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
Model attachment (macro expansion, header columns, config, visible declarations, validation) ran for every model on every compile, about 25% of warm compile time (CHI-442, part of CHI-441).
Changes
adapters/, and the installed code and native build identity.run.idare rebuilt every run.Verification
--no-cache, each mutation-checked;run.id, env, diagnostic replay, model add/remove and macro edits.make test,make check-ci.