Repository navigation
feat(compiler): add compiler engine switch and differential harness - #987
Merged
Merged
Conversation
kvlonge
enabled auto-merge (squash)
October 6, 2026 19:36
kvlonge
force-pushed
the
feat/compiler-differential-harness
branch
from
October 6, 2026 20:04
9f842c8 to
1efd351
Compare
Select the compiler engine with SQLBUILD_COMPILER_ENGINE (python by default, or native) or the hidden --compiler-engine global option. All frontier stages run through one compile_frontier seam; the native engine currently falls back to the Python stages. Compile JSON and sqb debug report the engine, compile reuse keys include it, and the native engine keeps its compiler, Rules and lineage stores in -native-v1 directories so the Python stores stay untouched.
Compare exit codes, normalised stdout and stderr, the compiled tree, manifest, DAG and per-model query fingerprints between two engines over the e2e fixtures, website examples, seeded generated projects, a failure corpus and dense projects, with optional per-stage captures.
itertools.count is not subscriptable at runtime before Python 3.13, so the ClassVar annotation failed at import on 3.12.
kvlonge
force-pushed
the
feat/compiler-differential-harness
branch
from
October 6, 2026 21:00
2b6309e to
f489772
Compare
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
The native compiler rewrite needs a per-invocation engine switch and a gate proving both engines produce identical compile output. No stage is native yet, so
nativeruns the Python stages through the new seam.Changes
SQLBUILD_COMPILER_ENGINE(pythondefault, ornative) and a hidden--compiler-engineglobal option. Invalid values fail at parse time.compile_frontierseam with aCompilerStageenum around discovery, compile inputs and the compiled project.SQLBUILD_COMPILER_STAGE_CAPTURE_DIRdumps each stage in insertion order (only sets and compile memo maps are sorted).compile --jsonreportscompiler_engine;sqb debugshows it.-native-v1paths; Python paths are unchanged. The resolved engine is in the reuse key, so unset andpythonshare entries; the capture dir is excluded.scripts/compiler_differentialcompares exit codes, normalised stdout/stderr,target/compiled, manifest, DAG, per-model fingerprints and stage captures. Every corpus entry declares an expected outcome (--expect success|failure:<CODE>for--project); any timeout fails.Verification
sqb rules; perturbation detection; a broken project fails unless its failure is declared.make compiler-differentialwith captures: 69 projects identical in 58s on 4 jobs.make check-ci, Rust fmt/clippy/tests (1.98.0),fensu dupes, public-repository scan.