Files
lmxopcua/scripts/validation/opcua-lifecycle-memory/sdk1-comparator/launch.ps1
T
Joseph Doherty fea7de0aef
v2-ci / unit-tests (push) Waiting to run
docs(evidence): #799 acceptance runs on master aa60b3e3 - Windows x64 and Linux both fail the unchanged cold RSS cap
Owner scope 2026-11-12 (Windows x64 + Linux, unchanged cycle-3 caps, >=7200 s, SDK 1.5 comparator).

- Linux ARM64 (late-slope, 7200.12 s, 1964 cycles / 491 restarts, shutdown verified, analyzer-validated):
  first rejection RSS at cycle 247 / 900.73 s, 358,682,624 > 358,678,528 (+4 KiB); peak 382.98 MiB vs
  limit 342.06 MiB; late plateau medians 344.4/341.1/341.9 MiB, OLS -1.90 MiB/h. FAIL.
- Windows x64 on windev (same workload, working set as RSS, handle table as descriptors): first rejection RSS
  at cycle 285 / 1130.76 s, 303,505,408 > 302,174,208; peak 319.49 vs limit 288.18 MiB; plateau ~314-315 MiB,
  +0.93 MiB/h. FAIL. Also incomplete: the launcher's wall-clock outer deadline fired early after a +552 s
  w32time step and ended the run at test-phase 7014 s (rejection had already latched); launchers now use a
  Stopwatch.
- SDK 1.5.378.182 comparator (efb9197a publication, Windows, 7201 s): RSS peak +65.8 MiB (never over its cap),
  plateau ~+48 MiB, but the +32 handle cap tripped at cycle 17 (max 674 vs 642).
- Managed flat on both SDK2 runs; growth is the generated-factory JIT burst (+40k/+44k methods) - Linux JIT
  doublemapper ~180 MiB; Windows private bytes grew ~25 MiB of a ~132 MiB working-set rise.
- Retained: b61f3e05 cycle-1 fixture failure (#808 unplaced UNS folder), Windows/SDK1 smoke diagnostics.

No cap raised, no warm baseline, no failed run counted as passing.

Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
2026-11-12 14:51:31 -05:00

51 lines
3.3 KiB
PowerShell

<#
.SYNOPSIS
Runs the SDK 1.5.378.182 comparator (lmxopcua#799) for 7,200 s on Windows with the same envelope as ../windows/launch.ps1:
private task directory for TEMP and fixture PKI, ephemeral fixture credential, external 30 s sampler, 7,440 s outer deadline.
#>
param(
[Parameter(Mandatory)] [string] $Bin,
[Parameter(Mandatory)] [string] $Output,
[Parameter(Mandatory)] [string] $SourceRevision
)
$ErrorActionPreference = 'Stop'
if (Test-Path $Output) { throw 'Use a fresh output directory' }
New-Item -ItemType Directory -Path $Output | Out-Null
$Output = (Resolve-Path $Output).Path
New-Item -ItemType Directory -Path (Join-Path $Output 'tmp') | Out-Null
& icacls $Output /inheritance:r /grant:r "$($env:USERNAME):(OI)(CI)F" '*S-1-5-18:(OI)(CI)F' | Out-Null
$exe = Join-Path (Resolve-Path $Bin).Path 'sdk1-comparator.exe'
$started = Get-Date
# Monotonic: the 2026-11-12 windev run lost its last 186 s when a +552 s host clock step (w32time) advanced a wall-clock deadline.
$clock = [System.Diagnostics.Stopwatch]::StartNew()
$bytes = New-Object byte[] 3; [System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes)
$env:OTOPCUA_BASELINE_CANONICAL_KEY = 'otua_k-server-events_' + (($bytes | ForEach-Object { $_.ToString('x2') }) -join '')
$env:OTOPCUA_COMPARATOR_SOURCE = $SourceRevision
$env:TEMP = Join-Path $Output 'tmp'; $env:TMP = $env:TEMP
@{ kind = 'comparator-launch'; sourceRevision = $SourceRevision; exe = $exe
exeSha256 = (Get-FileHash -Algorithm SHA256 $exe).Hash.ToLowerInvariant()
coreClrSha256 = (Get-FileHash -Algorithm SHA256 (Join-Path (Split-Path $exe) 'coreclr.dll')).Hash.ToLowerInvariant()
startedUtc = $started.ToUniversalTime().ToString('o'); credentialBytes = $env:OTOPCUA_BASELINE_CANONICAL_KEY.Length } |
ConvertTo-Json | Set-Content -Encoding UTF8 (Join-Path $Output 'launch.json')
$psi = New-Object System.Diagnostics.ProcessStartInfo $exe
$psi.Arguments = "`"$(Join-Path $Output 'run')`" 7200 --comparator"
$psi.UseShellExecute = $false; $psi.RedirectStandardOutput = $true; $psi.RedirectStandardError = $true
$proc = [System.Diagnostics.Process]::Start($psi)
$outTask = $proc.StandardOutput.ReadToEndAsync(); $errTask = $proc.StandardError.ReadToEndAsync()
$sampler = Join-Path $Output 'external-samples.jsonl'
while (-not $proc.WaitForExit(30000)) {
$elapsed = $clock.Elapsed.TotalSeconds
$row = [ordered]@{ utc = (Get-Date).ToUniversalTime().ToString('o'); launcherElapsedSeconds = [math]::Round($elapsed, 1) }
try {
$p = Get-Process -Id $proc.Id -ErrorAction Stop
$row.workingSet64 = $p.WorkingSet64; $row.privateMemorySize64 = $p.PrivateMemorySize64
$row.peakWorkingSet64 = $p.PeakWorkingSet64; $row.handleCount = $p.HandleCount; $row.threads = $p.Threads.Count
} catch { $row.targetGone = $true }
($row | ConvertTo-Json -Compress) | Add-Content -Encoding UTF8 $sampler
if ($elapsed -gt 7440) { & taskkill /PID $proc.Id /T /F | Out-Null; 'outer-deadline' | Set-Content (Join-Path $Output 'launcher-outcome.txt') }
}
Set-Content -Encoding UTF8 (Join-Path $Output 'stdout.log') $outTask.Result
Set-Content -Encoding UTF8 (Join-Path $Output 'stderr.log') $errTask.Result
"$($proc.ExitCode)" | Set-Content -Encoding ASCII (Join-Path $Output 'exit-status.txt')
'done' | Add-Content (Join-Path $Output 'launcher-outcome.txt')