-
Notifications
You must be signed in to change notification settings - Fork 234
fix: mismatched Push expectations in decoder syscall_block test #2207
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
fix: mismatched Push expectations in decoder syscall_block test #2207
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original test was passing because the test framework checks the operation, but not which values were pushed. Would you consider enhancing the test framework to validate the actual pushed values?
You could grab the immediate values in the hasher_trace
columns, and create a check_op_decoding_with_imm
which would check values, as well as the operation, and update tests to use it.
corrected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks a bunch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you for finding this!
We can merge as is, but I also left a couple of comments with potential improvements.
processor/src/decoder/tests.rs
Outdated
// | ||
// begin | ||
// fmp <- fmp + 1 | ||
// syscall.bar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a typo here: this should probably be call.bar
- right?
Describe your changes
The syscall_block test expected Push(TWO) in the program’s first SPAN and Push(ONE) in bar’s SPAN, while the constructed MAST nodes use Push(ONE) for the initial +1 FMP update and Push(TWO) for bar’s +2 FMP update. This mismatch caused the test to assert against values that cannot occur given the program structure and FmpUpdate semantics. The change aligns the expected op decoding with the actual program and documented FMP behavior (CALL resets to FMP_MIN, SYSCALL resets to SYSCALL_FMP_MIN, and FmpUpdate adds the pushed value).