Skip to content

Commit 2eb4afe

Browse files
committed
Merge branch 'main' into morgan/51
2 parents fbbb4eb + 4f6b306 commit 2eb4afe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2193
-1273
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TODO.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- one can "move out" the variable of the eq(.) polynomials out of the sumcheck computation in WHIR (as done in the PIOP)
99
- Structured AIR: often no all the columns use both up/down -> only handle the used ones to speed up the PIOP zerocheck
1010
- use RowMAjorMatrix instead of Vec<Vec> for witness, and avoid any transpositions as suggested by Thomas
11-
- Fill Precompile tables during bytecode execution
1211
- Use Univariate Skip to commit to tables with k.2^n rows (k small)
1312
- avoid field embedding in the initial sumcheck of logup*, when table / values are in base field
1413
- opti logup* GKR:
@@ -104,4 +103,4 @@ fn doesnt_work(x) inline -> 1 {
104103
} // the bug: we do not JUMP here, when inlined
105104
return 1; // will be compiled to `res = 1`; -> invalid (res = 0 and = 1 at the same time)
106105
}
107-
```
106+
```

crates/air/src/prove.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use p3_field::{ExtensionField, Field, cyclic_subgroup_known_order};
55
use p3_util::{log2_ceil_usize, log2_strict_usize};
66
use sumcheck::{MleGroup, MleGroupOwned, MleGroupRef, ProductComputation};
77
use tracing::{info_span, instrument};
8-
use utils::PF;
9-
use utils::{FSProver, add_multilinears, multilinears_linear_combination};
8+
use utils::{FSProver, multilinears_linear_combination};
9+
use utils::{PF, add_multilinears_inplace};
1010
use whir_p3::fiat_shamir::FSChallenger;
1111
use whir_p3::poly::evals::{eval_eq, fold_multilinear, scale_poly};
1212
use whir_p3::poly::{evals::EvaluationsList, multilinear::MultilinearPoint};
@@ -195,8 +195,9 @@ fn open_structured_columns<EF: ExtensionField<PF<EF>> + ExtensionField<IF>, IF:
195195

196196
let batched_column =
197197
multilinears_linear_combination(witness, &poly_eq_batching_scalars[..n_columns]);
198-
let batched_column_mixed = add_multilinears(
199-
&column_up(&batched_column),
198+
let mut batched_column_mixed = column_up(&batched_column);
199+
add_multilinears_inplace(
200+
&mut batched_column_mixed,
200201
&scale_poly(&column_down(&batched_column), alpha),
201202
);
202203
// TODO do not recompute this (we can deduce it from already computed values)
@@ -217,13 +218,9 @@ fn open_structured_columns<EF: ExtensionField<PF<EF>> + ExtensionField<IF>, IF:
217218
// TODO do not recompute this (we can deduce it from already computed values)
218219
let inner_sum = batched_column_mixed.evaluate(&MultilinearPoint(point.clone()));
219220

220-
let inner_mle = MleGroupOwned::Extension(vec![
221-
add_multilinears(
222-
&matrix_up_folded(&point),
223-
&scale_poly(&matrix_down_folded(&point), alpha),
224-
),
225-
batched_column,
226-
]);
221+
let mut mat_up = matrix_up_folded(&point);
222+
add_multilinears_inplace(&mut mat_up, &scale_poly(&matrix_down_folded(&point), alpha));
223+
let inner_mle = MleGroupOwned::Extension(vec![mat_up, batched_column]);
227224

228225
let (inner_challenges, _, _) = sumcheck::prove::<EF, _, _, _>(
229226
1,

crates/lean_compiler/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn compile_program(program: &str) -> (Bytecode, BTreeMap<usize, String>) {
3030
for (loc, name) in function_locations.iter() {
3131
println!("{name}: {loc}");
3232
}
33-
println!("\n\nCompiled Program:\n\n{}", compiled.to_string());
33+
println!("\n\nCompiled Program:\n\n{compiled}");
3434
(compiled, function_locations)
3535
}
3636

crates/lean_prover/src/prove_execution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn prove_execution(
4646
poseidons_16, // padded with empty poseidons
4747
poseidons_24, // padded with empty poseidons
4848
dot_products,
49-
vm_multilinear_evals,
49+
multilinear_evals: vm_multilinear_evals,
5050
public_memory_size,
5151
non_zero_memory_size,
5252
memory, // padded with zeros to next power of two
@@ -59,7 +59,7 @@ pub fn prove_execution(
5959
function_locations,
6060
vm_profiler,
6161
);
62-
get_execution_trace(bytecode, &execution_result)
62+
get_execution_trace(bytecode, execution_result)
6363
});
6464

6565
let public_memory = &memory[..public_memory_size];

crates/lean_prover/vm_air/src/dot_product_air.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::borrow::Borrow;
22

3-
use lean_vm::{DIMENSION, EF};
3+
use lean_vm::{DIMENSION, EF, WitnessDotProduct};
44
use p3_air::{Air, AirBuilder, BaseAir};
55
use p3_field::PrimeCharacteristicRing;
66
use p3_matrix::Matrix;
7-
use witness_generation::WitnessDotProduct;
87

98
/*
109
(DIMENSION = 5)

0 commit comments

Comments
 (0)