From 8e2686d008903a3e0bb5d952dcd5ea96e68b706b Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:42:31 +0000 Subject: [PATCH] Prover floor: the beside-the-miner sweep playbook (sweep 3) Co-Authored-By: Claude Fable 5.1 --- tools/prover-floor/pc2-floor-sweep3-miner.ps1 | 66 +++++++++++++++++++ tools/prover-floor/points-sweep3-miner.txt | 4 ++ 2 files changed, 70 insertions(+) create mode 100644 tools/prover-floor/pc2-floor-sweep3-miner.ps1 create mode 100644 tools/prover-floor/points-sweep3-miner.txt diff --git a/tools/prover-floor/pc2-floor-sweep3-miner.ps1 b/tools/prover-floor/pc2-floor-sweep3-miner.ps1 new file mode 100644 index 00000000..8282cc4e --- /dev/null +++ b/tools/prover-floor/pc2-floor-sweep3-miner.ps1 @@ -0,0 +1,66 @@ +# Published WITHOUT --stop-miners: the beside-the-miner pair (the 5090 mining at full rate on the same card). +# Prover floor (5 October 2026): the peak GPU memory and the time of one compressed shard proof through the PATCHED +# sp1-gpu-server (/opt/igneum-floor/home/.sp1/bin, reached by HOME=/opt/igneum-floor/home: the SDK spawns the +# server it finds under $HOME/.sp1/bin, sp1-cuda-6.8.1/src/server.rs) on PC 2's RTX 5090, the miners STOPPED by the +# job (--stop-miners) and the live prover switched off for the run (its server would otherwise own the socket). +# Every point: every server killed and its socket unlinked, a 1-s nvidia-smi sampler, one `--mode compressed +# --shard 0` of the pv1 host (/opt/igneum-pv1, the UNPATCHED SDK and verifier: its VERIFIED is the unpatched +# verifier's word on the patched server's proof), the peak, the time, the FLOOR lines the server prints. +# The point list comes from the FLOOR_POINTS environment the job carries, else the default sweep below. +$ErrorActionPreference = 'Continue' +$urlFile = if ($env:IGNEUM_APP_DIR) { Join-Path $env:IGNEUM_APP_DIR 'app.url' } else { Join-Path $env:LOCALAPPDATA 'igneum\app\app.url' } +if (-not (Test-Path $urlFile)) { $urlFile = Join-Path $env:LOCALAPPDATA 'igneum\app\app.url' } +$base = (Get-Content $urlFile -Raw).Trim().TrimEnd('/') +function Stamp { (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ') } +function Prove($on) { try { (Invoke-RestMethod -Method Post -Uri "$base/api/prove" -ContentType 'application/json' -Body (@{on=$on} | ConvertTo-Json -Compress) -TimeoutSec 10) | ConvertTo-Json -Compress } catch { "error: $_" } } +"RESULT start $(Stamp) prover off for the run: $(Prove $false)" +Start-Sleep -Seconds 45 +"RESULT gpus $(Stamp) $((& nvidia-smi --query-gpu=index,name,memory.used,memory.total,utilization.gpu,power.draw --format=csv,noheader,nounits 2>$null) -join ' | ')" +$job = $env:IGNEUM_JOB_DIR; if (-not $job) { $job = Join-Path $env:TEMP 'igneum-floor-measure' }; New-Item -ItemType Directory -Force -Path $job | Out-Null +function WslPath($p) { $w = (& wsl.exe -d Ubuntu-24.04 -u root -- wslpath -a ($p -replace '\\', '/') 2>$null); if ($w) { ($w -replace "`0", '').Trim() } else { '/mnt/c' + ($p.Substring(2) -replace '\\', '/') } } +$jobW = WslPath $job +$emptyW = WslPath (Join-Path $env:LOCALAPPDATA 'igneum\app\jobs\chain-pc2-pv1c\block-83616.json') +$points = if ($env:FLOOR_POINTS) { $env:FLOOR_POINTS } else { 'run m12 "$EMPTY" SP1_GPU_MEMORY_BUDGET_GB=12;run m12 "$V1" SP1_GPU_MEMORY_BUDGET_GB=12;run me26 "$V1" SP1_GPU_ELEMENT_THRESHOLD=67108864;run me26 "$EMPTY" SP1_GPU_ELEMENT_THRESHOLD=67108864' } +$bash = @' +set -uo pipefail +export PATH="$HOME/.cargo/bin:$PATH" +CUDA_DIR="$(ls -d /usr/local/cuda-12.* 2>/dev/null | sort -V | tail -1 || true)"; [ -n "$CUDA_DIR" ] && export PATH="$CUDA_DIR/bin:$PATH" && export LD_LIBRARY_PATH="$CUDA_DIR/lib64:/usr/lib/wsl/lib:${LD_LIBRARY_PATH:-}" +stamp() { date -u +%Y-%m-%dT%H:%M:%SZ; } +JOB='JOBW_PLACEHOLDER'; H=/opt/igneum-pv1/igneum-prove-host; FX="/root/igneum-prove-pv1/proving/fixtures" +FLOORHOME=/opt/igneum-floor/home; SRV=$FLOORHOME/.sp1/bin/sp1-gpu-server +EMPTY='EMPTY_PLACEHOLDER'; V1="$FX/fees-v1-shards2.json"; FULL="$FX/block-338-shard1.json"; ONE="$FX/block-56-transfers.json" +[ -x "$SRV" ] || { echo "RESULT measure_failed no patched server at $SRV"; exit 2; } +[ -x "$H" ] || { echo "RESULT measure_failed no pv1 host at $H"; exit 2; } +echo "RESULT patched_server sha256=$(sha256sum $SRV | cut -c1-64) version=$($SRV --version 2>/dev/null) host=$(sha256sum $H | cut -c1-16)" +echo "RESULT live_server sha256=$(sha256sum /root/.sp1/bin/sp1-gpu-server | cut -c1-16) untouched" +pkill -f sp1-gpu-server 2>/dev/null; sleep 2; rm -f /tmp/sp1-cuda-*.sock +echo "RESULT idle_mib $(nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits | head -1)" +run() { # name fixture env... + local name="$1" fx="$2"; shift 2 + local tag="$name-$(basename $fx .json)" + pkill -f sp1-gpu-server 2>/dev/null; sleep 2; rm -f /tmp/sp1-cuda-*.sock + local csv="$JOB/smi-$tag.csv" log="$JOB/log-$tag.txt" + nvidia-smi --query-gpu=timestamp,memory.used,utilization.gpu --format=csv,noheader,nounits -l 1 > "$csv" 2>/dev/null & + local SMI=$! + local t0=$(date +%s) + env HOME=$FLOORHOME SP1_PROVER=cuda RUST_LOG=off SP1_GPU_FLOOR_LOG=1 "$@" $H "$fx" --mode compressed --shard 0 --out "$JOB/res-$tag.json" > "$log" 2>&1 + local rc=$? + local wall=$(( $(date +%s) - t0 )) + pkill -f sp1-gpu-server 2>/dev/null; sleep 1; kill $SMI 2>/dev/null; sleep 1; rm -f /tmp/sp1-cuda-*.sock + local peak=$(awk -F', *' '{ if ($2+0 > m) m=$2+0 } END { print m+0 }' "$csv") + local n=$(wc -l < "$csv") + local line=$(grep -E "^RESULT compressed shard" "$log" | tail -1 | sed -E 's/.*prove ([0-9.]+) s, proof ([0-9]+) bytes, verify ([0-9.]+) s, ([A-Z ]+);.*/prove_s=\1 bytes=\2 verify_s=\3 \4/') + local cyc=$(grep -E "^RESULT execute shard" "$log" | tail -1 | sed -E 's/.*: ([0-9]+) cycles.*/\1/') + local err=$(grep -iE "error|panick|out of memory|OOM|unsupported" "$log" | grep -v "^FLOOR" | head -1 | cut -c1-200) + echo "RESULT floor cfg=$name fixture=$(basename $fx .json) peak_mib=$peak samples=$n wall_s=$wall cycles=${cyc:-na} ${line:-no_result} exit=$rc env='$*' ${err:+err=$err}" + grep -E "^FLOOR" "$log" | sed "s/^/RESULT floorline cfg=$name fixture=$(basename $fx .json) /" | head -40 +} +POINTS_PLACEHOLDER_BASH +pkill -f sp1-gpu-server 2>/dev/null; sleep 1; rm -f /tmp/sp1-cuda-*.sock +echo "RESULT measure_end $(stamp)" +'@ +$bash = $bash.Replace('JOBW_PLACEHOLDER', $jobW).Replace('EMPTY_PLACEHOLDER', $emptyW).Replace('POINTS_PLACEHOLDER_BASH', ($points -replace ';', "`n")) +$bashFile = Join-Path $job 'measure.sh' +[IO.File]::WriteAllText($bashFile, ($bash -replace "`r`n", "`n"), (New-Object System.Text.UTF8Encoding $false)) +& wsl.exe -d Ubuntu-24.04 -u root -- bash (WslPath $bashFile) 2>&1 | ForEach-Object { ($_ -replace "`0", '') } +"RESULT end $(Stamp) prover back on: $(Prove $true)" diff --git a/tools/prover-floor/points-sweep3-miner.txt b/tools/prover-floor/points-sweep3-miner.txt new file mode 100644 index 00000000..dbd349a6 --- /dev/null +++ b/tools/prover-floor/points-sweep3-miner.txt @@ -0,0 +1,4 @@ +run m12 "$EMPTY" SP1_GPU_MEMORY_BUDGET_GB=12 +run m12 "$V1" SP1_GPU_MEMORY_BUDGET_GB=12 +run me26 "$V1" SP1_GPU_ELEMENT_THRESHOLD=67108864 +run me26 "$EMPTY" SP1_GPU_ELEMENT_THRESHOLD=67108864