Repository navigation
compiler.rs: expression-level positive/characterization tests (tests_compiler_rejects 21->26). Closes #1137 - #1140
Merged
Conversation
…compiler_rejects 21->26). Closes #1137
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-06-14 17:54:25 UTC
Summary
Seal Status
|
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.
Summary
Add an expression-level positive-control / characterization test set to
mod tests_compiler_rejectsinbootstrap/src/compiler.rs. Where #1123 (Q) pinneddeclaration-level rejection and #1130 (T) pinned declaration-level acceptance, this set pins
EXPRESSION-LEVEL lowering: the exact Verilog a valid return-expression lowers to. Pure test
additions; no production code changes.
Motivation
The reject/accept suite covers casts (#1123/#1130) and declaration shapes, but the precise
SHAPE of lowered expressions is not pinned. A refactor of the expression generator could
silently change associativity, parenthesization, or operand handling without any test
failing. This locks the current output so such a change is caught.
Per the project rule, each assertion was written by first observing the current generator
output, then locking it in. These characterize CURRENT behavior; they do not endorse or
prescribe it.
New tests (5)
lowers_binop_add_characterization--return x + 1lowers toadd = (x + 1);(no droppedbody).
lowers_chained_binop_left_assoc_characterization--return x + 1 + 2lowersleft-associatively to
f = ((x + 1) + 2);.lowers_redundant_paren_to_operand_characterization--return (x)strips the redundantparenthesis to
f = x;.lowers_identity_cast_to_operand_characterization--return x as u8(u8 fn) lowers to theoperand
f = x;with no dropped body.let_binding_falls_back_to_todo_characterization-- aletbinding before the return isNOT yet lowered; the body falls back to the
// TODO: implementstub. Pinned as a visiblecurrent GAP (named characterization), to be updated deliberately if
letlowering is added.Verification
tests_compiler_rejectscount: 21 -> 26.L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality
claim added.