Skip to content
11 changes: 11 additions & 0 deletions triton_viz/clients/sanitizer/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,17 @@ def __init__(self, value, symbolic_expr):
def size(self):
return 2

@property
def dtype(self):
"""Return the dtype from the underlying symbolic expression."""
if (
hasattr(self.symbolic_expr, "dtype_tt")
and self.symbolic_expr.dtype_tt is not None
):
return self.symbolic_expr.dtype_tt
# Default to int64 if no dtype is available (common for integer operations)
return np.int64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please attach the test case, it doesn't seem correct to always fallback to np.int64.

Triton's logic is to assign scalars as int32 or int64 based on their values


def __int__(self):
int_val, _ = self.symbolic_expr.eval()
if isinstance(int_val, IntNumRef):
Expand Down