106 lines
8.3 KiB
PowerShell
106 lines
8.3 KiB
PowerShell
# Counter ASIC 3.0 gate run, the hash side (6 October 2026): gates G1 and G2 of docs/plans/counter-asic-2-rollout.md
|
|
# section 7 on PC 2's RTX 5090 (machine 1ccfe586) for the class v4 candidate mx8+sh256x27 composed with the era
|
|
# (docs/plans/counter-asic-3-gate/hash-gates.md). ONE signed `run` job carries both gates, as the PC 2 rule of the
|
|
# ca3 brief asks. It never quits, restarts or updates the installed app, never touches the prover (left ON), /opt or
|
|
# settings.json (read only, for the card keys), and does not switch the card off: bit-exactness and the verifier
|
|
# re-hash are not load sensitive, so the app keeps mining beside the runs and every row says what ran on the card.
|
|
# The kit is the fetch job fetch-ca3-v4-20261006 (packs-ca3-v4: the class v3 control mx8-devnet-epoch0 and the seven
|
|
# class v4 packs v4-devnet-epoch0, v4-era-0 .. v4-era-5, each with seeds.txt), every file sha256-listed.
|
|
# G1: the INSTALLED igneum-worker-cuda.exe (NVRTC, the pack's own kernel text) --bench on every pack: the self-test
|
|
# (cache FNV, dataset head, word MASK, 64 samples, 96 vector lanes) and the 2^24 fingerprint at base nonce 0, which
|
|
# must equal the Mac's (Metal and Apple OpenCL). G2: the worker's serve mode, one job of 1,024 nonces at target
|
|
# ffffffffffffffff per pack (every nonce a "found g2 <nonce> <hash>" line). The found lines never go to stdout: the
|
|
# intake's closing report keeps the last 200 KB of job.log and a file upload its last 256 KB, and the first run of this
|
|
# job (15:52Z) lost its G1 lines under 8 x 1,024 found lines. Each pack's found lines go to g2-<pack>.found in this job's
|
|
# folder (LF, nonce order), and stdout carries one line per pack: the count and the file's sha256. The Mac re-check
|
|
# (tools/ca3-v4/g2-recheck.sh) derives the same file from `igneum-pow hash-bound --prehash 00..01 --count 1024` on the
|
|
# same pack and compares digests: equal digests are 1,024 of 1,024; on a mismatch the file is fetched with
|
|
# `publish-jobs.sh add --kind collect --glob "app/jobs/<job id>/g2-*.found"` and diffed line by line. Every result line
|
|
# starts with RESULT, there are about 60 of them, and the report carries them all whatever the log length; the full
|
|
# job.log stays at app/jobs/<job id>/job.log on the PC (the RESULT log line names it; collect it with the same glob form).
|
|
$ErrorActionPreference = 'Continue'
|
|
function Stamp { (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ') }
|
|
function Smi($q) { try { (& nvidia-smi --query-gpu=$q --format=csv,noheader,nounits 2>$null) -join ' | ' } catch { 'nvidia-smi failed' } }
|
|
function CudaApps { @(& nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv,noheader 2>$null | ForEach-Object { "$_" }) }
|
|
"RESULT start $(Stamp) machine $env:COMPUTERNAME"
|
|
"RESULT log $(Join-Path $env:IGNEUM_JOB_DIR 'job.log') (the full output; the found lines of G2 are g2-<pack>.found beside it: collect --glob app/jobs/<job id>/g2-*.found)"
|
|
"RESULT gpus $(Stamp) $(Smi 'index,name,driver_version,memory.used,clocks.sm,clocks.mem,power.draw,power.limit,temperature.gpu')"
|
|
|
|
# the kit: the fetch job's folder under the app's jobs folder (nothing of another job's is reached)
|
|
$jobs = Split-Path $env:IGNEUM_JOB_DIR
|
|
$kit = Join-Path $jobs 'fetch-ca3-v4-20261006'
|
|
$packs = Join-Path $kit 'packs-ca3-v4'
|
|
if (-not (Test-Path $packs)) { "RESULT error packs missing at $packs (the fetch job fetch-ca3-v4-20261006 runs first)"; exit 2 }
|
|
$inst = @("$env:LOCALAPPDATA\Programs\Igneum Miner", "$env:ProgramFiles\Igneum Miner") | Where-Object { Test-Path (Join-Path $_ 'igneum-worker-cuda.exe') } | Select-Object -First 1
|
|
if (-not $inst) { "RESULT error no installed igneum-worker-cuda.exe"; exit 2 }
|
|
$exe = Join-Path $inst 'igneum-worker-cuda.exe'
|
|
"RESULT worker $exe sha256 $((Get-FileHash -Algorithm SHA256 $exe).Hash.ToLower()) bytes $((Get-Item $exe).Length)"
|
|
$appExe = Join-Path $inst 'igneum-app.exe'
|
|
if (Test-Path $appExe) { try { "RESULT app-version $((& $appExe --version 2>&1 | Out-String).Trim())" } catch { } }
|
|
foreach ($f in (Get-ChildItem $packs -Recurse -File | Sort-Object FullName)) { "RESULT kitfile $($f.FullName.Substring($packs.Length + 1).Replace('\', '/')) sha256 $((Get-FileHash -Algorithm SHA256 $f.FullName).Hash.ToLower()) bytes $($f.Length)" }
|
|
|
|
# the card keys, both forms, from settings.json (read only; nothing is posted: the card stays as it is)
|
|
$appDir = $env:IGNEUM_APP_DIR
|
|
if (-not $appDir) { $appDir = Join-Path $env:LOCALAPPDATA 'igneum\app' }
|
|
$sj = Join-Path $appDir 'settings.json'
|
|
if (Test-Path $sj) {
|
|
try {
|
|
$settings = Get-Content -LiteralPath $sj -Raw | ConvertFrom-Json
|
|
if ($settings.cards) {
|
|
foreach ($p in $settings.cards.PSObject.Properties) {
|
|
$short = ($p.Name -split ':')[0] + ':' + (($p.Name -split ':') | Select-Object -Last 1)
|
|
"RESULT card-key settings.json `"$($p.Name)`" short-form `"$short`" enabled=$($p.Value.enabled) identities=$($p.Value.identities) power_pct=$($p.Value.power_pct)"
|
|
}
|
|
} else { 'RESULT card-key none in settings.json' }
|
|
} catch { "RESULT card-key settings.json unreadable: $_" }
|
|
} else { 'RESULT card-key no settings.json' }
|
|
$w = @(Get-Process -Name 'igneum-worker-cuda' -ErrorAction SilentlyContinue)
|
|
"RESULT processes $(Stamp) igneum-worker-cuda running: $($w.Count) (the app's miners, left as they are); compute apps: $((CudaApps) -join '; ')"
|
|
|
|
$order = @('mx8-devnet-epoch0', 'v4-devnet-epoch0', 'v4-era-0', 'v4-era-1', 'v4-era-2', 'v4-era-3', 'v4-era-4', 'v4-era-5')
|
|
# ---- G1: --bench on every pack (self-test + 2^24 fingerprint at base 0; 5 timed dispatches, the rate a reference beside the miner) ----
|
|
foreach ($pk in $order) {
|
|
$d = Join-Path $packs $pk
|
|
if (-not (Test-Path $d)) { "RESULT g1 $pk missing"; continue }
|
|
$t0 = Get-Date
|
|
"RESULT g1 $pk start $(Stamp)"
|
|
& $exe --bench --pack $d --batches 5 --batch-log2 24 --block-warps 1 2>&1 | ForEach-Object { "RESULT g1 $pk $_" }
|
|
"RESULT g1 $pk end $(Stamp) exit=$LASTEXITCODE wall_s=$([int]((Get-Date) - $t0).TotalSeconds)"
|
|
}
|
|
|
|
# ---- G2: serve mode, 1,024 nonces at target ff..ff per pack, every nonce a found line ----
|
|
$g2Pre = '0000000000000000000000000000000000000000000000000000000000000001'
|
|
function G2-JobLines([string] $d) {
|
|
$ph = Get-Content -LiteralPath (Join-Path $d 'program.h') -Raw
|
|
$epoch = ([regex]::Match($ph, '#define IGNEUM_SEED_BYTES_HEX "([0-9a-f]+)"')).Groups[1].Value
|
|
$day = ([regex]::Match($ph, '#define IGNEUM_DAY_BYTES_HEX "([0-9a-f]+)"')).Groups[1].Value
|
|
$tokens = ''
|
|
$cls = [regex]::Match($ph, '#define IGNEUM_PROGRAM_CLASS "(v[234])"')
|
|
$era = [regex]::Match($ph, '#define IGNEUM_ERA_SEED_HEX "([0-9a-f]+)"')
|
|
# the class token is the pack's own (v3 or v4 since ca3-v4-node 7c22d0d: a class v4 pack is generator 4 and says "v4")
|
|
if ($cls.Success -and $cls.Groups[1].Value -ne 'v2') { $tokens = ' class=' + $cls.Groups[1].Value; if ($era.Success) { $tokens += ' era=' + $era.Groups[1].Value } }
|
|
return @("job g2 $g2Pre ffffffffffffffff 0 1024 $epoch $day$tokens", 'quit')
|
|
}
|
|
foreach ($pk in $order) {
|
|
$d = Join-Path $packs $pk
|
|
if (-not (Test-Path $d)) { "RESULT g2 $pk missing"; continue }
|
|
$lines = G2-JobLines $d
|
|
"RESULT g2 $pk start $(Stamp) job-line $($lines[0])"
|
|
$out = $lines | & $exe --serve --pack $d --race off 2>&1
|
|
$code = $LASTEXITCODE
|
|
$found = @()
|
|
foreach ($l in $out) { $s = [string]$l; if ($s -match '^found g2 (\d+) ([0-9a-f]{16})$') { $found += [pscustomobject]@{ n = [uint64]$Matches[1]; line = $s } } elseif ($s -match '^(ready|done|error|need)') { "RESULT g2 $pk $s" } }
|
|
# the found lines to a file in this job's folder: nonce order, LF, no BOM (the Mac derives the same bytes from hash-bound)
|
|
$ff = Join-Path $env:IGNEUM_JOB_DIR "g2-$pk.found"
|
|
$text = (($found | Sort-Object n | ForEach-Object { $_.line }) -join "`n")
|
|
if ($found.Count -gt 0) { $text += "`n" }
|
|
[IO.File]::WriteAllText($ff, $text, (New-Object Text.UTF8Encoding $false))
|
|
$dg = (Get-FileHash -Algorithm SHA256 $ff).Hash.ToLower()
|
|
$distinct = ($found | Select-Object -ExpandProperty n -Unique | Measure-Object).Count
|
|
"RESULT g2 $pk found $($found.Count) of 1024 distinct=$distinct sha256 $dg file $ff exit=$code"
|
|
}
|
|
$w = @(Get-Process -Name 'igneum-worker-cuda' -ErrorAction SilentlyContinue)
|
|
"RESULT processes $(Stamp) igneum-worker-cuda running: $($w.Count); compute apps: $((CudaApps) -join '; ')"
|
|
"RESULT gpus_after $(Stamp) $(Smi 'power.draw,power.limit,clocks.sm,clocks.mem,temperature.gpu,memory.used')"
|
|
"RESULT end $(Stamp)"
|
|
exit 0
|