Skip to content

fix(rust): a bare *T does not parse; supply the qualifier C already supplies (+10) - #3217

Merged
gHashTag merged 2 commits into
masterfrom
ptr-spellings
Sep 5, 2026
Merged

gHashTag merged 2 commits into
masterfrom
ptr-spellings

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

param_type_to_c has carried the C half of this since it found the same text passing
through verbatim in 52 generated files. The Rust half was never written, and Rust
is stricter: a raw pointer with no const or mut does not parse at all, so
everything behind it in the file was invisible to any first-error histogram.

error: expected `mut` or `const` keyword in raw pointer type
pub fn trit_cell_write(cell: *TritCell, value: i32) -> bool {

It was the largest mechanical class left in the Rust column: 39 of 339 first
errors, second only to mismatched types (74).

Three spellings arrive here, and a naive fix regressed a spec

Prefixing *mut unconditionally gave *mut const BezierCurve on
specs/tri/math/bezier.t27, which had been accepted before. Measured: +8 but −1.
*const T and *mut T are already Rust and must pass through untouched; only the
bare *T needs a qualifier, and bare means mutable in the source language.

With all three spellings handled: +10, 0 regressions.

Measured, 650 corpus specs, by name

rustc accepts, before 242
after 252
gain +10
regressions 0

A prediction that was refuted, recorded because it was wrong

Before measuring I wrote that this would unblock 0–2 specs, reasoning that
cell.value on a raw pointer gives E0609 rather than compiling, so the fix would only
move the error deeper. It unblocked 10. The reason is visible in the output: these
specs use pointers in the signatures of stub functions whose bodies are
unimplemented!(), so nothing ever dereferences them and repairing the signature is
sufficient.

Third instance this pass of the same shape: a rule that exists in one emitter and
never travelled to its sibling — after the serde gate (#3208) and the bracket element
type (#3213).

Closes #3216

…upplies (+10)

`param_type_to_c` has carried the C half of this since it found the same text
passing through verbatim in 52 generated files. The Rust half was never written,
and Rust is stricter -- a raw pointer with no `const` or `mut` does not parse at
all, so everything behind it in the file was invisible to any first-error
histogram. Largest mechanical class left in the column: 39 of 339 first errors.

Three spellings arrive at this arm. Prefixing `*mut` unconditionally produced
`*mut const BezierCurve` and regressed specs/tri/math/bezier.t27: +8 but -1.
`*const T` and `*mut T` are already Rust and pass through untouched; only the bare
`*T` needs a qualifier, and bare means mutable in the source language.

Measured by name over all 650 corpus specs: rustc accepts 242 -> 252, +10, zero
regressions. The one regression of the naive version was worth more than its eight
gains -- it is what named the second spelling.

A prediction written before measuring said 0-2, reasoning that a raw pointer would
give E0609 in the body instead. Wrong by fivefold: these specs use pointers in the
signatures of stub functions whose bodies are `unimplemented!()`.

Seal and 69 drifted seals move in the same commit; only gen_hash_rust and
sealed_at change.

Closes #3216

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) September 5, 2026 00:41
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 00:42:16 UTC

Summary

Status Count
Total Open PRs 13
PRs with Failing Checks 11
PRs with All Checks Green 2
READY 1
FAILING 11
PENDING 0

Seal Status

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

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 00:53:06 UTC

Summary

Status Count
Total Open PRs 13
PRs with Failing Checks 11
PRs with All Checks Green 2
READY 0
FAILING 11
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=6d3d457606a6 != 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 cfcd102 into master Sep 5, 2026
31 checks passed
@gHashTag
gHashTag deleted the ptr-spellings branch October 26, 2026 06:20
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.

A bare *T does not parse in Rust: the pointer arm param_type_to_c has, and t27_type_to_rust never got

1 participant