Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
94350e8
feat: target latest commit on 0xMiden/Plonky3 main branch
Leo-Besancon Nov 4, 2025
69626dd
fix: AirBuilder::Var is now Clone, not Copy
Leo-Besancon Nov 4, 2025
4138e94
feat: Update to target AirScriptAir and AirScriptBuilder traits
Leo-Besancon Nov 5, 2025
2b44fbf
refactor: Make AirScriptAir dyn compatible, clean code
Leo-Besancon Nov 6, 2025
cbea42d
feat: handle aux trace
Leo-Besancon Nov 6, 2025
30e4b07
tests: update winterfell E2E test following change
Leo-Besancon Nov 6, 2025
0633eeb
chore: fix tests
Leo-Besancon Nov 6, 2025
1c8c54a
chore(tests): move air-script/tests codegen and helpers into src/test…
Leo-Besancon Nov 12, 2025
de9088a
tests: add codegen script to help update all e2e tests
Leo-Besancon Nov 12, 2025
d81248b
refactor: review comments
Leo-Besancon Nov 12, 2025
1e71f68
chore: fmt + test fixes
Leo-Besancon Nov 12, 2025
e2f86e9
refactor: reverse the roles of alpha and beta, fix permutation_random…
Leo-Besancon Nov 12, 2025
94df522
fix: Use slash for unix path in `scripts/generate_all_e2e_tests.sh`
Leo-Besancon Nov 12, 2025
b4c3cda
fix: Change all the backslash..
Leo-Besancon Nov 12, 2025
d09e0ff
chore: remove unneeded print
Leo-Besancon Nov 13, 2025
5f2f351
tweak: Only use extension field of degree 2 for testing
Soulthym Nov 27, 2025
06cd71e
docs: comment num_beta_challenges
Soulthym Nov 27, 2025
871058c
refactor: rename num_beta_challenges -> max_beta_challenge_power
Soulthym Nov 27, 2025
7f02a2a
docs: comment tweak + added TODOs
Soulthym Nov 27, 2025
1d14475
refactor: avoid leaking extension field degree
Soulthym Nov 27, 2025
bdcd45d
chores: make lint
Soulthym Nov 27, 2025
a2bcabd
Use Plonky3 super trait (#515)
Leo-Besancon Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Fix regressions on MIR and list_comprehensions (#449).
- Add Plonky3 codegen backend (#461).
- Fixed a vector unrolling issue in nested match evaluations (#491).
- In Plonky3 codegen, use AirScriptAir and AirScriptBuilder traits, and generate aux constraints (#508).

## 0.4.0 (2025-06-20)

Expand Down
24 changes: 12 additions & 12 deletions air-script/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ mir = { package = "air-mir", path = "../mir", version = "0.5" }

[dev-dependencies]
expect-test = "1.4"
p3-air = { package = "p3-air", version = "0.3", default-features = false }
p3-challenger = { package = "p3-challenger", version = "0.3", default-features = false }
p3-circle = { package = "p3-circle", version = "0.3", default-features = false }
p3-commit = { package = "p3-commit", version = "0.3", default-features = false }
p3-field = { package = "p3-field", version = "0.3", default-features = false }
p3-fri = { package = "p3-fri", version = "0.3", default-features = false }
p3-matrix = { package = "p3-matrix", version = "0.3", default-features = false }
p3-merkle-tree = { package = "p3-merkle-tree", version = "0.3", default-features = false }
p3-goldilocks = { package = "p3-goldilocks", version = "0.3", default-features = false }
p3-sha256 = { package = "p3-sha256", version = "0.3", default-features = false }
p3-symmetric = { package = "p3-symmetric", version = "0.3", default-features = false }
p3-uni-stark = { package = "p3-uni-stark", version = "0.3.0", default-features = false }
p3-air = { package = "p3-air", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-challenger = { package = "p3-challenger", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-circle = { package = "p3-circle", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-commit = { package = "p3-commit", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-field = { package = "p3-field", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-fri = { package = "p3-fri", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-matrix = { package = "p3-matrix", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-merkle-tree = { package = "p3-merkle-tree", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-goldilocks = { package = "p3-goldilocks", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-sha256 = { package = "p3-sha256", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-symmetric = { package = "p3-symmetric", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
p3-uni-stark = { package = "p3-uni-stark", git="https://github.com/0xMiden/Plonky3", rev = "2e6ff23090b5bd5138695ceb757181443a523c6d", default-features = false }
winter-air = { package = "winter-air", version = "0.12", default-features = false }
winter-math = { package = "winter-math", version = "0.12", default-features = false }
winter-utils = { package = "winter-utils", version = "0.12", default-features = false }
Expand Down
5 changes: 5 additions & 0 deletions air-script/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
pub use air_codegen_winter::CodeGenerator as WinterfellCodeGenerator;
pub use air_ir::{Air, CompileError, compile};
pub use air_parser::{parse, parse_file, transforms};

#[cfg(test)]
pub mod test_utils;
#[cfg(test)]
mod tests;
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ macro_rules! generate_air_winterfell_test {
/// * `test_name` - The identifier for the test function (e.g., `test_binary_air`)
/// * `air_name` - The identifier for the AIR struct (e.g., `BinaryAir`)
#[macro_export]
macro_rules! generate_air_plonky3_test {
macro_rules! generate_air_plonky3_test_with_airscript_traits {
($test_name:ident, $air_name:ident) => {
#[test]
fn $test_name() {
type Val = Goldilocks;
type Challenge = BinomialExtensionField<Val, 3>;
type Challenge = BinomialExtensionField<Val, 5>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: it is probably enough to use just degree 2 here making things lighter, though it shouldn't matter really

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed in 5f2f351


type ByteHash = Sha256;
type FieldHash = SerializingHasher<ByteHash>;
Expand All @@ -67,18 +67,15 @@ macro_rules! generate_air_plonky3_test {
let config = MyConfig::new(pcs, challenger);

let inputs = generate_inputs();
let inputs_goldilocks: Vec<Val> =
inputs.iter().map(|&x| Val::from_u32(x)).collect();
let inputs_goldilocks: Vec<Val> = inputs.iter().map(|&x| Val::from_u32(x)).collect();

let trace = generate_trace_rows::<Val>(inputs);

check_constraints_with_periodic_columns(&$air_name {}, &trace, &inputs_goldilocks);

/*let prove_with_periodic_columns = prove_with_periodic_columns(&config, &BitwiseAir {}, trace, &inputs_goldilocks);
verify_with_periodic_columns(&config, &BitwiseAir {}, &prove_with_periodic_columns, &inputs_goldilocks).expect("Verification failed");*/

/*let proof = prove(&config, &BitwiseAir {}, trace, &inputs_goldilocks);
verify(&config, &BitwiseAir {}, &proof, &inputs_goldilocks).expect("Verification failed");*/
check_constraints_with_airscript_traits::<Goldilocks, Challenge, $air_name>(
&$air_name {},
&trace,
&inputs_goldilocks,
);
}
};
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use std::sync::Arc;

use air_ir::{CodeGenerator, CompileError};
use air_script::compile;
use miden_diagnostics::{
CodeMap, DefaultEmitter, DiagnosticsHandler, term::termcolor::ColorChoice,
};

use crate::compile;

pub enum Target {
Winterfell,
Plonky3,
Expand Down
8 changes: 8 additions & 0 deletions air-script/src/test_utils/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// Macros to generate Air tester structs and tests for both Plonky3 and Winterfell backends.
pub mod air_tester_macros;
/// Code generation for tests/**/*.air files.
pub mod codegen;
/// Plonky3-specific traits, to be moved to 0xMiden/Plonky3 once stabilized.
pub mod plonky3_traits;
/// Winterfell-specific traits
pub mod winterfell_traits;
Loading