Repository navigation
fix(t27b): refuse shapes the reference cannot compile (13 -> 0) - #6360
Merged
Merged
Conversation
t27b passed 13 corpus files that t27c test-report blocks. A pre-scan
in lower.rs now refuses each deterministic t27c gen-zig defect with a
named blocker: CSE hoist over a body local, a Zig keyword field left
bare, `[_]T{}` printed as `.{ _ }`, an undeclared struct field type,
a test reassign emitted as a redeclaration (#6358 cause 3), and a
`p.*`-only pointer param rebound as an unmutated var (#6358 cause 4).
pass_where_reference_does_not 13 -> 0, counted 648/720 unchanged,
mismatch 0.
Closes #6359
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6359. Refs #6063; covers causes (3) and (4) of #6358.
t27b now refuses every shape that it passed but the reference path (
t27c test-report: t27c gen-zig, thenzig test) cannot compile. All edits are incli/t27b/src/lower.rs:reference_defectsis a pre-scan called fromlower_mode.optimizecall thatCompiler::compilemakes.Before / after
The corpus was run over
specswith fixed copies of the binaries:Command:
corpus specs --blockers --reference t27c --reference-cacheOf the 15 files whose status changed, 13 went from pass to blocked and 2 from fail to blocked (hir_tb, gen_w368, both redeclarations). The reference BLOCKS all 15.
Every one of the 113 files that gained a new blocker is one the reference BLOCKS. No new blocker landed on a reference-pass file.
(a) The 13 files, with the reference's reason
_csehoisted above it).align = 4unescaped)[_]u8{}printed.{ _ })Namespacestruct...)List<SacredRule>List<...>List<String>UInt32StringStringCommandCategory(?CommandCategory)(b) Named blockers, each confirmed BLOCKED by
t27c test-reportStmtAssign(reference redeclares)w = 9;in a test, aftervar w(#6358 cause 3)FnDecl(reference var param)p.*, reboundvar p = p_arg;(#6358 cause 4)FnDecl(reference CSE hoist)_cse*temp reads a body localExprStructLit(zig keyword field)/ExprFieldAccess(zig keyword field).align = 4,s.alignExprArrayLiteral(reference empty typed)[_]u8{}StructDecl(reference undeclared field type)name: Stringin an unused structThe probes for all of these are in
shapes_the_reference_cannot_compile_are_refusedincli/t27b/tests/source.rs. That test has a near-miss control (a param assigned directly, and mapped field types) which the reference passes and t27b still runs.Causes (3) and (4) do not decide any corpus pass on their own, but they fire in 16 and 8 places, all in files the reference blocks. Examples:
StmtAssign(reference redeclares).FnDecl(reference var param).Three existing source.rs fixtures used the refused shapes, and the reference blocks all three:
[_]u32{}varincr(c: *u32) { c.* += 1; }They were rewritten without losing what they test:
if (true) { .. }block[_]u32{}became a one-element literal (a[5..]already covers the empty slice)incrbecame a local pointer,np.* += 2var u = "lit"becamevar u: strThe structs and strings fixtures now match the reference verdict for verdict.
(c) Causes not pinned to a shape here
These are Sema-level, depend on which code is analysed, or were not reached by this corpus:
(if ..) + 1and-(x - y), and const inlining of typed locals breaking peer types. These are semantic or type errors that show up only where the code is analysed. Neither decides a t27b pass today (pass_where_reference_does_not is 0).a[2..]is printed asa[2], an index rather than a slice. In the slices fixture this is a type error. Where the element type and the slice type happened to coincide it would be a silent change in meaning. Not refused here; a t27c issue should own it.var u = "lit"; u = "other";givesuthe type*const [3:0]u8, so assigning a string of a different length is a Sema error. This depends on analysis, so it is not refused.StmtIf(capture)(existing source.rs test).orelsewas not re-checked in this lane.Not touched
No test is ignored.
This is hand-written t27b logic, so it is debt for the port epic #6198 (AGENTS.md rule).
🤖 Generated with Claude Code