Skip to content

test(compiler): cover every analysis input in the compiler differential - #1016

Merged
kvlonge merged 4 commits into
mainfrom
test/differential-analysis-coverage
Oct 8, 2026
Merged

kvlonge merged 4 commits into
mainfrom
test/differential-analysis-coverage

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

The compiler differential covered discovery and render inputs, but analysis inputs (column inference, lineage, semantic checks, contracts, SQL tests) had no measured coverage and no failure corpus. Without that, changes to analysis can go untested while the differential still passes.

Changes

  • Analysis generator blocks and a CompiledProject classifier covering 56 analysis input kinds, plus --require-analysis-coverage wired into the per-PR gate.
  • The first seed of each run also compiles postgres and snowflake dialect variants, and runs --select, no-analysis and rich-lineage modes.
  • An analysis failure corpus of about 41 B/K/P/S cases that checks the first-error message, help, notes, location and code order. Unreachable codes are listed with reasons. Empty per-lane corpus modules are ready for follow-up work.
  • analysis_input_edits incremental edit sequence for the warm cache.
  • --wheel-site-report: an env-gated polyglot call-site recorder, plus a harness-side deferral counter. The report is uploaded as a CI artifact. The record directory and the compile-reuse switch no longer change compile-reuse or macro-call store identity.

Verification

  • Unit tests, compiler-differential e2e tests, make test and make check-ci passed.
  • make compiler-differential with the new flags (214 projects) and make compiler-differential-shipped (208 projects) passed.
  • Coverage: discovery 66/66, render 66/66, analysis 56/56.
  • Differential CPU time is about +29.5% against the previous gate, within budget.

…ifferential

When SQLBUILD_ANALYSIS_RECORD_DIR is set, the guarded Polyglot proxy wraps
every wheel callable it hands out and counts calls by the calling
file:function and API, writing one JSON file per process at exit. With the
variable unset the proxy returns exactly what it did before. The compiler
differential reads these records to show which compile-path wheel sites each
corpus reaches.
Add an incremental edit sequence that changes the inputs SQL analysis
publishes shapes from: an upstream column type under a star chain, a contract
type, a source expression, a UDF return type and a source column's declared
nullability. Every step must match a --no-cache compile of the same project.
Generate SQL analysis blocks in the seeded projects: typed, untyped and
star outputs over complete, published and open inputs; set operations and
CTEs; a contracted model under a three-level chain; scalar and table UDFs
with typed arguments; a proven dynamic pivot; quoted identifiers; metadata
audits; a SQL test with a macro mock; a needed sql_analysis opt-out under
require_sql_analysis; literal SQL in a Python task; and select-limited,
analysis-off and rich-lineage compiles. The first seed of a run also
compiles its analysis blocks under the postgres and snowflake dialects.

Classify CompiledProject captures into 56 analysis kinds, crediting a kind
only from analysed evidence, and add --require-analysis-coverage to the
per-PR job.

Add an analysis failure corpus with one case per reachable B, K, S and
syntax code plus ordering cases, checking the first error's code, message,
help, notes and location and every case's code order. The code set comes
from the help catalogue and the analysis-stage modules; unreachable codes
are listed with reasons. Each native analysis lane gets its own empty
corpus module already wired into the shared list.

--wheel-site-report prints and writes Polyglot wheel calls per engine,
site and corpus, plus analysis deferral counts read from the same record
directory; CI uploads it as an artifact. Nothing in it gates.
Reach P003 through the sql_analysis/sql_validation conflict, keep the
analysis record directory and the compile-reuse switch out of compile
reuse and macro-call store identity, credit hook and promotion kinds only
on analysed models, mirror the product's complete binding schemas, and
copy the site counter under its lock.
@kvlonge
kvlonge force-pushed the test/differential-analysis-coverage branch from 61c0d66 to 14e2860 Compare October 8, 2026 03:09
@kvlonge
kvlonge enabled auto-merge (squash) October 8, 2026 03:10
@kvlonge
kvlonge merged commit dc8cdcd into main Oct 8, 2026
71 of 73 checks passed
@kvlonge
kvlonge deleted the test/differential-analysis-coverage branch October 8, 2026 04:20
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