Skip to content

Commit 8a74989

Browse files
committed
Convert debug_assert to warning in resolve_result_type fallback
The type propagation fallback handles the case correctly by resolving to the appropriate type. The debug_assert was causing panics in debug builds on CI when the egraph creates terms with untracked type sorts.
1 parent 151c09a commit 8a74989

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • rust/spirv-tools-opt/src/direct

rust/spirv-tools-opt/src/direct/emit.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,10 +1073,11 @@ fn resolve_result_type(class: TypeClass, result_type: Word, ctx: &mut EmitCtx) -
10731073
return result_type;
10741074
}
10751075
// Fallback: egraph type propagation missed this case.
1076-
debug_assert!(
1077-
false,
1078-
"resolve_result_type fallback: expected {:?} but got {:?} for type id {}. \
1079-
This indicates incomplete IType/FType/BType propagation in datatypes.egg.",
1076+
// This can happen when egraph rules create terms whose type sort doesn't
1077+
// match the expected class (e.g., GammaF select absorption creating nodes
1078+
// with untracked types). The fallback below resolves it correctly.
1079+
eprintln!(
1080+
"warning: resolve_result_type fallback: expected {:?} but got {:?} for type id {}",
10801081
class, original_class, result_type
10811082
);
10821083
match class {

0 commit comments

Comments
 (0)