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

test: clean up templates and add interop for poseidon2 babybear against plonky3 impl #661

Merged
merged 9 commits into from
Mar 12, 2025

Conversation

gbotrel
Copy link
Collaborator

@gbotrel gbotrel commented Mar 11, 2025

No description provided.

@gbotrel gbotrel requested review from yelhousni and Copilot March 11, 2025 22:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR cleans up template code and updates test parameters while adding interop support for the Poseidon2 babybear implementation against Plonky3. Key changes include:

  • Adding a new interop test (plonky3_interop_test.go) that reads CSV test vectors.
  • Updating permutation parameters and test loops (using range iteration) in babybear, koalabear, and goldilocks test files.
  • Refining generator template logic by introducing a new DiagInternal field and adjusting parameter assignments.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
field/babybear/poseidon2/plonky3_interop_test.go Adds interop test for Poseidon2 babybear with CSV-based test vectors.
field/babybear/poseidon2/poseidon2_test.go Updates permutation parameters, error messages, and loop iterations.
field/goldilocks/poseidon2/poseidon2_test.go Adjusts test parameters and uses range-based loops for improved readability.
field/generator/generator_poseidon2.go Refactors parameter setup using a switch and new Params field.
field/koalabear/poseidon2/poseidon2_test.go Updates test parameters and loop constructions.
field/babybear/poseidon2/hash.go Updates parameter values and refines comments for clarity.
field/goldilocks/poseidon2/hash.go Reworks diag arrays as slices and updates related comments.
field/koalabear/poseidon2/hash.go Updates diag arrays and comments to reflect the new parameter values.
field/generator/asm/amd64/build.go Introduces DiagInternal in the Poseidon2Parameters struct.

gbotrel added 5 commits March 11, 2025 18:09
Copy link
Collaborator

@yelhousni yelhousni 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 to me! it matches plonky3/horizen and code generation is cleaner :)
I ran the sage script from Hoizen and and it output the same constants you have in this PR. So we can also cross check koala bear. Here is the corresponding rust file: https://gist.github.com/yelhousni/4ebb017ed55425357c188be3a11b5a64

@gbotrel gbotrel merged commit 1c4c156 into perf/p2_avx512 Mar 12, 2025
2 checks passed
@gbotrel gbotrel deleted the test/p2_babybear branch March 12, 2025 18:53
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.

None yet

2 participants