Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirhemo committed Oct 8, 2024
1 parent a16b004 commit a4abe54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Binary file modified crates/prover/allowed_vk_map.bin
Binary file not shown.
13 changes: 8 additions & 5 deletions crates/prover/scripts/build_compress_vks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,26 @@ fn main() {
let range_start = args.start;
let range_end = args.end;

let old_set_file = std::fs::File::open(build_dir.join("allowed_vk_map.bin")).unwrap();
let old_set: BTreeMap<[BabyBear; 8], usize> = bincode::deserialize_from(old_set_file).unwrap();
let old_map_file = std::fs::File::open(build_dir.join("allowed_vk_map.bin")).unwrap();
let old_map: BTreeMap<[BabyBear; 8], usize> = bincode::deserialize_from(old_map_file).unwrap();

println!("old_set: {:?}", old_set.len());
println!("old_set: {:?}", old_map.len());

let shrink_set_file = std::fs::File::open(build_dir.join("shrink/vk_map.bin")).unwrap();
let shrink_set: BTreeMap<[BabyBear; 8], usize> =
bincode::deserialize_from(shrink_set_file).unwrap();

println!("shrink_set: {:?}", shrink_set.len());

let new_set = old_set.into_keys().chain(shrink_set.into_keys()).collect::<BTreeSet<_>>();
let new_set = old_map.into_keys().chain(shrink_set.into_keys()).collect::<BTreeSet<_>>();

println!("new_set: {:?}", new_set.len());

let new_map =
new_set.into_iter().enumerate().map(|(i, vk)| (vk, i)).collect::<BTreeMap<_, _>>();

let mut file = std::fs::File::create(build_dir.join("allowed_vk_map_new.bin")).unwrap();
bincode::serialize_into(&mut file, &new_set).unwrap();
bincode::serialize_into(&mut file, &new_map).unwrap();
// build_vk_map_to_file::<DefaultProverComponents>(
// build_dir,
// reduce_batch_size,
Expand Down

0 comments on commit a4abe54

Please sign in to comment.