arithmetic: support modern and legacy dependency modes - #747
Merged
Conversation
ebfull
commented
Jun 1, 2026
Re-export ff, group, pasta_curves, and rand from ragu_arithmetic behind
the mutually-exclusive `modern-deps` and `legacy-deps` Cargo features, and
route all downstream crates through ragu_arithmetic::{ff,group,pasta_curves,rand}
instead of depending on those crates directly. This lets the workspace build
against either the modern (ff/group 0.14-pre, pasta_curves git, rand 0.10) or
legacy (ff/group 0.13, pasta_curves 0.5.1, rand 0.8) dependency sets.
Add a DeferredField trait that delegates to pasta_curves deferred reduction in
modern mode and falls back to eager accumulation in legacy mode, and a
CryptoRngCore trait abstracting the rng bound across both modes. The derive
macros now resolve a RaguArithmeticPath and emit ragu_arithmetic::ff::Field.
CI gains a legacy-check job (library-only, since tests use rand-0.10 APIs).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ebfull
force-pushed
the
dual-dependency-modes
branch
from
June 1, 2026 18:39
787d274 to
44c2fd4
Compare
TalDerei
self-requested a review
June 1, 2026 18:46
TalDerei
approved these changes
Jun 1, 2026
TalDerei
left a comment
Collaborator
There was a problem hiding this comment.
left some observations, nothing strictly blocking.
Comment on lines
+85
to
+101
| legacy-check: | ||
| name: legacy dependency check | ||
| needs: changes | ||
| if: needs.changes.outputs.rust == 'true' || github.event_name == 'push' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Setup Rust | ||
| uses: ./.github/actions/rust-setup | ||
| with: | ||
| cache-suffix: legacy-deps | ||
| - name: Check runtime crates with legacy dependencies | ||
| run: cargo check -p ragu_arithmetic -p ragu_pasta -p ragu_core -p ragu_primitives -p ragu_circuits -p ragu_pcd --lib --locked --no-default-features --features "alloc legacy-deps" | ||
| - name: Check root crate with legacy dependencies | ||
| run: cargo check -p ragu --lib --locked --no-default-features --features legacy-deps |
Collaborator
There was a problem hiding this comment.
I know the legacy feature flag is a temporary shim, but there's a CI gap here where it basically only does cargo check --lib and doesn't run test coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
modern-depsfeature to access the modern stacklegacy-depsfeature to access the legacy stack (old rand/ff/group/pasta/etc.)legacy-depswill be deleted eventually