compiler: move AST validation and symbol construction into native - #8996
Merged
marsninja merged 6 commits intoSep 6, 2026
Merged
Conversation
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.
Description
Run the existing
ASTValidationPassandSymTabBuildPassin the native compiler kernel after parsing and annex weaving. Materialize the AST and symbol graph together, then consume typedPassResultrecords through the normal host pass driver so diagnostics, suppression, timing, and scheduling remain consistent.Modules with wildcard imports defer symbol construction until dependency resolution; parsing without a known codespace retains the host schedule. Pass algorithms remain shared in
passes/.The migration also fixes shared backend infrastructure needed by these passes:
Chess compile measurements
Ten uncached AOT builds per kernel, two fresh-process batches each, two excluded warmups per batch, ordered baseline/new/new/baseline. Compiler startup is excluded; object emission and linking are included.
Observed median improvement: 3.0% overall, 2.9x for the migrated passes. Overall timing ranges overlap, so the total improvement is a local measurement, not a guaranteed speedup. Measurements used identical host source based on
d5d6172cc, before rebasing onto the latest main and its additional compiler performance changes. The benchmark script and methodology are included.Validation
git range-diffconfirms this is the only conflict-resolution adjustment.git diff --checkpasses.The full suite and a complete packaged Jac binary rebuild were not run. Native Unicode string iteration remains byte-based; the hash regression covers the ASCII compiler type names used here.