From 986d113024fd450f43152abb8d688e5ce01af7ef Mon Sep 17 00:00:00 2001 From: George Hotz <72895+geohot@users.noreply.github.com> Date: Wed, 19 Nov 2025 14:21:08 -0800 Subject: [PATCH] symbolic fuzz failure (#13367) * symbolic fuzz failure * skip flaky test --- test/unit/test_symbolic_failures.py | 35 +++++++++++++++++++++++++++++ test/unit/test_tqdm.py | 1 + 2 files changed, 36 insertions(+) diff --git a/test/unit/test_symbolic_failures.py b/test/unit/test_symbolic_failures.py index 0fc5ee2467..ce8a2016b3 100644 --- a/test/unit/test_symbolic_failures.py +++ b/test/unit/test_symbolic_failures.py @@ -159,3 +159,38 @@ class TestFuzzFailure(unittest.TestCase): num = expr.simplify().substitute({v1:v1_val, v2:v2_val, v3:v3_val}).ssimplify() rn = expr.substitute({v1:v1_val, v2:v2_val, v3:v3_val}).ssimplify() self.assertEqual(num, rn) + + def test_fuzz_failure11(self): + v1=Variable("v1", 0, 16) + v2=Variable("v2", 0, 128) + v3=Variable("v3", 0, 5) + expr = UOp(Ops.MOD, dtypes.index, arg=None, src=( + UOp(Ops.ADD, dtypes.index, arg=None, src=( + UOp(Ops.MOD, dtypes.index, arg=None, src=( + UOp(Ops.ADD, dtypes.index, arg=None, src=( + UOp(Ops.MAX, dtypes.index, arg=None, src=( + UOp(Ops.MUL, dtypes.index, arg=None, src=( + x5:=UOp(Ops.DEFINE_VAR, dtypes.index, arg=('v2', 0, 128), src=()), + UOp(Ops.CONST, dtypes.index, arg=0, src=()),)), + UOp(Ops.CONST, dtypes.index, arg=8, src=()),)), + UOp(Ops.MUL, dtypes.index, arg=None, src=( + x5, + UOp(Ops.CONST, dtypes.index, arg=-2, src=()),)),)), + x10:=UOp(Ops.CONST, dtypes.index, arg=5, src=()),)), + UOp(Ops.ADD, dtypes.index, arg=None, src=( + UOp(Ops.ADD, dtypes.index, arg=None, src=( + UOp(Ops.IDIV, dtypes.index, arg=None, src=( + x14:=UOp(Ops.DEFINE_VAR, dtypes.index, arg=('v1', 0, 16), src=()), + UOp(Ops.CONST, dtypes.index, arg=6, src=()),)), + UOp(Ops.CONST, dtypes.index, arg=4, src=()),)), + UOp(Ops.ADD, dtypes.index, arg=None, src=( + x14, + UOp(Ops.CONST, dtypes.index, arg=1, src=()),)),)),)), + x10,)) + v1_val, v2_val, v3_val = UOp.const(dtypes.int, 0), UOp.const(dtypes.int, 7),UOp.const(dtypes.int, 0) + num = expr.simplify().substitute({v1:v1_val, v2:v2_val, v3:v3_val}).ssimplify() + rn = expr.substitute({v1:v1_val, v2:v2_val, v3:v3_val}).ssimplify() + self.assertEqual(num, rn) + +if __name__ == '__main__': + unittest.main() diff --git a/test/unit/test_tqdm.py b/test/unit/test_tqdm.py index d3a0b350b5..52c64c7ea6 100644 --- a/test/unit/test_tqdm.py +++ b/test/unit/test_tqdm.py @@ -128,6 +128,7 @@ class TestProgressBar(unittest.TestCase): self._compare_bars(tinytqdm_output, tqdm_output) if n > 5: break + @unittest.skip("this is flaky") @patch('sys.stderr', new_callable=StringIO) @patch('shutil.get_terminal_size') def test_set_description(self, mock_terminal_size, mock_stderr):