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 / tests / dagsim / run_cli.sh

87 lines · 5938 bytes Raw Blame History
1#!/bin/sh
2# run_cli.sh DAGSIM_BIN [OUT_DIR]
3# Reproducible CLI example for omega-mv#583: pinned fixtures in, JSON and a
4# Pareto table out, byte-identical on a second run, no GPU touched.
5set -u
6BIN=${1:?dagsim binary}
7OUT=${2:-/tmp/dagsim-cli-$$}
8F=tests/dagsim/fixtures
9ASOF=2026-10-20
10mkdir -p "$OUT"
11fail=0
12say() { echo "run_cli: $*"; }
13check() { if [ "$1" -ne 0 ]; then say "FAIL $2"; fail=1; else say "ok $2"; fi; }
14
15"$BIN" eval $F/m1_spark_subset.oev --asof $ASOF > "$OUT/subset.json"; rc=$?
16check $rc "eval exits 0 on the pinned M1 subset"
17grep -q '"status": "OK"' "$OUT/subset.json"; check $? "status OK"
18grep -q '"makespan_ns": {"nominal": 151756700,' "$OUT/subset.json"; check $? "serial makespan 20000 + 40736700 + 111000000 ns"
19grep -q '"makespan_ge_bounds": true' "$OUT/subset.json"; check $? "makespan is above its bounds"
20grep -q '"status": "UNMEASURED"' "$OUT/subset.json"; check $? "energy UNMEASURED without an instrument"
21grep -q '"gpu_executed": false' "$OUT/subset.json"; check $? "offline: no GPU execution"
22grep -q '"provenance": \["measured", "specified"\]' "$OUT/subset.json"; check $? "provenance list names measured and specified only"
23"$BIN" eval $F/m1_spark_subset.oev --asof $ASOF > "$OUT/subset2.json"
24cmp -s "$OUT/subset.json" "$OUT/subset2.json"; check $? "second run byte-identical"
25
26"$BIN" eval $F/needs_arch244_trace.oev --asof $ASOF > "$OUT/unknown.json"; rc=$?
27[ $rc -eq 1 ] ; check $? "unknown-trace fixture exits 1"
28grep -q '"status": "REFUSED_UNKNOWN"' "$OUT/unknown.json"; check $? "unknown stays unknown (REFUSED_UNKNOWN)"
29grep -q 'makespan' "$OUT/unknown.json"; [ $? -ne 0 ]; check $? "no makespan printed on refusal"
30
31"$BIN" eval $F/m1_spark_subset.oev --asof 2026-12-01 > "$OUT/stale.json"
32grep -q '"status": "REFUSED_STALE"' "$OUT/stale.json"; check $? "30-day calibration refused at 43 days"
33
34"$BIN" eval $F/m1_synthetic_power.oev --asof $ASOF > "$OUT/syn.json"
35grep -q '"status": "SYNTHETIC_SENSITIVITY_ONLY"' "$OUT/syn.json"; check $? "synthetic power is labelled, not ranked"
36grep -q '"ranking_valid": false' "$OUT/syn.json"; check $? "energy ranking invalid on synthetic power"
37
38"$BIN" eval $F/m1_spark_overlap.oev --asof $ASOF > "$OUT/overlap.json"
39grep -q '"status": "OK"' "$OUT/overlap.json"; check $? "overlap fixture evaluates"
40# two halves sharing a 65.4 GB/s pipe: 2 GB of traffic is 30.58 ms, each half's own busy
41# time is 55.5 ms, so busy time binds and both halves end together at 40.7567 + 55.5 ms.
42grep -q '"makespan_ns": {"nominal": 96256700,' "$OUT/overlap.json"; check $? "split copy: busy time binds, 40756700 + 55500000 ns"
43
44"$BIN" pareto $F/m1_spark_subset.oev $F/m1_spark_overlap.oev $F/m1_synthetic_power.oev $F/needs_arch244_trace.oev --asof $ASOF > "$OUT/pareto.txt"; rc=$?
45check $rc "pareto exits 0"
46grep -q 'needs_arch244_trace.oev *REFUSED_UNKNOWN' "$OUT/pareto.txt"; check $? "refused candidate shown as refused in the table"
47grep -q 'm1_spark_overlap.oev *OK .* yes$' "$OUT/pareto.txt"; check $? "faster candidate is on the front"
48grep -q 'm1_spark_subset.oev *OK .* no$' "$OUT/pareto.txt"; check $? "dominated candidate is off the front"
49grep -q 'Energy not measured on every row' "$OUT/pareto.txt"; check $? "pareto says energy is not ranked"
50
51"$BIN" diff $F/mw_baseline.oev $F/mw_reuse.oev --asof $ASOF > "$OUT/diff_reuse.json"; rc=$?
52check $rc "reuse diff OK"
53grep -q '"reused": 200' "$OUT/diff_reuse.json"; check $? "200 ns of search moved to the reused ledger"
54"$BIN" diff $F/mw_baseline.oev $F/mw_bad_elimination.oev --asof $ASOF > "$OUT/diff_bad.json"; rc=$?
55[ $rc -eq 1 ]; check $? "unproven elimination exits 1"
56grep -q '"status": "REFUSED_REMOVED_REQUIRED"' "$OUT/diff_bad.json"; check $? "unproven elimination refused"
57"$BIN" diff $F/mw_baseline.oev $F/mw_baseline.oev --asof $ASOF > "$OUT/diff_same.json"
58grep -q '"kept": 4, "added": 0, "removed": 0' "$OUT/diff_same.json"; check $? "no-change fixture adds no nodes"
59
60# omega-mv#705: inverted lifetime must not come back as an OK capacity certificate.
61"$BIN" eval $F/inverted_masks_overflow.oev --asof 2026-10-24 > "$OUT/inverted.json"; rc=$?
62[ $rc -eq 1 ]; check $? "inverted lifetime exits 1"
63grep -q '"status": "REFUSED_LIFETIME"' "$OUT/inverted.json"; check $? "inverted lifetime status"
64grep -q 'first=C' "$OUT/inverted.json"; check $? "inverted reason names first=C"
65grep -q 'last=A' "$OUT/inverted.json"; check $? "inverted reason names last=A"
66grep -q 'makespan' "$OUT/inverted.json"; [ $? -ne 0 ]; check $? "no makespan on inverted refusal"
67"$BIN" eval $F/inverted_lone.oev --asof 2026-10-24 > "$OUT/inverted_lone.json"; rc=$?
68[ $rc -eq 1 ]; check $? "lone inverted lifetime exits 1"
69grep -q '"status": "REFUSED_LIFETIME"' "$OUT/inverted_lone.json"; check $? "lone inverted is not peak 0"
70"$BIN" eval $F/capacity_two_80.oev --asof 2026-10-24 > "$OUT/cap80.json"; rc=$?
71[ $rc -eq 1 ]; check $? "two overlapping 80 B buffers exit 1"
72grep -q '"status": "REFUSED_CAPACITY"' "$OUT/cap80.json"; check $? "overlap is REFUSED_CAPACITY"
73"$BIN" eval $F/valid_disjoint_80.oev --asof 2026-10-24 > "$OUT/disjoint80.json"; rc=$?
74check $rc "disjoint 80 B pair exits 0"
75grep -q '"status": "OK"' "$OUT/disjoint80.json"; check $? "disjoint pair OK"
76grep -q '"bytes": 80' "$OUT/disjoint80.json"; check $? "disjoint peak 80"
77"$BIN" eval $F/valid_tie_80.oev --asof 2026-10-24 > "$OUT/tie80.json"; rc=$?
78check $rc "completion/allocation tie exits 0"
79grep -q '"status": "OK"' "$OUT/tie80.json"; check $? "tie OK"
80grep -q '"bytes": 80' "$OUT/tie80.json"; check $? "tie peak 80"
81"$BIN" pareto $F/inverted_masks_overflow.oev $F/valid_disjoint_80.oev --asof 2026-10-24 > "$OUT/pareto_life.txt"; rc=$?
82check $rc "pareto with a refused lifetime exits 0"
83grep -q 'inverted_masks_overflow.oev *REFUSED_LIFETIME' "$OUT/pareto_life.txt"; check $? "inverted row is refused, not ranked OK"
84grep -q 'valid_disjoint_80.oev *OK' "$OUT/pareto_life.txt"; check $? "valid row still ranked"
85
86say "outputs in $OUT"
87exit $fail