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

chore: do not differentiate fixed-length vs variable-length in Poseidon2 #7284

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

guipublic
Copy link
Contributor

Description

Problem*

We do not differentiate anymore fixed-length and variable-length poseidon2 hashes.

Summary*

Simply remove the terminator that was added at the end of the input.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Changes to Brillig bytecode sizes

Generated at commit: dabed2c2ef62f6b9b61476a28e1699baa2e561be, compared to commit: 3a42eb5c68f9616f0ebe367c894f0376ba41e0ef

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
no_predicates_numeric_generic_poseidon_inliner_min -31 ✅ -4.84%
fold_numeric_generic_poseidon_inliner_min -31 ✅ -4.84%
fold_2_to_17_inliner_zero -89 ✅ -22.14%

Full diff report 👇
Program Brillig opcodes (+/-) %
regression_5252_inliner_min 3,572 (-16) -0.45%
bench_2_to_17_inliner_min 355 (-15) -4.05%
poseidon2_inliner_min 362 (-16) -4.23%
fold_2_to_17_inliner_min 383 (-19) -4.73%
no_predicates_numeric_generic_poseidon_inliner_min 610 (-31) -4.84%
fold_numeric_generic_poseidon_inliner_min 610 (-31) -4.84%
fold_2_to_17_inliner_zero 313 (-89) -22.14%

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Changes to number of Brillig opcodes executed

Generated at commit: dabed2c2ef62f6b9b61476a28e1699baa2e561be, compared to commit: 3a42eb5c68f9616f0ebe367c894f0376ba41e0ef

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
poseidon2_inliner_min -4 ✅ -0.46%
fold_2_to_17_inliner_zero -170,825 ✅ -12.96%

Full diff report 👇
Program Brillig opcodes (+/-) %
bench_2_to_17_inliner_min 712,412 (-3) -0.00%
fold_2_to_17_inliner_min 1,355,048 (-9) -0.00%
regression_5252_inliner_min 1,032,592 (-7) -0.00%
fold_numeric_generic_poseidon_inliner_min 5,851 (-7) -0.12%
no_predicates_numeric_generic_poseidon_inliner_min 5,851 (-7) -0.12%
poseidon2_inliner_min 869 (-4) -0.46%
fold_2_to_17_inliner_zero 1,146,797 (-170,825) -12.96%

@TomAFrench
Copy link
Member

I think we can hold off from making this change until we have Poseidon2 out in an external library

@guipublic guipublic requested a review from kashbrti February 5, 2025 10:31
@guipublic
Copy link
Contributor Author

I think we can hold off from making this change until we have Poseidon2 out in an external library

I don't see any benefit in holding this off?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 1032e6e Previous: 410c8b0 Ratio
AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob 62 s 50 s 1.24

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@saleel
Copy link
Contributor

saleel commented Feb 5, 2025

@TomAFrench someone in discord was complaining about this issue.
Isn't it better to have this fixed now to not have a discrepancy when its moved to a separate lib anyway?

Copy link

@lucasxia01 lucasxia01 left a comment

Choose a reason for hiding this comment

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

I thought we were keeping a variable length implementation? like with message_size being a witness value

@guipublic
Copy link
Contributor Author

I thought we were keeping a variable length implementation? like with message_size being a witness value

Yes we still do this, it's just the 0/1 at the end that we don't do anymore.

Copy link

@lucasxia01 lucasxia01 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

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.

4 participants