Skip to content

fix(rust): preserve writes to by-value parameter bindings - #5911

Merged
dmitrii-f-t27 merged 6 commits into
gHashTag:masterfrom
dmitrii-f-t27:codex/rust-value-params
Oct 4, 2026
Merged

dmitrii-f-t27 merged 6 commits into
gHashTag:masterfrom
dmitrii-f-t27:codex/rust-value-params

Conversation

@dmitrii-f-t27

@dmitrii-f-t27 dmitrii-f-t27 commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Writing a by-value scalar or fixed-array parameter previously produced immutable Rust bindings and E0384/E0594. Generation now adds mut only to parameter bindings that the body writes, respecting local and loop-capture shadows. Argument types, reference parameters and caller copy semantics are preserved.

The source fixture exercises eight functions and nine assertions. Real generated Rust is compiled and executed across 256 scalar inputs and 16 array/counter cases; reference writes, copy semantics and meaningful negative mutations are checked. A separate collection-capture check verifies generation scope only. The tri-net Rust corpus improves from89/102 to96/102, with no newly failing module.

Validation:

  • Full integrated bootstrap:2812 passed,0 failed,2 ignored across120 targets, including the accepted compiler entry-port/refusal, classifier and C-test repairs; Icarus359/359. Release build, real tri parse, typecheck and the new fixture's native seal verification pass. C and Zig each execute all9 source checks.
  • The corpus ratchet stays clean with95 existing expected failures and an unchanged ledger. This does not mean every source spec passes.
  • Forty-five existing seal aliases for23 unchanged specs are refreshed through native per-spec save/verify without force. Exact raw artifact hashes and token comparisons show only parameter mut and whitespace changes; comments, bodies, argument types, spec/C/Zig/Verilog hashes and alias/module identities stay identical. The full seal coverage gate passes:1449 seals,1325 hold,124 known-broken; its debt ledger is unchanged.

Those23 specs have existing backend debt: orphan_detection passes6/6 native tests, while22 have Zig compilation blockers now recorded explicitly. Their raw standalone Rust modules still fail for inherited reasons; the comparison adds no new diagnostic class. The seal refresh certifies current generated hashes and records these limitations; it does not certify successful Rust compilation or blocked tests.

Current canonical and merged candidate reproduce the same two advisory failures: ring096 signature drift and FPGA conformance178 elaboration diagnostic lines against ledger176. All37 actual generated Verilog artifacts are byte-identical between them. The real checks and debt ledgers stay unchanged.

Closes #5901

Preserve value and reference types, caller copy semantics and lexical shadows.
Add a source-first regression with real generated Rust execution and mutation.
Update FROZEN_HASH deliberately for this candidate compiler snapshot so the
build guard can verify it; M3 remains blocked by the unchanged-baseline Lean
classifier disagreement and this candidate is not a completed GOLD ring.

Closes gHashTag#5901
Refs gHashTag#5910
@dmitrii-f-t27
dmitrii-f-t27 merged commit 53dcd80 into gHashTag:master Oct 4, 2026
35 of 36 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.

Rust codegen: infer mutation of by-value scalar and fixed-array parameters

1 participant