diff options
| author | VictorJulianiR <juliani_rodrigues@hotmail.com> | 2026-11-21 21:01:32 -0300 |
|---|---|---|
| committer | VictorJulianiR <juliani_rodrigues@hotmail.com> | 2026-11-21 21:01:32 -0300 |
| commit | 2a802ec630724d2e28f8933e64f69176c84a6901 (patch) | |
| tree | d170a6ea970b7f6dec59c1eb1ec7d8fd535e8770 /scripts | |
| parent | 4abd54571b6efa02d97eda4711792fa00b455dc3 (diff) | |
bench_wave64.py: a configuration that fails partway is a failure
Each process added its output hash to `hashes` before a later process of
the same configuration could fail. The failed configuration got no row,
but its partial hashes stayed, so the "every configuration ran" check
passed, it was compared as if it had run, and the script could print
"emulated output equals the reference" and exit 0. A reference that
failed after its first process was used as the reference all the same.
Hashes are now kept only for a configuration whose every process ran.
The test replaces the builds and the GPU runs with stubs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/bench_wave64.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/bench_wave64.py b/scripts/bench_wave64.py index c20e32b41..812cc80a4 100644 --- a/scripts/bench_wave64.py +++ b/scripts/bench_wave64.py | |||
| @@ -80,7 +80,7 @@ def main(): | |||
| 80 | print(f"emulated: {seg[0]} segments, {seg[1]} of them continuation segments (one extra round each)") | 80 | print(f"emulated: {seg[0]} segments, {seg[1]} of them continuation segments (one extra round each)") |
| 81 | hashes, rows = {}, [] | 81 | hashes, rows = {}, [] |
| 82 | for name, driver, emulate in CONFIGS: | 82 | for name, driver, emulate in CONFIGS: |
| 83 | med, mins, dev = [], [], None | 83 | med, mins, seen, dev = [], [], set(), None |
| 84 | for _ in range(a.procs): | 84 | for _ in range(a.procs): |
| 85 | t, h, dev = run(a.build, spv[emulate], a.groups, a.reps, driver, emulate) | 85 | t, h, dev = run(a.build, spv[emulate], a.groups, a.reps, driver, emulate) |
| 86 | if t is None: | 86 | if t is None: |
| @@ -89,8 +89,11 @@ def main(): | |||
| 89 | break | 89 | break |
| 90 | med.append(t[0]) | 90 | med.append(t[0]) |
| 91 | mins.append(t[1]) | 91 | mins.append(t[1]) |
| 92 | hashes.setdefault(name, set()).add(h) | 92 | seen.add(h) |
| 93 | if med: | 93 | if med: |
| 94 | # Only a configuration whose every process ran counts: the hashes of the processes before a | ||
| 95 | # failed one used to be kept, so the failure passed as a configuration that had run. | ||
| 96 | hashes[name] = seen | ||
| 94 | rows.append((name, dev, statistics.median(med), min(mins), min(med), max(med))) | 97 | rows.append((name, dev, statistics.median(med), min(mins), min(med), max(med))) |
| 95 | for name, dev, m, lo, a_, b_ in rows: | 98 | for name, dev, m, lo, a_, b_ in rows: |
| 96 | print(f"{name:26} {dev:34} median {m:8.3f} ms best {lo:8.3f} process medians {a_:.3f}..{b_:.3f}") | 99 | print(f"{name:26} {dev:34} median {m:8.3f} ms best {lo:8.3f} process medians {a_:.3f}..{b_:.3f}") |