Skip to content

Add type-correcting projections on pointer cast and related operations#937

Merged
dkcumming merged 19 commits intomasterfrom
jb/tweak-iterations
Feb 11, 2026
Merged

Add type-correcting projections on pointer cast and related operations#937
dkcumming merged 19 commits intomasterfrom
jb/tweak-iterations

Conversation

@jberthold
Copy link
Member

  • When casting pointers, projections are added which adjust the type of the pointee to the target pointee type.
  • Some of these projections naturally cancel out against other inverse ones. The appendP function is adjusted to do these cancellations.
  • Test expectations are adjusted accordingly. The iterator_simple test is now passing.

@jberthold
Copy link
Member Author

Tested a selection of p-token proofs and short-running SPL proofs, all were passing with these changes.

@jberthold jberthold marked this pull request as ready for review February 11, 2026 04:34
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.

Nice, I think let's give this a try. I imagine we will have to make adjustments for other cases as we find more out but I think this is a great improvement as is

Comment on lines +1118 to +1120
// requires LENGTH +Int PTR_OFFSET <=Int ORIGIN_SIZE // refuse to create an invalid fat pointer
// andBool dynamicSize(1) ==K #metadataSize(lookupTy(_TY)) // expect a slice type
// andBool hasIndexTail(PROJS) ???
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these conditions be present?

@dkcumming dkcumming merged commit 4ed7d9a into master Feb 11, 2026
7 checks passed
@dkcumming dkcumming deleted the jb/tweak-iterations branch February 11, 2026 05:37
automergerpr-permission-manager bot pushed a commit that referenced this pull request Feb 11, 2026
- More `BinOp::Offset` tests #935
- fix: type of offset for applyBinOp(binOpOffset, ...) #936
- Add type-correcting projections on pointer cast and related operations
#937

---------

Co-authored-by: Maria Kotsifakou <kotsifakou.maria@gmail.com>
Co-authored-by: Jost Berthold <jost.berthold@gmail.com>
automergerpr-permission-manager bot pushed a commit to runtimeverification/solana-token that referenced this pull request Feb 11, 2026
- [More BinOp::Offset tests More BinOp::Offset
tests](runtimeverification/mir-semantics#935)
- [fix: type of offset for applyBinOp(binOpOffset, ...) fix: type of
offset for applyBinOp(binOpOffset, ...)](936)
- [Add type-correcting projections on pointer cast and related
operations](runtimeverification/mir-semantics#937)
@dkcumming dkcumming mentioned this pull request Feb 18, 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.

2 participants

Comments