Skip to content

feat(t27b): array and struct parameters and locals the body assigns - #6584

Merged
gHashTag merged 6 commits into
masterfrom
claude/t27b-tail-valueparams
Oct 5, 2026
Merged

gHashTag merged 6 commits into
masterfrom
claude/t27b-tail-valueparams

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6569
Refs #6063

What

  • An array or struct parameter that the reference makes a var (var p = p_arg;) is copied into a slot of the callee at entry, and the body writes that copy. The reference decides this with t27c's own collect_mutable_names test, which names a StmtAssign target or the identifier base of an index or field target, walking if/while/for bodies. The caller's value never changes, as in the reference.
  • An array or struct local that the same test names (const or let, typed or not) is a writable slot of its own, as the reference's var is. A copy is never an alias.
  • A name written only in places the test does not walk stays a constant in the reference, which refuses the write ("cannot assign to constant"). t27b still refuses it too.
  • Invariant and bench blocks do not use the set, because t27c does not compute it for them.
  • Code is in the new submodule cli/t27b/src/lower/refvars.rs. lower.rs gets small hooks:
    • mod refvars;;
    • one field;
    • one call in begin_body;
    • one line each at the parameter, annotated-local and untyped-local sites.
  • Conformance spec first: specs/tri/t27b/conformance/value_params.t27 passes t27c test-report (10 pass) and t27b (10 pass).

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. It names cli/t27b/src/lower.rs, cli/t27b/src/lower/refvars.rs, cli/t27b/tests/valueparams.rs, cli/t27b/tests/common/mod.rs and cli/t27b/tests/source.rs. That line is not in this PR. CI's own-language check honours the owner-approved-foreign label.

Ledger bless (Q53)

docs/reports/t27b_expectations.json is re-blessed in this PR.

Files

File Class
specs/tri/t27b/conformance/value_params.t27 .t27
docs/reports/t27b_expectations.json generated (tri t27b ratchet --bless --accept-new)
cli/t27b/src/lower.rs (hooks) hand-written Rust (owner exception)
cli/t27b/src/lower/refvars.rs hand-written Rust (owner exception)
cli/t27b/tests/valueparams.rs hand-written Rust tests (owner exception)
cli/t27b/tests/source.rs (one case dropped: const p = Pt{..}; p.x = 3; is accepted by the reference) hand-written Rust tests (owner exception)
docs/now/2026-10-06-t27b-value-params.md prose (NOW entry)

Tests

  • cargo test -p t27b: all green.
  • tests/valueparams.rs has 3 tests:
    • the spec's 10 tests pass;
    • a deeper-only write is refused, as the reference refuses it;
    • the caller's array is unchanged.

Corpus (t27b corpus specs --blockers --reference <t27c> --reference-cache, jobs 8, after merging master 9c59c51)

counted (t27b pass where reference passes) checked pass where reference fails mismatch
lab master 597216d 705 / 752 422 1 (eternal_monitor, older than this lane) 0
this branch (local) 711 / 755 428 1 (same) 0

Three specs that the reference blocks now hit another t27b blocker first. None of them is counted:

  • sgd: now ExprIdentifier(undeclared);
  • mlp: now ExprCall(undeclared fn);
  • net: now StmtLocal.

🤖 Generated with Claude Code

gHashTag and others added 5 commits October 6, 2026 00:18
Conformance spec specs/tri/t27b/conformance/value_params.t27 first
(6 pass under t27c test-report and t27b).

Closes #6569
Refs #6063

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Locals the reference makes var (t27c collect_mutable_names) get a
writable slot; the parameter copy moves into lower/refvars.rs.

Closes #6569
Refs #6063

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lab run 597216d plus this branch's verdicts; 3 up, 9 new entries
(4 gft not-pass via --accept-new), 0 down, cap 43 -> 44.

Closes #6569
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 18:20:08 UTC

Summary

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

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).

Pair and Counter are already defined by other specs; tri types ratchet
refuses a second definition. Renamed to ValPair and HitCounter.

Closes #6569
Refs #6063

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 18:28:54 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)=8e8efc938684 != 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: array and struct parameters the body assigns (StmtAssign, assignment through a constant)

1 participant