Skip to content

feat(native): register the analysis stages behind the preview engine - #1024

Merged
kvlonge merged 2 commits into
mainfrom
feat/native-analysis-seams
Oct 8, 2026
Merged

kvlonge merged 2 commits into
mainfrom
feat/native-analysis-seams

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

The native analysis work is split into parallel lanes that all need entries in the same shared files. Registering every lane once here lets each later lane touch only its own files.

Changes

  • NativeStage members and preview tiers for TYPE_SYSTEM, MODEL_ANALYSIS, SEMANTIC_CHECKS, CONTRACTS, LINEAGE_FACTS, SQL_TEST_GLUE and PROJECT_ASSEMBLY.
  • One None-returning ("use Python") stub per seam, each gated once per compile. Dispatch lives in compile/_helpers/native_stages/ (project assembly, model analysis, expression-source shapes, SQL test assembly) and at semantic completion, contracts, fast lineage and SQL test planning.
  • ModelSqlAnalysis gains an optional dynamic column contract proof; a native analysis that carries one replaces the per-model Python pivot proof. The native analysis request also carries the dynamic families.
  • Empty binding directories with register functions, empty sqlbuild-analysis modules, labelled _native.pyi sections, and a native_session field on CompiledProject (omitted from stage captures).
  • Declared column nullability helpers move unchanged to assembly/semantic_shapes.py so project.py stays under the fensu cap.

No behaviour change: under every engine the stubs return None and Python runs as before.

Verification

  • E2E: a DuckDB project compiled in-process under python, native and native-preview. Under preview every seam is called exactly once and returns None; under the others none is called. Reports and compiled artifacts are byte-identical across engines.
  • Unit: tier registry; native pivot proof precedence over the Python proof.
  • Passed: cargo test --workspace --all-features, clippy, fmt, make check-ci, make test, make compiler-differential (CI flags), make compiler-differential-shipped, tests/e2e/scripts/compiler_differential.

@kvlonge
kvlonge force-pushed the feat/native-analysis-seams branch from e29893f to a5f1799 Compare October 8, 2026 07:32
…eams

Route the per-model dynamic pivot proof through the model-analysis
dispatch: ModelSqlAnalysis gains an optional dynamic column contract proof
that replaces the Python proof when the native analysis supplies one, and
the native analysis request now carries the dynamic families.

Infer expression-source shapes through a MODEL_ANALYSIS stub and assemble
compiled SQL test facts through a SQL_TEST_GLUE stub, each gated once per
compile, so the M4d and M4h lanes no longer need to edit project.py.

Drop the vacuous native type normalization test.
@kvlonge
kvlonge enabled auto-merge (squash) October 8, 2026 08:58
@kvlonge
kvlonge merged commit 18ed683 into main Oct 8, 2026
71 of 73 checks passed
@kvlonge
kvlonge deleted the feat/native-analysis-seams branch October 8, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant