Skip to content

Commit 6cbfc49

Browse files
committed
wip10
1 parent 939cd1e commit 6cbfc49

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

extensions/native/circuit/src/sumcheck/chip.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ where
201201
head_specific.read_records[6].as_mut(),
202202
);
203203
cur_timestamp += 7; // 5 register reads + ctx read + challenges read
204+
head_row.challenges.copy_from_slice(&challenges);
204205

205206
// challenges = [alpha, c1=r, c2=1-r]
206207
let alpha: [F; 4] = challenges[0..EXT_DEG].try_into().unwrap();
@@ -335,7 +336,7 @@ where
335336
let alpha_numerator = alpha_acc;
336337
let alpha_denominator = FieldExtension::multiply(alpha_acc, alpha);
337338
logup_row.challenges[0..EXT_DEG].copy_from_slice(&alpha_acc);
338-
logup_row.challenges[2 * EXT_DEG..(3 * EXT_DEG)].copy_from_slice(&alpha_denominator);
339+
logup_row.challenges[3 * EXT_DEG..(4 * EXT_DEG)].copy_from_slice(&alpha_denominator);
339340

340341
let max_round = max_round.as_canonical_u32();
341342
if round < max_round - 1 {
@@ -409,7 +410,7 @@ where
409410
state.memory,
410411
r_evals_ptr.as_canonical_u32()
411412
+ (1 + num_prod_spec + num_logup_spec + i as u32) * (EXT_DEG as u32),
412-
p_eval,
413+
q_eval,
413414
&mut logup_specific.write_records[1],
414415
);
415416
cur_timestamp += 3; // 1 read, 2 writes
@@ -432,6 +433,7 @@ where
432433

433434
let head_row = &mut rows[0];
434435
head_row.last_timestamp = F::from_canonical_u32(cur_timestamp + 1);
436+
head_row.eval_acc = eval_acc;
435437

436438
let head_specific: &mut HeaderSpecificCols<F> =
437439
head_row.specific[..HeaderSpecificCols::<F>::width()].borrow_mut();
@@ -460,7 +462,6 @@ impl<F: PrimeField32> TraceFiller<F> for NativeSumcheckFiller {
460462
let start_timestamp = cols.start_timestamp.as_canonical_u32();
461463
let last_timestamp = cols.last_timestamp.as_canonical_u32();
462464

463-
println!("start_timestamp: {}, cols.header_row: {:?}, prod_row: {:?}, logup_row: {:?}", start_timestamp, cols.header_row, cols.prod_row, cols.logup_row);
464465
if cols.header_row == F::ONE {
465466
let header: &mut HeaderSpecificCols<F> =
466467
cols.specific[..HeaderSpecificCols::<F>::width()].borrow_mut();

extensions/native/recursion/tests/sumcheck.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ fn build_test_program<C: Config>(builder: &mut Builder<C>) {
8181
548478283u32, 456436544, 1716290291, 791326976,
8282
1829717553, 1422025771, 1917123958, 727015942,
8383
183548369, 591240150, 96141963, 1286249979,
84+
0, 0, 0, 0,
8485
];
8586
let challenges: Array<C, Ext<C::F, C::EF>> = builder.dyn_array(challenges_u32s.len() / EXT_DEG);
8687
for (idx, n) in challenges_u32s.chunks(EXT_DEG).enumerate() {

0 commit comments

Comments
 (0)