Repository navigation
refactor(runtime): ask the semantic questions of lowered records - #2252
Merged
Merged
Conversation
The constant fold, declared dimension and count, classification verdict and unit of an expression are asked of its lowered record (lower.ExprEntry.Folded, Dimension, Held, Classifies, Unit) rather than by handing the semantic model a syntax tree. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This was referenced Nov 15, 2026
…tic-residues Co-Authored-By: jason.han <hanhuijun@gmail.com>
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.
What and why
No tracking issue.
Based on
develop. #2249, which this step was stacked on, has merged; the branch hasdevelopmerged in and so contains #2249's merged content, and the diff shows only this step.Fourth part of the execution-owned expression migration in
docs/internals/execution-ir-design.md, after #2218, #2225 and #2249. The runtime no longer hands a syntax tree to the semantic layer: it asks the lowered record.internal/ir/lower/expr_questions.goaddsExprEntry.Folded,Dimension,Held,ClassifiesandUnit. Each answers from the provenance tree the record keeps, through the unchanged semantic-layer functions (EvalWithin,DimensionOfExpr,ValuesHeldBy,EvalClassification,UnitOfExpr).Context.UnitOfamong them (builtins_named.go,collections.go,compile.go,eval.go,eval_declared.go,instance.go,shape.go,tensor_functions.go,tool.go,write_conformance.go).NoValueError.Refneeded no code change: the error already carries the feature'sSymbol. The stale row in the design document is corrected.Error timing is unchanged. A few helpers that folded a raw tree now lower the expression first; lowering reports no errors and is memoized.
Not in this PR: removing the retained tree fields, moving the semantic-layer signatures off trees, and forbidding
exec/runtimefrom importingsyntax/astare the final step.Baselines
None moves. The merges of
developwere clean, andpilot-apijson-diff -check,derived-census -check -require-exporterandpilot-diff -checkreproduce the committed records on the merged head.How it was verified
On the pushed head (this change merged with
develop):go build ./...,go vet ./...,gofmt -l .,make lintgo test -count=1 ./...with the training and pilot corpora required, andgo test -C tools -count=1 ./...go test ./tests/hygiene,scripts/check-doc-ids.py,scripts/changelog.py checkmake docs-counts,make spec-compliance-check,make wasm-checkpilot-diff -checkandpilot-apijson-diff -check(JDK 21),pilot-exec-diff,pilot-xpect -checkNew tests in
internal/exec/runtime/expr_questions_test.go:TestLoweredRecordAnswersTheSemanticQuestionsandTestLoweredDefaultIsTheOneAFeatureStatesOrRedefines. The existing runtime tests pass unchanged.Checklist
make testandmake lintpass locally (the suite was run without-race)docs/internals/execution-ir-design.md)🟢 Devin Review found nothing to fix · View findings