Skip to content

fix(rt): handle fun-type closure env refs in callee setup#956

Merged
Stevengre merged 2 commits intomasterfrom
jh/fix-thunk-projection
Mar 4, 2026
Merged

fix(rt): handle fun-type closure env refs in callee setup#956
Stevengre merged 2 commits intomasterfrom
jh/fix-thunk-projection

Conversation

@Stevengre
Copy link
Contributor

@Stevengre Stevengre commented Feb 28, 2026

  • Extend closure callee setup (setupCalleeClosure2) to accept closure-env references whose pointee resolves to typeInfoFunType (in addition to typeInfoVoidType).
  • Add isFunType(TypeInfo) helper predicate used by that guard.
  • In the fix commit, refresh closure_access_struct-fail.main.expected to show the behavior change from stuck frontier to terminal #EndProgram.
  • Cleanup after fix:
    • rename closure_access_struct-fail.rs -> closure_access_struct.rs
    • remove show/closure_access_struct-fail.main.expected
    • remove this case from PROVE_RS_SHOW_SPECS

@Stevengre Stevengre force-pushed the jh/fix-thunk-projection branch from 7aa75b3 to 05745a8 Compare March 3, 2026 10:28
@Stevengre Stevengre changed the title fix(rt): resolve thunk(operandCopy) in projection traversal fix(rt): recognize closure env refs in tuple-arg setup Mar 3, 2026
@Stevengre Stevengre force-pushed the jh/fix-thunk-projection branch 2 times, most recently from 261d9c9 to 1ffcb53 Compare March 4, 2026 02:47
@Stevengre Stevengre force-pushed the jh/fix-thunk-projection branch from 1ffcb53 to b46a5fe Compare March 4, 2026 03:09
@Stevengre Stevengre changed the title fix(rt): recognize closure env refs in tuple-arg setup fix(rt): handle fun-type closure env refs in callee setup Mar 4, 2026
@Stevengre Stevengre self-assigned this Mar 4, 2026
@Stevengre Stevengre marked this pull request as ready for review March 4, 2026 03:43
Copy link
Collaborator

@dkcumming dkcumming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand I think this is sound. I was wondering if it is possible for a non-closure function to has a 2 arity tuple as it's second arg and that mean that a function incorrectly matches a closure. But from what I see I think this case is not possible, but I wanted to bring it up as I approve in case we learn things down the line

@Stevengre Stevengre merged commit 697e68a into master Mar 4, 2026
13 of 14 checks passed
@Stevengre Stevengre deleted the jh/fix-thunk-projection branch March 4, 2026 07:18
automergerpr-permission-manager bot pushed a commit that referenced this pull request Mar 4, 2026
#956 added handles `FunType` for closures instead of `VoidType` for that
come from [stable mir json
129](runtimeverification/stable-mir-json#129)
for `setupCalleeClosure2`. This PR adds the same thing to
`setupCalleeClosure`. (Fixes regressed proofs for P-Token)

- Added explicit `FnOnce` test `closure_fnonce_tuple_arg.rs`
- Fixed `and_then_closure.rs`
@dkcumming dkcumming mentioned this pull request Mar 4, 2026
mariaKt added a commit that referenced this pull request Mar 4, 2026
- fix(rt): handle fun-type closure env refs in callee setup
[956](#956)
- fix(decode): accept signed enum tag scalars in _extract_tag
[954](#954)
- Added check for `FunType` in `setupCalleeClosure
[969](#969)
dkcumming added a commit to runtimeverification/solana-token that referenced this pull request Mar 10, 2026
- fix(rt): handle fun-type closure env refs in callee setup
[956](runtimeverification/mir-semantics#956)
- fix(decode): accept signed enum tag scalars in _extract_tag
[954](runtimeverification/mir-semantics#954)
- Added check for FunType in setupCalleeClosure
[969](runtimeverification/mir-semantics#969)
- Merge in latest master
[973](runtimeverification/mir-semantics#973)
- fix(kompile): map linked NormalSym functions to monoItemFn(noBody)
[953](runtimeverification/mir-semantics#953)
- fix(rt): generalize direct-tag enum decoding to any variant count and
discriminant
[955](runtimeverification/mir-semantics#955)
- fix(spl-token): encode multisig signers as pubkey aggregates
[958](runtimeverification/mir-semantics#958)
- fix(rt): closure aggregate + #setTupleArgs fallback
[952](runtimeverification/mir-semantics#952)
- fix(rt): bug fix for castKindPtrToPtr
[974](runtimeverification/mir-semantics#974)
- fix(rt): repair closure callee setup for iter-eq repro
[957](runtimeverification/mir-semantics#957)
- Change the number of signers from 11 to 3
[982](runtimeverification/mir-semantics#982)
- Merging latest master into feature/p-token
[981](runtimeverification/mir-semantics#981)
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.

2 participants