mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
Fix/hcqfuzz harnesss bug (#10923)
* update command so extra module is found * fix empty range in randrange errors * lint
This commit is contained in:
@@ -4,9 +4,9 @@ To add a new test, define a `TestSpec`-based class in a file in the `tests/` fol
|
||||
|
||||
You can choose which tests to load from which file:
|
||||
```bash
|
||||
RUN_FILES="hcq,allocator" python3 extra/hcqfuzz/fuzzer.py
|
||||
PYTHONPATH=. RUN_FILES="hcq,allocator" python3 extra/hcqfuzz/fuzzer.py
|
||||
```
|
||||
Or skip tests from any file:
|
||||
```bash
|
||||
SKIP_FILES="allocator" python3 extra/hcqfuzz/fuzzer.py
|
||||
PYTHONPATH=. SKIP_FILES="allocator" python3 extra/hcqfuzz/fuzzer.py
|
||||
```
|
||||
|
||||
3
test/external/external_fuzz_ampt.py
vendored
3
test/external/external_fuzz_ampt.py
vendored
@@ -1,4 +1,5 @@
|
||||
import random
|
||||
from typing import Optional
|
||||
from tinygrad.helpers import round_up
|
||||
from tinygrad.runtime.support.am.amdev import AMPageTableTraverseContext
|
||||
from test.external.external_test_am import helper_read_entry_components, FakeAM
|
||||
@@ -59,7 +60,7 @@ class AMPTFuzzer:
|
||||
|
||||
return True
|
||||
|
||||
def random_alloc(self):
|
||||
def random_alloc(self) -> Optional[int]:
|
||||
if self.total_size - self.alloc_payload < self.min_alloc_size: return None
|
||||
|
||||
size = random.randint(self.min_alloc_size, min(self.max_alloc_size, self.total_size - self.alloc_payload))
|
||||
|
||||
2
test/external/external_fuzz_tlsf.py
vendored
2
test/external/external_fuzz_tlsf.py
vendored
@@ -30,6 +30,8 @@ class AllocatorFuzzer:
|
||||
return True
|
||||
|
||||
def random_alloc(self) -> Optional[int]:
|
||||
if self.total_size - self.alloc_payload < self.min_alloc_size: return None
|
||||
|
||||
size = random.randint(self.min_alloc_size, min(self.max_alloc_size, self.total_size - self.alloc_payload))
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user