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 / amd-speed-20261114 / recompute / render_sessions.py

29 lines · 1360 bytes Raw Blame History
1#!/usr/bin/env python3
2# Write the two card-session tables of REPORT.md section 12 from out/sessions-table.json (between the two marker lines).
3# REPORT.md is rewritten only if its bytes would change.
4import json, sys
5from common import HERE, OUT
6
7rep = HERE.parent / 'REPORT.md'
8rows = json.loads((OUT / 'sessions-table.json').read_text())
9BEGIN, END = '<!-- sessions:begin (generated by recompute/render_sessions.py) -->', '<!-- sessions:end -->'
10lines = [BEGIN,
11 '| Session | UTC start | Lane | What ran | State |',
12 '|---|---|---|---|---|']
13for r in rows:
14 lines.append(f"| {r['session'][-8:]} | {r['utc_start']} | {r['lane']} | {r['ran']} | {r['state']} |")
15lines += ['', 'Evidence file and hash for each session (full session name; paths under `raw/`):', '',
16 '| Session | Evidence | sha256 |', '|---|---|---|']
17for r in rows:
18 h = f"`{r['sha256']}`" if r['sha256'] else 'not downloaded'
19 lines.append(f"| `{r['session']}` | `{r['evidence']}` | {h} |")
20lines.append(END)
21text = rep.read_text()
22if BEGIN not in text or END not in text:
23 sys.exit('RENDER FAIL: markers missing in REPORT.md')
24head, rest = text.split(BEGIN, 1)
25tail = rest.split(END, 1)[1]
26new = head + '\n'.join(lines) + tail
27if new != text:
28 rep.write_text(new)
29print(f'RENDER sessions rows={len(rows)} {"unchanged" if new == text else "written"}')