Skip to content
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

Fixes output constraints for LOADFP instruction #170

Merged
merged 2 commits into from
May 15, 2024
Merged

Conversation

tess-eract
Copy link
Collaborator

This addresses Issue #132.

Currently, the STARK constraints in the CPUChip for the LOADFP instruction check that the write_value is equal to fp, while the implementation of the LOADFP instruction instead writes fp + b, where b is the second operand.

This PR changes the STARK constraints to set the output to fp + b, and adds some tests to basic/tests/test_prover.rs to check this behavior.

@@ -119,7 +119,7 @@ impl CpuChip {
)
.assert_one(local.read_1_used());
builder
.when(is_jal + is_left_imm_op)
.when(is_jal + is_left_imm_op + is_loadfp + is_imm32)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here and below we add some missing cases to the memory channel constraints, asserting that the read channels are unused for IMM32 and LOADFP and that the write channel is unused for BEQ and BNE.

@tess-eract tess-eract marked this pull request as ready for review May 7, 2024 23:54
@tess-eract tess-eract requested a review from morganthomas May 7, 2024 23:54
@tess-eract tess-eract merged commit 7ce53f9 into main May 15, 2024
2 checks passed
@tess-eract tess-eract deleted the dorebell/issue132 branch May 15, 2024 01:42
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.

2 participants