Witness generation fix (#266)

When we went through newly-populated values, as in

    for &(watch, _) in &buffer.target_values

`watch` was not necessarily a representative, because it came from a `GeneratedValues`, whose `set_target` doesn't know about representatives.
This commit is contained in:
Daniel Lubarov 2021-09-22 13:43:11 -07:00 committed by GitHub
parent 7360391515
commit e8cb2bbd22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,9 @@ pub(crate) fn generate_partial_witness<F: RichField + Extendable<D>, const D: us
// Enqueue unfinished generators that were watching one of the newly populated targets.
for &(watch, _) in &buffer.target_values {
let opt_watchers = generator_indices_by_watches.get(&witness.target_index(watch));
let watch_index = witness.target_index(watch);
let watch_rep_index = witness.forest[watch_index].parent;
let opt_watchers = generator_indices_by_watches.get(&watch_rep_index);
if let Some(watchers) = opt_watchers {
for &watching_generator_idx in watchers {
if !generator_is_expired[watching_generator_idx] {