Skip to content

fix: minor fixes pt. 4#22282

Open
iakovenkos wants to merge 15 commits intomerge-train/barretenbergfrom
si/triage-issues-4
Open

fix: minor fixes pt. 4#22282
iakovenkos wants to merge 15 commits intomerge-train/barretenbergfrom
si/triage-issues-4

Conversation

@iakovenkos
Copy link
Copy Markdown
Contributor

@iakovenkos iakovenkos commented Apr 2, 2026

another batch of claude issues

  • 2208 Merge with shift size 0
  • 2447 ub in Poseidon2 tests
  • 2448 overly restrictive BB_ASSERTs in IPA
  • 2390 expanded comment for eq polys handling
  • 2252 removed unused multi-polynomial evaluate

removed dummy ops from all mega circuits -- allows to bump up the max chonk capacity to 18 circuits (it's really close to 19, ~100 msm rows above 2^15)

}
BB_ASSERT_EQ(
G_zero, data.G_zero_from_prover, "G_0 should be equal to G_0 sent in transcript. IPA verification fails.");
if (G_zero != data.G_zero_from_prover) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't see any reason to panic here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm yeah this does seem funny

claimed_G_zero.assert_equal(computed_G_zero);
BB_ASSERT_EQ(computed_G_zero.get_value(), claimed_G_zero.get_value(), "G_zero doesn't match received G_zero.");
// The circuit constraint enforces correctness; mismatched witnesses will produce an unsatisfiable circuit.
claimed_G_zero.assert_equal(computed_G_zero, "G_zero doesn't match received G_zero.");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same as here - i think this assert was disruptive for circuit construction

ProverEqPolynomial<FF>::construct(accumulator_claim.challenge, bb::numeric::get_msb(circuit_size));
polynomials.eq_instance =
ProverEqPolynomial<FF>::construct(instance_claim.challenge, bb::numeric::get_msb(circuit_size));
// Construct eq polynomials with 2^m coefficients (m = log2(circuit_size)), not 2^VIRTUAL_LOG_N.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's efficient and correct, but the implementation is somewhat convoluted

GTEST_SKIP() << "Native-only test";
return;
}
if constexpr (!IsRecursive) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

checking that an honest prover can prove a merge with shift size 0 - i got puzzled why we have an assert on the verifier side

}

// The domain separation IV depends on the input size, therefore, the hashes must not coincide.
EXPECT_NE(hashes[0], hashes[1]);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oob

@iakovenkos iakovenkos requested a review from ledwards2225 April 2, 2026 17:07
Copy link
Copy Markdown
Contributor

@ledwards2225 ledwards2225 left a comment

Choose a reason for hiding this comment

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

LGTM but want to get @federicobarbacovi to weigh in on the merge assert. Seems potentially valuable to keep if it alerts us to unexpected behavior. On the other hand, if we don't need it anymore, should we remove the dummy ops in apps?

}
BB_ASSERT_EQ(
G_zero, data.G_zero_from_prover, "G_0 should be equal to G_0 sent in transcript. IPA verification fails.");
if (G_zero != data.G_zero_from_prover) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm yeah this does seem funny

// For stdlib: shift_size is FF (we'll get the value later)
const FF shift_size = transcript->template receive_from_prover<FF>("shift_size");
;
if constexpr (IsRecursive) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm guessing that these checks were intended to flag unexpected behavior rather than invalid behavior. It used to be the case that we always added some ops to everything - I thought we got rid of that but then I would think this would've triggered. Maybe @federicobarbacovi can weigh in here?

Copy link
Copy Markdown
Contributor

@federicobarbacovi federicobarbacovi Apr 2, 2026

Choose a reason for hiding this comment

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

If shift size is zero, proving used to fail because Shplonk tries to access the zero coefficient of the polynomials it's proving, see here.

We are not using Shplonk directly in the merge anymore, so I don't know whether proving would still fail with shift size equal to zero.

Re whether we always add something: yes, we do add ecc ops to each builder during finalisation, see here. At the same time, the first merge in Chonk happens against an empty table. The reason why the first merge doesn't trigger this assertion is that the shift size is computed for the left table. As the first merge is in prepend mode, the left table is the table coming from the first app, which is never zero because of the ops we add.


// === Verify with unmodified verifier (which has BB_ASSERT_GT for shift_size > 0) ===
// Disable the assert so we can test the math
BB_DISABLE_ASSERTS();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this disable needed if we remove the assert on shift size 0?

Copy link
Copy Markdown
Contributor

@ledwards2225 ledwards2225 left a comment

Choose a reason for hiding this comment

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

Approving so as to unblock the PR since Federico weighed in. I wonder if we should keep the test demonstrating validity but also keep the ASSERT? One reason we might not want to remove dummy ops from apps even if merge allows it is to avoid commitments that are infinity.

@iakovenkos iakovenkos self-assigned this Apr 3, 2026
@iakovenkos iakovenkos added the ci-full Run all master checks. label Apr 3, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator

AztecBot commented Apr 3, 2026

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/06e1f05d426ab32e�06e1f05d426ab32e8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_offchain_payment.test.ts (59s) (code: 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants