Skip to content

Commit fe45e75

Browse files
authored
Fix typos and improve comments in TODO and Rust source files for clarity and consistency. (#77)
1 parent da25e7c commit fe45e75

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- Lev's trick to skip some low-level modular reduction
2020
- Sumcheck, case z = 0, no need to fold, only keep first half of the values (done in PR 33 by Lambda) (and also in WHIR?)
2121
- Custom AVX2 / AVX512 / Neon implem in Plonky3 for all of the finite field operations (done for degree 4 extension, but not degree 5)
22-
- Many times, we evaluate different multilinear polynomials (diferent columns of the same table etc) at a common point. OPTI = compute the eq(.) once, and then dot_product with everything
22+
- Many times, we evaluate different multilinear polynomials (different columns of the same table etc) at a common point. OPTI = compute the eq(.) once, and then dot_product with everything
2323
- To commit to multiple AIR table using 1 single pcs, the most general form our "packed pcs" api should accept is:
2424
a list of n (n not a power of 2) columns, each ending with m repeated values (in this manner we can reduce proof size when they are a lot of columns (poseidons ...))
2525
- in the runner of leanISA program, if we call 2 times the same function with the same arguments, we can reuse the same memory frame
@@ -95,7 +95,7 @@ But we reduce proof size a lot using instead (TODO):
9595
- About range checks, that can currently be done in 3 cycles (see 2.5.3 of the zkVM pdf), in the instruction encoding of DEREF, if we replaced (1 - AUX) by a dedicated column,
9696
we could allow DEREFS that 'does not do anything with the resulting value', which is exactly what we want for range check: we only want to ensure that m[m[fp + x]] (resp m[(t-1) - m[fp + x]])
9797
is a valid memory access (i.e. the index is < M the memory size), but currently the DEREF instruction forces us to 'store' the result, in m[fp + i] (resp m[fp + k]).
98-
TLDR: adding a new encoding field for DEREF would save 2 memory cells / range check. If this can also increase perf in alternative scenario (other instructions for isntance),
98+
TLDR: adding a new encoding field for DEREF would save 2 memory cells / range check. If this can also increase perf in alternative scenario (other instructions for instance),
9999
potentially we should consider it.
100100

101101
## Known leanISA compiler bugs:

crates/lean_prover/src/common.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn fold_bytecode(bytecode: &Bytecode, folding_challenges: &MultilinearPoint<
6666
fold_multilinear_chunks(&encoded_bytecode, folding_challenges)
6767
}
6868

69-
pub fn intitial_and_final_pc_conditions(
69+
pub fn initial_and_final_pc_conditions(
7070
bytecode: &Bytecode,
7171
log_n_cycles: usize,
7272
) -> (Evaluation<EF>, Evaluation<EF>) {
@@ -126,7 +126,7 @@ pub fn add_memory_statements_for_dot_product_precompile(
126126
return Err(ProofError::InvalidProof);
127127
}
128128
if entry.n_vars() >= log_public_memory {
129-
todo!("vm multilinear eval accross multiple memory chunks")
129+
todo!("vm multilinear eval across multiple memory chunks")
130130
}
131131
let addr_bits = to_big_endian_in_field(entry.addr_coeffs, log_memory - entry.n_vars());
132132
let statement = Evaluation::new([addr_bits, entry.point.clone()].concat(), entry.res);
@@ -418,8 +418,8 @@ pub fn add_poseidon_lookup_statements_on_indexes(
418418
log_n_p24: usize,
419419
index_lookup_point: &MultilinearPoint<EF>,
420420
inner_values: &[EF],
421-
p16_indexe_statements: [&mut Vec<Evaluation<EF>>; 4], // a, b, res_1, res_2
422-
p24_indexe_statements: [&mut Vec<Evaluation<EF>>; 3], // a, b, res
421+
p16_index_statements: [&mut Vec<Evaluation<EF>>; 4], // a, b, res_1, res_2
422+
p24_index_statements: [&mut Vec<Evaluation<EF>>; 3], // a, b, res
423423
) {
424424
assert_eq!(inner_values.len(), 7);
425425
let mut idx_point_right_p16 = MultilinearPoint(index_lookup_point[3..].to_vec());
@@ -428,13 +428,13 @@ pub fn add_poseidon_lookup_statements_on_indexes(
428428
if log_n_p16 < log_n_p24 {
429429
std::mem::swap(&mut idx_point_right_p16, &mut idx_point_right_p24);
430430
}
431-
for (i, stmt) in p16_indexe_statements.into_iter().enumerate() {
431+
for (i, stmt) in p16_index_statements.into_iter().enumerate() {
432432
stmt.push(Evaluation::new(
433433
idx_point_right_p16.clone(),
434434
inner_values[i],
435435
));
436436
}
437-
for (i, stmt) in p24_indexe_statements.into_iter().enumerate() {
437+
for (i, stmt) in p24_index_statements.into_iter().enumerate() {
438438
stmt.push(Evaluation::new(
439439
idx_point_right_p24.clone(),
440440
inner_values[i + 4],

crates/lean_prover/src/prove_execution.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ pub fn prove_execution(
421421
.iter()
422422
.map(|c| c.as_slice())
423423
.collect::<Vec<_>>(),
424-
), // we do not use packing here beacause it's slower in practice (this sumcheck is small)
424+
), // we do not use packing here because it's slower in practice (this sumcheck is small)
425425
&dot_product_footprint_computation,
426426
&dot_product_footprint_computation,
427427
&[],
@@ -937,7 +937,7 @@ pub fn prove_execution(
937937
}
938938

939939
let (initial_pc_statement, final_pc_statement) =
940-
intitial_and_final_pc_conditions(bytecode, log_n_cycles);
940+
initial_and_final_pc_conditions(bytecode, log_n_cycles);
941941

942942
let dot_product_computation_column_evals = dot_product_computations_base
943943
.par_iter()
@@ -1073,17 +1073,17 @@ pub fn prove_execution(
10731073
dot_product_air_statement(2),
10741074
dot_product_logup_star_indexes_statement_a,
10751075
grand_product_dot_product_table_indexes_statement_index_a,
1076-
], // dot product: indexe a
1076+
], // dot product: index a
10771077
vec![
10781078
dot_product_air_statement(3),
10791079
dot_product_logup_star_indexes_statement_b,
10801080
grand_product_dot_product_table_indexes_statement_index_b,
1081-
], // dot product: indexe b
1081+
], // dot product: index b
10821082
vec![
10831083
dot_product_air_statement(4),
10841084
dot_product_logup_star_indexes_statement_res,
10851085
grand_product_dot_product_table_indexes_statement_index_res,
1086-
], // dot product: indexe res
1086+
], // dot product: index res
10871087
],
10881088
dot_product_computation_column_statements,
10891089
]

crates/lean_prover/src/verify_execution.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ pub fn verify_execution(
610610
}
611611

612612
let (initial_pc_statement, final_pc_statement) =
613-
intitial_and_final_pc_conditions(bytecode, log_n_cycles);
613+
initial_and_final_pc_conditions(bytecode, log_n_cycles);
614614

615615
let dot_product_computation_column_evals =
616616
verifier_state.next_extension_scalars_const::<DIMENSION>()?;
@@ -780,17 +780,17 @@ pub fn verify_execution(
780780
dot_product_air_statement(2),
781781
dot_product_logup_star_indexes_statement_a,
782782
grand_product_dot_product_table_indexes_statement_index_a,
783-
], // dot product: indexe a
783+
], // dot product: index a
784784
vec![
785785
dot_product_air_statement(3),
786786
dot_product_logup_star_indexes_statement_b,
787787
grand_product_dot_product_table_indexes_statement_index_b,
788-
], // dot product: indexe b
788+
], // dot product: index b
789789
vec![
790790
dot_product_air_statement(4),
791791
dot_product_logup_star_indexes_statement_res,
792792
grand_product_dot_product_table_indexes_statement_index_res,
793-
], // dot product: indexe res
793+
], // dot product: index res
794794
],
795795
dot_product_computation_column_statements,
796796
]

0 commit comments

Comments
 (0)