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

integrate plonky3 into ceno backend #832

Merged
merged 6 commits into from
Feb 20, 2025
Merged

integrate plonky3 into ceno backend #832

merged 6 commits into from
Feb 20, 2025

Conversation

hero78119
Copy link
Collaborator

@hero78119 hero78119 commented Feb 19, 2025

Related to #806

### Changes highlights
- compiles on base crates except for `mpcs`, `poseidon`. We will remove
crate `poseidon` in the future, as right now only `mpcs` depends on it.
- migrate `transcripts` to `p3::poseidon`. We can upgrade to `poseidon2`
later.
- use `p3::Field` instead of `ff:Field`, and adjust respective api:
`E::from` -> `from_canonical_u64`. `E::from -> from_base`

sumcheck/mle both all unittest passed.
### issues
#806 

### change log 
- [x] introduce `FieldFrom`/`FieldInto` to simulate `From/Into` of
plonky3 field, avoiding invasive modification. We can use
shortcut`3u64.into_f()` to convert a number into field
- [x] clippy & build pass 
- [x] clean up old dependency:
https://github.com/scroll-tech/ceno-Goldilocks &
https://github.com/zkcrypto/ff
@hero78119 hero78119 marked this pull request as draft February 19, 2025 08:46
@hero78119 hero78119 changed the title plonky3 migration integrate plonky3 into ceno backend Feb 19, 2025
### change log
- [x] use p3 high level api
[DuplexChallenger](https://github.com/Plonky3/Plonky3/blob/93e19ff9f6c7c99e3c89dd711ae4e432c686507c/challenger/src/duplex_challenger.rs#L10)
to wrap poseidon2 permutation inside
- [x] refactor & simplify `transcript`, `poseidon-hash` to use new
challenger api
- [x] clean up `MdsMatrixGoldilocks` p3 poseidon logic, introducing by
#805 #811
@hero78119 hero78119 marked this pull request as ready for review February 19, 2025 12:23
@hero78119 hero78119 mentioned this pull request Jan 8, 2025
4 tasks
@hero78119
Copy link
Collaborator Author

test with e2e fibonacci 2^20

fibonacci_max_steps_1048576/prove_fibonacci/fibonacci_max_steps_1048576
                        time:   [3.8828 s 3.9018 s 3.9230 s]
                        change: [-6.2441% -5.6485% -5.0552%] (p = 0.00 < 0.05)
                        Performance has improved.

result for 5% latency reduction

Copy link
Collaborator

@lispc lispc left a comment

Choose a reason for hiding this comment

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

approved since we already reviewed sub prs.

@lispc lispc added this pull request to the merge queue Feb 20, 2025
Merged via the queue into master with commit 22a1df5 Feb 20, 2025
4 checks passed
@lispc lispc deleted the feat/plonky3_migration branch February 20, 2025 08:49
@hero78119 hero78119 mentioned this pull request Mar 5, 2025
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.

2 participants