From 7aaa9b577c5e848d97674f60d933e4382902bf20 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Tue, 28 Oct 2025 10:15:13 +0800 Subject: [PATCH] test with IGNORE_OOB=0 --- .github/workflows/test.yml | 2 +- tinygrad/uop/spec.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea0129cfe1..d9f14e56e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -308,7 +308,7 @@ jobs: key: spec-unit deps: testing_unit - name: Test SPEC=2 - run: SPEC=2 PYTHONPATH="." pytest --maxfail=10 -n auto --durations=30 --ignore=test/models --ignore test/unit/test_hashing.py --timeout 40 -k "not test_setitem_big" --splits 2 --group ${{ matrix.group }} + run: IGNORE_OOB=0 SPEC=2 PYTHONPATH="." pytest --maxfail=10 -n auto --durations=30 --ignore=test/models --ignore test/unit/test_hashing.py --timeout 40 -k "not test_setitem_big" --splits 2 --group ${{ matrix.group }} fuzzing: name: Fuzzing diff --git a/tinygrad/uop/spec.py b/tinygrad/uop/spec.py index 769273ab07..ced3cea7ee 100644 --- a/tinygrad/uop/spec.py +++ b/tinygrad/uop/spec.py @@ -119,9 +119,9 @@ program_spec = PatternMatcher([ (UPat(Ops.INDEX, src=(UPat(GroupOp.Defines).or_after(), UPat(), UPat(dtype=dtypes.bool))), lambda: True), (UPat(Ops.INDEX, src=(UPat(GroupOp.Defines).or_after(), UPat())), lambda: True), - # LOAD (idx, alt_value) / LOAD(idx) / STORE(idx, val) - (UPat(Ops.LOAD, src=(UPat(Ops.INDEX, name="idx").or_casted(), UPat())), validate_index), + # LOAD(idx) / LOAD (idx, alt_value) / STORE(idx, val) (UPat(Ops.LOAD, src=(UPat(Ops.INDEX, name="idx").or_casted(), )), validate_index), + (UPat(Ops.LOAD, src=(UPat(Ops.INDEX, name="idx").or_casted(), UPat())), validate_index), (UPat(Ops.STORE, src=(UPat(Ops.INDEX, name="idx").or_casted(), UPat())), validate_index), # RANGE/SPECIAL define loops, END closes them @@ -145,9 +145,9 @@ program_spec = PatternMatcher([ (UPat(Ops.GEP, src=(UPat.var("src"),), name="gep"), lambda gep,src: gep.dtype == src.dtype.scalar()), # BARRIER - (UPat(Ops.BARRIER, dtypes.void, src=UPat(Ops.STORE, allow_any_len=True)), lambda: True), # NOTE: all pointers must be local - (UPat(Ops.BARRIER, dtypes.void), lambda: True), # BARRIERs can also happen at the end of loops + (UPat(Ops.BARRIER, dtypes.void, src=(UPat(),)), lambda: True), + # all CUSTOM + PRECAST (UPat((Ops.CUSTOMI, Ops.CUSTOM, Ops.PRECAST)), lambda: True), ])+shared_spec @@ -157,6 +157,10 @@ kernel_spec = PatternMatcher([ # index is allowed here (UPat(GroupOp.Elementwise|{Ops.CONST, Ops.RANGE, Ops.DEFINE_VAR}, dtype=dtypes.index), lambda: True), + # LOAD(idx) / STORE(idx, val) -- NOTE: we do this here to not run validate_index since z3 doesn't support Invalid + (UPat(Ops.LOAD, src=(UPat(Ops.INDEX).or_casted(), )), lambda: True), + (UPat(Ops.STORE, src=(UPat(Ops.INDEX).or_casted(), UPat())), lambda: True), + # UNROLL/CONTRACT is used here for WMMA (UPat(Ops.CONTRACT, name="x"), lambda x: x.dtype.count == prod(y[1] for y in x.arg)), (UPat(Ops.UNROLL, name="x"), lambda x: x.src[0].dtype.count == prod(y[1] for y in x.arg)),