Skip to content

Commit

Permalink
Refactor FriReducedOpeningChip
Browse files Browse the repository at this point in the history
  • Loading branch information
nyunyunyunyu committed Jan 22, 2025
1 parent 5f374a6 commit 6258838
Show file tree
Hide file tree
Showing 15 changed files with 584 additions and 423 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions crates/vm/src/arch/testing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ impl VmChipTestBuilder<BabyBear> {
let tester = tester.load(self.execution);
tester.load(self.program)
}
pub fn build_babybear_poseidon2(self) -> VmChipTester<BabyBearPoseidon2Config> {
self.memory
.controller
.borrow_mut()
.finalize(None::<&mut Poseidon2PeripheryChip<BabyBear>>);
let tester = VmChipTester {
memory: Some(self.memory),
..Default::default()
};
let tester = tester.load(self.execution);
tester.load(self.program)
}
}

impl<F: PrimeField32> Default for VmChipTestBuilder<F> {
Expand Down
8 changes: 7 additions & 1 deletion crates/vm/src/utils/stark_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ where
VC::Periphery: Chip<BabyBearPoseidon2Config>,
{
setup_tracing();
let engine = BabyBearPoseidon2Engine::new(FriParameters::standard_fast());
let mut log_blowup = 1;
while config.system().max_constraint_degree > (1 << log_blowup) + 1 {
log_blowup += 1;
}
let engine = BabyBearPoseidon2Engine::new(
FriParameters::standard_with_100_bits_conjectured_security(log_blowup),
);
let vm = VirtualMachine::new(engine, config);
let pk = vm.keygen();
let mut result = vm.execute_and_generate(exe, input).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ fn test_vm_initial_memory() {
fn test_vm_1_persistent() {
let engine = BabyBearPoseidon2Engine::new(FriParameters::standard_fast());
let config = NativeConfig {
system: SystemConfig::new(3, MemoryConfig::new(1, 1, 16, 10, 6, 64, 1024), 0),
system: SystemConfig::new(5, MemoryConfig::new(1, 1, 16, 10, 6, 64, 1024), 0),
native: Default::default(),
}
.with_continuations();
Expand Down
1 change: 1 addition & 0 deletions extensions/native/circuit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ eyre.workspace = true
serde.workspace = true
serde-big-array.workspace = true
bitcode.workspace = true
static_assertions.workspace = true

[dev-dependencies]
openvm-stark-sdk = { workspace = true }
Expand Down
Loading

0 comments on commit 6258838

Please sign in to comment.