-
Notifications
You must be signed in to change notification settings - Fork 0
Allow Hint Space Ids for NativeSumcheck Inputs
#31
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
base: feat/v1.4.1-scroll-ext
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this read is no longer needed.
| /// write p_evals | ||
| pub write_record: MemoryWriteAuxCols<T, EXT_DEG>, | ||
| /// write p1, p2 values back to witness array if the source is hint space id | ||
| pub write_ps_record: MemoryWriteAuxCols<T, { EXT_DEG * 2 }>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we already have write_ps_record, let's remove the above read_records.
| /// write both p_evals and q_evals | ||
| pub write_records: [MemoryWriteAuxCols<T, EXT_DEG>; 2], | ||
| /// write p1, p2, q1, q2 back to witness array if the source is hint space id | ||
| pub write_pqs_record: MemoryWriteAuxCols<T, { EXT_DEG * 4 }>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
| self.memory_bridge | ||
| .read( | ||
| MemoryAddress::new(native_as, register_ptrs[2] + prod_row_specific.data_ptr), | ||
| prod_row_specific.p, | ||
| start_timestamp, | ||
| &prod_row_specific.read_records[0], | ||
| ) | ||
| .eval( | ||
| builder, | ||
| (prod_in_round_evaluation + prod_next_round_evaluation) * not(is_hint_src_id), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opt: we can mimic the memory read behavior by reusing write_ps_record with one additional requirement that write_ps_record.prev_data == prod_row_specific.p if it's not(is_hint_src_id).
| self.memory_bridge | ||
| .read( | ||
| MemoryAddress::new(native_as, register_ptrs[3] + logup_row_specific.data_ptr), | ||
| logup_row_specific.pq, | ||
| start_timestamp, | ||
| &logup_row_specific.read_records[0], | ||
| ) | ||
| .eval( | ||
| builder, | ||
| (logup_in_round_evaluation + logup_next_round_evaluation) * not(is_hint_src_id), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
| let num_prod_evals = num_prod_specs * num_layers * 2; | ||
| let prod_spec_evals: Array<C, Ext<C::F, C::EF>> = builder.dyn_array(num_prod_evals); | ||
| for idx in 0..num_prod_evals { | ||
| let e: Ext<C::F, C::EF> = builder.constant(prod_evals[idx]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You restored the original test back, it's better to add one more test case to cover the case that evals comes from hint space.
NativeSumcheckopcode's ability to accept hint space Ids for its evaluation inputs.prod_evalsandlogup_evalsfrom hint insumcheck_layer_eval#30, this PR ensures the read values are written back to default-initialized witness arrays if the evaluations come from hint space.