diff --git a/tools/ca3-v4-amend/pc1-ca4-hot-ldcs.ps1 b/tools/ca3-v4-amend/pc1-ca4-hot-ldcs.ps1 index 0bb5fe2a4..2e0994f53 100644 --- a/tools/ca3-v4-amend/pc1-ca4-hot-ldcs.ps1 +++ b/tools/ca3-v4-amend/pc1-ca4-hot-ldcs.ps1 @@ -48,8 +48,15 @@ function HelperReset() { Start-Sleep -Seconds 2 try { Start-ScheduledTask -TaskName 'Igneum Power Helper' -ErrorAction Stop } catch { $t = "$_" -replace '\s+', ' '; "RESULT helper start refused: $t"; if ($t -match '800710E0') { 'RESULT helper STOP: the scheduler refused the elevated instance (0x800710E0); nothing escalates' }; return $false } $t = 0 - while ($t -lt 60) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } - 'RESULT helper STOP: helper.alive never freshened within 60 s of the start; nothing escalates' + while ($t -lt 20) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } + # the 0.3.20 helper's heartbeat file does not freshen on every run (the 02:45Z restore: stale past 60 s, the rgc answered at once), so a + # probe dev line answered in helper.log is the proof when the heartbeat is not + $s0 = HelperSeqBase + $mark = 0; if (Test-Path $helperLog) { $mark = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue).Count } + Set-Content -LiteralPath $cmdFile -Value "$s0 dev $idx`n" -NoNewline -Encoding ascii + $t2 = 0 + while ($t2 -lt 20) { Start-Sleep -Seconds 1; $t2++; $new = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue); if ($new.Count -gt $mark -and ($new[$mark..($new.Count - 1)] | Where-Object { $_ -match "\b$s0 dev " })) { "RESULT helper up after $($t + $t2) s (the heartbeat stale, the probe dev line $s0 answered in helper.log)"; return $true } } + 'RESULT helper STOP: no heartbeat within 20 s and no answer to a probe dev line within 20 more; nothing escalates' return $false } function HelperSeqBase() { $m = 0; foreach ($f in @($cmdFile, $helperLog)) { if (Test-Path $f) { foreach ($l in (Get-Content -LiteralPath $f -ErrorAction SilentlyContinue)) { if ($l -match '(?:^|\s)(\d{1,6}) (?:dev|pl|lgc|rgc|lmc|rmc|nvidia-smi|reregister)\b') { $v = [int]$Matches[1]; if ($v -gt $m) { $m = $v } } } } }; return $m + 100 } diff --git a/tools/ca3-v4-amend/pc1-ca4-microbench.ps1 b/tools/ca3-v4-amend/pc1-ca4-microbench.ps1 index 5282b9d02..d59d5519b 100644 --- a/tools/ca3-v4-amend/pc1-ca4-microbench.ps1 +++ b/tools/ca3-v4-amend/pc1-ca4-microbench.ps1 @@ -41,8 +41,15 @@ function HelperReset() { Start-Sleep -Seconds 2 try { Start-ScheduledTask -TaskName 'Igneum Power Helper' -ErrorAction Stop } catch { $t = "$_" -replace '\s+', ' '; "RESULT helper start refused: $t"; if ($t -match '800710E0') { 'RESULT helper STOP: the scheduler refused the elevated instance (0x800710E0); nothing escalates' }; return $false } $t = 0 - while ($t -lt 60) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } - 'RESULT helper STOP: helper.alive never freshened within 60 s of the start; nothing escalates' + while ($t -lt 20) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } + # the 0.3.20 helper's heartbeat file does not freshen on every run (the 02:45Z restore: stale past 60 s, the rgc answered at once), so a + # probe dev line answered in helper.log is the proof when the heartbeat is not + $s0 = HelperSeqBase + $mark = 0; if (Test-Path $helperLog) { $mark = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue).Count } + Set-Content -LiteralPath $cmdFile -Value "$s0 dev $idx`n" -NoNewline -Encoding ascii + $t2 = 0 + while ($t2 -lt 20) { Start-Sleep -Seconds 1; $t2++; $new = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue); if ($new.Count -gt $mark -and ($new[$mark..($new.Count - 1)] | Where-Object { $_ -match "\b$s0 dev " })) { "RESULT helper up after $($t + $t2) s (the heartbeat stale, the probe dev line $s0 answered in helper.log)"; return $true } } + 'RESULT helper STOP: no heartbeat within 20 s and no answer to a probe dev line within 20 more; nothing escalates' return $false } function HelperSeqBase() { $m = 0; foreach ($f in @($cmdFile, $helperLog)) { if (Test-Path $f) { foreach ($l in (Get-Content -LiteralPath $f -ErrorAction SilentlyContinue)) { if ($l -match '(?:^|\s)(\d{1,6}) (?:dev|pl|lgc|rgc|lmc|rmc|nvidia-smi|reregister)\b') { $v = [int]$Matches[1]; if ($v -gt $m) { $m = $v } } } } }; return $m + 100 } diff --git a/tools/ca3-v4-amend/pc1-ca4-packs.ps1 b/tools/ca3-v4-amend/pc1-ca4-packs.ps1 index f75a099a2..4f9da75bf 100644 --- a/tools/ca3-v4-amend/pc1-ca4-packs.ps1 +++ b/tools/ca3-v4-amend/pc1-ca4-packs.ps1 @@ -52,8 +52,15 @@ function HelperReset() { Start-Sleep -Seconds 2 try { Start-ScheduledTask -TaskName 'Igneum Power Helper' -ErrorAction Stop } catch { $t = "$_" -replace '\s+', ' '; "RESULT helper start refused: $t"; if ($t -match '800710E0') { 'RESULT helper STOP: the scheduler refused the elevated instance (0x800710E0); nothing escalates' }; return $false } $t = 0 - while ($t -lt 60) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } - 'RESULT helper STOP: helper.alive never freshened within 60 s of the start; nothing escalates' + while ($t -lt 20) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } + # the 0.3.20 helper's heartbeat file does not freshen on every run (the 02:45Z restore: stale past 60 s, the rgc answered at once), so a + # probe dev line answered in helper.log is the proof when the heartbeat is not + $s0 = HelperSeqBase + $mark = 0; if (Test-Path $helperLog) { $mark = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue).Count } + Set-Content -LiteralPath $cmdFile -Value "$s0 dev $idx`n" -NoNewline -Encoding ascii + $t2 = 0 + while ($t2 -lt 20) { Start-Sleep -Seconds 1; $t2++; $new = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue); if ($new.Count -gt $mark -and ($new[$mark..($new.Count - 1)] | Where-Object { $_ -match "\b$s0 dev " })) { "RESULT helper up after $($t + $t2) s (the heartbeat stale, the probe dev line $s0 answered in helper.log)"; return $true } } + 'RESULT helper STOP: no heartbeat within 20 s and no answer to a probe dev line within 20 more; nothing escalates' return $false } function HelperSeqBase() { $m = 0; foreach ($f in @($cmdFile, $helperLog)) { if (Test-Path $f) { foreach ($l in (Get-Content -LiteralPath $f -ErrorAction SilentlyContinue)) { if ($l -match '(?:^|\s)(\d{1,6}) (?:dev|pl|lgc|rgc|lmc|rmc|nvidia-smi|reregister)\b') { $v = [int]$Matches[1]; if ($v -gt $m) { $m = $v } } } } }; return $m + 100 } diff --git a/tools/ca3-v4-amend/pc1-v4-efficiency.ps1 b/tools/ca3-v4-amend/pc1-v4-efficiency.ps1 index fb5864a46..b9eaacd1a 100644 --- a/tools/ca3-v4-amend/pc1-v4-efficiency.ps1 +++ b/tools/ca3-v4-amend/pc1-v4-efficiency.ps1 @@ -141,8 +141,15 @@ function HelperReset() { Start-Sleep -Seconds 2 try { Start-ScheduledTask -TaskName 'Igneum Power Helper' -ErrorAction Stop } catch { $t = "$_" -replace '\s+', ' '; "RESULT helper start refused: $t"; if ($t -match '800710E0') { 'RESULT helper STOP: the scheduler refused the elevated instance (0x800710E0); nothing escalates' }; return $false } $t = 0 - while ($t -lt 60) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } - 'RESULT helper STOP: helper.alive never freshened within 60 s of the start; nothing escalates' + while ($t -lt 20) { Start-Sleep -Seconds 1; $t++; if ((HelperAliveAge) -le 4) { "RESULT helper fresh after $t s (helper.alive within 4 s; started over an empty cmd.txt)"; return $true } } + # the 0.3.20 helper's heartbeat file does not freshen on every run (the 02:45Z restore: stale past 60 s, the rgc answered at once), so a + # probe dev line answered in helper.log is the proof when the heartbeat is not + $s0 = HelperSeqBase + $mark = 0; if (Test-Path $helperLog) { $mark = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue).Count } + Set-Content -LiteralPath $cmdFile -Value "$s0 dev $idx`n" -NoNewline -Encoding ascii + $t2 = 0 + while ($t2 -lt 20) { Start-Sleep -Seconds 1; $t2++; $new = @(Get-Content -LiteralPath $helperLog -ErrorAction SilentlyContinue); if ($new.Count -gt $mark -and ($new[$mark..($new.Count - 1)] | Where-Object { $_ -match "\b$s0 dev " })) { "RESULT helper up after $($t + $t2) s (the heartbeat stale, the probe dev line $s0 answered in helper.log)"; return $true } } + 'RESULT helper STOP: no heartbeat within 20 s and no answer to a probe dev line within 20 more; nothing escalates' return $false } function HelperSeqBase() {