Skip to content

Conversation

@jberthold
Copy link
Member

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about removing this expected file, since it's already reached the #EndProgram.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it does not hurt to keep it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to use prove-rs folder even for concrete testing. Because it only has one file to be added and one test to be ran. exec-smir eliminates the smir.json generation process, but have to execute both llvm and haskell backend.

Copy link
Member Author

@jberthold jberthold Nov 7, 2025

Choose a reason for hiding this comment

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

All exec_smir tests EDIT: The exec_smir tests that run without step limit
are also run as proofs to prove termination. I thought it is an advantage to run the test in more than one way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, just think it's a little bit annoying of these file changes (smir.json, .state, test_integration). Additionally, to my experience, the .state only different when there are some issues in the semantics.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with you @Stevengre and I raised it before and @ehildenb and @jberthold convinced my it was safer to have a dump some intermediate state to compare against. It isn't much more overhead to update with the make commands, and it could potentially uncover a bug in our process if we have unexpected diffs in that intermediate state but the proof itself still passes.

@jberthold jberthold marked this pull request as ready for review November 7, 2025 08:46
@jberthold
Copy link
Member Author

When testing this with p-token, I found that the recognition of closures is still not complete.
Will try to make another test program that has the same characteristics as the load_mut function closure.

@jberthold jberthold force-pushed the HOTFIX-pass-singleton-tuples-as-single-elements-to-closures branch from 325ba74 to c6fb79a Compare November 7, 2025 12:18
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.

I looked at this with close account, and I do see more branching so I believe this is working. Is this meant to remove thunks that we were seeing in p-token, if so which ones? Maybe it would be good to add a description (even if brief) before merging so if we look back we can see what this is in relation to before needing to read the code changes.

@jberthold
Copy link
Member Author

I looked at this with close account, and I do see more branching so I believe this is working. Is this meant to remove thunks that we were seeing in p-token, if so which ones? Maybe it would be good to add a description (even if brief) before merging so if we look back we can see what this is in relation to before needing to read the code changes.

Definitely working because the test programs will execute wrongly without the new K code.
What I don't understand is how the information about the calling convention does not get into Stable MIR JSON for the programs. The spread_arg flag should just be set for all closures. I'll check stable-mir-json about this.

Will extend the documenting text and mention that flag before I merge.

@jberthold jberthold merged commit 63cd6a5 into master Nov 10, 2025
7 checks passed
@jberthold jberthold deleted the HOTFIX-pass-singleton-tuples-as-single-elements-to-closures branch November 10, 2025 00:26
Stevengre pushed a commit that referenced this pull request Nov 10, 2025
This PR implements a special calling convention applied to _closures_:
* The first argument is the closure's environment (currently not supported nor are types extracted in stable-mir-json)
* The second argument is a _tuple_ that needs to be unpacked and the individual components stored as locals `_2` to `_N`
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.

4 participants