interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / evidence / FLASH-NEXT-CONTROL-FIX-20261118 / summarize.py

32 lines · 1477 bytes Raw Blame History
1# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2# summarize.py: counts from exercise.py output. Fails (exit 1) on any inconsistency between the historical
3# record, the historical re-run and the strict decoder. usage: python3 -I summarize.py RESULTS_JSONL
4import collections, json, sys
5
6recs = [json.loads(l) for l in open(sys.argv[1])]
7bad = []
8c = collections.Counter()
9from_end = collections.Counter()
10for r in recs:
11 role, fc, hr, s = r['role'], r['fullcover'], r['hist_rerun'], r['strict']
12 f, cl = s['flip'], s['clean']
13 c[role] += 1
14 if not (fc['coded'] == hr['coded'] == s['coded'] and fc['roundtrip'] == hr['roundtrip'] == 1
15 and fc['flip_detected'] == hr['flip_detected'] == int(f['hist_detected'])):
16 bad.append(('historical verdict not reproduced', r['name']))
17 if cl != {'bytes_equal': '1', 'strict_ok': '1'}:
18 bad.append(('clean stream failed strict check', r['name']))
19 if f['strict_detected'] != '1':
20 bad.append(('strict check missed the flip', r['name']))
21 c[(role, f['class'])] += 1
22 for k in ('init_bad', 'starved', 'leftover', 'term_bad'):
23 c[(role, k)] += int(f[k])
24 if role == 'missed':
25 from_end[int(f['from_row_end'])] += 1
26for k in sorted(c, key=str):
27 print(k if isinstance(k, str) else ' '.join(k), c[k])
28print('missed from_row_end', dict(sorted(from_end.items())))
29print('inconsistencies', len(bad))
30for b in bad:
31 print('BAD', *b)
32sys.exit(1 if bad else 0)