Repository navigation
feat(native): normalise and compare types natively behind the preview engine - #1028
Merged
Merged
Conversation
kvlonge
force-pushed
the
feat/native-type-system
branch
from
October 8, 2026 12:46
d0d316d to
42e0974
Compare
kvlonge
enabled auto-merge (squash)
October 8, 2026 12:46
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
Contracts, metadata checks and CTE facts compare types; the native analysis stages need the same answers in Rust. This adds one native type normalization that matches Python byte for byte, behind the preview engine.
Changes
sqlbuild-analysis::type_system: a port of Python'snormalize_type. It parses with the crate'sparse_data_type(same Polyglot commit as the wheel, same complexity guard). It reads the type's SQL and arguments the way the wheel exposes them, then applies Python's family rules, dialect rewrites and text fallback.None, so Python runs) for non-ASCII text, more than 32[(Polyglot does not bound[]suffixes), dialects this build of Polyglot does not include or does not know, integers beyondi64, and values Python would hold as objects. It returns the parse error so Python logs the same debug event before its fallback._native.normalize_typebinding, wired into theTYPE_SYSTEMstub. Undernative-preview,normalize_typeand thereforetypes_equaluse it;pythonandnativeare unchanged.Verification
native-preview(identical report and artifacts, native calls answered).cargo test --workspace --all-features, clippy and fmt (1.99.0),make check-ci,make test,make compiler-differential(CI flags),make compiler-differential-shipped,tests/e2e/scripts/compiler_differential.