Skip to content

feat(t27b): std.mem.eql and std.mem.indexOf compared with null, on strings - #6567

Merged
gHashTag merged 3 commits into
masterfrom
claude/t27b-tail-stdmem-2
Oct 5, 2026
Merged

gHashTag merged 3 commits into
masterfrom
claude/t27b-tail-stdmem-2

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6449
Refs #6063

What

  • std.mem.eql(u8, a, b) on two strings is lowered as a == b. Two literals fold; otherwise it calls __t27b_str_eql. This matches t27c's Zig backend, which prints the call verbatim.
  • std.mem.indexOf(u8, h, n) == null and != null call a second synthesized fn, __t27b_str_contains. It follows Zig 0.16 semantics: a needle longer than the haystack is never found, and an empty needle always is.
  • Every other shape is still refused as ExprCall(std.*): the index used any other way, another element type, or an operand that is not a string.
  • Code is in the new submodule cli/t27b/src/lower/stdmem.rs, with small hooks in lower.rs.

Owner exception

Allowed by the owner 2026-10-05; debt to be replaced via #6198.

The local only-t27 hook (#6511) read an uncommitted line in tools/policy/foreign-exceptions.txt that names this PR's paths. That line is not in this PR, so the exception ends with the PR.

Files

File Class
cli/t27b/src/lower.rs (hooks) hand-written Rust (owner exception)
cli/t27b/src/lower/stdmem.rs hand-written Rust (owner exception)
cli/t27b/tests/stdmem.rs hand-written Rust tests (owner exception)
docs/now/2026-10-05-t27b-stdmem.md prose (NOW entry)

Tests

  • cargo test -p t27b: all green.
  • tests/stdmem.rs: each source was run under t27c test-report first. It gives 3 pass and 2 fail there, and the same here.

Corpus (t27b corpus specs --blockers --reference <t27c> --reference-cache, jobs 8)

counted (t27b pass where reference passes) checked pass where reference fails mismatch
after #6537 680 / 728 399 0 0
this branch 683 / 728 402 0 0

No file loses its pass. Three files newly pass: specs/automation/browser-pod-restart.t27, specs/port/scripts/git_commands_tasks_1_4.t27, and specs/port/scripts/tri-search.t27.

🤖 Generated with Claude Code

gHashTag and others added 3 commits October 5, 2026 23:02
…rings

std.mem.eql(u8, a, b) on strings lowers as a == b; std.mem.indexOf(u8, h, n)
== / != null calls a second synthesized fn, __t27b_str_contains, with Zig
0.16 std.mem.find semantics. Other shapes stay refused as ExprCall(std.*).

Closes #6449
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 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 17:13:41 UTC

Summary

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

These columns do not partition: 9 + 40 + 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)=9f2c8a4829f6 != 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).

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: std.mem.eql(u8, a, b) and std.mem.indexOf(u8, h, n) == / != null on strings

1 participant