Skip to content

Commit

Permalink
Fix #207
Browse files Browse the repository at this point in the history
This puts in place a fix for duplicate registers being added during
expression expansion.  Its not clear whether there are any other places
where this can happen, but none are being triggered on our (largish)
example.
  • Loading branch information
DavePearce committed Jun 19, 2024
1 parent 132dd15 commit 829609c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/cgo-main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,4 @@ fn main() {
let trace =
cgo::compute_trace_from_file(&mut corset, &args.tracefile, args.fail_on_missing).unwrap();
//
for col in trace.ids {
println!("COLUMN: {col}");
}
}
3 changes: 2 additions & 1 deletion src/cgo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ impl Trace {
let crefs = corset.columns.columns_of(reg_id);
//
if crefs.is_empty() {
todo!("NO COLUMNS ASSIGNED FOR: {handle}")
// This should be unreachable.
unreachable!("No column assigned to register ({handle}:{reg_id})")
} else {
// I'm assuming every register is mapped to at least one
// column.
Expand Down
4 changes: 2 additions & 2 deletions src/transformer/selectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ fn do_expand_expr(
// TODO: replace name with exprs hash to 100% ensure bijectivity handle/expression
// Only insert the computation if a column matching the expression has not already been created
if cols
.insert_column_and_register(
.maybe_insert_column_and_register(
Column::builder()
.handle(new_handle.clone())
.kind(Kind::Computed)
.build(),
)
.is_ok()
.is_some()
{
validate_computation(new_cs, e, &new_handle);
let _ = comps.insert(
Expand Down

0 comments on commit 829609c

Please sign in to comment.