Skip to content
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

[WIP] Block machine: only use JIT #2540

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 2 additions & 53 deletions executor/src/witgen/machines/block_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,62 +461,11 @@ impl<'a, T: FieldElement> BlockMachine<'a, T> {
assert!(updates.is_complete());
self.block_count_jit += 1;
return Ok(updates);
}

let outer_query = OuterQuery::new(
arguments,
range_constraints,
self.parts.connections[&identity_id],
);

// TODO this assumes we are always using the same lookup for this machine.
let mut sequence_iterator = self
.processing_sequence_cache
.get_processing_sequence(&outer_query.arguments);

if !sequence_iterator.has_steps() {
// Shortcut, no need to do anything.
log::trace!(
"Abort processing block machine '{}' (inputs incomplete according to cache)",
self.name()
);
} else {
return Ok(EvalValue::incomplete(
IncompleteCause::BlockMachineLookupIncomplete,
IncompleteCause::NonConstantRequiredArgument("???"),
));
}

let process_result =
self.process(mutable_state, &mut sequence_iterator, outer_query.clone())?;

match process_result {
ProcessResult::Success(updated_data, updates) => {
assert!(updates.is_complete());
self.block_count_runtime += 1;

log::trace!(
"End processing block machine '{}' (successfully)",
self.name()
);
self.append_block(updated_data.block)?;
self.publics.extend(updated_data.publics);

let updates = updates.report_side_effect();

// We solved the query, so report it to the cache.
self.processing_sequence_cache
.report_processing_sequence(&outer_query.arguments, sequence_iterator);
Ok(updates)
}
ProcessResult::Incomplete(updates) => {
log::trace!(
"End processing block machine '{}' (incomplete)",
self.name()
);
self.processing_sequence_cache
.report_incomplete(&outer_query.arguments);
Ok(updates)
}
}
}

fn process_lookup_via_jit<'b, Q: QueryCallback<T>>(
Expand Down
Loading