-
Notifications
You must be signed in to change notification settings - Fork 118
Unit test for LoadWordLeft
#2299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2a99ded
to
87ccaa2
Compare
This was referenced Jun 11, 2024
397db5e
to
160f124
Compare
After applying #2311 to this PR, I will run the nodes again to see if the constraint holds now. |
Base automatically changed from
zkvm/mips/fixme-register-access-underflow
to
master
June 13, 2024 14:27
Demo halts, making the PR a draft until solved |
Closing due to #2729 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides a unit test for the `LoadWordLeft` instruction. It matches closely the Cannon definition of the instruction given by
I used this test to realize that our current implementation of the interpreter for that function was not working properly. In particular, bytes were being mapped to different positions. I changed the interpreter code to avoid the confusing (and error prone) use of
overwrite_n
in favor of a more direct set of variables calledmod_n
. I included comments to help understand what the above function does and what it expects in each byte position of the destination register.Old description
This unit test matches what the interpreter of
LoadWordLeft
is doing. Nonetheless, the constraints still do not pass when trying to make a proof for them. In particular:"Unsatisfied expression: ((((Curr(x[19]) - 0x0100000000000000000000000000000000000000000000000000000000000000) * Curr(x[23])) + Curr(x[22])) - 0x0100000000000000000000000000000000000000000000000000000000000000)"
Still figuring out why. The obvious answer would be dummy rows initialized to zeros so the
-1
will not hold. But we already solved that issue when creating the trace, by padding with a dummy row that is known to be a "real" row.~