Skip to content

Commit

Permalink
refactor(test): Simplify spec generation
Browse files Browse the repository at this point in the history
If the constraints are not in place, the corresponding error message is
well suited to figure out what is going on. Since this is a test, not a
piece of production code, that's all that's needed. Adding special
error handling logic, especially with the to-be-avoided “catch_unwind”,
is overkill.

changelog: ignore
  • Loading branch information
jan-ferdinand committed Aug 14, 2024
1 parent f2a09a7 commit 7a9102a
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions triton-vm/src/table/master_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1503,22 +1503,12 @@ mod tests {

#[test]
fn update_arithmetization_overview() {
let mut spec_snippets = vec![generate_table_overview(), generate_constraints_overview()];

let tasm_constraints_in_place = std::panic::catch_unwind(|| {
static_air_constraint_evaluation_tasm(
StaticTasmConstraintEvaluationMemoryLayout::default(),
);
})
.is_ok();
if tasm_constraints_in_place {
spec_snippets.push(generate_tasm_air_evaluation_cost_overview());
} else {
println!("Cannot verify spec's overview of tasm cost of AIR evaluation; tasm constraints need to be in place for that. To generate them, run:\n");
println!("$> cargo run --bin constraint-evaluation-generator");
}

spec_snippets.push(generate_opcode_pressure_overview());
let spec_snippets = vec![
generate_table_overview(),
generate_constraints_overview(),
generate_tasm_air_evaluation_cost_overview(),
generate_opcode_pressure_overview(),
];

// current directory is triton-vm/triton-vm/
let spec_path = Path::new("../specification/src/arithmetization-overview.md");
Expand Down

0 comments on commit 7a9102a

Please sign in to comment.