From c756051df6b639f3a22926b9be15a71ac62b6c95 Mon Sep 17 00:00:00 2001 From: Graham Calihan Date: Mon, 23 Nov 2026 17:21:07 -0500 Subject: [PATCH 1/2] Scripts: smoke.ps1 names the adapter XCL ran on, from report.json The gpu line took the first Win32_VideoController that is not the basic display adapter. On a machine with an iGPU and a discrete GPU that is often the iGPU: on an RTX 3080 + AMD RDNA2 iGPU machine the block said "AMD Radeon(TM) Graphics" while XCL ran on the RTX 3080. The line now comes from d3d12.adapter in the run's report.json (next to the log; XCL removes the previous run's report at start), without the VRAM suffix. The Win32 query stays as the fallback when the report or the field is missing. --- scripts/smoke.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/smoke.ps1 b/scripts/smoke.ps1 index a4f668a01a..1aa4ad8605 100644 --- a/scripts/smoke.ps1 +++ b/scripts/smoke.ps1 @@ -44,7 +44,14 @@ $commits = [regex]::Matches($text, 'memory: (\d+) MB committed') | ForEach-Objec $peak = if ($commits) { ($commits | Measure-Object -Maximum).Maximum } else { 'n/a' } $removals = ([regex]::Matches($text, 'device removed')).Count $crashes = ([regex]::Matches($text, 'unhandled exception|process ends with status')).Count -$gpu = (Get-CimInstance Win32_VideoController | Where-Object { $_.Name -notmatch 'Basic' } | Select-Object -First 1).Name +# the adapter XCL ran on (report.json next to the log; XCL removes the last run's at start), +# not the first one Windows lists – on a machine with an iGPU that is often not the one used +$gpu = $null +$report = Join-Path (Split-Path $log -Parent) 'report.json' +if (Test-Path $report) { + try { $gpu = ((Get-Content $report -Raw -Encoding utf8 | ConvertFrom-Json).d3d12.adapter -replace '\s*\([^()]*VRAM\)$', '') } catch { } +} +if (-not $gpu) { $gpu = (Get-CimInstance Win32_VideoController | Where-Object { $_.Name -notmatch 'Basic' } | Select-Object -First 1).Name } $code = if ($timedOut) { 'killed (no exit)' } else { '0x{0:x}' -f $p.ExitCode } @" From f52ae3d3726cd3a1e223d8fbb90ac4ff2c5c0a9e Mon Sep 17 00:00:00 2001 From: SandimL Date: Mon, 23 Nov 2026 19:10:58 -0400 Subject: [PATCH 2/2] Scripts: run smoke.ps1 on Windows PowerShell 5.1 --- scripts/smoke.ps1 | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/scripts/smoke.ps1 b/scripts/smoke.ps1 index 1aa4ad8605..f0738cdb98 100644 --- a/scripts/smoke.ps1 +++ b/scripts/smoke.ps1 @@ -17,21 +17,35 @@ $root = Split-Path $PSScriptRoot -Parent $commit = (git -C $root rev-parse HEAD).Trim() $dirty = [bool](git -C $root status --porcelain --untracked-files=no -- crates Cargo.toml Cargo.lock) -$out = New-TemporaryFile -$err = New-TemporaryFile +# Use ProcessStartInfo instead of Start-Process: the latter cannot build its +# environment block on Windows PowerShell 5.1 when PATH is present twice with +# different casing (which is possible on Windows). +$psi = New-Object System.Diagnostics.ProcessStartInfo +$psi.FileName = $Xcl +$psi.Arguments = 'run "' + $Game + '"' +$psi.UseShellExecute = $false +$psi.CreateNoWindow = $true +$psi.RedirectStandardOutput = $true +$psi.RedirectStandardError = $true +$psi.StandardOutputEncoding = [System.Text.Encoding]::UTF8 +$psi.StandardErrorEncoding = [System.Text.Encoding]::UTF8 +$p = New-Object System.Diagnostics.Process +$p.StartInfo = $psi $env:XCL_NETWORK = '0' $env:XCL_RUN_SECONDS = "$Seconds" $env:XCL_ACTIVITY = '1' -$p = Start-Process -FilePath $Xcl -ArgumentList @('run', "`"$Game`"") -NoNewWindow -PassThru -RedirectStandardOutput $out -RedirectStandardError $err -$null = $p.Handle # (without it ExitCode stays empty) +$null = $p.Start() +$stdoutTask = $p.StandardOutput.ReadToEndAsync() +$stderrTask = $p.StandardError.ReadToEndAsync() if (-not $p.WaitForExit(($Seconds + 120) * 1000)) { - Stop-Process -Id $p.Id -Force + if (-not $p.HasExited) { $p.Kill() } $timedOut = $true } +$p.WaitForExit() +$stdout = $stdoutTask.Result +$null = $stderrTask.Result Remove-Item Env:XCL_RUN_SECONDS, Env:XCL_ACTIVITY -$stdout = Get-Content $out -Raw -Encoding utf8 -Remove-Item $out, $err $logLine = ($stdout -split "`n" | Where-Object { $_ -match '^Log:\s+(.+)$' } | Select-Object -Last 1) if (-not $logLine) { throw "XCL printed no log path; its output:`n$stdout" } $log = ($logLine -replace '^Log:\s+', '').Trim()