Repository navigation
fix(hy-check): resolve named slice aliases in copy element checks (fixes #3585) - #3586
Yumihariii wants to merge 1 commit into
Conversation
f0972e0 to
32c7bff
Compare
|
Rebased onto Full |
32c7bff to
cbcd642
Compare
|
Rebased onto current main (0a40291), clean apply, still ahead=1 with an identical patch-id — diff unchanged (buildable.rs copy-element alias resolution + tests/copy_slice_named_alias_3585.rs). Re-run on the new base, full This is still the only open PR that fixes the named-alias residual (#3585): |
cbcd642 to
e615d4e
Compare
|
Rebased onto Evidence on the rebased tree:
Saw the board put this PR in land-candidates after the 21:29 sync — thanks for keeping it on the radar; behind is 0 again and CI is already running on the new head. |
e615d4e to
fb21598
Compare
|
Head refreshed onto ce01933 ( |
fb21598 to
98715e5
Compare
|
Rebased onto c3c78c0 (main) — new head |
98715e5 to
9c740f4
Compare
|
Rebased onto current main ( Checked whether the wave touched our gap (buildable.rs got +371 lines from #3694/#3718): ran our test file against bare main without the fix → 3 of 6 still fail ( Gates on the merged version (main + our commit), all green:
New head: |
9c740f4 to
2f1e0be
Compare
|
Rebased onto current main
Happy to answer review questions; checks on the new head should appear shortly. |
2f1e0be to
9408f67
Compare
|
Rebased onto current main (c716aeb) to keep this in sync with the session-112 landings — zero conflicts, patch-id 2f1e0be→9408f67 (my commit content conserved) unchanged, so the fix content is byte-identical to what you already saw. behind is back to 0.. Re-validated post-rebase with a forced recompile against the new base: cargo test -p hy-check fully green (lib 183/183 plus every integration suite, zero failures), including the six regression tests in copy_slice_named_alias_3585 (3 accept-path + 3 reject-path). New head: 9408f67. CI on the new head should follow the usual quick/compiler path; nothing here needs re-review, it is purely a freshness rebase. Thanks for the two lands today (#3673/#3675) — checked the wave before rebasing: it touches hy-check freeze/shape and hy-emit lib/stmt only, no overlap with this PR's files. |
9408f67 to
ca5fd36
Compare
|
Rebased onto current main ( Since the two landed PRs this session touched Merge-tree gate on the new head: targeted |
ca5fd36 to
63b327d
Compare
|
Refreshed the branch after sessions 118-119 landed: rebased onto current main ( Re-ran the tests on the new head: One heads-up: |
63b327d to
982e8d9
Compare
|
Branch updated to current main: rebased Verification on the merged tree: FYI the |
982e8d9 to
8fac987
Compare
|
Updated the branch onto fca2f63. Note both newly landed PRs (#3771, #3772) touch the same crate and buildable.rs-adjacent logic, so I did not just take the clean textual rebase for granted — ran everything against the merged tree in an isolated target dir:
Patch replay is byte-identical (9c538404), zero conflicts, and the named-alias gap from #3585 is still open on bare main — none of the landed rules cover those shapes. |
8fac987 to
e713c73
Compare
|
Rebased onto |
|
One note for the verify pass: the red |
e713c73 to
5fd818e
Compare
|
Rebased onto Merged-tree gate, fresh target dir to dodge cache staleness:
Zero regressions. The prior head's quick=FAILURE was the #3945 repo-wide red bleeding in, addressed in the earlier comment; |
5fd818e to
bac96f2
Compare
|
Rebased onto 0c1a9cd. Worth noting: session 141/142 did touch buildable.rs (+31 via the shape-provenance land), so before re-applying I placed the six-test suite alone on bare 0c1a9cd — still 3 failures, all named-slice-alias shapes (int64-from-int32 named, literal other-width, byte-slice-from-string). The gap this PR fixes survives the wave, so it is not superseded. The rebase itself merged cleanly (hunks disjoint) with byte-identical patch-id (9c538404), and the full -p hy-check suite on the merged tree is green: our copy_slice_named_alias_3585 6/6, issue_3085 16/16, the four new wave suites (builtins_closure_local_index_store, handle_share_and_closure_const, interp_shadowed_fmt_3568, tuple_forwarded_and_const_arity) all pass, 0 failures anywhere. |
bac96f2 to
7b850cf
Compare
|
Rebased onto Since Merged-tree gate: full |
7b850cf to
8c6701e
Compare
|
Rebased onto |
limitlessprojects#3585) Landed limitlessprojects#3145 compares exact element spellings resolved from the binding text, which closes the anonymous-slice shapes of the copy() soundness family. Named slice aliases remain uncovered: the (slice, slice) arm collapses both sides to the same coarse OpKind (all integer widths -> Int, all float widths -> Float) so width-mismatched copies between named slices are accepted (go build then fails), and the (slice, string) byte check resolves a named element to an int fallback so the legal copy(namedByteSlice, "s") is rejected with a wrong-type label. copy_slice_elem_scalar adds the missing resolution step: binding text first (unchanged for anonymous spellings), then the alias registry (limitlessprojects#2811's named_slice_element_name) for named slice types, then canonical_numeric_name — byte=uint8 and rune=int32 share one canonical name so genuine aliases stay silent; unresolved elements, user types and aliases-of-aliases fail open per the limitlessprojects#2811/limitlessprojects#2788/limitlessprojects#2796 convention. RED on stock main (d6507a5): 3/6 of the new suite fail (both FN accepts with 0 diagnostics; the FP rejects []byte alias with "element type `int`"). GREEN: new suite 6/6, upstream issue_3085 suite 16/16, issue_2655 suite and hy-check --lib unchanged, cargo test -p hy-check 288 suites 2158 tests 0 fail, workspace check clean. Filed per the DUP CHECK on limitlessprojects#2940: residual named-alias shapes, verbatim repros in limitlessprojects#3585. Supersedes nothing; narrower than limitlessprojects#2940.
8c6701e to
0eab772
Compare
|
Rebased onto current main (94b0e14) per the board's update-branch action; patch-id unchanged (byte-identical replay of the named-slice-alias fix). On the new base: copy_slice_named_alias_3585 6/6, hy-check lib 183/183, 0 failures. The #3988 attribution note applies here too — any compiler-job examples-e2e failure on current main comes from the known examples breakage (#4236), not from this diff. |
Fixes #3585 — the named-slice-alias residual family of the
copy()element-width soundness gap. Following the DUP CHECK on #2940: the four anonymous shapes in that table are genuinely closed by landed #3145 and this PR does not re-litigate them (#2940 will be closed as superseded). What remains, verified empirically againstd6507a52e, is that the check never resolves element spellings through the alias registry, so named slice aliases behave differently from their anonymous spellings.The delta
copy_slice_elem_scalarinbuildable.rs— one resolution step inserted ahead of the existing comparison logic:(slice, slice)arm: element spelling comes from the binding text as today; when the variable's declared type is a named slice alias (type my_int64_slice = []int64), it now resolves throughnamed_slice_element_name(hy-check accepts invalid slice-to-string and string-to-slice conversions (non-byte/rune elements) violating Row 13 BUILDABLE #2811's registry resolver, same precedent that fixed the sibling gap there) beforecanonical_numeric_name.copy(named_int64_slice, named_int32_slice)/copy(named_float64_slice, []float32{…})now reject with the real widths in the label instead of being accepted with 0 diagnostics and dying ingo build.(slice, string)arm: the byte-destination check goes through the same resolution, sotype bs = []byte; copy(bs_dst, "hi")— legal in Go — is no longer rejected with the misleadingelement typeint`` fallback label.copy_named_rune_slice_from_int32_slice_accepted); unresolved elements, user-defined element types and aliases-of-aliases fail open, matching the hy-check accepts invalid slice-to-string and string-to-slice conversions (non-byte/rune elements) violating Row 13 BUILDABLE #2811/hy-check: slice and map literals permit mismatched concrete numeric types (Row 13 BUILDABLE) #2788/Soundness: hy-check accepts append with mismatched concrete numeric types (Row 13 BUILDABLE violation) #2796 convention. No anonymous behavior changes: the binding-text path is untouched when it resolves.Evidence (this tree)
main(d6507a52e): 3/6 of the new suite fail — both false negatives accept withdiagnostics: [], the false positive rejects with the`int`fallback label (exact outputs in hy-check: copy() misses named slice aliases — width mismatches accepted (FN) and legal []byte-alias string copy rejected (FP) #3585).copy_slice_named_alias_3585.rs6/6; upstreamissue_3085_copy_slice_soundness16/16;issue_2655_copy_slice_elem_soundnessandhy-check --libunchanged pass.cargo test -p hy-check→ 288 suites, 2158 tests, 0 failed.cargo check --workspace --all-targetsclean. (Env: rust toolchain pinned to 1.99.0 pertools/env.sh.)Scope check: one checker function + arm rewiring in
buildable.rs(+58/−23), one new test file, nothing else touched.