Skip to content

feat(t27b): lower optionals -- ?T, null, .?, == null - #6357

Merged
gHashTag merged 1 commit into
masterfrom
claude/t27b-optional
Oct 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/t27b-optional

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6356
Refs #6063

What

  • ?T in cli/t27b/src/lower.rs (LTy::Opt): an in-memory aggregate, payload at offset 0 then a has-value byte, rounded to the payload alignment. Locals, params (by pointer), returns (sret), struct fields.
  • null (where an optional is wanted), x == null / x != null, ?T == T against a constant or variable, and x.? (also x.?.len, &x.?, x.? = v).
  • x.? on null traps with the new TrapKind::Null = 11, "attempt to use null value", as Zig does.
  • Named refusals: StmtIf(capture) (t27c gen drops |v|, so Zig reports an undeclared identifier: no reference to match), ExprBinary(?T) (two optionals compared), ExprFieldAccess(?T) (field of an optional without .?), ConstDecl(?T) (module-level optional).
  • Tests: optionals_match_the_reference and optionals_the_reference_does_not_match_are_refused in cli/t27b/tests/source.rs. Verdicts were checked under t27c test-report (6 PASS, 2 FAIL; the capture case is BLOCKED).

Corpus

t27b corpus specs --blockers --reference t27c --reference-cache <own cache>, fixed binary copies, before = origin/master d8375ad.

before after
pass 361 375
pass_vacuous 286 286
fail 9 10
rejected 559 544
front-end error 40 40
mismatch 0 0
timeout 2 2
crash 0 0
counted /720 634 648
checked pass (of 720) 356 370

The +1 fail is specs/port/scripts/check-first-party-doc-language.t27. The reference also fails it, on the same test: find_last_char_found FAIL, the other 3 PASS. It is outside the 720.

Top of the greedy order after: StmtExpr +5, ExprArrayLiteral +5, type undefined +4, ExprCall(std.*) +4, type f32 +3.

🤖 Generated with Claude Code

?T lives in memory: the payload, then a has-value byte. Locals, params,
sret returns and struct fields take it; `.?` traps as TrapKind::Null
("attempt to use null value"), as Zig does. `if (x) |v|` is refused as
StmtIf(capture): t27c gen drops the capture and Zig fails.

Corpus: counted 634 -> 648 of 720, checked pass 356 -> 370, mismatch 0.

Closes #6356

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

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 04:23:45 UTC

Summary

Status Count
Total Open PRs 46
PRs with Failing Checks 34
PRs with All Checks Green 12
READY 11
FAILING 34
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8597b6ded596 != 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 84e478b into master Oct 5, 2026
29 of 31 checks passed
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: optionals (?T, null, .?, == null) in the native backend

1 participant