Repository navigation
feat(native): make native rendering the default compiler path - #1043
Merged
Merged
Conversation
With SQLBUILD_COMPILER_ENGINE unset, compiles now run declaration files and scopes, model config, reference extraction, the model loop, macro calls with the macro-call store, and attachments natively. A failing native render stage still re-runs Python for the exact error. SQLBUILD_COMPILER_ENGINE=python remains the oracle; SQL analysis and later stages stay in the preview tier. Tests that assumed only native-preview ran these stages now expect the shipped engine to run them, and an E2E test proves the unset default renders natively, writes the macro-call store and matches Python. CI runs the shipped differential with stage captures and full discovery and render coverage, compares python with native on Python 3.13 and 3.14, and checks on Windows that the default compiles a playground project to the same files as Python.
…e reuse With the macro-call store on by default, a compile that reuses a stored call never runs the macro, so a module the macro imports while running is not loaded and whole-project reuse stopped tracking it. Editing that module then replayed a stale compile. Compile reuse now also stamps the module files the stored call results depend on. Also: the compile docs no longer say an edited model recompiles uncached, the one-model edit performance guard returns to the shared ratio now that rendering is native, and the native declaration error E2E test covers the shipped engine.
… replay stale output A macro lazily imports an outside module, or a package module with a transitive import; a compile after an unrelated model edit reuses the stored call, then the module is edited. The next compile must not replay and must match --no-cache, on the default engine and native-preview. Fails without the module tracking fix.
kvlonge
enabled auto-merge (squash)
October 8, 2026 20:03
…auncher uv's Windows console-script launcher runs the entry point as __main__ from a zip appended to sqb.exe. Its location, sqb.exe\__main__.py, is not a readable file, so the store treated the process as running unknown code and was never used or saved on Windows. A __main__ loaded by zipimport is now backed by its archive, the launcher executable. Other zip-imported modules still disable the store. The Windows CI step prints the macro bridge debug log when the store is missing.
…s like preview Until the macro bridge stops re-running failing stages, the default engine re-runs macros the same way native-preview does.
… errors like preview
kvlonge
added a commit
that referenced
this pull request
Oct 9, 2026
kvlonge
added a commit
that referenced
this pull request
Oct 9, 2026
* feat(native): analyse models natively behind the preview engine Run the uncached model analysis as a native session: compact batches, dataflow waves, shape publication, deferred binding validation and expression-source shapes. Legacy analyses and input enrichment defer to Python per model and are recorded. * test(native): count only lineage deferrals in the fast lineage engine test * test(native): use the native attachment entry field after #1043 and #1046 * fix(native): compare catalog shapes on cold compiles and record deferrals after the session Keep the binding catalog's schemas and analysis shapes in captures and ignore them only on warm stages, where Python's analysis cache skips catalog preparation. Record per-model deferrals once the session completes, and fall back to Python when provide or finish panics.
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
Native rendering passed its flip gate, so the default compiler engine now renders natively.
Changes
NATIVE_STAGE_TIERS: declaration files and scopes, model config, reference extraction, model loop, macro calls, macro-call store and attachments areshipped; analysis stages staypreview. A failing native render stage still re-runs Python for the exact error.python.pythonwithnative; Windows checks the default compiles a playground likepython; edit performance guard back to the shared ratio.SQLBUILD_COMPILER_ENGINE=pythonis the oracle, macro determinism applies by default.Release note: compiles render natively by default and keep macro call results under
target/cache/, so macros must be deterministic. The first compile after upgrading is cold once.SQLBUILD_COMPILER_ENGINE=pythonselects the Python compiler.Residual risks: a new module shadowing a lazily imported one (
pkg/sub/__init__.pyoverpkg/sub.py, ortry: import optional_mod) is not detected, since onlysys.pathentries are stat'd (pre-existing for compile reuse). Editable checkouts don't invalidate the store on SQLBuild Python edits; releases are safe.Verification
make compiler-differential(CI flags),-shipped(coverage); differential E2Ecargo test, clippy/fmt on 1.99.0make test,make check-ci, hygiene scan