-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for witness in programs (#476)
- Loading branch information
Showing
29 changed files
with
1,311 additions
and
800 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use p3_field::AbstractField; | ||
use sp1_core::stark::StarkGenericConfig; | ||
use sp1_core::utils::BabyBearPoseidon2; | ||
use sp1_recursion_compiler::asm::VmBuilder; | ||
use sp1_recursion_core::runtime::Runtime; | ||
|
||
#[test] | ||
fn test_io() { | ||
type SC = BabyBearPoseidon2; | ||
type F = <SC as StarkGenericConfig>::Val; | ||
type EF = <SC as StarkGenericConfig>::Challenge; | ||
let mut builder = VmBuilder::<F, EF>::default(); | ||
|
||
let arr = builder.hint_vars(); | ||
builder.range(0, arr.len()).for_each(|i, builder| { | ||
let el = builder.get(&arr, i); | ||
builder.print_v(el); | ||
}); | ||
|
||
let arr = builder.hint_felts(); | ||
builder.range(0, arr.len()).for_each(|i, builder| { | ||
let el = builder.get(&arr, i); | ||
builder.print_f(el); | ||
}); | ||
|
||
let arr = builder.hint_exts(); | ||
builder.range(0, arr.len()).for_each(|i, builder| { | ||
let el = builder.get(&arr, i); | ||
builder.print_e(el); | ||
}); | ||
|
||
let program = builder.compile(); | ||
|
||
let config = SC::default(); | ||
let mut runtime = Runtime::<F, EF, _>::new(&program, config.perm.clone()); | ||
runtime.witness_stream = vec![ | ||
vec![F::zero().into(), F::zero().into(), F::one().into()], | ||
vec![F::zero().into(), F::zero().into(), F::two().into()], | ||
vec![F::one().into(), F::one().into(), F::two().into()], | ||
]; | ||
runtime.run(); | ||
} |
This file contains 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
Oops, something went wrong.