Skip to content

Conversation

@iakovenkos
Copy link
Contributor

@iakovenkos iakovenkos commented Aug 12, 2025

@iakovenkos iakovenkos self-assigned this Aug 12, 2025
@netlify
Copy link

netlify bot commented Aug 13, 2025

Deploy Preview for aztec-docs-temp-you-can-delete ready!

Name Link
🔨 Latest commit ce573fb
🔍 Latest deploy log https://app.netlify.com/projects/aztec-docs-temp-you-can-delete/deploys/689c62e90843a200086c29d7
😎 Deploy Preview https://deploy-preview-16318--aztec-docs-temp-you-can-delete.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Aug 14, 2025

Deploy Preview for barretenberg ready!

Name Link
🔨 Latest commit 6970a75
🔍 Latest deploy log https://app.netlify.com/projects/barretenberg/deploys/689e1a2679213f00084360cf
😎 Deploy Preview https://deploy-preview-16318--barretenberg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@iakovenkos iakovenkos changed the base branch from next to merge-train/barretenberg August 14, 2025 17:19
@iakovenkos iakovenkos marked this pull request as ready for review August 14, 2025 17:19
std::span<const Fr> multilinear_challenge,
const Polynomial& A_0);
const Polynomial& A_0,
const bool& has_zk = false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See the explanation below

template <typename Curve>
std::vector<typename GeminiProver_<Curve>::Polynomial> GeminiProver_<Curve>::compute_fold_polynomials(
const size_t log_n, std::span<const Fr> multilinear_challenge, const Polynomial& A_0)
const size_t log_n, std::span<const Fr> multilinear_challenge, const Polynomial& A_0, const bool& has_zk)
Copy link
Contributor Author

@iakovenkos iakovenkos Aug 14, 2025

Choose a reason for hiding this comment

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

the main Gemini changes are here:
the prover computes the folds for the first log_n rounds as before, and either scales the final constant fold during the virtual rounds or places zero polys to the claims. The reason for the latter is that UltraZKVerifiers would still need the log_circuit_size to evaluate the RowDisablingPolynomial in the very end of sumcheck.
Note MegaZKRecrursive verifier can always run for 20 rounds, cause it's used in a single place.

@ledwards2225 ledwards2225 added the ci-full Run all master checks. label Aug 15, 2025

// Execute Sumcheck Verifier
const size_t log_circuit_size = numeric::get_msb(circuit_size);
// const size_t log_circuit_size = numeric::get_msb(circuit_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

Beware that we were in the process of making the AVM circuit size non const: #16332

Copy link
Contributor Author

@iakovenkos iakovenkos Aug 18, 2025

Choose a reason for hiding this comment

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

Thanks @fcarreiro! Now the verifier does not need to know the size of the circuit, just an upper bound, which in your case will be given by MAX_AVM_TRACE_LOG_SIZE. The main change is that in "virtual" rounds the prover is sending valid univariates in Sumchecck and valid commitments/evals in the PCS. The overhead is
num virtual rounds * MAX_RELATION_PARTIAL_LENGTH * num of ops to evaluate the entire relation at a given point.
So the Prover's work stays O(max_poly_size).

Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC if we used MAX_AVM_TRACE_LOG_SIZE then the proof size would still be the correct unpadded one?

Copy link
Contributor Author

@iakovenkos iakovenkos Aug 18, 2025

Choose a reason for hiding this comment

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

Looked at Lucas' PR - I think the avm prover must still use the actual polynomial size when initializing Sumcheck and doing Gemini, cause it saves work and memory + doesn't affect the VK

@Maddiaa0 Maddiaa0 requested a review from charlielye as a code owner August 18, 2025 15:13

return Utils::scale_and_batch_elements(relation_evaluations, alphas);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🎉

std::shared_ptr<Goblin::Transcript> transcript = std::make_shared<Goblin::Transcript>();
// Construct Mega proof \pi_M of the AVM recursive verifier circuit
auto mega_proving_key = std::make_shared<DeciderProvingKey_<MegaFlavor>>(mega_builder);
// Detect when MEGA_AVM_LOG_N needs to be bumped.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems useful to keep track of this. Currently it's 21.

Copy link
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.

Good stuff. Let's get this in

const Fr u_last = multilinear_challenge[log_n - 1];
const Fr final_eval = last.at(0) + u_last * (last.at(1) - last.at(0));
Polynomial const_fold(1);
// Temporary fix: when we're running a zk proof, the verifier uses a `padding_indicator_array`. So the evals in
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you see a path to improving this? Worth an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think I know how to remove it

@iakovenkos iakovenkos merged commit 5ee5a1f into merge-train/barretenberg Aug 19, 2025
6 checks passed
@iakovenkos iakovenkos deleted the si/genuine-sumcheck-padding branch August 19, 2025 22:20
github-merge-queue bot pushed a commit that referenced this pull request Aug 21, 2025
BEGIN_COMMIT_OVERRIDE
chore: Clean up public input propagation in `acir_format` (#16411)
feat: merge via append ecc ops in hiding kernel (#16338)
chore: install clang20, upgrade wasi-sdk to 27 (#16414)
chore: make clang20 default and clean up presets (#16306)
chore: stdlib sha256 without packed_byte_array  (#15912)
fix: Revert "chore: stdlib sha256 without packed_byte_array  (#15912)"
fix: Correct active range for databus (#16381)
fix: Revert "fix: Correct active range for databus (#16381)"
feat: fixed size decider without padding (#16318)
Revert "chore: make clang20 default and clean up presets (#16306)"
Revert "chore: install clang20, upgrade wasi-sdk to 27 (#16414)"
chore: document the ECCVM builders. (#15913)
END_COMMIT_OVERRIDE
critesjosh pushed a commit that referenced this pull request Aug 22, 2025
Closes AztecProtocol/barretenberg#1158
Closes AztecProtocol/barretenberg#1310
Closes AztecProtocol/barretenberg#1283

---------

Co-authored-by: ledwards2225 <l.edwards.d@gmail.com>
Co-authored-by: Maddiaa <47148561+Maddiaa0@users.noreply.github.com>
mralj pushed a commit that referenced this pull request Oct 13, 2025
Closes AztecProtocol/barretenberg#1158
Closes AztecProtocol/barretenberg#1310
Closes AztecProtocol/barretenberg#1283

---------

Co-authored-by: ledwards2225 <l.edwards.d@gmail.com>
Co-authored-by: Maddiaa <47148561+Maddiaa0@users.noreply.github.com>
ludamad pushed a commit that referenced this pull request Dec 16, 2025
Closes AztecProtocol/barretenberg#1158
Closes AztecProtocol/barretenberg#1310
Closes AztecProtocol/barretenberg#1283

---------

Co-authored-by: ledwards2225 <l.edwards.d@gmail.com>
Co-authored-by: Maddiaa <47148561+Maddiaa0@users.noreply.github.com>
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.

5 participants