Skip to content

Commit 934fb35

Browse files
authored
Merge branch 'main' into robin/miden/constraint_eval
2 parents 528ab87 + 5dadf46 commit 934fb35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+992
-1439
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Unreleased
22

3+
- Dropped BabyBear support; simplified tests, benchmarks, and dev-utils to Goldilocks-only ([#52](https://github.com/0xMiden/p3-miden/pull/52)).
4+
- Added crate-local `testing` modules to `p3-miden-lmcs` and `p3-miden-lifted-fri` behind a `testing` feature flag ([#52](https://github.com/0xMiden/p3-miden/pull/52)).
5+
- Moved `p3-miden-lifted-examples` from `[[example]]` to `[[bin]]` entries ([#52](https://github.com/0xMiden/p3-miden/pull/52)).
36
- perf: fold constraints on the fly ([#55](https://github.com/0xMiden/p3-miden/pull/55))
47

58
## 0.5.0 (2026-03-10)

Cargo.lock

Lines changed: 4 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ p3-symmetric = { version = "0.5.0", default-features = false }
4444
p3-util = { version = "0.5.0", default-features = false }
4545

4646
# Plonky3 (concrete implementations — dev/test/bench only in core crates)
47-
p3-baby-bear = { version = "0.5.0", default-features = false }
4847
p3-blake3 = { version = "0.5.0", default-features = false }
4948
p3-bn254 = { version = "0.5.0", default-features = false }
5049
p3-fri = { version = "0.5.0", default-features = false }

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ build-avx512: ## Build with avx512 support
9696

9797
.PHONY: bench
9898
bench: ## Run benchmarks
99-
cargo bench
99+
cargo bench --workspace --features testing
100100

101101
# --- installing ----------------------------------------------------------------------------------
102102

p3-miden-dev-utils/Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ homepage.workspace = true
1313
p3-miden-stateful-hasher.workspace = true
1414

1515
# Plonky3
16-
p3-baby-bear.workspace = true
1716
p3-challenger.workspace = true
1817
p3-commit.workspace = true
19-
p3-dft.workspace = true
2018
p3-field.workspace = true
2119
p3-goldilocks.workspace = true
2220
p3-keccak.workspace = true
@@ -27,9 +25,5 @@ p3-symmetric.workspace = true
2725
# Third-party
2826
rand.workspace = true
2927

30-
# Criterion only for std targets (not wasm32)
31-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
32-
criterion.workspace = true
33-
3428
[features]
3529
parallel = []

p3-miden-dev-utils/src/bench.rs

Lines changed: 0 additions & 42 deletions
This file was deleted.

p3-miden-dev-utils/src/configs.rs

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
//! This module contains:
44
//! - `BenchScenario` and `PcsScenario` traits for generic benchmarking
55
//! - Macros for generating config-specific modules
6-
//! - Config implementations (baby_bear_poseidon2, goldilocks_poseidon2, etc.)
6+
//! - Config implementations (goldilocks_poseidon2, goldilocks_keccak)
77
//!
88
//! # Usage
99
//!
1010
//! ## For tests (import specific config module)
1111
//! ```ignore
12-
//! use p3_miden_dev_utils::configs::baby_bear_poseidon2::*;
12+
//! use p3_miden_dev_utils::configs::goldilocks_poseidon2::*;
1313
//!
1414
//! #[test]
1515
//! fn test_example() {
@@ -19,10 +19,10 @@
1919
//!
2020
//! ## For benchmarks (use trait-based dispatch)
2121
//! ```ignore
22-
//! use p3_miden_dev_utils::{BenchScenario, BabyBearPoseidon2};
22+
//! use p3_miden_dev_utils::{BenchScenario, GoldilocksPoseidon2};
2323
//!
2424
//! fn bench<S: BenchScenario>() {
25-
//! let mmcs = S::packed_mmcs();
25+
//! let mmcs = S::mmcs();
2626
//! }
2727
//! ```
2828
@@ -37,7 +37,7 @@ use p3_field::{ExtensionField, Field, TwoAdicField};
3737
/// Trait for benchmark scenarios defining field + hash configuration.
3838
///
3939
/// Each implementor represents a specific combination from the matrix:
40-
/// - Fields: BabyBear, Goldilocks
40+
/// - Fields: Goldilocks
4141
/// - Hashes: Poseidon2, Keccak
4242
///
4343
/// # Example
@@ -46,13 +46,13 @@ use p3_field::{ExtensionField, Field, TwoAdicField};
4646
/// fn bench_generic<S: BenchScenario>(c: &mut Criterion) {
4747
/// for &log_height in LOG_HEIGHTS {
4848
/// let group_name = format!("MyBench/{}/{}", S::FIELD_NAME, S::HASH_NAME);
49-
/// let mmcs = S::packed_mmcs();
49+
/// let mmcs = S::mmcs();
5050
/// // ...
5151
/// }
5252
/// }
5353
/// ```
5454
pub trait BenchScenario {
55-
/// Base field type (e.g., BabyBear, Goldilocks)
55+
/// Base field type (e.g., Goldilocks)
5656
type F: Field + TwoAdicField + Ord;
5757

5858
/// Extension field type
@@ -95,27 +95,14 @@ pub trait PcsScenario: BenchScenario {
9595

9696
/// Helper trait for creating permutations from RNG.
9797
///
98-
/// This is needed because BabyBear and Goldilocks permutations have
98+
/// This is needed because Goldilocks permutations have
9999
/// the same method but it's not defined in a common trait.
100100
pub trait PermFromRng: Sized {
101101
fn new_from_rng_128(rng: &mut SmallRng) -> Self;
102102
}
103103

104104
use rand::rngs::SmallRng;
105105

106-
// BabyBear Poseidon2 implementations (only 16 and 24 are supported)
107-
impl PermFromRng for p3_baby_bear::Poseidon2BabyBear<16> {
108-
fn new_from_rng_128(rng: &mut SmallRng) -> Self {
109-
p3_baby_bear::Poseidon2BabyBear::new_from_rng_128(rng)
110-
}
111-
}
112-
113-
impl PermFromRng for p3_baby_bear::Poseidon2BabyBear<24> {
114-
fn new_from_rng_128(rng: &mut SmallRng) -> Self {
115-
p3_baby_bear::Poseidon2BabyBear::new_from_rng_128(rng)
116-
}
117-
}
118-
119106
// Goldilocks Poseidon2 implementations (8 and 12 are common)
120107
impl PermFromRng for p3_goldilocks::Poseidon2Goldilocks<8> {
121108
fn new_from_rng_128(rng: &mut SmallRng) -> Self {
@@ -350,34 +337,6 @@ macro_rules! impl_keccak_config {
350337
// Config modules
351338
// =============================================================================
352339

353-
/// BabyBear + Keccak configuration.
354-
pub mod baby_bear_keccak {
355-
use p3_baby_bear::BabyBear;
356-
357-
crate::impl_keccak_config!(
358-
scenario: BabyBearKeccak,
359-
field: BabyBear,
360-
ext_degree: 4,
361-
field_name: "babybear"
362-
);
363-
}
364-
365-
/// BabyBear + Poseidon2 configuration.
366-
pub mod baby_bear_poseidon2 {
367-
use p3_baby_bear::{BabyBear, Poseidon2BabyBear};
368-
369-
crate::impl_poseidon2_config!(
370-
scenario: BabyBearPoseidon2,
371-
field: BabyBear,
372-
ext_degree: 4,
373-
perm: Poseidon2BabyBear,
374-
width: 16,
375-
rate: 8,
376-
digest: 8,
377-
field_name: "babybear"
378-
);
379-
}
380-
381340
/// Goldilocks + Keccak configuration.
382341
pub mod goldilocks_keccak {
383342
use p3_goldilocks::Goldilocks;
@@ -407,7 +366,5 @@ pub mod goldilocks_poseidon2 {
407366
}
408367

409368
// Re-export scenario structs at module level
410-
pub use baby_bear_keccak::BabyBearKeccak;
411-
pub use baby_bear_poseidon2::BabyBearPoseidon2;
412369
pub use goldilocks_keccak::GoldilocksKeccak;
413370
pub use goldilocks_poseidon2::GoldilocksPoseidon2;

p3-miden-dev-utils/src/fixtures.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
//! This module contains constants and helper functions that define
44
//! reproducible test/benchmark scenarios.
55
6-
use alloc::{vec, vec::Vec};
7-
8-
use p3_field::PackedValue;
9-
106
// =============================================================================
117
// Seeds
128
// =============================================================================
@@ -38,44 +34,3 @@ pub const RELATIVE_SPECS: &[&[(usize, usize)]] = &[
3834
&[(4, 8), (2, 20), (0, 20)],
3935
&[(0, 16)],
4036
];
41-
42-
// =============================================================================
43-
// Matrix scenarios
44-
// =============================================================================
45-
46-
/// Common matrix group scenarios for testing lifting with varying heights.
47-
///
48-
/// Each scenario is a list of (height, width) pairs, sorted by ascending height.
49-
/// The `rate` parameter controls the RATE-based width scenarios.
50-
///
51-
/// # Parameters
52-
/// - `pack_width`: The SIMD packing width (e.g., `P::WIDTH` for packed field)
53-
/// - `rate`: The sponge rate for width alignment scenarios
54-
pub fn matrix_scenarios<P: PackedValue>(rate: usize) -> Vec<Vec<(usize, usize)>> {
55-
let pack_width = P::WIDTH.max(2);
56-
vec![
57-
// Single matrices
58-
vec![(1, 1)],
59-
vec![(1, rate - 1)],
60-
// Multiple heights (must be ascending)
61-
vec![(2, 3), (4, 5), (8, rate)],
62-
vec![(1, 5), (1, 3), (2, 7), (4, 1), (8, rate + 1)],
63-
// Packing boundary tests
64-
vec![
65-
(pack_width / 2, rate - 1),
66-
(pack_width, rate),
67-
(pack_width * 2, rate + 3),
68-
],
69-
vec![(pack_width, rate + 5), (pack_width * 2, 25)],
70-
vec![
71-
(1, rate * 2),
72-
(pack_width / 2, rate * 2 - 1),
73-
(pack_width, rate * 2),
74-
(pack_width * 2, rate * 3 - 2),
75-
],
76-
// Same-height matrices
77-
vec![(4, rate - 1), (4, rate), (8, rate + 3), (8, rate * 2)],
78-
// Single tall matrix
79-
vec![(pack_width * 2, rate - 1)],
80-
]
81-
}

0 commit comments

Comments
 (0)