Repository navigation
test(compiler): cover every render input in the compiler differential - #1001
Merged
Merged
Conversation
Add rendering feature blocks to the seeded generator: macros reading context, constants, enums and the environment, nested and typed-reference macro calls, macro-generated references with relaxed explicit-reference rules, table functions, variable, environment and hook-context interpolation, runtime placeholders, cursor intrinsics, macros in tests, scenarios, audits, functions and source expressions, enum-typed columns, model-private declarations, named hook arguments, and model, source and seed audits. The harness provides the fixed environment variable the generated projects read.
Classify CompileProjectInputs stage captures into render input kinds, crediting a kind only from rendered evidence: a template absent from the rendered SQL, a recorded usage, reference, grant, hook entry or attached audit. Encoded empty sets and mappings prove nothing. Kinds credited from a used macro's source text are reported as indirect. Add --require-render-coverage and require it in the per-PR compiler differential job. Share the capture readers with discovery coverage.
Add one failing project per reachable render, scope and attachment code (P005, P007, P008, P009, S006, S007, S008, S009, K012, C214 and the C216 warning) and P001 cases for macro, interpolation, reference and hook argument errors, each checked against its first error message. render_error_codes derives the code set from the compiler; the end-to-end test requires every code to be reached unless it is listed as unreachable with a reason. Share the base-project case builder across the corpus modules.
Plan a generated project with every feature block and require its CompileProjectInputs capture to hold every field canonically, name every callable, and prove every required render kind. Perturb the native compile inputs to show the differential localises a render mismatch to the compile_project_inputs capture.
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
Before M3 ports scopes, rendering and the macro bridge to Rust, the compiler differential must cover every render input and render-time error code and compare
CompileProjectInputs, as #994 did for discovery.Changes
enforce_explicit = false; table functions;@@var,@@ENV:and@@CTX:interpolation; runtime placeholders and cursor intrinsics; macros in tests, scenarios, audits, functions, hooks and source expressions; enum-typed and model-private declarations; named hook arguments; and model, source and seed audits.CompileProjectInputscapture, with--require-render-coverage, now required in the per-PR job. A kind counts only with rendered evidence. Encoded empties count for nothing. Macro context reads are named as indirect. No kind is config-only.compile_project_inputs.Verification
make compiler-differentialwith the new flag (139 projects identical, 63/63 render kinds, also native vs native),make check-ci,make test, hygiene.CompileProjectInputscaptures match python-vs-python on 46 projects, repeated seeds and dense-1000. TheCompiledProjectmismatch comes from a real scheduling-order nondeterminism in the shared-analysis memo, so it is reported in CHI-539 and not canonicalised.