interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / evidence / FB1-CUT4B-88f3f59-probe / probe_gpu_open.sh

49 lines · 2779 bytes Raw Blame History
1#!/bin/bash
2# tools/probe_gpu_open.sh OUT_DIR [N]
3# FB-1 cut 4b flake investigation: does the FIRST chip call of a fresh process fail
4# in the device-open path (seen twice: cut 1b run 2, cut 3c attempt 1)? Each sample
5# is a fresh process (build/gpu_session_probe). Variants, N samples each, in order:
6# baseline one probe at a time, idle gap 200 ms between processes
7# back_to_back the next probe starts the instant the previous one exits (the sighting:
8# "another chip job had just used the chip")
9# overlap a holder keeps a device open (hold 300 ms) while the probe opens its own
10# after_latch NOT RUN (would need a deliberate stall; never leave the chip uncertain)
11# Negative control first: the probe must report a failure when it cannot open the
12# control nodes (file-descriptor limit 3 -> open() fails), with the stage named.
13# Run through the heavy queue only (lanes.sh queue --heavy); never kill it.
14set -u
15OUT=${1:?out dir}; N=${2:-30}
16cd "$(dirname "$0")/.." || exit 2
17P=${PHYSICS_DIR:-../physics}
18mkdir -p "$OUT"
19make PHYSICS_DIR="$P" build/gpu_session_probe > "$OUT/build.log" 2>&1 || { echo "PROBE BUILD FAIL"; exit 1; }
20PR=./build/gpu_session_probe
21LOG="$OUT/probe.log"; : > "$LOG"
22{ uname -a; nvidia-smi --query-gpu=name,driver_version --format=csv,noheader 2>/dev/null; echo "omega $(git rev-parse HEAD) physics $(git -C "$P" rev-parse HEAD)"; date -u +%FT%TZ; } > "$OUT/device.txt"
23echo "## negative_control (fd limit 3: /dev/nvidiactl cannot be opened)" | tee -a "$LOG"
24( ulimit -n 3; $PR --label negative_control ) 2>&1 | tee -a "$LOG"
25neg_rc=${PIPESTATUS[0]}
26echo "negative_control exit=$neg_rc (must be non-zero with a named stage)" | tee -a "$LOG"
27fails=0; total=0
28run_variant() { # name
29 local name=$1 f=0
30 echo "## $name N=$N" | tee -a "$LOG"
31 for i in $(seq 1 "$N"); do
32 if [ "$name" = overlap ]; then $PR --label holder --hold-ms 300 >> "$LOG" 2>&1 & sleep 0.05; fi
33 $PR --label "$name#$i" 2>&1 | tee -a "$LOG" | grep -q 'rc=OK' || f=$((f+1))
34 [ "$name" = overlap ] && wait
35 [ "$name" = baseline ] && sleep 0.2
36 done
37 echo "$name: failures $f / $N" | tee -a "$LOG"
38 fails=$((fails+f)); total=$((total+N))
39}
40run_variant baseline
41run_variant back_to_back
42run_variant overlap
43grep -c 'rc=OK' "$LOG" > "$OUT/ok_count.txt"
44grep 'rc=' "$LOG" | grep -v 'rc=OK' | grep -v negative_control > "$OUT/failures.txt"
45echo "end $(date -u +%FT%TZ)" >> "$OUT/device.txt"
46cp tests/gpu_session_probe.c src/omega_gpu_session.c tools/probe_gpu_open.sh "$OUT/"
47(cd "$OUT" && sha256sum -- * > SHA256SUMS)
48echo "PROBE_GPU_OPEN: negative_control_exit=$neg_rc first_call_failures=$fails/$total (details $OUT/failures.txt)"
49[ "$neg_rc" != 0 ] || { echo "PROBE_GPU_OPEN: INSTRUMENT FAIL (negative control passed)"; exit 3; }