chore: decouple perm arg boundary from shiftability assumptions#22396
Merged
iakovenkos merged 5 commits intomerge-train/barretenbergfrom Apr 8, 2026
Merged
chore: decouple perm arg boundary from shiftability assumptions#22396iakovenkos merged 5 commits intomerge-train/barretenbergfrom
iakovenkos merged 5 commits intomerge-train/barretenbergfrom
Conversation
notnotraju
reviewed
Apr 8, 2026
| EXPECT_FALSE(tampered_permutation_relation_failures.empty()); | ||
| } | ||
|
|
||
| /** |
Contributor
There was a problem hiding this comment.
Once we start masking at the top, I guess we can update this test to include ZK flavor? (I.e., where lagrange_first would be the row at index 4, a.k.a. the 5th row.)
Contributor
Author
There was a problem hiding this comment.
can do it now as well, since I need to update sol anyway
notnotraju
reviewed
Apr 8, 2026
| EXPECT_FALSE(tampered_failures.empty()); | ||
| // Sub-relation 2 (lagrange_first * z_perm = 0) should fail at the lagrange_first row | ||
| ASSERT_TRUE(tampered_failures.contains(2)) << "Expected sub-relation 2 (z_perm init) to fail"; | ||
| ASSERT_EQ(tampered_failures.at(2), first_row) << "Expected failure at lagrange_first row"; |
notnotraju
reviewed
Apr 8, 2026
| EXPECT_FALSE(failures.empty()) << "Set relation should fail after z_perm init corruption"; | ||
| EXPECT_TRUE(failures.contains(ECCVMSetRelationImpl<FF>::Z_PERM_INIT)) | ||
| << "Sub-relation Z_PERM_INIT should catch the corruption"; | ||
| EXPECT_EQ(failures.at(ECCVMSetRelationImpl<FF>::Z_PERM_INIT), first_row) |
notnotraju
reviewed
Apr 8, 2026
| using InitView = typename InitAccumulator::View; | ||
| const auto& lagrange_first_init = InitView(in.lagrange_first); | ||
| const auto& z_perm_init = InitView(in.z_perm); | ||
| std::get<Z_PERM_INIT>(accumulator) += lagrange_first_init * z_perm_init * scaling_factor; |
Contributor
There was a problem hiding this comment.
I'm so happy the subrelations are named rather than numbered :-)
notnotraju
approved these changes
Apr 8, 2026
Contributor
notnotraju
left a comment
There was a problem hiding this comment.
Looks good, thank you for realizing that we need to do this in prep for masking at the top!
notnotraju
reviewed
Apr 8, 2026
| auto& z_perm = prover_instance->polynomials.z_perm; | ||
| auto& z_perm_shift = prover_instance->polynomials.z_perm_shift; | ||
| ASSERT_TRUE(z_perm.is_shiftable()); | ||
| size_t structural_first_row = z_perm.start_index() - 1; |
Contributor
There was a problem hiding this comment.
we could also have a static constexpr flavor variable called structural_first_row, just to further pin it? To me, it seems nice to be so explicit, but I'm not sure.
…rlap in optimized verifier The removal of BATCH_SCALAR_0 shifted the batch scalar region 0x40 too low, causing BATCH_SCALAR_1/2 to collide with POWERS_OF_EVALUATION_CHALLENGE_13/14. This corrupted fold_pos_evaluations which dereferences those power entries after batch scalars have been written.
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.
brittle.