Skip to content

Commit

Permalink
Propagate known: thoughts
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Jan 10, 2025
1 parent 99fb7e0 commit c485e72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 10 additions & 0 deletions executor/src/witgen/jit/single_step_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ mod test {
B' = B;
";
let code = generate_single_step(input, "Main").unwrap();

// TODO:
// if VM::instr_add[0] == 1, we want to infer that VM::instr_mul[1] = 0
// the problem is that we have the submachine call only on row 0,
// and we want to keep it that way because we do not want to insert
// to submachine calls.
// this means we need a "pre-complete" submachine call on row 1,
// which is used to infer range constraints but does not actually add
// the call.

assert_eq!(
format_code(&code),
"\
Expand Down
12 changes: 0 additions & 12 deletions executor/src/witgen/jit/witgen_inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,6 @@ impl<'a, T: FieldElement, FixedEval: FixedEvaluator<T>> WitgenInference<'a, T, F
};
let result = (lhs_evaluated - rhs_evaluated).solve().unwrap();
if !result.effects.is_empty() {
println!(
"Got new effects:\n{}",
result
.effects
.iter()
.map(|e| match e {
Effect::Assignment(v, expr) => format!("{v} = {expr}"),
Effect::RangeConstraint(v, rc) => format!("{v}: {rc}"),
_ => panic!("Unexpected effect."),
})
.format("\n")
);
return result;
}
}
Expand Down

0 comments on commit c485e72

Please sign in to comment.