112 lines
9.5 KiB
PowerShell
112 lines
9.5 KiB
PowerShell
# Counter ASIC 3.0, PC 1 AMD job G2 (6 October 2026): gate G2 of docs/plans/counter-asic-2-rollout.md section 7 on
|
|
# the AMD vendor (docs/plans/counter-asic-3-gate/hash-gates.md, the "RX 9070 XT" cell): the CPU verifier exact on
|
|
# 1,024 hashes from the RX 9070 XT (machine ae432dc7, gfx1201) for the class v4 candidate and the class v3 control.
|
|
# The hash lane's form (tools/ca3-v4/pc2-v4-gates.ps1, ca3-coord ca61dec: the class token from the pack's IGNEUM_PROGRAM_CLASS): one serve-mode job per pack of 1,024 nonces
|
|
# at target ffffffffffffffff and prehash 00..01 (every nonce a "found g2 <nonce> <hash>" line), through the kit's
|
|
# igneum-worker-opencl.exe (--serve --pack <dir> --device <gfx1201>); the found lines never go to stdout: each pack's
|
|
# lines go to g2-<pack>.found in this job's folder (nonce order, LF, no BOM) and ONE line per pack reports the count,
|
|
# the distinct nonces and the file's sha256. The Mac derives the same bytes from `igneum-pow hash-bound --prehash 00..01
|
|
# --nonce 0 --count 1024` on the same pack (tools/ca3-v4/g2-recheck.sh <pack dir> --digest <hex>): 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.
|
|
# Packs (the G2 kit, fetch job fetch-ca3-pc1-amd-g2-20261006): proto-cuda/packs-ca3-v4/v4-devnet-epoch0 (the candidate
|
|
# mx8+sh256x27 composed with the era at the devnet epoch-0 chain seeds; generator 4, class "v4", program id
|
|
# c120d7963abdcd96 since the program-id fix 7c22d0d, kernels and vectors byte-identical) and packs-ca3-v4/mx8-devnet-epoch0
|
|
# (the class v3 control, id 73bcbfe8ccf988f1). The first kit's sh256x27 is the genesis STRING-seed pack (IGNEUM_SEED_BYTES_HEX of 14 bytes), which the
|
|
# worker's job protocol cannot take (epoch_seed must be 64 hex), so G2 runs on the chain-seed packs the 5090 and the
|
|
# Mac ran (8 x 1,024 of 1,024 there). Beside the miners (correctness, not rate): no card is switched; the process
|
|
# list says what the card carried. Never quits, pauses, resumes or updates the installed app; never writes
|
|
# settings.json. Every result line starts with RESULT; a `SUMMARY {json}` line ends the job. Read back with
|
|
# `node tools/jobs.mjs <job id>`; the full output stays in app/jobs/<job id>/job.log on the PC beside the found files.
|
|
$ErrorActionPreference = 'Continue'
|
|
$jobName = 'pc1-amd-g2'
|
|
$kitId = 'fetch-ca3-pc1-amd-g2-20261006'
|
|
$started = Get-Date
|
|
function Stamp { (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ') }
|
|
function Summary([string] $status, [hashtable] $extra) {
|
|
$o = [ordered]@{ job = $jobName; status = $status; duration_s = [int]((Get-Date) - $started).TotalSeconds; finished_at = (Stamp) }
|
|
foreach ($k in $extra.Keys) { $o[$k] = $extra[$k] }
|
|
'SUMMARY ' + ($o | ConvertTo-Json -Compress -Depth 4)
|
|
}
|
|
# the verifier's digests of the two found files, derived on the Mac through tools/ca3-v4/g2-recheck.sh on 6 October
|
|
# 2026 (the kit worker's serve mode on Apple OpenCL gave the same files): a match is 1,024 of 1,024 with no file moved
|
|
$expectedDigest = @{ 'mx8-devnet-epoch0' = '2a1824a2e0834287cf53b33f84cb7322014c85efa9788bece574e4e0730940bd'; 'v4-devnet-epoch0' = '435b976a4de57c5a26c8bada8b3b9e003504687c790d4b856bc56619d3aabd18' }
|
|
$order = @('mx8-devnet-epoch0', 'v4-devnet-epoch0')
|
|
"RESULT start $(Stamp) job=$jobName machine=$env:COMPUTERNAME app_version=$env:IGNEUM_APP_VERSION"
|
|
"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)"
|
|
$jobs = Split-Path $env:IGNEUM_JOB_DIR
|
|
$kit = Join-Path $jobs $kitId
|
|
if (-not (Test-Path $kit)) { "RESULT error kit missing at $kit (the fetch job $kitId runs first; republish it after any app update)"; Summary 'failed' @{ error = 'kit missing' }; exit 2 }
|
|
$exe = Join-Path $kit 'bin\igneum-worker-opencl.exe'
|
|
$packs = Join-Path $kit 'packs'
|
|
if (-not (Test-Path $exe)) { "RESULT error worker missing at $exe"; Summary 'failed' @{ error = 'worker missing' }; exit 2 }
|
|
if (-not (Test-Path $packs)) { "RESULT error packs missing at $packs"; Summary 'failed' @{ error = 'packs missing' }; exit 2 }
|
|
"RESULT worker kit $exe sha256 $((Get-FileHash -Algorithm SHA256 $exe).Hash.ToLower()) bytes $((Get-Item $exe).Length)"
|
|
foreach ($pk in $order) {
|
|
$d = Join-Path $packs $pk
|
|
if (-not (Test-Path (Join-Path $d 'kernel_bound.cl'))) { "RESULT error pack $pk missing at $d"; Summary 'failed' @{ error = "pack $pk missing" }; exit 2 }
|
|
"RESULT pack $pk kernel_bound.cl sha256 $((Get-FileHash -Algorithm SHA256 (Join-Path $d 'kernel_bound.cl')).Hash.ToLower()) program.h sha256 $((Get-FileHash -Algorithm SHA256 (Join-Path $d 'program.h')).Hash.ToLower())"
|
|
}
|
|
$job = $env:IGNEUM_JOB_DIR; if (-not $job) { $job = Join-Path $env:TEMP 'igneum-ca3-pc1-amd-g2' }; New-Item -ItemType Directory -Force -Path $job | Out-Null
|
|
|
|
# the OpenCL device index of the 9070 XT (the installed worker's list when present: the app's own indices)
|
|
$inst = @("$env:LOCALAPPDATA\Programs\Igneum Miner", "$env:ProgramFiles\Igneum Miner") | Where-Object { Test-Path (Join-Path $_ 'igneum-app.exe') } | Select-Object -First 1
|
|
$listExe = $exe
|
|
if ($inst -and (Test-Path (Join-Path $inst 'igneum-worker-opencl.exe'))) { $listExe = Join-Path $inst 'igneum-worker-opencl.exe' }
|
|
$list = @(& $listExe --list 2>&1 | ForEach-Object { "$_" })
|
|
$list | ForEach-Object { "RESULT list $_" }
|
|
$dev = $null
|
|
foreach ($l in $list) { if ($l -match '^\s*\[(\d+)\].*gfx1201' -and $l -notmatch 'dup') { $dev = [int]$Matches[1]; break } }
|
|
if ($null -eq $dev) { "RESULT error no gfx1201 device in --list (the eGPU is off the bus: G2 on AMD stays OWED)"; Summary 'failed' @{ error = 'no gfx1201' }; exit 2 }
|
|
"RESULT device $dev gfx1201 (list from $listExe)"
|
|
function Workers { @(Get-CimInstance Win32_Process -Filter "Name = 'igneum-worker-opencl.exe' OR Name = 'igneum-worker-cuda.exe'" -ErrorAction SilentlyContinue | ForEach-Object { "$($_.Name):$($_.ProcessId):[$($_.CommandLine -replace '\s+', ' ')]" }) }
|
|
$w = @(Workers)
|
|
$loaded = ($w | Where-Object { $_ -match "igneum-worker-opencl.*--device\s+$dev(\s|$)" }).Count -gt 0
|
|
"RESULT workers_before $(Stamp) $($w -join ' ')"
|
|
"RESULT context card_state=$(if ($loaded) { 'loaded (the card mines beside this job: a correctness gate, the load changes nothing)' } else { 'quiet (no opencl worker with --device ' + $dev + ')' })"
|
|
|
|
# ---- G2: serve mode, 1,024 nonces at target ff..ff per pack, every nonce a found line, the lines to a file ----
|
|
$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";
|
|
# the worker refuses a token that disagrees with the pack)
|
|
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')
|
|
}
|
|
$ok = 0; $digestMatch = 0
|
|
foreach ($pk in $order) {
|
|
$d = Join-Path $packs $pk
|
|
$lines = G2-JobLines $d
|
|
if ($lines[0] -notmatch ' [0-9a-f]{64} ') { "RESULT g2 $pk error=the pack's IGNEUM_SEED_BYTES_HEX is not 64 hex (a string-seed pack cannot be served)"; continue }
|
|
$t0 = Get-Date
|
|
"RESULT g2 $pk start $(Stamp) job-line $($lines[0])"
|
|
$out = $lines | & $exe --serve --pack $d --device $dev 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|prepared|info first pack|build )') { "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 $job "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
|
|
$want = $expectedDigest[$pk]
|
|
$m = if ($want -and $want -notmatch '^__') { if ($dg -eq $want) { 'yes' } else { 'no' } } else { 'unknown' }
|
|
"RESULT g2 $pk found $($found.Count) of 1024 distinct=$distinct sha256 $dg file $ff exit=$code"
|
|
"RESULT G2 pack=$pk found=$($found.Count) distinct=$distinct digest=$dg digest_match=$m expected=$want wall_s=$([int]((Get-Date) - $t0).TotalSeconds) card=gfx1201 harness=opencl-kit-serve card_state=$(if ($loaded) { 'loaded' } else { 'quiet' })"
|
|
if ($found.Count -eq 1024 -and $distinct -eq 1024 -and $code -eq 0) { $ok++ }
|
|
if ($m -eq 'yes') { $digestMatch++ }
|
|
}
|
|
"RESULT workers_after $(Stamp) $((Workers) -join ' ')"
|
|
"RESULT end $(Stamp)"
|
|
$status = if ($ok -eq $order.Count) { 'done' } elseif ($ok -gt 0) { 'partial' } else { 'failed' }
|
|
Summary $status @{ packs_ok = $ok; packs_wanted = $order.Count; digest_match = $digestMatch; device = $dev; card_state = $(if ($loaded) { 'loaded' } else { 'quiet' }) }
|
|
if ($status -eq 'failed') { exit 1 }
|
|
exit 0
|