Skip to content

feat(native): build model config and validate models natively behind the preview engine - #1034

Merged
kvlonge merged 2 commits into
mainfrom
feat/native-model-loop-leftovers
Oct 8, 2026
Merged

kvlonge merged 2 commits into
mainfrom
feat/native-model-loop-leftovers

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Why

M3i (native rendering as the default) needs the per-model loop's config work to run natively. After M3e/M3f the preview engine still built model config and ran the model config validators in Python for every model.

Changes

  • sqlbuild-model-config: native path-default selection, Python-exact Duration/ISO cursor-bound parsing, header storage overrides, and the happy path of all ten model validators (references, incremental/microbatch, capability, contract, non-incremental, snapshot, custom materialization, storage, migration, placeholders). Anything uncertain (non-ASCII text, unusual ISO forms, big ints, odd types) rejects.
  • Bindings: NativeModelConfigBuilder layers defaults, path defaults and headers, expands ${...} templates, applies target namespace overrides and storage policies, and returns the reads Python records; NativeModelValidator accepts or rejects.
  • Preview MODEL_CONFIG stage: the loop uses both. A deferred build runs build_model_config; a rejection runs the Python validators for the exact error. Shipped/python engines unchanged.
  • Python validator sequence moved to run_python_model_validators (same order).
  • Stays Python: SQL-analysis gate/opt-out, Python-hook checks, enum contract columns and named usages (object assembly until M3j), cursor-intrinsic scan, reusable config cache. Hook expansion is already native via the macro bridge.

Verification

  • Seeded parity: 6,000 configs (native accepts 1,607 of 1,610 Python accepts, never one Python rejects); 6,000 builds (equal config and reads or defer, never hides a Python error).
  • 19 new failure-corpus validator cases; DuckDB build E2E on python/native/native-preview.
  • cargo test --workspace --all-features; clippy/fmt 1.99.0.
  • make compiler-differential (CI flags): 243/243; -shipped: 237/237.
  • tests/e2e/scripts/compiler_differential, make check-ci, make test (11,833 passed), hygiene scan.

@kvlonge
kvlonge enabled auto-merge (squash) October 8, 2026 14:55
@kvlonge
kvlonge force-pushed the feat/native-model-loop-leftovers branch from 88a5dd2 to abbc715 Compare October 8, 2026 14:55
@kvlonge
kvlonge merged commit 24e47aa into main Oct 8, 2026
37 checks passed
@kvlonge
kvlonge deleted the feat/native-model-loop-leftovers branch October 8, 2026 15:54
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