Counter ASIC 3.0 PC 1 AMD: the identities job (one POST api/cards for the 9070 XT's live entry back to 8, the rate before and after; main's go 17:0x UTC)
This commit is contained in:
parent
f40cc1abc3
commit
bdf59ac810
1 changed files with 66 additions and 0 deletions
66
tools/ca3-pc1-amd/pc1-amd-identities.ps1
Normal file
66
tools/ca3-pc1-amd/pc1-amd-identities.ps1
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# Counter ASIC 3.0, PC 1 AMD identities job (6 October 2026, main's go at 17:0x UTC): ONE POST to the installed app's
|
||||
# api/cards for the RX 9070 XT's live entry, {key: amd:gfx1201, enabled: true, identities: 8}, because job 1's restore
|
||||
# (15:56Z) posted another entry's identities (2) to every key form and the reset job's read (16:55Z) showed the app
|
||||
# running the card under amd:gfx1201 with identities 2 where it ran 8 before. Reads the app's state before, posts once,
|
||||
# waits for the card's worker to settle, reads the state after, and prints the rate before and after (18.92 MH/s at
|
||||
# 2 identities is the number to beat). Beside the miners; the only write is that one POST (it restarts that card's
|
||||
# worker, nothing else). Never quits, pauses, resumes or updates the installed app; never writes settings.json. Every
|
||||
# result line starts with RESULT; a `SUMMARY {json}` line closes the report; status failed unless the live key reads
|
||||
# identities 8 and state mining after the settle.
|
||||
$ErrorActionPreference = 'Continue'
|
||||
$jobName = 'pc1-amd-identities'
|
||||
$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)
|
||||
}
|
||||
"RESULT start $(Stamp) job=$jobName machine=$env:COMPUTERNAME app_version=$env:IGNEUM_APP_VERSION"
|
||||
$appDir = if ($env:IGNEUM_APP_DIR) { $env:IGNEUM_APP_DIR } else { Join-Path $env:LOCALAPPDATA 'igneum\app' }
|
||||
$urlFile = Join-Path $appDir 'app.url'
|
||||
$base = $null
|
||||
if (Test-Path $urlFile) { $base = (Get-Content -LiteralPath $urlFile -Raw).Trim().TrimEnd('/') }
|
||||
if (-not $base) { "RESULT identities error=no app.url under $appDir: nothing posted"; Summary 'failed' @{ reason = 'no app.url' }; exit 1 }
|
||||
|
||||
$wantKey = 'amd:gfx1201'
|
||||
$wantIdent = 8
|
||||
|
||||
function ReadLive([string] $tag) {
|
||||
# the 9070 XT's live entry from api/state: key, identities, state, pid, MH/s now and avg, watts
|
||||
try {
|
||||
$st = Invoke-RestMethod -Uri "$base/api/state" -Method GET -TimeoutSec 10
|
||||
$cards = $st.mining.cards; if (-not $cards) { $cards = $st.cards }
|
||||
foreach ($c in @($cards)) {
|
||||
if ($c.vendor -eq 'amd' -and ("$($c.key)" -match 'gfx1201')) {
|
||||
"RESULT live_$tag key=$($c.key) enabled=$($c.enabled) identities=$($c.identities) state=$($c.state) pid=$($c.pid) mhs_now=$($c.hash_now) mhs_avg=$($c.hash_avg) watts=$($c.power_w) at=$(Stamp)"
|
||||
return $c
|
||||
}
|
||||
}
|
||||
"RESULT live_$tag error=no gfx1201 card in api/state"
|
||||
return $null
|
||||
} catch { "RESULT live_$tag error=$($_.Exception.Message)"; return $null }
|
||||
}
|
||||
|
||||
$before = ReadLive 'before'
|
||||
if ($before -and "$($before.key)" -ne $wantKey) { "RESULT identities note=the live key is $($before.key), not $wantKey; posting to $wantKey as main ordered, the live key read after decides" }
|
||||
|
||||
# the one POST
|
||||
$body = @{ key = $wantKey; enabled = $true; identities = $wantIdent } | ConvertTo-Json -Compress
|
||||
try {
|
||||
Invoke-RestMethod -Uri "$base/api/cards" -Method POST -Body $body -ContentType 'application/json' -TimeoutSec 10 | Out-Null
|
||||
"RESULT posted key=$wantKey enabled=true identities=$wantIdent at=$(Stamp)"
|
||||
} catch { "RESULT posted error=$($_.Exception.Message)"; Summary 'failed' @{ reason = 'post failed' }; exit 1 }
|
||||
|
||||
# settle: the card's worker restarts under the new count; the rate needs its first STATUS window
|
||||
"RESULT settle 120 s"
|
||||
Start-Sleep -Seconds 120
|
||||
$after = ReadLive 'after'
|
||||
|
||||
$ok = $false
|
||||
if ($after) { $ok = ("$($after.identities)" -eq "$wantIdent") -and ($after.state -eq 'mining') }
|
||||
if ($before -and $after) { "RESULT rate before=$($before.hash_now) MH/s at identities $($before.identities); after=$($after.hash_now) MH/s at identities $($after.identities) (avg $($after.hash_avg)); the number to beat is 18.92 at 2" }
|
||||
if (-not $ok) { "RESULT identities error=the live entry does not read identities $wantIdent and mining after the settle (reads identities=$($after.identities) state=$($after.state))" }
|
||||
"RESULT end $(Stamp)"
|
||||
Summary $(if ($ok) { 'done' } else { 'failed' }) @{ key = $wantKey; identities_before = "$($before.identities)"; identities_after = "$($after.identities)"; mhs_before = "$($before.hash_now)"; mhs_after = "$($after.hash_now)" }
|
||||
exit $(if ($ok) { 0 } else { 1 })
|
||||
Loading…
Reference in a new issue