Skip to content

Commit 7414290

Browse files
committed
Remove machine calls and prover function calls
1 parent 36eaa35 commit 7414290

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

executor/src/witgen/jit/compiler.rs

+22-7
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,26 @@ fn format_effects_inner<T: FieldElement>(
338338
) -> String {
339339
effects
340340
.iter()
341-
.map(|effect| format_effect(effect, is_top_level))
341+
.filter_map(|effect| {
342+
let code = format_effect(effect, is_top_level);
343+
if code.is_empty() {
344+
None
345+
} else {
346+
Some(code)
347+
}
348+
})
342349
.join("\n")
343350
}
344351

345352
fn format_effect<T: FieldElement>(effect: &Effect<T, Variable>, is_top_level: bool) -> String {
346353
match effect {
347-
Effect::Assignment(var, e) => set(var, &format_expression(e), is_top_level, false),
354+
Effect::Assignment(var, e) => {
355+
if let Variable::MachineCallParam(_) = var {
356+
return "".to_string();
357+
} else {
358+
set(var, &format_expression(e), is_top_level, false)
359+
}
360+
}
348361
Effect::RangeConstraint(..) => {
349362
unreachable!("Final code should not contain pure range constraints.")
350363
}
@@ -388,9 +401,10 @@ fn format_effect<T: FieldElement>(effect: &Effect<T, Variable>, is_top_level: bo
388401
} else {
389402
"".to_string()
390403
};
391-
format!(
392-
"{var_decls}assert!(call_machine(mutable_state, {id}.into(), MutSlice::from((&mut [{args}]).as_mut_slice())));"
393-
)
404+
// format!(
405+
// "{var_decls}assert!(call_machine(mutable_state, {id}.into(), MutSlice::from((&mut [{args}]).as_mut_slice())));"
406+
// )
407+
format!("{var_decls}// Skipping machine call")
394408
}
395409
Effect::ProverFunctionCall(ProverFunctionCall {
396410
targets,
@@ -407,8 +421,9 @@ fn format_effect<T: FieldElement>(effect: &Effect<T, Variable>, is_top_level: bo
407421
.enumerate()
408422
.map(|(i, v)| set(v, &format!("result[{i}]"), is_top_level, false))
409423
.format("\n");
410-
let block = format!("{function_call}\n{store_results}");
411-
format!("{{\n{}\n}}", indent(block, 1))
424+
let block = format!("{}\n{}", function_call, store_results);
425+
// format!("{{\n{}\n}}", indent(block, 1))
426+
"// Skipping prover function".to_string()
412427
}
413428
Effect::Branch(condition, first, second) => {
414429
let var_decls = if is_top_level {

0 commit comments

Comments
 (0)