Skip to content

fix(rt): closure type metadata decode + setupCalleeClosure3#957

Draft
Stevengre wants to merge 6 commits intocodex/base-pr957-pr955-pr956from
jh/fix-closure-type-call-setup
Draft

fix(rt): closure type metadata decode + setupCalleeClosure3#957
Stevengre wants to merge 6 commits intocodex/base-pr957-pr955-pr956from
jh/fix-closure-type-call-setup

Conversation

@Stevengre
Copy link
Contributor

@Stevengre Stevengre commented Feb 28, 2026

Summary

  • Keeps the red→fix history for iter-eq repro and adds one more fix iteration above the existing chain.
  • Fixes static alloc decoding for fieldless/signed-tag enums in kmir/src/kmir/decoding.py, which unblocks lookupAlloc(allocId(1)) from UnableToDecodePy and removes the #decodeConstant(...RefType...) stuck frontier.
  • After this fix, the repro reaches #EndProgram (no stuck leaf).
  • Adds the EndProgram cleanup commit: removes this repro from show tracking, deletes its show snapshot, and renames the repro file from *-fail.rs to passing form.

Scope

  • kmir/src/kmir/decoding.py
  • kmir/src/tests/integration/test_integration.py
  • kmir/src/tests/integration/data/prove-rs/iter-eq-copied-take-dereftruncate.rs (renamed)
  • kmir/src/tests/integration/data/prove-rs/show/iter-eq-copied-take-dereftruncate-fail.repro.expected (deleted)

Testing

  • REMOTE: uv --project kmir run -- pytest kmir/src/tests/integration/test_integration.py -k iter-eq-copied-take-dereftruncate-fail --update-expected-output
    • Result: FAILED (expected-by-name assertion): proof no longer fails (apr_proof.failed == False) because it reaches EndProgram.
  • REMOTE: uv --project kmir run -- kmir prove-rs kmir/src/tests/integration/data/prove-rs/iter-eq-copied-take-dereftruncate-fail.rs --start-symbol repro --proof-dir .tmp-proofs/iter-eq-status-check
    • Result: PASSED (ProofStatus.PASSED, stuck: 0, terminal: 2).
  • REMOTE: uv --project kmir run -- pytest kmir/src/tests/integration/test_integration.py -k iter-eq-copied-take-dereftruncate
    • Result: PASSED (1 passed, 250 deselected).

automergerpr-permission-manager bot pushed a commit to runtimeverification/stable-mir-json that referenced this pull request Mar 2, 2026
#129)

### Summary
- In `TyCollector::visit_ty` (`src/printer.rs`), after successful
closure instance traversal, record closure `Ty` metadata in `types`.
- Update integration golden files
(`tests/integration/programs/*.smir.json.expected`) to match emitted
closure `FunType` metadata.
- Keep `Makefile` integration path as
`TESTDIR=tests/integration/programs` to keep closure fixture output
paths stable.

### Context
In the closure arm of `TyCollector::visit_ty`, the code resolved and
visited the closure instance but returned without inserting the closure
`Ty` into `types`. Other type families were inserted; closures were the
exception.

This made downstream closure type lookup incomplete (notably for kmir
proof paths that consume exported type metadata). Recording closure `Ty`
closes that gap.

Related split: static/vtable alloc fallback changes were moved out to
[stable-mir-json#131](#131)
so this PR stays focused on closure metadata.

Dependency context: this PR is depended on by
[mir-semantics#957](runtimeverification/mir-semantics#957).
@Stevengre Stevengre force-pushed the jh/fix-closure-type-call-setup branch 2 times, most recently from 085f266 to cf54fdd Compare March 3, 2026 09:59
@Stevengre Stevengre changed the base branch from master to codex/base-pr957-red March 3, 2026 10:00
@Stevengre Stevengre force-pushed the jh/fix-closure-type-call-setup branch from 9ffa29f to 79f90e4 Compare March 4, 2026 03:17
@Stevengre Stevengre changed the base branch from codex/base-pr957-red to codex/base-pr957-pr955-pr956 March 4, 2026 03:18
@Stevengre Stevengre force-pushed the jh/fix-closure-type-call-setup branch from 79f90e4 to 761dbc0 Compare March 4, 2026 04:44
@Stevengre Stevengre force-pushed the jh/fix-closure-type-call-setup branch from 761dbc0 to 1986fca Compare March 4, 2026 05:04
@Stevengre Stevengre self-assigned this Mar 4, 2026
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.

1 participant