Skip to content

fix(hy-check): propagate non-owned origin, const roots, and A3 loans on field/index assign (#92) - #93

Closed
yodakkak wants to merge 1 commit into
limitlessprojects:mainfrom
yodakkak:fix/may-share-field-assign-literal-bridge
Closed

yodakkak wants to merge 1 commit into
limitlessprojects:mainfrom
yodakkak:fix/may-share-field-assign-literal-bridge

Conversation

@yodakkak

@yodakkak yodakkak commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rebased onto main (c5126b0) after #181 and #183 landed and re-scoped to the remaining live soundness gaps in
ebind_assign_targets when assigning into field or index places (PlaceKind::Field / PlaceKind::Index, e.g. h.m = ..., xs[0] = ...,
, h.m = ..., p, h.m = ...):

  1. O5.1 / HYB-E3004 (
    on_owned_origin laundering via field/index move or parallel rebind):
    • In
      ebind_assign_targets, the else branches for non-Ident targets (h.m = move p, xs[0] = move p, p, h.m = fresh, p, and multi-value unpack
      , h.m = pair(move p)) previously only called
      ecord_may_share /
      ecord_multi_value_may_share.
    • Because collect_ref_roots skips Expr::Move (and in p, h.m = fresh, p, target 0 clears p.non_owned_origin before target 1 links h <-> p),
      oot (h or xs) kept
      on_owned_origin: None, allowing ask worker(move h) / ask worker(move xs) to be falsely accepted (Verdict::Accept) instead of rejecting with HYB-E3004.
  2. T22 / HYB-E3006 (const deep-immutability bypass via field/index move):
    • Unlike the PlaceKind::Ident arms, the else branches (PlaceKind::Field / PlaceKind::Index) in single/parallel and multi-value unpack assignments did not call
      ecord_move_const_and_a3_loans(st, root, ...). Moving a const composite into a field or index (h.m = move shared_k or
      , h.m = pair(move shared_k)) failed to link
      oot to shared_k, falsely accepting subsequent h.m["k"] = 99 or delete(h.m, "k") instead of rejecting with HYB-E3006.
  3. O8 / A3 / HYB-E3102 (map-slot loan bypass via field/index move):
    • Moving a map with a live &m["k"] slot loan into a field or index (h.m = move m) inside the loan's live window failed to inherit the LoanTarget::MapSlot onto
      oot, falsely accepting h.m["other"] = ... before the slot pointer's last use instead of rejecting with HYB-E3102.

Verification

  • cargo test -p hy-check (all unit, corpus, and integration test suites pass; added ield_and_index_assign_propagate_move_non_owned_const_and_a3_loans covering all 6 reproducers).

@limitlessprojects

Copy link
Copy Markdown
Owner

Triage (2026-10-15, AI maintainer): field-assign + literal-bridge may-share (#92) overlaps the landed pr-162 collector (literals holding live bindings are now walked) — your field-ASSIGN half is likely still live. Queued for hole-by-hole verification then a rebase. No action needed from you.

@limitlessprojects

Copy link
Copy Markdown
Owner

Triage (2026-10-15, AI maintainer, post-CI-repair): unchanged: field-assign + literal-bridge may-share (issue #92) queued for hole-by-hole verification vs pr-162's collector; note pr-220 also attacks #92 — the three-way verification lands whatever remains live.

@yodakkak

Copy link
Copy Markdown
Contributor Author

Rebased cleanly onto current main (44a08b9) with 0 conflicts (cargo test -p hy-check 217/217 passing). Adapted to pr-162's collect_ref_roots collector; the live holes covered on 44a08b9 are:

  1. Field/index store sharing (h.m = m, xs[0] = m, mm["a"] = m, and multi-value unpack into field/index places) in process_assign.
  2. Transitive share_clear (clique closure on vertex elimination so rebinding h2 in h1 <-> h2 <-> h3 preserves h1 <-> h3).
  3. scope_pop preservation of outer may_share edges and freeze propagation across the restored may_share component after an inner shadow dies.

@limitlessprojects

Copy link
Copy Markdown
Owner

Wave-2 triage: queued — next tier (carried from wave 1). Fixes #92 (field/index store sharing, composite literal projections, transitive may-share).

@yodakkak
yodakkak force-pushed the fix/may-share-field-assign-literal-bridge branch from e316768 to 226672a Compare October 17, 2026 07:35
@yodakkak
yodakkak force-pushed the fix/may-share-field-assign-literal-bridge branch 4 times, most recently from 36797d8 to 483c3d5 Compare October 18, 2026 06:29
@yodakkak yodakkak changed the title fix(hy-check): track field/index store sharing, composite literal projections, and transitive share_clear (#92) fix(hy-check): propagate non-owned origin, const roots, and A3 loans on field/index assign (#92) Oct 18, 2026
@yodakkak

Copy link
Copy Markdown
Contributor Author

Verified against main (c5126b0) after #92 was closed (#181 / #183 covered simple identifier field stores h.m = p and inner-block shadowing):

  • Rebased fix(hy-check): propagate non-owned origin, const roots, and A3 loans on field/index assign (#92) #93 onto c5126b0 and narrowed it strictly to the two else (PlaceKind::Field / PlaceKind::Index) arms of
    ebind_assign_targets in compiler/crates/hy-check/src/loans.rs that remained live on main:
    1. h.m = move p / xs[0] = move p / p, h.m = fresh, p /
      , h.m = pair(move p) laundering non-owned origin past HYB-E3004 (O5.1)
    2. h.m = move shared_k /
      , h.m = pair(move shared_k) bypassing const write protection HYB-E3006 (T22)
    3. h.m = move m during a live &m["k"] slot loan bypassing HYB-E3102 (O8 / A3)
  • Added regression test ield_and_index_assign_propagate_move_non_owned_const_and_a3_loans in compiler/crates/hy-check/src/lib.rs.

@github-actions

Copy link
Copy Markdown
Contributor

Shepherd (Phase A — propose only): this PR's changed-file set overlaps >=0.6 Jaccard with #613, which carries the larger take. Proposing close as superseded.

This is a proposal, not a close — nothing auto-closes while this comment is fresh. If this PR has unique content (a different rule, extra tests, a different fix), say so or push, and the label comes off. Cluster signal is a file-set heuristic; the verdict stays human.

@yodakkak

Copy link
Copy Markdown
Contributor Author

This PR has unique content and is not a duplicate of #613 (#612). It fixes the remaining live holes of #92 in the PlaceKind::Field / PlaceKind::Index arms of
ebind_assign_targets (h.m = move p non-owned origin laundering past HYB-E3004, h.m = move shared_k const write bypass past HYB-E3006, and h.m = move m during a live &m[k] slot loan bypassing HYB-E3102), which is orthogonal to #613.

@yodakkak
yodakkak force-pushed the fix/may-share-field-assign-literal-bridge branch from 0dc052e to f96945c Compare October 20, 2026 06:23
@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Oct 20, 2026
@yodakkak
yodakkak force-pushed the fix/may-share-field-assign-literal-bridge branch from 732b60a to 5e9b99b Compare October 21, 2026 10:12
@github-actions github-actions Bot added the bot:conflict Shepherd: merge conflicts vs main label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Shepherd W2 could not update this branch automatically (behind main by 59). Labeled bot:conflict — if the conflicts are docs-only (PLAN.md/STATUS.md) W5 resolves them deterministically; otherwise this needs a human.

PUT /repos/limitlessprojects/Go-Hybrid/pulls/93/update-branch -> 403 {"message":"refusing to allow a GitHub App to create or update workflow `.github/workflows/author-stage.yml` without `workflows` permission","documentation_url":"https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch","status":"403"}

@limitlessprojects

Copy link
Copy Markdown
Owner

Queue-reset sweep: this repo now runs a rolling conveyor, and open PRs
outside the active review window are being closed as not planned to keep the
queue honest — a stale queue wastes every contributor's time, including yours.

This is not a verdict on the work. If this change still matters:

  1. rebase against current main (main has landed a lot since this PR opened),
  2. confirm the diff still applies and the affected verdicts still hold,
  3. reopen — the triage board picks reopened PRs up as fresh arrivals.

Wildcard holds (verdict window 2026-11-01) and Pareto land candidates are
unaffected. Thanks for the effort — high-volume repos only stay reviewable
with a queue that actually drains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:conflict Shepherd: merge conflicts vs main bot:dup-of:#613 Shepherd W4: superseded by cluster survivor bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) bot:stale-base Shepherd: behind main beyond threshold triage:behind Base is far behind main - rebase before review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants