Skip to content

Commit

Permalink
Testing simulates all steps in the serving flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nyunyunyunyu committed Jan 15, 2025
1 parent a7fef1a commit 3d63ce9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/vm/src/arch/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ impl<E: Stateful<Vec<u8>>, P: Stateful<Vec<u8>>> Stateful<VmInventoryState> for
}

fn store_state(&self) -> VmInventoryState {
// TODO: parallelize this.
// TODO: parallelize this. Now some implementations of Executor/Periphery are not Send + Sync.
let executors = self.executors.iter().map(|e| e.store_state()).collect();
let periphery = self.periphery.iter().map(|p| p.store_state()).collect();
VmInventoryState {
Expand Down
11 changes: 8 additions & 3 deletions crates/vm/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,20 @@ fn test_vm_continuations_recover_state() {
.executor
.execute_segments(program.clone(), Streams::default())
.unwrap();
// Simulate remote proving which chip complex state needs to be serialized then deserialized.
let states: Vec<_> = segments
.iter()
.map(|s| s.store_chip_complex_state())
.map(|s| bitcode::serialize(&s.store_chip_complex_state()).unwrap())
.collect();
let proof_inputs_per_seg = states
.into_iter()
.map(|s| {
ExecutionSegment::new_for_proving(&config, program.clone(), s)
.generate_proof_input(None)
ExecutionSegment::new_for_proving(
&config,
program.clone(),
bitcode::deserialize(&s).unwrap(),
)
.generate_proof_input(None)
})
.collect();
let proofs = vm.prove(
Expand Down

0 comments on commit 3d63ce9

Please sign in to comment.