Support distributor DLL packages and validate Windows player mode

This commit is contained in:
xdfnx-dev committed 2026-10-03 11:28:21 +03:00
1 parent 65ab1460a8
commit df415ec828
8 files changed
+191 -16

No files matched your search

+10 -2
View File
@@ -26,7 +26,10 @@ locally and excluded from packages.
Experimental Windows builds also cover RDNA3 `gfx1100..gfx1103`, RDNA3.5 Experimental Windows builds also cover RDNA3 `gfx1100..gfx1103`, RDNA3.5
`gfx1150..gfx1154` and RDNA4 `gfx1200/gfx1201`, with separate guarded packages. `gfx1150..gfx1154` and RDNA4 `gfx1200/gfx1201`, with separate guarded packages.
Only RX 9070 XT has physical validation here; all other targets are compile-tested. Only RX 9070 XT has physical validation here; other targets are compile-tested.
Community RX 9060 XT / gfx1200 logs now show native K/M execution and finite
output in Cyberpunk and Dawnwalker. Visual issues are still reported, so this
is backend coverage rather than completed image-quality validation.
The installer checks the real HIP target before changing game files. See The installer checks the real HIP target before changing game files. See
[Windows GPU coverage and issue #10 diagnostics](docs/windows-gpu-support.md). [Windows GPU coverage and issue #10 diagnostics](docs/windows-gpu-support.md).
@@ -47,7 +50,12 @@ RX 9070 XT. Cyberpunk 2077 2.31 also reaches saved 4K gameplay with K and M:
required native transformer layer executes, and no backend failures, required native transformer layer executes, and no backend failures,
previous-frame outputs or CPU image copies occur. Sessions include menus and previous-frame outputs or CPU image copies occur. Sessions include menus and
loading; this synchronous diagnostic is not an FPS benchmark. Other GPUs, loading; this synchronous diagnostic is not an FPS benchmark. Other GPUs,
including the reporter's RX 9060 XT / gfx1200, still require hardware testing. including the reporter's RX 9060 XT / gfx1200, required further testing at that point.
The subsequent RX 9060 XT retest passes all required native-layer/output
checks in Cyberpunk and Dawnwalker; texture/LOD and motion artifacts remain
open. Distributor-supplied DLL pairs can now be selected automatically by the
quick launcher. The public fork ZIP still uses locally supplied NVIDIA files;
packaging support does not establish redistribution permission.
See [supported games](SUPPORTED_GAMES.md) for the tested games and DLSS models. See [supported games](SUPPORTED_GAMES.md) for the tested games and DLSS models.
+27 -2
View File
@@ -2,8 +2,11 @@
The shim, diagnostics, native K/M kernels and game installer accept the The shim, diagnostics, native K/M kernels and game installer accept the
targets below, with one package per actual ISA. **Only RX 9070 XT has physical targets below, with one package per actual ISA. **Only RX 9070 XT has physical
validation here.** All other targets are experimental and compile-tested; validation here.** Community RX 9060 XT / gfx1200 logs now show K/M backend
working DLSS, interop and performance on them remain unverified. execution in Cyberpunk and Dawnwalker with all required native layers and
finite output. Visual issues remain reported and are not resolved by those
checks. All other targets are experimental and compile-tested; their DLSS,
interop and performance remain unverified.
| Family | Target | Examples / scope | | Family | Target | Examples / scope |
| --- | --- | --- | | --- | --- | --- |
@@ -68,6 +71,28 @@ The new packages/preflight address the identified failures. They do not prove
those games work on RX 9060 XT; a new native-D3D12 run on that GPU is required. those games work on RX 9060 XT; a new native-D3D12 run on that GPU is required.
Raw community logs and personal directory paths stay local. Raw community logs and personal directory paths stay local.
## Community retest, 2026-10-03
[Comment 5962444244](https://github.com/countervolts/d4r/issues/10#issuecomment-5962444244)
uses the corrected `52d9872` package / `3d62b98` binaries on RX 9060 XT
(`gfx1200`, 16 GB). Cyberpunk K/M complete 4,365 / 1,751 session frames;
Dawnwalker K/M complete 6,713 / 1,690. Every frame has a finite-output GPU
check, all required native layers execute and all four sessions exit normally.
The logs record zero backend failures, previous-frame outputs and CPU image
copies. This is community backend coverage, not a reference-image comparison:
the tester reports texture/LOD and motion-related artifacts. All four runs use
the HDR network input/output path, unlike the local Cyberpunk LDR validation.
Spider-Man 2 crashes with `0xc0000005` before any completed DLSS frame;
its nonstandard launch is not evidence of a transformer kernel failure.
Assassin's Creed exits with zero frames and Streamline logs repeated internal
minidumps; its clean process exit is still inconclusive. Their causes remain
open without a stack trace. The Witcher 3 log in
[comment 5962808629](https://github.com/countervolts/d4r/issues/10#issuecomment-5962808629)
selects the gfx1200 d4r shim instead of the original NGX core (its SHA256
matches the shipped shim exactly), and the installer correctly refuses
before modifying the game. It does not establish a Witcher runtime failure.
## Build ## Build
Prepare dependencies following `windows-rdna4-port.md`. Default: gfx1201. Prepare dependencies following `windows-rdna4-port.md`. Default: gfx1201.
+7 -4
View File
@@ -9,14 +9,16 @@ The package detects the real GPU automatically. Do not rename any DLLs.
Already installed an older test? Close the game and run RESTORE-GAME.cmd Already installed an older test? Close the game and run RESTORE-GAME.cmd
from that old package first, then extract this version to a new folder. from that old package first, then extract this version to a new folder.
2. CLOSE YOUR GAME. Have these TWO ORIGINAL NVIDIA files ready: 2. CLOSE YOUR GAME. If your distributor included the validated NVIDIA DLL pair,
it is selected automatically; you only need to choose the game executable.
Otherwise have these TWO ORIGINAL NVIDIA files ready:
_nvngx.dll version 32.0.16.1714 _nvngx.dll version 32.0.16.1714
nvngx_dlss.dll version 310.9.1 nvngx_dlss.dll version 310.9.1
NVIDIA DLLs are not included. Other versions are rejected. The xdfnx-dev public test ZIP does not include them. Other versions are rejected.
The small _nvngx.dll inside this package is d4r, NOT the original NVIDIA file. The small _nvngx.dll inside this package is d4r, NOT the original NVIDIA file.
3. DOUBLE-CLICK START-K.cmd. Pick the actual game .exe when asked. 3. DOUBLE-CLICK START-K.cmd. Pick the actual game .exe when asked.
Pick your two NVIDIA DLLs. These choices are remembered for the next run. If asked, pick your two NVIDIA DLLs. These choices are remembered for the next run.
Next time, press Enter for the same game, or C to choose another. Next time, press Enter for the same game, or C to choose another.
If Steam/Epic is needed, keep it open. Choose a D3D12 game without anti-cheat. If Steam/Epic is needed, keep it open. Choose a D3D12 game without anti-cheat.
If a launcher opens, type C and choose the real game executable next time. If a launcher opens, type C and choose the real game executable next time.
@@ -53,7 +55,8 @@ Colour, depth, motion and output remain in VRAM in the runtime fast path.
Runtime files are in files/. Cache/settings are created in work/. Runtime files are in files/. Cache/settings are created in work/.
Licenses are in licenses/. Corresponding sources are a SEPARATE release download; Licenses are in licenses/. Corresponding sources are a SEPARATE release download;
testers do not need to download or build them. No NVIDIA proprietary DLLs are shipped. testers do not need to download or build them. NVIDIA DLLs, when supplied by a
distributor, keep their separate license and are not part of the GPL source archive.
Report: https://github.com/countervolts/d4r/issues/10 Report: https://github.com/countervolts/d4r/issues/10
Source: https://github.com/xdfnx-dev/d4r Source: https://github.com/xdfnx-dev/d4r
+70
View File
@@ -19,6 +19,76 @@ explicit limits; the validated package keeps conservative arithmetic.
## Milestone and gates ## Milestone and gates
2026-10-03 upstream Windows refresh: imported ayo's `e7e5c44` (LF patch
attributes) and `54c201a` (drag-in installation / per-game `d4r.ini`) while
preserving their authorship. The target-independent NGX loader selects the
shim using the game's D3D12/HIP LUID. Player mode derives paths and the
validated codegen settings from `d4r.ini`, pins NVIDIA DLL identities and
exposes K/M, async interop, logging, validation and cache settings. OptiScaler
patch `0006` resolves relative library directories. These changes do not
replace the transformer arithmetic or establish a performance improvement.
The new packaging fixture passes 3/3 cases. Player config/loader probes pass
2/2 in both PowerShell 5 and PowerShell 7, including real gfx1201 LUID
selection without executing GPU kernels. Found and fixed a PowerShell 7
argument-quoting regression in `test-player-config.ps1`: only Legacy/PS5
passing needs escaped embedded quotes. Both new DLL targets compile through
CMake/Ninja, and all 20 RX 9070 XT CTest gates pass (6.21 seconds).
Reports are in `test-results/upstream-player-54c201a-ps5/`,
`upstream-player-54c201a-ps7/` and `upstream-release-54c201a/`.
The drag-in installation has not yet received a real-game K/M test, and
OptiScaler patch `0006` is not in the previously published frontend binary.
The existing public quick-test archive is unchanged and continues to use the
game-tested installer layout. Do not label it as the new drag-in release.
2026-10-03 community retest ([comment 5962444244](https://github.com/countervolts/d4r/issues/10#issuecomment-5962444244)):
seven new diagnostic bundles are read without running their contents. On
RX 9060 XT / gfx1200, Cyberpunk K/M complete **4365 / 1751** frames and
Dawnwalker K/M complete **6713 / 1690**. Each frame has a finite-output GPU
check; all required native transformer layers execute, exit codes are zero,
and backend failures / previous-frame output / CPU image-copy counters are
zero. These sessions use HDR input/output helpers; the local Cyberpunk tests
below used LDR. This establishes additional community backend execution,
not numerical or visual equivalence. The tester reports texture/LOD and motion
artifacts, which remain an explicit correctness gate before performance work.
Do not claim that NaN/Inf scans establish image correctness.
Mean recorded `interop_ngx_ms` is 18.623 / 50.237 ms for Cyberpunk K/M and
8.126 / 32.632 ms for Dawnwalker K/M. These are CPU completion intervals in
the synchronous diagnostic, including scheduling and validation, not isolated
GPU kernel times or a controlled cross-game/preset benchmark. K performance
remains open. Extracted logs, original ZIP hashes and parsed reports stay local
under `build/issue-10-latest/`; personal user paths are not committed.
The new Spider-Man 2 log exits `0xc0000005` before a DLSS frame, without a
usable crash stack. Assassin's Creed's process exits zero with no DLSS frames,
but Streamline reports repeated internal minidumps before capability discovery;
it remains inconclusive. Neither report establishes a native WMMA failure.
[The Witcher 3 report](https://github.com/countervolts/d4r/issues/10#issuecomment-5962808629)
selects the gfx1200 d4r shim instead of the original NGX core; the submitted
SHA256 matches that shim exactly. It is rejected before installation, rather
than failing a GPU workload. Launcher/Streamline crash diagnosis remains open.
Distributor-supplied NVIDIA DLL support: quick-test packaging accepts optional
`-NvidiaDirectory <directory>` and `-NvidiaLicensePath <applicable-license>`.
It stages the exact validated originals under `files/nvidia/`, adds both DLLs
and the separate license to integrity metadata and selects them automatically.
Explicit developer overrides still have strict SHA256 checks; bundled files
take precedence over stale remembered file selections. Restore remains
independent of DLL/GPU selection. This option is for local testing or a
distributor with appropriate permission; matching hashes are not a grant of
redistribution rights. The current public xdfnx-dev release remains unchanged
and contains no NVIDIA runtime binaries or private NVIDIA-derived kernels.
The [current NVIDIA SDK license](https://github.com/NVIDIA/DLSS/blob/main/LICENSE.txt)
has distribution conditions and a supplement limiting DLSS/NGX development
to systems with NVIDIA GPUs; the Linux bundle's contents alone do not resolve
permission for this Windows package. A local-only bundled package with the
user-provided pair passes eight isolated installer/restore/negative fixtures,
including stale-choice recovery and altered bundled-core rejection before any
game write. The ordinary no-DLL package also passes all six existing fixtures;
reports are in `test-results/windows-bundled-fixtures/` and
`windows-unbundled-fixtures/`. Real games are untouched by these fixture tests.
2026-10-02 issue #10 follow-up ([comment 5958769640](https://github.com/countervolts/d4r/issues/10#issuecomment-5958769640)): 2026-10-02 issue #10 follow-up ([comment 5958769640](https://github.com/countervolts/d4r/issues/10#issuecomment-5958769640)):
four new logs confirm that RX 9060 XT / gfx1200 HIP discovery succeeds. The four new logs confirm that RX 9060 XT / gfx1200 HIP discovery succeeds. The
Cyberpunk K/M runs never launch the transformer: numeric CUDA NGX capabilities Cyberpunk K/M runs never launch the transformer: numeric CUDA NGX capabilities
+24 -4
View File
@@ -1,7 +1,8 @@
[CmdletBinding()] [CmdletBinding()]
param( param(
[string]$GamePackagePrefix, [Parameter(Mandatory=$true)][string]$PackageRoot, [string]$GamePackagePrefix, [Parameter(Mandatory=$true)][string]$PackageRoot,
[string]$ArchivePath [string]$ArchivePath,
[string]$NvidiaDirectory, [string]$NvidiaLicensePath
) )
$ErrorActionPreference='Stop' $ErrorActionPreference='Stop'
. (Join-Path $PSScriptRoot 'gpu-target.ps1') . (Join-Path $PSScriptRoot 'gpu-target.ps1')
@@ -65,9 +66,27 @@ foreach ($launch in @(@{name='START-K.cmd'; arguments='-Preset 11'},@{name='STAR
Set-Content -LiteralPath $path -Encoding ASCII Set-Content -LiteralPath $path -Encoding ASCII
$files.Add(@{path=$launch.name; sha256=(Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash; version=$null}) $files.Add(@{path=$launch.name; sha256=(Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash; version=$null})
} }
# Publicly supplied original identity, never the binary itself. $ngxCoreSha256='66767018C36B3BAB46398DADE3ADF173DAA3730FDA75965689EA848C9BC4E79B'
$bundledNvidia=$null
if ($NvidiaDirectory) {
# Opt-in for local testing or a distributor with appropriate permission.
# A matching hash establishes binary identity, not redistribution rights.
if (!$NvidiaLicensePath -or !(Test-Path -LiteralPath $NvidiaLicensePath -PathType Leaf)) {
throw 'Bundled NVIDIA files require -NvidiaLicensePath with their applicable license. This option does not establish redistribution permission.'
}
$core=Join-Path $NvidiaDirectory '_nvngx.dll'
$dlss=Join-Path $NvidiaDirectory 'nvngx_dlss.dll'
if ((Get-FileHash -LiteralPath $core -Algorithm SHA256).Hash -ne $ngxCoreSha256 -or
(Get-FileHash -LiteralPath $dlss -Algorithm SHA256).Hash -ne $baseline.dlssSha256) {
throw 'Bundled NVIDIA files must match the validated original NGX and DLSS hashes.'
}
[void](Stage $core 'files/nvidia/_nvngx.dll')
[void](Stage $dlss 'files/nvidia/nvngx_dlss.dll')
[void](Stage $NvidiaLicensePath 'licenses/NVIDIA-RTX.txt')
$bundledNvidia=@{ngxCore='nvidia/_nvngx.dll'; dlssDll='nvidia/nvngx_dlss.dll'; license='licenses/NVIDIA-RTX.txt'}
} elseif ($NvidiaLicensePath) { throw '-NvidiaLicensePath requires -NvidiaDirectory.' }
$metadata=[ordered]@{schema=1; packageCommit=$commit; binarySourceCommit=$baseline.d4rCommit; $metadata=[ordered]@{schema=1; packageCommit=$commit; binarySourceCommit=$baseline.d4rCommit;
ngxCoreSha256='66767018C36B3BAB46398DADE3ADF173DAA3730FDA75965689EA848C9BC4E79B'; ngxCoreSha256=$ngxCoreSha256; bundledNvidia=$bundledNvidia;
dependencies=@{optiScalerSourceCommit=$baseline.optiScaler.sourceCommit; zludaSourceCommit=$baseline.zludaBuild.sourceCommit; dependencies=@{optiScalerSourceCommit=$baseline.optiScaler.sourceCommit; zludaSourceCommit=$baseline.zludaBuild.sourceCommit;
llvmSource=$baseline.zludaBuild.llvmSource; hipRuntime=$baseline.hipRuntime}; llvmSource=$baseline.zludaBuild.llvmSource; hipRuntime=$baseline.hipRuntime};
commonFiles=$common; targets=$targets; files=$files} commonFiles=$common; targets=$targets; files=$files}
@@ -86,4 +105,5 @@ if ($ArchivePath) {
} }
} finally { if ($archive) { $archive.Dispose() }; $stream.Dispose() } } finally { if ($archive) { $archive.Dispose() }; $stream.Dispose() }
} }
Write-Host "Quick-test package: $PackageRoot (11 targets, automatic GPU selection, no NVIDIA DLLs)" $nvidiaMode=if ($bundledNvidia) { 'bundled NVIDIA files; distributor must have appropriate permission' } else { 'user-supplied NVIDIA files' }
Write-Host "Quick-test package: $PackageRoot (11 targets, automatic GPU selection, $nvidiaMode)"
+17 -2
View File
@@ -32,6 +32,13 @@ function Copy-Payload([string]$Source, [string]$Destination, [string]$Relative)
New-Item -ItemType Directory -Force (Split-Path $path) | Out-Null New-Item -ItemType Directory -Force (Split-Path $path) | Out-Null
Copy-Item -LiteralPath (Join-Path $Source $Relative) -Destination $path -Force Copy-Item -LiteralPath (Join-Path $Source $Relative) -Destination $path -Force
} }
function Get-BundledNvidiaFile([string]$Relative) {
$directory=Join-Path $PSScriptRoot 'nvidia'
$path=[IO.Path]::GetFullPath((Join-Path $PSScriptRoot $Relative))
if (!$path.StartsWith($directory+'\',[StringComparison]::OrdinalIgnoreCase) -or
!(Test-Path -LiteralPath $path -PathType Leaf)) { throw 'Invalid bundled NVIDIA file. Extract the complete package again.' }
return $path
}
if ($Action -eq 'restore') { if ($Action -eq 'restore') {
$GameExe=Select-LocalFile 'Select the SAME game executable used for the test' '*.exe' $(if ($GameExe) { $GameExe } elseif ($saved) { $saved.game }) $GameExe=Select-LocalFile 'Select the SAME game executable used for the test' '*.exe' $(if ($GameExe) { $GameExe } elseif ($saved) { $saved.game })
& (Join-Path $PSScriptRoot 'common/windows-game.ps1') -Action restore -GameExe $GameExe & (Join-Path $PSScriptRoot 'common/windows-game.ps1') -Action restore -GameExe $GameExe
@@ -96,8 +103,16 @@ try {
elseif ($reuse) { throw 'Invalid choice. Press Enter or type C on the next run.' } elseif ($reuse) { throw 'Invalid choice. Press Enter or type C on the next run.' }
} }
$GameExe=Select-LocalFile 'Select the actual D3D12 game .exe (not Steam or a launcher)' '*.exe' $(if ($GameExe) { $GameExe } else { $previousGame }) $GameExe=Select-LocalFile 'Select the actual D3D12 game .exe (not Steam or a launcher)' '*.exe' $(if ($GameExe) { $GameExe } else { $previousGame })
$NgxCore=Select-LocalFile 'Select your ORIGINAL NVIDIA _nvngx.dll (32.0.16.1714)' '_nvngx.dll' $(if ($NgxCore) { $NgxCore } elseif ($saved) { $saved.ngxCore }) $bundledCore=$null; $bundledDlss=$null
$DlssDll=Select-LocalFile 'Select your NVIDIA nvngx_dlss.dll (310.9.1)' 'nvngx_dlss.dll' $(if ($DlssDll) { $DlssDll } elseif ($saved) { $saved.dlssDll }) if ($manifest.bundledNvidia) {
$bundledCore=Get-BundledNvidiaFile $manifest.bundledNvidia.ngxCore
$bundledDlss=Get-BundledNvidiaFile $manifest.bundledNvidia.dlssDll
}
$status.nvidiaDllSource=@{core=$(if ($NgxCore) { 'explicit' } elseif ($bundledCore) { 'bundled' } else { 'user-supplied' });
dlss=$(if ($DlssDll) { 'explicit' } elseif ($bundledDlss) { 'bundled' } else { 'user-supplied' })}
if ($bundledCore -and !$NgxCore -and !$DlssDll) { Write-Host 'Using the validated NVIDIA DLL pair included by this package distributor.' }
$NgxCore=Select-LocalFile 'Select your ORIGINAL NVIDIA _nvngx.dll (32.0.16.1714)' '_nvngx.dll' $(if ($NgxCore) { $NgxCore } elseif ($bundledCore) { $bundledCore } elseif ($saved) { $saved.ngxCore })
$DlssDll=Select-LocalFile 'Select your NVIDIA nvngx_dlss.dll (310.9.1)' 'nvngx_dlss.dll' $(if ($DlssDll) { $DlssDll } elseif ($bundledDlss) { $bundledDlss } elseif ($saved) { $saved.dlssDll })
$status.game=$GameExe $status.game=$GameExe
$status.localDlls=@($NgxCore,$DlssDll | ForEach-Object { $item=Get-Item -LiteralPath $_; @{path=$item.FullName; version=$item.VersionInfo.FileVersion; sha256=(Get-FileHash -LiteralPath $_ -Algorithm SHA256).Hash} }) $status.localDlls=@($NgxCore,$DlssDll | ForEach-Object { $item=Get-Item -LiteralPath $_; @{path=$item.FullName; version=$item.VersionInfo.FileVersion; sha256=(Get-FileHash -LiteralPath $_ -Algorithm SHA256).Hash} })
if ((Get-FileHash -LiteralPath $NgxCore -Algorithm SHA256).Hash -ne $manifest.ngxCoreSha256) { if ((Get-FileHash -LiteralPath $NgxCore -Algorithm SHA256).Hash -ne $manifest.ngxCoreSha256) {
+6 -2
View File
@@ -36,8 +36,12 @@ function Invoke-Native([string]$Log,[string]$Exe,[string[]]$Arguments) {
} }
function Build([string]$Name,[string[]]$Arguments) { function Build([string]$Name,[string[]]$Arguments) {
$log=Join-Path $OutputDirectory "build-$Name.log" $log=Join-Path $OutputDirectory "build-$Name.log"
# PowerShell 5 strips embedded quotes from native arguments; escape them. # PowerShell 5 / Legacy native passing strips embedded quotes. PowerShell
if (Invoke-Native $log $cxx @($Arguments | ForEach-Object { $_.Replace('"','\"') })) { throw "Build failed: $Name; see $log" } # 7's Standard/Windows passing preserves them and must not double-escape.
if ($PSVersionTable.PSVersion.Major -le 5 -or $PSNativeCommandArgumentPassing -eq 'Legacy') {
$Arguments=@($Arguments | ForEach-Object { $_.Replace('"','\"') })
}
if (Invoke-Native $log $cxx $Arguments) { throw "Build failed: $Name; see $log" }
} }
$results=@() $results=@()
@@ -54,6 +54,36 @@ Invoke-Child 'restore' @('-Action','restore')
foreach ($name in $before.Keys) { if ((Get-FileHash -LiteralPath (Join-Path $game $name)).Hash -ne $before[$name]) { throw 'Original game bytes not restored.' } } foreach ($name in $before.Keys) { if ((Get-FileHash -LiteralPath (Join-Path $game $name)).Hash -ne $before[$name]) { throw 'Original game bytes not restored.' } }
if (Test-Path -LiteralPath (Join-Path $game 'd4r')) { throw 'Runtime directory remains after restore.' } if (Test-Path -LiteralPath (Join-Path $game 'd4r')) { throw 'Runtime directory remains after restore.' }
$results+=@{case='auto-gfx1201-install-remember-restore'; passed=$true; gpuKernelsExecuted=$false} $results+=@{case='auto-gfx1201-install-remember-restore'; passed=$true; gpuKernelsExecuted=$false}
$manifest=Get-Content -LiteralPath (Join-Path $PackageRoot 'files/package.json') -Raw | ConvertFrom-Json
if ($manifest.bundledNvidia) {
# Bundled originals take precedence over stale remembered shim selections;
# explicit overrides still go through the existing strict negative gates.
$exe=Fixture 'bundled auto selection'
$saved.ngxCore=Join-Path $PackageRoot 'files/targets/gfx1201/d4r/_nvngx.dll'
$saved.dlssDll=$saved.ngxCore
$saved | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $PackageRoot 'work/settings.json') -Encoding UTF8
Invoke-Child 'bundled-install' @('-Action','install','-GameExe',$exe)
$game=Split-Path $exe
foreach ($pair in @(@{path='d4r/vendor/_nvngx.dll'; expected=$NgxCore},@{path='d4r/nvngx_dlss.dll'; expected=$DlssDll})) {
if ((Get-FileHash -LiteralPath (Join-Path $game $pair.path)).Hash -ne (Get-FileHash -LiteralPath $pair.expected).Hash) { throw 'Bundled original DLL selection failed.' }
}
$report=Get-ChildItem -LiteralPath (Join-Path $PackageRoot 'results') -Directory | Sort-Object Name -Descending | Select-Object -First 1
$status=Get-Content -LiteralPath (Join-Path $report.FullName 'quick-test.json') -Raw | ConvertFrom-Json
if ($status.nvidiaDllSource.core -ne 'bundled' -or $status.nvidiaDllSource.dlss -ne 'bundled') { throw 'Bundled DLL provenance is missing.' }
Invoke-Child 'bundled-restore' @('-Action','restore','-GameExe',$exe)
if (Test-Path -LiteralPath (Join-Path $game 'd4r')) { throw 'Bundled runtime directory remains after restore.' }
$results+=@{case='bundled-auto-selection-ignores-stale-choices'; passed=$true; gpuKernelsExecuted=$false}
$core=Join-Path (Join-Path $PackageRoot 'files') $manifest.bundledNvidia.ngxCore
$original=[IO.File]::ReadAllBytes($core)
try {
[IO.File]::AppendAllText($core,'tampered bundled fixture')
$exe=Fixture 'tampered bundled core'
Invoke-Child 'tampered-bundled-core' @('-Action','install','-GameExe',$exe) 1
$game=Split-Path $exe
if ((Test-Path -LiteralPath (Join-Path $game '.d4r-backup')) -or (Test-Path -LiteralPath (Join-Path $game 'dxgi.dll'))) { throw 'Tampered bundled DLL changed game files.' }
$results+=@{case='tampered-bundled-core'; passed=$true; rejectedBeforeGameChanges=$true; gpuKernelsExecuted=$false}
} finally { [IO.File]::WriteAllBytes($core,$original) }
}
# A harmless child refuses attached debuggers and produces an empty stderr. # A harmless child refuses attached debuggers and produces an empty stderr.
# The default launcher must allow it to exit and must report no DLSS session. # The default launcher must allow it to exit and must report no DLSS session.
$exe=Join-Path (Join-Path $OutputDirectory 'launcher-fixture') 'Fixture.exe' $exe=Join-Path (Join-Path $OutputDirectory 'launcher-fixture') 'Fixture.exe'