Repository navigation
feat(native): analyse models natively behind the preview engine - #1045
Merged
Merged
Conversation
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.
…rals 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.
kvlonge
force-pushed
the
feat/native-model-analysis
branch
from
October 9, 2026 00:37
d85da5f to
330c21b
Compare
kvlonge
enabled auto-merge (squash)
October 9, 2026 00:38
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
M4d, part 1 of 2. Model analysis runs natively under the
native-previewengine, behind the M4bMODEL_ANALYSISseam. It produces today'sModelSqlAnalysisper model, and every model whose result native cannot reproduce exactly is deferred to Python.Changes
sqlbuild-analysis::assembly::analysis_session: an uncached session over the compile'sProjectCatalog. It covers the request, a session catalog copy, compact batches, topological waves, projection, the star/type pass, deferred binding validation and shape publication. It runs step by step and Python resumes it with answers toDefer.analysis_session: legacy analysis (refactor: expose row diff adapter hooks #2/feat: add query command #3) and input enrichment (site Docs/readme logo #1, ported in part 2). A cycle, a duplicate name or a session error hands the whole analysis back to Python.ProjectCatalog.inferred_schemanow returns columns in their order instead of a hash map. This makes Python's published shapes deterministic in case-sensitive dialects.schemasandanalysis_shapeson the cold compile only; warm stages skip them because Python's analysis cache skips catalog preparation there.Verification
cargo test --workspace --all-features, clippy and fmt pass (1.99.0).make compiler-differentialwith stage captures and all three coverage gates: 292 projects identical; analysis coverage 56/56. Native deferrals: 878 input enrichment, 12 legacy analysis.make compiler-differential-shipped: 249 projects identical.tests/e2e/scripts/compiler_differentialpasses (25 tests, incl. a wrong native catalog shape failing on cold compile).make check-ciandmake testpass (11818 tests).