Skip to content

t27b: add body-reads guard to countdown transform - #13439

Merged
gHashTag merged 3 commits into
masterfrom
lane/t27b-countdown-fix
Nov 9, 2026
Merged

gHashTag merged 3 commits into
masterfrom
lane/t27b-countdown-fix

Conversation

@gHashTag

@gHashTag gHashTag commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Countdown transform in lower.rs fired when the induction variable iv was read in the loop body (array index, arithmetic), producing wrong runtime values
  • 6 ratchet UNEXPECTED FAILUREs on master (wasm_module, HirApbBridge_new, glass_window, segment_tree, 04_control_flow, orchestrator_bench)
  • Fix: add fn expr_has_var + fn stmts_has_var recursive traversal; guard with !stmts_has_var(body, iv) — transform only fires when iv is never read in body
  • Net-zero foreign-budget: 3 insertions, 3 deletions (removed 2 blank lines)

Test plan

  • t27b-native-ratchet passes with 0 UNEXPECTED FAILUREs for all 6 listed specs
  • t27b-native-linux and t27b-native-macos still pass
  • The countdown benchmark (bench_audit.t27) still benefits: i is not read in that loop body, so transform fires correctly

Closes #13438

🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

gHashTag and others added 2 commits November 9, 2026 19:07
Dereference rhs2 (Box<Expr>) when assigning into the init Assign
value field (Expr): *value = *rhs2 instead of *value = rhs2.
Compile error introduced in PR #13422 squash; prevents t27b from
building, causing all t27b differential tests to report infra failure.

Refs #13421
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The countdown transform fired when the induction variable `iv` was read
in the loop body (as array index or arithmetic operand), producing wrong
values and 6 ratchet UNEXPECTED FAILUREs on master.

Add `fn expr_has_var` + `fn stmts_has_var` recursive traversal over all
Stmt/Expr variants and guard the transform with `!stmts_has_var(body, iv)`.
Removes 2 blank lines to maintain net-zero foreign-budget.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) November 9, 2026 12:34
…7b-countdown-fix

# Conflicts:
#	cli/t27b/src/lower.rs
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-11-09 12:36:48 UTC

Summary

Status Count
Total Open PRs 43
PRs with Failing Checks 38
PRs with All Checks Green 5
READY 4
FAILING 38
PENDING 0
NO CHECKS YET 0

These columns do not partition: 4 + 38 + 0 + 0 = 42, and there are 43 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b882be1e4933 != manifest seal=87e5cbd3ad94.
    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 e547acc into master Nov 9, 2026
40 of 42 checks passed
@gHashTag
gHashTag deleted the lane/t27b-countdown-fix branch November 9, 2026 12:39
gHashTag added a commit that referenced this pull request Nov 9, 2026
…) (#13441)

Add inline instructions for the word-count measurement: `t27b asm bench_audit.t27`
with a fresh binary from master after #13439. References tracking issue #13440.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

t27b: countdown transform fires when iv is read in body -- 6 ratchet UNEXPECTED FAILUREs

1 participant