Skip to content

Stop v2 lowering from dropping a call in a brace-bodied fn - #11595

Merged
briansrls merged 4 commits into
mainfrom
session/sharp-pike-550
Sep 18, 2026
Merged

briansrls merged 4 commits into
mainfrom
session/sharp-pike-550

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Brace-bodied fn rollup() { leaf() } was lowered to Transform over the { token, so the call disappeared with no diagnostic (DESIGN §5 silent wrongness).
  • Root cause: body_lower_try_body_lowered treated a brace-headed sequence as an expression (call/infix). The matcher now returns Absent for a brace-headed sequence, and {/} are unwritable as infix operators.
  • body_lower_primary_expr tries the ident-call before the first-atom fallback so a call is not taken as a bare atom; body_lower_call_callee_optional still refuses token heads, so operator atoms fall through. Unwrap primary_expr before call matching.
  • Floor witness: tokenize → parse → normalize of a two-fn module; the block body's arrow edge must be the call to leaf (not {), with fn leaf() -> Bool = true as the expression-body control. Parse is warmed for the two claims.

Test plan

  • claim_batch --entry src/v2/test/claim/body_lowering_block_body_call_test.dag --functions body_lowering_block_call_parses_holds,body_lowering_block_body_call_reaches_arrow_body PASS
  • Required floor on this PR (new-witness eval-step budget; parse producer is WARM)

Made with Cursor

Brian Searls and others added 4 commits September 18, 2026 08:13
A brace-headed fn body was matched as an expression, so `{` became the Transform operator and the interior call vanished with no diagnostic. Skip that matcher, lower the call through the primary-expr path, and enroll a floor witness that requires the call to reach the arrow body.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the extra parse claim and the warm-share row. One test fn ingest the module and reads rollup's arrow body directly, so the floor does not pay a second pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
…e callee-absent reds.

The floor enrolled the module but refused the single-pass claim at 76,758 eval steps against 72,300. Warm-sharing the parse (measured 59,549 on the prior floor run) plus a parse inhabitance claim is the same shape the parse witnesses already use. The lowering repair also made the XL-0/XL-3 "callee is absent" deficiency rows return false; they now assert the callee reaches.

Co-authored-by: Cursor <cursoragent@cursor.com>
The silent drop lived in body_lower_try_body_lowered: those arms could mint Transform with `{` as operator. That matcher now returns Absent for a brace-headed sequence, and `{`/`}` are unwritable as infix operators, so every call site walks the interior instead of skipping one caller.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

review 67616 — agreed: the skip at body_lower_body_subtree_lower_rest was a guard around one call site of body_lower_try_body_lowered, leaving the same silent-drop arm on the other four.

9936753a5d moves the boundary into the matcher. A brace-headed sequence is no longer a Present lowering from body_lower_try_body_lowered (Absent = not this strategy, so every call site walks the interior). { and } are also unwritable as infix operators in body_lower_operator_atom_optional. The caller-site skip is deleted.

— sent from sharp-pike-550

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