Skip to content

compiler.rs: expression-level positive/characterization tests (tests_compiler_rejects 21->26). Closes #1137 - #1140

Merged
gHashTag merged 1 commit into
masterfrom
loop10-x-expr-characterization
Jun 14, 2026
Merged

gHashTag merged 1 commit into
masterfrom
loop10-x-expr-characterization

Conversation

@gHashTag

Copy link
Copy Markdown
Collaborator

Summary

Add an expression-level positive-control / characterization test set to
mod tests_compiler_rejects in bootstrap/src/compiler.rs. Where #1123 (Q) pinned
declaration-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 + 1 lowers to add = (x + 1); (no dropped
    body).
  • lowers_chained_binop_left_assoc_characterization -- return x + 1 + 2 lowers
    left-associatively to f = ((x + 1) + 2);.
  • lowers_redundant_paren_to_operand_characterization -- return (x) strips the redundant
    parenthesis to f = x;.
  • lowers_identity_cast_to_operand_characterization -- return x as u8 (u8 fn) lowers to the
    operand f = x; with no dropped body.
  • let_binding_falls_back_to_todo_characterization -- a let binding before the return is
    NOT yet lowered; the body falls back to the // TODO: implement stub. Pinned as a visible
    current GAP (named characterization), to be updated deliberately if let lowering is added.

Verification

  • tests_compiler_rejects count: 21 -> 26.
  • Full suite: 1468 passed, 0 failed, 0 regressions.
  • Build warnings unchanged (623; test-only additions).

L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality
claim added.

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-06-14 17:54:25 UTC

Summary

Status Count
Total Open PRs 2
PRs with Failing Checks 0
PRs with All Checks Green 2
READY 1
FAILING 0
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=1953ec73601f != manifest seal=49e55df6d444.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit d785985 into master Jun 14, 2026
18 of 19 checks passed
@gHashTag
gHashTag deleted the loop10-x-expr-characterization branch October 26, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant