From a5fb74a3a3886331e9d4c2c8e4686a2ff42f7c20 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Thu, 8 Oct 2026 15:17:09 +0000 Subject: [PATCH] class v6 kit: the two-pack emulation runner (the known-failed shape: the plain-address pack and the fold pack of one seed read two ids and two fingerprints on the worker's own kernel text) Co-Authored-By: Claude Fable 5.1 --- tools/class-v5/emu-two-packs-box.sh | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tools/class-v5/emu-two-packs-box.sh diff --git a/tools/class-v5/emu-two-packs-box.sh b/tools/class-v5/emu-two-packs-box.sh new file mode 100755 index 000000000..ac33024e1 --- /dev/null +++ b/tools/class-v5/emu-two-packs-box.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# The kit's CPU emulation of the NVRTC worker (the real kernel text on host threads, kits-on-box.sh's emu step lifted) on +# any two packs: pack A is run through --check, pack B is the second namespace the two-pack emulation needs. Prints each +# pack's id and class, then the check line (the dataset self-test, the vector warps, the fingerprint). The class v6 kit's +# known-failed shape (8 October 2026): the plain-address pack and the fold pack of one seed must read two ids and two +# fingerprints. A file run by path on the box, through the pool lease. +# emu-two-packs-box.sh [label] +set -uo pipefail +R="$1"; A="$2"; B="$3"; L="${4:-emu-two-packs}" +T=$(mktemp -d /tmp/v6-emu.XXXXXX); E="$T/emu"; mkdir -p "$E" +cd "$R" +for p in "$A" "$B"; do echo "PACK $(basename "$p") id $(grep -oE 'IGNEUM_PROGRAM_ID 0x[0-9a-f]+' "$p/program.h" | head -1 | awk '{print $2}') generator $(grep -oE 'IGNEUM_GENERATOR [0-9]+' "$p/program.h" | awk '{print $2}') class $(grep -oE 'IGNEUM_LOAD_CLASS "[^"]+"' "$p/program.h" | cut -d'"' -f2)"; done +emu_kernel() { { echo '#include '; echo '#include '; echo "namespace $2 {"; sed -E 's/([A-Za-z_0-9]+)<<<([^,]+), ([^>]+)>>>\(/emu_launch(\1, \2, \3, /' "$1/$3.cu"; echo "}"; } > "$E/$3_$2.cpp"; g++ -std=c++17 -O2 -w -I proto-cuda/emu -I "$1" -c "$E/$3_$2.cpp" -o "$E/$3_$2.o"; } +emu_kernel "$A" emu_pack_a kernel && emu_kernel "$A" emu_pack_a kernel_bound && emu_kernel "$B" emu_pack_b kernel && emu_kernel "$B" emu_pack_b kernel_bound \ + && g++ -std=c++17 -O2 -Wall -Wextra -DIGNEUM_EMU -I proto-cuda/nvrtc -I /usr/local/cuda/include -c proto-cuda/nvrtc/worker.cpp -o "$E/worker.o" \ + && g++ -std=c++17 -O2 -Wall -Wextra -DIGNEUM_EMU -DIGNEUM_EMU_TWO_PACKS -I proto-cuda/nvrtc -I proto-cuda/emu -I /usr/local/cuda/include -c proto-cuda/nvrtc/emu/emu_backend.cpp -o "$E/emu_backend.o" \ + && g++ -std=c++17 -O2 -w -I proto-cuda/emu -c proto-cuda/emu/shim.cpp -o "$E/shim.o" \ + && g++ -o "$E/igneum-worker-cuda-emu" "$E"/*.o -pthread 2> "$T/emu-build.log" || { echo "FAIL emu build"; head -30 "$T/emu-build.log"; exit 1; } +run_check() { # + local ed="$T/emu-$3"; mkdir -p "$ed" + cp "$E"/worker.o "$E"/emu_backend.o "$E"/shim.o "$ed"/ 2>/dev/null + ( cd "$ed" && E="$ed" emu_kernel "$1" emu_pack_a kernel && E="$ed" emu_kernel "$1" emu_pack_a kernel_bound && E="$ed" emu_kernel "$2" emu_pack_b kernel && E="$ed" emu_kernel "$2" emu_pack_b kernel_bound ) >/dev/null 2>&1 + g++ -o "$ed/igneum-worker-cuda-emu" "$ed"/*.o -pthread 2>> "$T/emu-build.log" || { echo "FAIL emu link $3"; return 1; } + /srv/builds/_bin/lease pool 32 --label "$L: $3" --owner class-v5 --class v5 --min 8 -- env IGNEUM_EMU_PACK="$1" IGNEUM_EMU_PACK2="$2" timeout 2400 "$ed/igneum-worker-cuda-emu" --check --pack "$1" > "$T/$3.log" 2>&1 + echo "RC $3 $?" + grep -E '^check (PASS|FAIL)|self-test|fingerprint|FAIL|error' "$T/$3.log" | grep -vE "^lease:" | cut -c1-320 +} +run_check "$A" "$B" "$(basename "$A")" +run_check "$B" "$A" "$(basename "$B")" +echo "logs under $T"