Skip to content

Conversation

@Nashtare
Copy link
Contributor

builds on top of #141

Part of some more global refactoring around PublicInput logic and Challenges generation.

Attempt at proposing a RecursiveChallenger trait along with a concrete impl through CircuitChallenger to observe values and sample challenges. There remains to actually have hashing constraints (via fixed Poseidon2 or generic).

There are a couple tweaks / cleanups / lighter refactoring that I'd still like to do but decoupling the 3 PRs got a bit messy so I may hold it off for now (dropped some TODOs inline)

Base automatically changed from robin/target_allocator to main October 10, 2025 15:14
@Nashtare Nashtare self-assigned this Oct 11, 2025
@Nashtare Nashtare added this to the Core recursive verifier milestone Oct 11, 2025
@Nashtare Nashtare force-pushed the robin/recursive_challenger branch from bfdde19 to b3b5eae Compare October 11, 2025 19:37
@Nashtare Nashtare moved this from Todo to Ready for review in Plonky3 Recursion Oct 11, 2025
@Nashtare Nashtare requested a review from hratoanina October 13, 2025 13:52
Copy link
Contributor

@hratoanina hratoanina left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!
You don't have to address the code comments, if I need it I'll just change it in the Poseidon sponge table PR.

fn test_hash_absorb_squeeze_sequence() {
let mut circuit = CircuitBuilder::<BabyBear>::new();
circuit.enable_op(
NonPrimitiveOpType::HashAbsorb { reset: true },
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need you would need to potentially separately allow with reset = true and reset = false?

}

/// Flush the absorb buffer, performing the actual hash absorb operation.
fn flush_absorb<F: Field>(&mut self, circuit: &mut CircuitBuilder<F>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm trying to think of a case where you would need to absorb outside of for sampling, or if we can just put the logic directly into sample.

self.buffer_flushed = false;
}

fn sample(&mut self, circuit: &mut CircuitBuilder<F>) -> Target {
Copy link
Contributor

Choose a reason for hiding this comment

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

For easier compatibility with the table, it would be better if add_hash_squeeze were called only with vecs of RATE elements.
It could be done either by maintaining an output vector, or by always returning RATE elements when calling sample. I'd prefer the former.

@github-project-automation github-project-automation bot moved this from Ready for review to Ready to be merged in Plonky3 Recursion Oct 13, 2025
@Nashtare
Copy link
Contributor Author

@hratoanina should I just merge as is then?

@hratoanina
Copy link
Contributor

@Nashtare Yeah, I'm fine with merging it right now.

@Nashtare Nashtare enabled auto-merge (squash) October 13, 2025 16:16
@Nashtare Nashtare merged commit 5ab4ceb into main Oct 13, 2025
8 checks passed
@Nashtare Nashtare deleted the robin/recursive_challenger branch October 13, 2025 16:16
@github-project-automation github-project-automation bot moved this from Ready to be merged to Done in Plonky3 Recursion Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants