feature(casm): Added blake2s and qm31 encoding tests.#9605
Open
feature(casm): Added blake2s and qm31 encoding tests.#9605
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Feb 4, 2026
6fe509a to
dc85f9f
Compare
5d9d50d to
6753bb1
Compare
SIERRA_UPDATE_NO_CHANGE_TAG=Only new tests.
dc85f9f to
8414255
Compare
6753bb1 to
2bd9465
Compare
ilyalesokhin-starkware
approved these changes
Feb 5, 2026
Contributor
ilyalesokhin-starkware
left a comment
There was a problem hiding this comment.
@ilyalesokhin-starkware reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware).
Contributor
|
add a test case with an immediate Code quote: #[test_case(
Instruction::new(
InstructionBody::QM31AssertEq(AssertEqInstruction {
a: cell_ref!([ap + 2]),
b: res!([fp + -1]),
}),
false,
),
0x1_c00a_7fff_7fff_8002,
None;
"{QM31} [ap + 2] = [fp - 1];"
)] |
This file contains hidden or 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
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.

Summary
Added test cases for encoding Blake2s compression and QM31 assertion instructions. The new tests verify that these instructions are correctly encoded into their binary representation, ensuring proper assembly of complex instructions with various parameters and flags.
Type of change
Please check one:
Why is this change needed?
This PR adds test coverage for encoding specialized instructions (Blake2s compression and QM31 assertions) that were previously untested. These tests ensure that the binary encoding of these instructions matches their expected representation, which is critical for the correctness of the Cairo assembly process.
What is the behavior or documentation after?
The test suite now includes specific test cases that verify the encoding of Blake2s compression instructions (with both finalize=true and finalize=false options) and QM31 assertion instructions (with and without ap++). Each test case validates that the instruction is correctly encoded to its expected binary representation.