(ast:UOp|list[UOp], check_spec:PatternMatcher)
| 29 | return validate_index_with_z3(sz, idx, gate) |
| 30 | |
| 31 | def type_verify(ast:UOp|list[UOp], check_spec:PatternMatcher): |
| 32 | lst = list(ast.toposort()) if isinstance(ast, UOp) else ast |
| 33 | if SPEC > 1: test_pyrender(lst[-1]) # assume this is the sink |
| 34 | |
| 35 | with Context(TRACK_MATCH_STATS=0): |
| 36 | for i,u in enumerate(lst): |
| 37 | ret = check_spec.rewrite(u) |
| 38 | if cast(bool|None, ret) is not True: |
| 39 | if DEBUG >= 3: print_uops(lst) |
| 40 | raise RuntimeError(f"UOp verification failed at {i} on {u.op} {u.dtype} {len(u.src)} {[(x.op, x.dtype, x.arg) for x in u.src]} {u.arg}") |
| 41 | |
| 42 | # ***** new specs ***** |
| 43 |
no test coverage detected
searching dependent graphs…