-
Notifications
You must be signed in to change notification settings - Fork 91
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
Unit test for LoadWordLeft
#2299
Draft
querolita
wants to merge
13
commits into
master
Choose a base branch
from
zkvm/mips/test-lwl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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
querolita
force-pushed
the
zkvm/mips/unit-tests-random-init
branch
from
June 11, 2024 11:32
2a99ded
to
87ccaa2
Compare
This was referenced Jun 11, 2024
querolita
force-pushed
the
zkvm/mips/test-lwl
branch
from
June 11, 2024 13:57
397db5e
to
160f124
Compare
querolita
changed the base branch from
master
to
zkvm/mips/fixme-register-access-underflow
June 11, 2024 16:54
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 |
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.~