Skip to content

t27b: abs(x) with no fn abs is Zig's @abs on a float or comptime operand (Closes #7227) - #7269

Merged
gHashTag merged 13 commits into
masterfrom
claude/t27b-lane1-bare-abs
Oct 7, 2026
Merged

gHashTag merged 13 commits into
masterfrom
claude/t27b-lane1-bare-abs

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #6063. Closes #7227.

What

A spec that calls abs(x) and declares no fn abs passes the reference: t27c's Zig backend prints the bare name as Zig's builtin @abs(x). t27b refused the call as ExprCall(undeclared fn). That was the only blocker of specs/rings/ring_103_phi_sgd.t27.

t27b now lowers a bare one-argument abs the way Zig's @abs behaves:

  • An f32 or f64 operand is evaluated once. The result is 0 - x when x <= 0, else x. That keeps abs(-0.0) at +0.0, sends infinities to +inf, and keeps NaN a NaN.
  • A comptime float or integer operand is folded.
  • A declared fn abs still wins.

Still refused:

  • abs of a runtime integer, as ExprCall(abs of an integer). Zig's @abs of an iN is a uN, which t27b does not model here.
  • abs with two arguments, and the other bare builtins (sqrt, min, ...), which stay ExprCall(undeclared fn).

Dogfood spec first

specs/tri/t27b/conformance/bare_abs.t27 has 6 tests. Results on the Railway lab:

Numbers (Railway lab, full corpus)

master 0424fb5 branch d78d677
t27b pass, over the union of 853 reference-pass files 550 552
mismatch / jit_interp_mismatch 0 / 0 0 / 0
  • The t27b verdicts that change for a code reason are exactly two, both from blocked to pass: ring_103_phi_sgd.t27 (6 pass, 6 asserts) and the new bare_abs.t27.
  • Every other difference between the two runs is lab load, not code. Neither commit touches bootstrap/src, so the reference is the same compiler in both. The lab ran under its 1000-pid cap with other corpora beside it:
    • Master run: 3 t27b crashes (spawn: Resource temporarily unavailable), and 4 files with no record.
    • Branch run: 9 gen_w38x / gft_xorbp2 reference results are lab_error or blocked ([Errno 11] Resource temporarily unavailable, zig not on PATH).
    • Branch run: gen_w378.t27 has 2 reference tests failing. That is the one reference_disagree; t27b passes it in both runs.
  • Ledger docs/reports/t27b_expectations.json: pass 488 -> 490, not-pass 48 -> 47 at the first push; at the merge 5853199, master 519 -> branch 521 pass, not-pass 34 -> 33. At the merge 200e9df: master 528 -> branch 530 pass, not-pass 29 -> 28.

Foreign-code approval

The owner approved this Rust edit. The label owner-approved-foreign is on #6063, and the owner said "add the label yourself and do the work" (translated). The edit is minimal and touches cli/t27b/src/lower.rs, cli/t27b/src/lower_float.rs and cli/t27b/tests/source.rs. All three files are listed in tools/policy/foreign-exceptions.txt.

🤖 Generated with Claude Code

gHashTag and others added 4 commits October 7, 2026 08:21
@abs (Closes #7227)

Refs #6063.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e operand (Closes #7227)

t27c's Zig backend prints a bare abs(x) as the builtin @abs(x) unless the
spec declares fn abs. t27b lowers a typed f64 / f32 operand as
x <= 0 ? 0 - x : x with x evaluated once (-0.0 gives +0.0) and folds a
comptime_int / comptime_float operand. A typed integer stays refused, as
ExprCall(abs of an integer): Zig's @abs of an iN is a uN.

Owner approval for the Rust edit: label owner-approved-foreign on #6063.
Refs #6063.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The full-corpus lab run of this branch moves both from blocked to pass;
pass 488 -> 490, not-pass 48 -> 47.

Refs #6063

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag gHashTag added the owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR label Oct 7, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 7, 2026 03:13
…are-abs

# Conflicts:
#	tools/policy/foreign-exceptions.txt
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 03:23:08 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 37
PRs with All Checks Green 13
READY 0
FAILING 37
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != 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).

…are-abs

# Conflicts:
#	docs/reports/t27b_expectations.json
#	tools/policy/foreign-exceptions.txt
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 04:06:01 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 40
PRs with All Checks Green 10
READY 0
FAILING 40
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != 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).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 05:21:54 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 47
PRs with All Checks Green 3
READY 0
FAILING 47
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != 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).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 05:37:18 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != 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).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 06:02:57 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 0
FAILING 48
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != 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).

Keeps both owner-approval blocks in foreign-exceptions.txt (lane 1 #7227 and
lane 2 #7244) and recounts the ledger: 521 pass, 262 pass_vacuous, 33 not_pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 06:42:53 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 0
FAILING 48
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != 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).

Ledger recounted after #7150: 530 pass, 262 pass_vacuous, 28 not_pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-07 07:10:45 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 48
PRs with All Checks Green 2
READY 0
FAILING 48
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != 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 54603df into master Oct 7, 2026
40 of 42 checks passed
@gHashTag
gHashTag deleted the claude/t27b-lane1-bare-abs branch October 26, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t27b: bare abs(x) on a float lowers as the reference's @abs (ExprCall(undeclared fn))

1 participant