acdream/tools/run-offline-vulkan-capture.ps1
Erik 5852bdb877 feat(render): Vulkan campaign V11 step 4 — retire GL from CI and gate scripts
Closes out the GL deletion by fixing the CI workflow and developer gate
scripts that still assumed a GL arm existed to compare against, build,
or select via ACDREAM_RENDER_BACKEND.

.github/workflows/headless-portability.yml: linux-graphical's "Verify
actionable unsupported-driver gate" step is deleted outright — it ran
the deleted `ui-studio` CLI verb (Studio was removed at Commit 1) to
prove the GL capability gate rejects Mesa's llvmpipe driver, and there
is no more GL capability gate for any driver to pass or fail. Its test
filter dropped two dead entries (GraphicalCapabilityRequirementsTests,
deleted at Commit 2; StudioWindowTests, already gone). Its package
contract check dropped the libcimgui.so assertion (ImGui's native
bridge, deleted at Commit 1). linux-vulkan's explanatory comment, which
described GL's rejection as the reason no cross-backend pixel diff runs
in CI, is rewritten to explain there is no GL arm left at all. Two dead
src/AcDream.UI.ImGui/** path triggers (that project no longer exists)
are removed from both the pull_request and push filters.

tools/run-backend-differential-gate.ps1 and its dedicated route file
tools/connected-backend-differential.route.txt are deleted: the whole
script's purpose was comparing a GL launch against a Vulkan launch of
the same route, and there is no second arm left to compare. Single-arm
regression checking already exists via run-offline-pixel-gate.ps1's
-Baseline mechanism.

tools/run-portal-churn-soak.ps1 is simplified rather than deleted: its
repeated-portal-churn methodology (within-arm capture comparison,
memory/entity/GPU trend analysis) has value independent of the
GL-versus-Vulkan question it was built to answer for issues #256/#257
before V11. -Backends now defaults to @('vulkan') alone; the doc
comments are rewritten from "step 0 discriminator, run before V11" to
an ongoing single-arm regression soak.

tools/run-offline-pixel-gate.ps1 drops its now-nonfunctional -Backend
parameter (ACDREAM_RENDER_BACKEND has read zero call sites since
RuntimeOptions.RenderBackend was removed at Commit 2 — passing -Backend
gl silently launched Vulkan anyway) along with its GL-escape-hatch
example and every comment that referenced the now-deleted differential
gate. tools/run-connected-world-lifecycle-gate.ps1,
tools/run-offline-vulkan-capture.ps1, and
tools/run-repeat-connected-gate.ps1 keep their (harmless, already
no-op) ACDREAM_RENDER_BACKEND set/clear lines but have their
now-inaccurate "escape hatch" / "GL run" comments corrected to state
plainly that the variable is unread and the line is kept only for the
historical record.

No .cs files touched; `dotnet build AcDream.slnx -c Release` unaffected
(0 warnings, 0 errors, matching the prior commit's build).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 03:06:45 +02:00

98 lines
3.8 KiB
PowerShell

<#
.SYNOPSIS
Campaign V: one offline Vulkan capture with the validation layer proven loaded.
.DESCRIPTION
The same deterministic offline scene run-offline-pixel-gate.ps1 captures.
Before Campaign V slice V10 flipped the process default, this needed
ACDREAM_RENDER_BACKEND=vulkan to reach the Vulkan arm at all; V11 then
deleted the GL arm the variable used to select, so it is now a no-op left
for the record rather than something this script depends on.
VK_LOADER_DEBUG=layer makes the loader print the layer it inserts, so
"validation was on" is evidence rather than a claim.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)][string]$Out,
[int]$WarmupMs = 12000,
[int]$DayGroup = 0,
[switch]$SkipBuild
)
$ErrorActionPreference = 'Stop'
$repo = Split-Path -Parent $PSScriptRoot
$exe = Join-Path $repo 'src\AcDream.App\bin\Release\net10.0\AcDream.App.exe'
function Write-Step($message) { Write-Host "[vk-capture] $message" }
if (-not $SkipBuild) {
& dotnet build (Join-Path $repo 'AcDream.slnx') -c Release --nologo -v q | Out-Null
if ($LASTEXITCODE -ne 0) { throw "Release build failed with exit code $LASTEXITCODE." }
}
if (-not (Test-Path $exe)) { throw "Client not found at $exe." }
if (Test-Path $Out) { Remove-Item -Recurse -Force $Out }
New-Item -ItemType Directory -Force -Path $Out | Out-Null
$probe = Join-Path $Out 'vk.probe.txt'
Set-Content -Encoding utf8 -Path $probe -Value @"
sleep $WarmupMs
screenshot vk-offline 30000
sleep 500
"@
$log = Join-Path $Out 'client.log'
$previousLive = $env:ACDREAM_LIVE
Remove-Item Env:\ACDREAM_LIVE -ErrorAction SilentlyContinue
$env:ACDREAM_DAT_DIR = Join-Path $env:USERPROFILE "Documents\Asheron's Call"
$env:ACDREAM_NO_AUDIO = '1'
$env:ACDREAM_RETAIL_UI = '1'
$env:ACDREAM_DAY_GROUP = "$DayGroup"
$env:ACDREAM_UI_PROBE_SCRIPT = $probe
$env:ACDREAM_AUTOMATION_ARTIFACT_DIR = $Out
$env:ACDREAM_RENDER_BACKEND = 'vulkan'
$env:VK_INSTANCE_LAYERS = 'VK_LAYER_KHRONOS_validation'
$env:VK_LOADER_DEBUG = 'layer'
Write-Step "launching Vulkan offline client (warmup ${WarmupMs}ms, day group $DayGroup)"
$proc = Start-Process -FilePath $exe -RedirectStandardOutput $log `
-RedirectStandardError "$log.err" -PassThru -WindowStyle Minimized
try {
$shots = Join-Path $Out 'screenshots'
$deadline = (Get-Date).AddMilliseconds($WarmupMs + 60000)
$captured = $false
while ((Get-Date) -lt $deadline) {
if ((Test-Path $shots) -and (Get-ChildItem $shots -Filter *.png -ErrorAction SilentlyContinue)) {
$captured = $true
break
}
if ($proc.HasExited) { break }
Start-Sleep -Milliseconds 1000
}
if ($captured) { Start-Sleep -Milliseconds 1500 }
else { Write-Step 'no screenshot captured before the deadline' }
}
finally {
$app = Get-Process -Name AcDream.App -ErrorAction SilentlyContinue
if ($app) {
$app.CloseMainWindow() | Out-Null
if (-not $app.WaitForExit(15000)) {
Write-Step 'WM_CLOSE timed out; forcing'
$app | Stop-Process -Force
}
}
Remove-Item Env:\ACDREAM_RENDER_BACKEND -ErrorAction SilentlyContinue
Remove-Item Env:\VK_INSTANCE_LAYERS -ErrorAction SilentlyContinue
Remove-Item Env:\VK_LOADER_DEBUG -ErrorAction SilentlyContinue
if ($previousLive) { $env:ACDREAM_LIVE = $previousLive }
}
Write-Step "exit code $($proc.ExitCode)"
Write-Step 'layer insertion evidence:'
Select-String -Path $log, "$log.err" -Pattern 'Insert instance layer' -ErrorAction SilentlyContinue |
Select-Object -First 3 | ForEach-Object { Write-Host " $($_.Line)" }
Write-Step 'validation output:'
$vuids = Select-String -Path $log, "$log.err" -Pattern 'VUID-|UNASSIGNED-|Validation Error|Validation Warning' -ErrorAction SilentlyContinue
if ($vuids) { $vuids | Select-Object -First 20 | ForEach-Object { Write-Host " $($_.Line)" } }
else { Write-Host ' none' }