Skip to content

Commit dc8cdcd

Browse files
authored
test(compiler): cover every analysis input in the compiler differential (#1016)
* test(compiler): record Polyglot wheel calls by calling site for the differential 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. * test(compiler): compare analysis input edits with uncached compiles 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. * test(compiler): cover every analysis input in the compiler differential 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. * test(compiler): address differential coverage review findings 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.
1 parent 79a5b45 commit dc8cdcd

51 files changed

Lines changed: 3232 additions & 27 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/verify.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,16 @@ jobs:
294294
run: >-
295295
make compiler-differential
296296
COMPILER_DIFFERENTIAL_ARGS="--stage-captures --require-discovery-coverage
297-
--require-render-coverage"
297+
--require-render-coverage --require-analysis-coverage
298+
--wheel-site-report ${{ runner.temp }}/compiler-differential-wheel-sites.json"
299+
- name: Upload the Polyglot wheel-site and deferral report
300+
if: always()
301+
uses: actions/upload-artifact@v4
302+
with:
303+
name: compiler-differential-wheel-sites-${{ github.run_id }}-${{ github.run_attempt }}
304+
path: ${{ runner.temp }}/compiler-differential-wheel-sites.json
305+
if-no-files-found: warn
306+
retention-days: 30
298307
- name: Compare generated seeds and the failure corpus (python vs shipped native)
299308
run: make compiler-differential-shipped
300309

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Analysis-stage failure cases, one module per native analysis lane."""
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Failure cases owned by the native model analysis session lane."""
2+
3+
from scripts.compiler_differential.models import FailureCase
4+
5+
6+
def analysis_session_failure_cases() -> tuple[FailureCase, ...]:
7+
"""Return this lane's failure cases; the lane appends here without editing shared lists."""
8+
9+
return ()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Failure cases owned by the native project assembly and target validation lane."""
2+
3+
from scripts.compiler_differential.models import FailureCase
4+
5+
6+
def assembly_failure_cases() -> tuple[FailureCase, ...]:
7+
"""Return this lane's failure cases; the lane appends here without editing shared lists."""
8+
9+
return ()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Failure cases owned by the native contracts and promotion conflicts lane."""
2+
3+
from scripts.compiler_differential.models import FailureCase
4+
5+
6+
def contracts_failure_cases() -> tuple[FailureCase, ...]:
7+
"""Return this lane's failure cases; the lane appends here without editing shared lists."""
8+
9+
return ()

0 commit comments

Comments
 (0)