Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/benchmarks-mv/blob/main/native/queueflow/export-windows.sh # benchmarks-mv Measurement harnesses and evidence bundles for AIEN on the NVIDIA DGX Spark GB10. Speed is reported against the machine's physical limit and my own previous run. Attachment of AienOS. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `benchmarks-mv / native / queueflow / export-windows.sh` 73 lines ยท 4022 bytes Raw Blame History 1 #!/bin/sh 2 # SPDX-License-Identifier: Apache-2.0 3 # Copyright 2026 Drake Stapleton (AIEN / aien-dev) 4 # 5 # export-windows.sh: read-only export of the spark-window GPU queue trace to integer TSV. 6 # Usage: sh export-windows.sh WINDOWS_ROOT CUTOFF_EPOCH OUT_DIR 7 # Writes OUT_DIR/windows-dev.tsv (request time < CUTOFF), OUT_DIR/windows-heldout.tsv 8 # (request time >= CUTOFF) and OUT_DIR/windows-heldout.tsv.d0 (the latest end time of a dev 9 # window: the time the slot is free before the first held-out row). Only timestamps, codes and 10 # an owner index leave the trace: no window names, holder logs or box state are copied. 11 # Columns (all integers, tab separated, sorted by request time then window id): 12 # 1 req epoch s, content of /requested 13 # 2 start epoch s, mtime of /held (the lock was taken); 0 if the window never held 14 # 3 end epoch s, mtime of /close.json 15 # 4 lease seconds (/lease minutes * 60) 16 # 5 gb10 0 none, 1 shared, 2 exclusive, 9 absent/other 17 # 6 quiet 0 none, 1 exclusive, 9 absent/other 18 # 7 close 0 closed, 1 closed while still waiting, 2 reaped lease expired, 3 reaped holder gone, 9 other 19 # 8 verd 0 quiet machine, 1 NO VERDICT, 2 absent, 9 other 20 # 9 owner 1, 2, ... in order of first appearance of sha256(/owner) over the whole trace 21 # (the label itself is not exported) 22 # 10 waited open.json waited_s, -1 if absent 23 # 11 held close.json held_s, -1 if absent 24 # The trace itself is never written to. 25 set -eu 26 root=${1:?windows root}; cut=${2:?cutoff epoch}; out=${3:?out dir} 27 [ -d "$root" ] || { echo "export-windows: no directory $root" >&2; exit 2; } 28 mkdir -p "$out" 29 tmp="$out/.windows.all" 30 : > "$tmp" 31 for d in "$root"/2026*; do 32 [ -d "$d" ] || continue 33 [ -f "$d/requested" ] && [ -f "$d/close.json" ] || { echo "export-windows: skip open or partial $(basename "$d")" >&2; continue; } 34 req=$(date -u -d "$(head -n 1 "$d/requested" | cut -c1-20)" +%s) 35 if [ -f "$d/held" ]; then start=$(stat -c %Y "$d/held"); else start=0; fi 36 end=$(stat -c %Y "$d/close.json") 37 lease=$(( $(cat "$d/lease" 2>/dev/null || echo 0) * 60 )) 38 case "$(cat "$d/gb10" 2>/dev/null || echo x)" in none) g=0;; shared) g=1;; exclusive) g=2;; *) g=9;; esac 39 case "$(cat "$d/quiet" 2>/dev/null || echo x)" in none) q=0;; exclusive) q=1;; *) q=9;; esac 40 cj=$(tr -d '\n' < "$d/close.json") 41 case "$cj" in 42 *'"closed_by": "spark-window close", "reason": "closed while still waiting'*) c=1;; 43 *'"closed_by": "spark-window close", "reason": "closed"'*) c=0;; 44 *'"closed_by": "spark-window reap", "reason": "lease expired'*) c=2;; 45 *'"closed_by": "spark-window reap", "reason": "holder process gone'*) c=3;; 46 *) c=9;; 47 esac 48 case "$cj" in 49 *'"verdict": "quiet machine"'*) v=0;; 50 *'"verdict": "NO VERDICT'*) v=1;; 51 *'"verdict"'*) v=9;; 52 *) v=2;; 53 esac 54 own=$(printf '%s' "$(cat "$d/owner" 2>/dev/null)" | sha256sum | cut -c1-12) 55 own=$(printf '%d' "0x$own") 56 w=$(grep -o '"waited_s": [0-9]*' "$d/open.json" 2>/dev/null | head -n 1 | sed 's/.*: //') 57 [ -n "$w" ] || w=-1 58 h=$(printf '%s' "$cj" | grep -o '"held_s": [0-9]*' | head -n 1 | sed 's/.*: //') 59 [ -n "$h" ] || h=-1 60 printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' "$req" "$start" "$end" "$lease" "$g" "$q" "$c" "$v" "$own" "$w" "$h" "$(basename "$d")" >> "$tmp" 61 done 62 sort -t "$(printf '\t')" -k1,1n -k12,12 "$tmp" | awk -F '\t' -v cut="$cut" -v dev="$out/windows-dev.tsv" -v ho="$out/windows-heldout.tsv" ' 63 BEGIN { printf "" > dev; printf "" > ho; d0 = 0 } 64 { if (!($9 in own)) own[$9] = ++nown 65 $9 = own[$9] 66 if ($1 < cut && $3 > d0) d0 = $3 67 line = $1; for (i = 2; i <= 11; i++) line = line "\t" $i 68 if ($1 < cut) print line >> dev; else print line >> ho } 69 END { print d0 > (ho ".d0") }' 70 mv "$tmp" "$out/.windows.ids" 71 cut -f12 "$out/.windows.ids" > "$out/.windows.idlist" 72 mv "$out/.windows.idlist" "$out/.windows.ids" 73 echo "export-windows: dev $(wc -l < "$out/windows-dev.tsv") heldout $(wc -l < "$out/windows-heldout.tsv") cutoff $cut"