Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: IndexScanPageAir use from_partitioned_slice #97

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
chore: directly use local_page and local_aux
bfan05 committed Jun 27, 2024
commit 56b6ad5cac093fab69a5f802b41e818bad3fef26
9 changes: 2 additions & 7 deletions chips/src/single_page_index_scan/page_index_scan_input/air.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::borrow::Borrow;

use afs_stark_backend::air_builders::PartitionedAirBuilder;
use p3_air::{Air, AirBuilderWithPublicValues, BaseAir};
use p3_field::Field;
@@ -84,9 +82,6 @@ where
let local_page = page_main.row_slice(0);
let local_aux = aux_main.row_slice(0);

let page_slice: &[AB::Var] = (*local_page).borrow();
let aux_slice: &[AB::Var] = (*local_aux).borrow();

// get the idx_limb_bits and decomp, which will be used to generate local_cols
let (idx_limb_bits, decomp) = match &self.variant_air {
PageIndexScanInputAirVariants::Lt(StrictCompAir {
@@ -121,8 +116,8 @@ where
};

let local_cols = PageIndexScanInputCols::<AB::Var>::from_partitioned_slice(
page_slice,
Copy link
Contributor

Choose a reason for hiding this comment

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

tip: you can do

let PageIndexScanInputCols { local_cols, page_cols } = 

aux_slice,
&local_page,
&local_aux,
self.idx_len,
self.data_len,
idx_limb_bits.clone(),