# The 192 integer decodes on the build host's platforms with the narrow kernel sets (binaries of mac-build.sh ). set -euo pipefail TAG=${1:?binary tag}; shift W=$RB_ROOT/det1/work; B=$RB_ROOT/idf/bin; X=$RB_ROOT/idf/xplat; mkdir -p $X OS="macOS $(sw_vers -productVersion)"; HW="arm64 desktop SoC, 24 performance and 8 efficiency cores" meta() { printf '{"system": "%s", "hardware": "%s", "target": "%s", "fabric": "%s", "kernels": "%s", "threads": "%s", "rustc": "%s", "runtime": "%s", "measured": "%s"}\n' "$OS" "$HW" "$1" "$2" "$3" "$4" "$(rustc --version | cut -d" " -f2)" "$5" "$(date +%F)"; } for step in "$@"; do case $step in neon) WAI_INT_ISA=neon $B/native.$TAG decode $W/jobs.dash.tsv > $X/macos-arm64-cpu-isa-neon.tsv meta aarch64-apple-darwin CPU "fast, kernel set neon" "all (32)" native > $X/macos-arm64-cpu-isa-neon.json ;; neon1) WAI_INT_ISA=neon WAI_INT_THREADS=1 $B/native.$TAG decode $W/jobs.dash.tsv > $X/macos-arm64-cpu-1t-isa-neon.tsv meta aarch64-apple-darwin CPU "fast, kernel set neon" 1 native > $X/macos-arm64-cpu-1t-isa-neon.json ;; wide) WAI_INT_ISA=wide $B/native.$TAG decode $W/jobs.dash.tsv > $X/macos-arm64-cpu-isa-wide.tsv meta aarch64-apple-darwin CPU "fast, kernel set wide" "all (32)" native > $X/macos-arm64-cpu-isa-wide.json ;; gpu) WAI_INT_ISA=neon $B/gpu.$TAG --gpu decode $W/jobs.dash.tsv > $X/macos-arm64-gpu-metal-isa-neon.raw 2> $X/macos-arm64-gpu-metal-isa-neon.err cut -f1-4 $X/macos-arm64-gpu-metal-isa-neon.raw > $X/macos-arm64-gpu-metal-isa-neon.tsv meta aarch64-apple-darwin "GPU, Metal, integrated (80 cores)" "fast, kernel set neon" "all (32) for graphs off the device" "wgpu 30.0.1, $(grep -o 'key=[^ ]*' $X/macos-arm64-gpu-metal-isa-neon.err | head -1)" > $X/macos-arm64-gpu-metal-isa-neon.json ;; wasm) S=$RB_ROOT/idf/wasm-shards; rm -rf $S; mkdir -p $S awk "{print > (\"$S/jobs.\" (NR-1)%8)}" $W/jobs.dash.tsv for f in $S/jobs.?; do wasmtime run --dir $W::$W --dir $S::$S $B/wasm.$TAG decode $f > $f.out & done; wait cat $S/jobs.?.out > $X/wasm32-wasip2-isa-wide.tsv meta wasm32-wasip2 "CPU, WebAssembly" "fast, kernel set wide (the only set on wasm)" "1 (eight decoder processes side by side)" "$(wasmtime --version | cut -d' ' -f1-2)" > $X/wasm32-wasip2-isa-wide.json ;; esac; wc -l $X/*.tsv | tail -1; done ls $X