diff --git a/README.md b/README.md index 05e3e63d1f..06987f5891 100644 --- a/README.md +++ b/README.md @@ -446,11 +446,14 @@ exact caches warm: ``` The script builds `xcl` in release mode and refuses a dirty worktree or a non-empty output -folder. Both runs use a new temporary `XCL_DATA_ROOT` and `XCL_DXIL_CACHE`; the warm run reuses +folder. `-Seconds` counts from the title's start; an XCL-cold run first prepares every shader of +the title, which can take far longer than the default two minutes allowed for startup, so give it +`-StartupTimeoutSeconds` as `smoke.ps1` takes. Both runs use a new temporary `XCL_DATA_ROOT` and `XCL_DXIL_CACHE`; the warm run reuses the cold run's directories. They are deleted afterwards, and existing user caches are never read, changed, or deleted. The output folder contains only each run's `xcl.log` and `report.json`, plus -a versioned `manifest.json` with the commit, run order, hardware/toolchain, selected XCL -environment, cache identity, durations, and exit status. It contains no game files or cache data. +a versioned `manifest.json` with the commit, run order, hardware/toolchain, every `XCL_*` +setting the runs inherit (except the cache paths above), cache identity, durations, and exit status. It contains no game files or cache data. +A run that crashes before writing its report keeps its log and exit code in the manifest. The manifest identifies the workload with a SHA-256 metadata fingerprint over its sorted relative file paths, lengths, and UTC modification-time ticks. Only the fingerprint and its algorithm/version diff --git a/scripts/perf-run.ps1 b/scripts/perf-run.ps1 index 9c5aa3fe99..7194e4460b 100644 --- a/scripts/perf-run.ps1 +++ b/scripts/perf-run.ps1 @@ -6,7 +6,10 @@ param( [Parameter(Mandatory = $true)][string]$OutDir, [int]$Seconds = 120, [string[]]$CargoFeatures = @(), - [string]$CargoTargetDir + [string]$CargoTargetDir, + # Additional time for launcher work such as shader preparation before the guest timer starts. + # An XCL-cold run prepares every shader of the title first, which can take far longer. + [ValidateRange(1,86400)][int]$StartupTimeoutSeconds = 120 ) $ErrorActionPreference = 'Stop' @@ -80,7 +83,11 @@ function Get-WorkloadIdentity([string]$Path) { $workloadIdentity = Get-WorkloadIdentity $gamePath +# Native commands run with 'Continue': under Windows PowerShell, when the output is redirected +# (a queued or logged run), each stderr line becomes an error record that 'Stop' would throw on. +# Their exit codes are checked instead. function Run-Git([string[]]$Arguments) { + $ErrorActionPreference = 'Continue' $out = @(& git.exe -C $root @Arguments) if ($LASTEXITCODE -ne 0) { throw "git $($Arguments -join ' ') failed with exit code $LASTEXITCODE" } return $out @@ -115,11 +122,14 @@ $cargoArguments += '--target-dir', $cargoTargetPath Push-Location $root try { + $ErrorActionPreference = 'Continue' & cargo @cargoArguments - if ($LASTEXITCODE -ne 0) { throw "release build failed with exit code $LASTEXITCODE" } + $buildExit = $LASTEXITCODE } finally { + $ErrorActionPreference = 'Stop' Pop-Location } +if ($buildExit -ne 0) { throw "release build failed with exit code $buildExit" } if (@(Run-Git -Arguments @('status', '--porcelain', '--untracked-files=all')).Count -ne 0) { throw 'the worktree changed during the release build' } @@ -139,14 +149,11 @@ $dxilCache = Join-Path $cacheRoot 'dxil' $null = New-Item -ItemType Directory -Path $dataRoot $null = New-Item -ItemType Directory -Path $dxilCache -$environmentNames = @( - 'XCL_ACTIVITY', 'XCL_ADAPTER', 'XCL_DEVICE_TYPE', 'XCL_DIRECT_DXIL', - 'XCL_DXC_THREADS', 'XCL_FRAME_INTERVAL_US', 'XCL_HEAP_WINDOWS', - 'XCL_GPU_TIMING', 'XCL_GPU_TIMING_MS', 'XCL_LAZY_PSO', 'XCL_NETWORK', 'XCL_PRESS_AT', 'XCL_PSO_PRELOAD', - 'XCL_REQUIRE_GPU', 'XCL_RUN_SECONDS', 'XCL_STALL_TRACE' -) $changedNames = @('XCL_ACTIVITY', 'XCL_DATA_ROOT', 'XCL_DXIL_CACHE', 'XCL_GPU_TIMING', 'XCL_GPU_TIMING_MS', 'XCL_NETWORK', 'XCL_RUN_SECONDS', 'XCL_STALL_TRACE') +# Every XCL_* setting the runs inherit is recorded, since the runtime reads far more switches than a +# list could keep up with. Left out: the per-run cache paths set below and this script's test hooks. +$unrecordedNames = @('XCL_DATA_ROOT', 'XCL_DXIL_CACHE') $savedEnvironment = @{} foreach ($name in $changedNames) { $savedEnvironment[$name] = [Environment]::GetEnvironmentVariable($name, 'Process') @@ -165,6 +172,64 @@ function Video-Driver([string]$Adapter) { } } +# A job object that kills its processes when terminated or closed, so a run's whole process tree +# ends with it. +if (-not ('XclPerfRun.KillOnCloseJob' -as [type])) { + Add-Type -TypeDefinition @' +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +namespace XclPerfRun { + public sealed class KillOnCloseJob : IDisposable { + [StructLayout(LayoutKind.Sequential)] + struct BasicLimitInformation { + public long PerProcessUserTimeLimit, PerJobUserTimeLimit; + public uint LimitFlags; + public UIntPtr MinimumWorkingSetSize, MaximumWorkingSetSize; + public uint ActiveProcessLimit; + public UIntPtr Affinity; + public uint PriorityClass, SchedulingClass; + } + [StructLayout(LayoutKind.Sequential)] + struct ExtendedLimitInformation { + public BasicLimitInformation Basic; + public ulong ReadOperationCount, WriteOperationCount, OtherOperationCount; + public ulong ReadTransferCount, WriteTransferCount, OtherTransferCount; + public UIntPtr ProcessMemoryLimit, JobMemoryLimit, PeakProcessMemoryUsed, PeakJobMemoryUsed; + } + const int ExtendedLimitInformationClass = 9; + const uint KillOnJobClose = 0x2000; + [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr CreateJobObjectW(IntPtr attributes, IntPtr name); + [DllImport("kernel32.dll", SetLastError = true)] static extern bool SetInformationJobObject(IntPtr job, int infoClass, ref ExtendedLimitInformation info, int length); + [DllImport("kernel32.dll", SetLastError = true)] static extern bool AssignProcessToJobObject(IntPtr job, IntPtr process); + [DllImport("kernel32.dll", SetLastError = true)] static extern bool TerminateJobObject(IntPtr job, uint exitCode); + [DllImport("kernel32.dll", SetLastError = true)] static extern bool CloseHandle(IntPtr handle); + IntPtr handle; + public KillOnCloseJob() { + handle = CreateJobObjectW(IntPtr.Zero, IntPtr.Zero); + if (handle == IntPtr.Zero) throw new Win32Exception(); + var info = new ExtendedLimitInformation(); + info.Basic.LimitFlags = KillOnJobClose; + if (!SetInformationJobObject(handle, ExtendedLimitInformationClass, ref info, Marshal.SizeOf(typeof(ExtendedLimitInformation)))) { + var error = new Win32Exception(); + Dispose(); + throw error; + } + } + public void Add(IntPtr process) { + if (!AssignProcessToJobObject(handle, process)) throw new Win32Exception(); + } + public void Terminate() { + if (!TerminateJobObject(handle, 1)) throw new Win32Exception(); + } + public void Dispose() { + if (handle != IntPtr.Zero) { CloseHandle(handle); handle = IntPtr.Zero; } + } + } +} +'@ +} + function Invoke-PerfRun([string]$Mode, [int]$Order) { $runName = '{0:d2}-{1}' -f $Order, $Mode $artifactDir = Join-Path (Join-Path $outPath 'runs') $runName @@ -176,7 +241,9 @@ function Invoke-PerfRun([string]$Mode, [int]$Order) { $psi.Arguments = '/d /c ""' + $xcl + '" run "' + $gamePath + '""' } else { $psi.FileName = $xcl - $psi.Arguments = 'run "' + $gamePath + '"' + # Windows argument parsing halves backslashes before a quote, so a folder given with a + # trailing separator needs that run doubled or its closing quote becomes part of the path. + $psi.Arguments = 'run "' + ($gamePath -replace '(\\+)$', '$1$1') + '"' } $psi.WorkingDirectory = $root $psi.UseShellExecute = $false @@ -188,20 +255,36 @@ function Invoke-PerfRun([string]$Mode, [int]$Order) { $process = New-Object System.Diagnostics.Process $process.StartInfo = $psi - $watch = [Diagnostics.Stopwatch]::StartNew() - $null = $process.Start() - $stdoutTask = $process.StandardOutput.ReadToEndAsync() - $stderrTask = $process.StandardError.ReadToEndAsync() - $timedOut = -not $process.WaitForExit(($Seconds + 120) * 1000) - if ($timedOut -and -not $process.HasExited) { $process.Kill() } - $process.WaitForExit() - $watch.Stop() + $job = New-Object XclPerfRun.KillOnCloseJob + try { + $watch = [Diagnostics.Stopwatch]::StartNew() + $null = $process.Start() + $job.Add($process.Handle) + $stdoutTask = $process.StandardOutput.ReadToEndAsync() + $stderrTask = $process.StandardError.ReadToEndAsync() + $timedOut = -not $process.WaitForExit(($Seconds + $StartupTimeoutSeconds) * 1000) + # Ends the launcher and everything it started, so that no process left behind keeps + # writing the run's log or holds its output pipes open after the run is timed. + $job.Terminate() + $process.WaitForExit() + $watch.Stop() + } finally { + $job.Dispose() + } + # A process that escaped the job (started before the launcher was assigned to it) could still + # hold the pipes; do not wait for it indefinitely. + if (-not $stdoutTask.Wait(30000) -or -not $stderrTask.Wait(30000)) { + throw "the $Mode run's output was still open 30 s after XCL ended" + } $stdout = $stdoutTask.Result - $null = $stderrTask.Result + $stderr = $stderrTask.Result - $logLine = ($stdout -split '\r?\n' | Where-Object { $_ -match '^Log:\s+(.+)$' } | Select-Object -Last 1) - if (-not $logLine) { throw "XCL printed no log path during the $Mode run" } - $log = ($logLine -replace '^Log:\s+', '').Trim() + # A run that ends normally prints `Log: `; one that crashes before writing its report + # prints `No report - see the log: ` instead. Keep that log too: it is the crash record. + $logPattern = '^\s*(?:Log:|No report\b.*\bsee the log:)\s+(.+)$' + $logLine = ($stdout -split '\r?\n' | Where-Object { $_ -match $logPattern } | Select-Object -Last 1) + if (-not $logLine) { throw "XCL printed no log path during the $Mode run (exit code $($process.ExitCode), timed out: $timedOut); its output:`n$stdout`n$stderr" } + $log = ($logLine -replace $logPattern, '$1').Trim() if (-not (Test-Path -LiteralPath $log)) { throw "XCL's $Mode log does not exist: $log" } Copy-Item -LiteralPath $log -Destination (Join-Path $artifactDir 'xcl.log') @@ -220,6 +303,7 @@ function Invoke-PerfRun([string]$Mode, [int]$Order) { order = $Order cache_state = "xcl-$Mode" duration_requested_seconds = $Seconds + startup_timeout_seconds = $StartupTimeoutSeconds duration_actual_ms = $watch.ElapsedMilliseconds exit_code = if ($timedOut) { $null } else { $process.ExitCode } timed_out = $timedOut @@ -240,7 +324,11 @@ try { $env:XCL_STALL_TRACE = '1' $recordedEnvironment = [ordered]@{} - foreach ($name in $environmentNames) { + [string[]]$recordedNames = @([Environment]::GetEnvironmentVariables('Process').Keys | + ForEach-Object { ([string]$_).ToUpperInvariant() } | + Where-Object { $_.StartsWith('XCL_') -and -not $_.StartsWith('XCL_PERF_RUN_') -and $_ -notin $unrecordedNames }) + [Array]::Sort($recordedNames, [StringComparer]::Ordinal) + foreach ($name in $recordedNames) { $recordedEnvironment[$name] = [Environment]::GetEnvironmentVariable($name, 'Process') } @@ -255,8 +343,11 @@ try { $os = Get-CimInstance Win32_OperatingSystem $windows = "$($os.Caption) $($os.Version) build $($os.BuildNumber)" } catch { } + $ErrorActionPreference = 'Continue' $rust = (& rustc -Vv) -join [Environment]::NewLine - if ($LASTEXITCODE -ne 0) { throw 'rustc -Vv failed' } + $rustExit = $LASTEXITCODE + $ErrorActionPreference = 'Stop' + if ($rustExit -ne 0) { throw 'rustc -Vv failed' } $verifiedWorkloadIdentity = Get-WorkloadIdentity $gamePath if ($verifiedWorkloadIdentity.id -ne $workloadIdentity.id) { throw 'game metadata inventory changed during the performance runs' diff --git a/scripts/perf-run.tests.ps1 b/scripts/perf-run.tests.ps1 index 986ddb05db..d702e953c5 100644 --- a/scripts/perf-run.tests.ps1 +++ b/scripts/perf-run.tests.ps1 @@ -15,6 +15,7 @@ $bin = Join-Path $fixture 'bin' $userData = Join-Path $fixture 'user-data' $userDxil = Join-Path $fixture 'user-dxil' $cargoMarker = Join-Path $fixture 'cargo.txt' +$runLog = Join-Path $fixture 'run.log' $mockXcl = Join-Path $bin 'mock-xcl.cmd' $oldPath = $env:PATH $oldTest = $env:XCL_PERF_RUN_TESTING @@ -24,6 +25,8 @@ $oldDxil = $env:XCL_DXIL_CACHE $oldPress = $env:XCL_PRESS_AT $oldGpuTiming = $env:XCL_GPU_TIMING $oldGpuTimingMs = $env:XCL_GPU_TIMING_MS +$oldPipelineThreads = $env:XCL_PIPELINE_THREADS +$oldPrepareAll = $env:XCL_PREPARE_ALL try { $null = New-Item -ItemType Directory -Path $scripts, $game, $bin, $userData, $userDxil @@ -36,6 +39,7 @@ try { @' @echo off echo %* > "%MOCK_CARGO_MARKER%" +>&2 echo synthetic build progress exit /b 0 '@ | Set-Content -LiteralPath (Join-Path $bin 'cargo.cmd') -Encoding Ascii @' @@ -54,10 +58,24 @@ echo seen>"%XCL_DXIL_CACHE%\seen" if not exist "%XCL_DATA_ROOT%\MockTitle\logs" mkdir "%XCL_DATA_ROOT%\MockTitle\logs" echo cache=%STATE%>"%XCL_DATA_ROOT%\MockTitle\logs\xcl.log" echo gpu_timing=%XCL_GPU_TIMING% threshold=%XCL_GPU_TIMING_MS%>>"%XCL_DATA_ROOT%\MockTitle\logs\xcl.log" +if not "%MOCK_XCL_CRASH%"=="1" goto no_crash +echo Game exited with code 0xc0000005 (3221225477) +echo No report - see the log: %XCL_DATA_ROOT%\MockTitle\logs\xcl.log +exit /b -1073741819 +:no_crash echo {"d3d12":{"adapter":"Mock GPU","submissions":2,"slowest_submission_ms":1.5,"slowest_submission_lists":3}}>"%XCL_DATA_ROOT%\MockTitle\logs\report.json" echo Log: %XCL_DATA_ROOT%\MockTitle\logs\xcl.log +if not "%MOCK_XCL_LINGER%"=="1" exit /b 0 +start "" /b cmd /d /c ""%~dp0mock-child.cmd"" +ping -n 11 127.0.0.1 >nul exit /b 0 '@ | Set-Content -LiteralPath $mockXcl -Encoding Ascii + # Started by the mock and sharing its output: writes the log 5 s later unless it is ended. + @' +@echo off +ping -n 6 127.0.0.1 >nul +echo late child write>>"%XCL_DATA_ROOT%\MockTitle\logs\xcl.log" +'@ | Set-Content -LiteralPath (Join-Path $bin 'mock-child.cmd') -Encoding Ascii & git.exe -C $repo init | Out-Null & git.exe -C $repo add . @@ -73,9 +91,14 @@ exit /b 0 $env:XCL_PRESS_AT = '20:A,24:A' $env:XCL_GPU_TIMING = 'caller-value' $env:XCL_GPU_TIMING_MS = '999' + $env:XCL_PIPELINE_THREADS = '1' + $env:XCL_PREPARE_ALL = '1' - & (Join-Path $scripts 'perf-run.ps1') -Game $game -OutDir $out -Seconds 2 + # Redirected like a queued or logged run: Windows PowerShell then turns native stderr (cargo's + # progress) into error records, which must not stop the script. + & (Join-Path $scripts 'perf-run.ps1') -Game $game -OutDir $out -Seconds 2 -StartupTimeoutSeconds 30 *> $runLog if ($LASTEXITCODE -ne 0) { throw "perf-run.ps1 exited with $LASTEXITCODE" } + if (-not (Get-Content -LiteralPath $runLog -Raw).Contains('synthetic build progress')) { throw 'native build output was not kept in the redirected log' } $manifest = Get-Content -LiteralPath (Join-Path $out 'manifest.json') -Raw -Encoding utf8 | ConvertFrom-Json $manifestRaw = Get-Content -LiteralPath (Join-Path $out 'manifest.json') -Raw -Encoding utf8 @@ -87,6 +110,12 @@ exit /b 0 if ($manifest.environment.XCL_GPU_TIMING -ne '1' -or $manifest.environment.XCL_GPU_TIMING_MS -ne '50') { throw 'submission timing settings were not forced and recorded' } + if ($manifest.environment.XCL_PIPELINE_THREADS -ne '1') { throw 'an inherited XCL setting was not recorded' } + if ($manifest.environment.XCL_PREPARE_ALL -ne '1') { throw 'the shader preparation switch was not recorded' } + $recordedNames = @($manifest.environment.PSObject.Properties.Name) + if (@($recordedNames | Where-Object { $_ -in @('XCL_DATA_ROOT', 'XCL_DXIL_CACHE') -or $_ -like 'XCL_PERF_RUN_*' }).Count -ne 0) { + throw 'per-run cache paths or test hooks were recorded' + } if ($manifest.workload_id_algorithm -ne 'sha256-relative-path-length-mtime-utc-ticks' -or $manifest.workload_id_version -ne 1) { throw 'workload identity algorithm/version was not recorded' } if ($manifest.workload_id -notmatch '^[0-9a-f]{64}$') { throw 'workload identity is not a full SHA-256 value' } @@ -94,6 +123,7 @@ exit /b 0 throw 'workload inventory details leaked into the manifest' } if ($manifest.runs.Count -ne 2 -or $manifest.runs[0].cache_state -ne 'xcl-cold' -or $manifest.runs[1].cache_state -ne 'xcl-warm') { throw 'run records are incomplete' } + if (@($manifest.runs | Where-Object { $_.startup_timeout_seconds -ne 30 }).Count -ne 0) { throw 'startup timeout was not recorded' } if ((Get-Content -LiteralPath (Join-Path $out 'runs\01-cold\xcl.log') -Raw) -notmatch 'cache=cold') { throw 'cold run did not start with a fresh DXIL cache' } if ((Get-Content -LiteralPath (Join-Path $out 'runs\02-warm\xcl.log') -Raw) -notmatch 'cache=warm') { throw 'warm run did not reuse the cold cache' } if ((Get-Content -LiteralPath (Join-Path $out 'runs\01-cold\xcl.log') -Raw) -notmatch 'gpu_timing=1 threshold=50') { @@ -140,6 +170,37 @@ exit /b 0 throw 'different builds with the same folder leaf received the same workload identity' } + # A crash before the report: the log is still kept and the exit code recorded. + $crashOut = Join-Path $fixture 'crash-artifacts' + $env:MOCK_XCL_CRASH = '1' + try { + & (Join-Path $scripts 'perf-run.ps1') -Game $game -OutDir $crashOut -Seconds 2 *> $runLog + } finally { + Remove-Item Env:MOCK_XCL_CRASH -ErrorAction SilentlyContinue + } + $crashManifest = Get-Content -LiteralPath (Join-Path $crashOut 'manifest.json') -Raw -Encoding utf8 | ConvertFrom-Json + if ($crashManifest.runs[0].exit_code -ne -1073741819 -or $null -ne $crashManifest.runs[0].artifacts.report) { throw 'a crashed run was not recorded with its exit code and without a report' } + if ((Get-Content -LiteralPath (Join-Path $crashOut 'runs\01-cold\xcl.log') -Raw) -notmatch 'cache=cold') { throw 'the crashed run''s log was not kept' } + + # A timeout ends the whole process tree: a child of the launcher does not outlive the run, + # keep its output open or write the log after the run's time is taken. + $lingerOut = Join-Path $fixture 'linger-artifacts' + $env:MOCK_XCL_LINGER = '1' + try { + & (Join-Path $scripts 'perf-run.ps1') -Game $game -OutDir $lingerOut -Seconds 1 -StartupTimeoutSeconds 1 *> $runLog + } finally { + Remove-Item Env:MOCK_XCL_LINGER -ErrorAction SilentlyContinue + } + $lingerManifest = Get-Content -LiteralPath (Join-Path $lingerOut 'manifest.json') -Raw -Encoding utf8 | ConvertFrom-Json + foreach ($run in $lingerManifest.runs) { + if (-not $run.timed_out -or $run.duration_actual_ms -ge 4000) { throw "a timed-out run was not ended at its deadline: $($run.duration_actual_ms) ms" } + } + foreach ($runName in @('01-cold', '02-warm')) { + if ((Get-Content -LiteralPath (Join-Path $lingerOut "runs\$runName\xcl.log") -Raw) -match 'late child write') { + throw "a process left by the $runName run wrote its log after the timeout" + } + } + Add-Content -LiteralPath (Join-Path $repo '.gitignore') -Value '# dirty' $refused = $false try { @@ -148,6 +209,38 @@ exit /b 0 $refused = $_.Exception.Message -match 'clean worktree' } if (-not $refused) { throw 'a dirty worktree was not refused' } + Set-Content -LiteralPath (Join-Path $repo '.gitignore') -Value 'target/' -Encoding Ascii + + # A real executable parses its command line the way XCL does (a command file does not): a game + # folder with a space and a trailing separator must arrive as given. The shim records its + # arguments, then hands over to the mock. + $nativeXcl = Join-Path $bin 'mock-xcl.exe' + $nativeArgs = Join-Path $fixture 'native-args.txt' + $shimSource = Join-Path $fixture 'shim.cs' + @' +using System; +using System.Diagnostics; +using System.IO; +static class Shim { + static int Main(string[] args) { + File.WriteAllLines(Environment.GetEnvironmentVariable("MOCK_XCL_ARGS"), args); + var cmd = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mock-xcl.cmd"); + var psi = new ProcessStartInfo("cmd.exe", "/d /c \"\"" + cmd + "\"\"") { UseShellExecute = false }; + using (var p = Process.Start(psi)) { p.WaitForExit(); return p.ExitCode; } + } +} +'@ | Set-Content -LiteralPath $shimSource -Encoding Ascii + $csc = Join-Path $env:WINDIR 'Microsoft.NET\Framework64\v4.0.30319\csc.exe' + & $csc /nologo /target:exe "/out:$nativeXcl" $shimSource | Out-Null + if ($LASTEXITCODE -ne 0) { throw 'could not compile the native mock' } + $env:XCL_PERF_RUN_TEST_XCL = $nativeXcl + $env:MOCK_XCL_ARGS = $nativeArgs + $slashGame = $game + '\' + & (Join-Path $scripts 'perf-run.ps1') -Game $slashGame -OutDir (Join-Path $fixture 'native-artifacts') -Seconds 2 *> $runLog + $received = @(Get-Content -LiteralPath $nativeArgs) + if ($received.Count -ne 2 -or $received[0] -ne 'run' -or $received[1] -ne $slashGame) { + throw "the native launch received [$($received -join '] [')] instead of [run] [$slashGame]" + } Write-Host 'perf-run tests: all assertions passed' } finally { @@ -159,6 +252,8 @@ exit /b 0 $env:XCL_PRESS_AT = $oldPress $env:XCL_GPU_TIMING = $oldGpuTiming $env:XCL_GPU_TIMING_MS = $oldGpuTimingMs - Remove-Item Env:MOCK_CARGO_MARKER -ErrorAction SilentlyContinue + $env:XCL_PIPELINE_THREADS = $oldPipelineThreads + $env:XCL_PREPARE_ALL = $oldPrepareAll + Remove-Item Env:MOCK_CARGO_MARKER, Env:MOCK_XCL_CRASH, Env:MOCK_XCL_ARGS -ErrorAction SilentlyContinue if (Test-Path -LiteralPath $fixture) { Remove-Item -LiteralPath $fixture -Recurse -Force } }