feat(settings): the player's own DLSS 5 files, added in Settings and copied where every version's game looks for them #282
No reviewers
Labels
No labels
area/build
area/install
area/mods
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!282
Loading…
Reference in a new issue
No description provided.
Delete branch "pmwork-personal/LongshotLauncher:feat/dlss5-files"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Longshot runs NVIDIA's DLSS 5 since Longshot #2503, and on RTX 20, 30 and 40 the community FP16 file since Longshot #2513, but it never ships or downloads either file: today players copy
nvngx_dlssnr.dllinto a folder by hand. With this, they choose the files they already have in Settings, and the launcher puts each one where every version's game looks for it.HumanBean and hckrman101 agreed to the approach before the game PRs, depending on how it is done; this is its launcher half.
What changed
ngxfolder comes first.%LOCALAPPDATA%\Longshot\ngx\nvngx_dlssnr.dlland%LOCALAPPDATA%\Longshot\ngx\fp16\nvngx_dlssnr.dll, whatever the file was called. Longshot'sgpu/vk/vk_dlss.cpplooks there afterRX_VK_DLSS_DIRand the game folder'sngx, and the folder is shared by every version and kept by updates.RX_VK_DLSS_DIR: an environment variable works only when the launcher starts the game, it would override a player's ownRX_VK_DLSS_DIR, and NGX looks for its other runtimes there too.ngxfolder, work as before..longshot-launcher-placed.txt(each file's identity, bytes, last write time and SHA-256 as placed; its name starts with a dot, nevernvngx_). Longshot's guide has players put the files in this folder by hand. A file the record does not match (put there by hand, or changed since) is the player's: its row offers no Remove, and Storage and Remove everything leave it out. The row says "Put here by hand", except when an FP16 file has an unrecognized size. Adding a file over it makes the place the launcher's again.Core/Dlss5Files.cs):MZ) and has a DLSS 5 model's size.nvngx, so NGX never takes it.gpu/vk/dlss_nr_model.hkFp16Known(size and SHA-256CDFA6C1E…FEABF3ED) is the FP16 file.Dlss5.CheckSignature); the description check is new.fp16andngxfolders when they are empty. It never touches a file in a game folder, a file put there by hand, or the file it was copied from. Add and Remove are refused while Longshot runs, because the game holds the files.Disk.Walktook a part that is a file for a folder that failed to list, so the measure was called partial. That happened to the DLSS 5 files, and main'ssystem_headers.txtpart takes the same path. A file part is now skipped there;Storage.Measurealready counts its bytes.tests/launcher_core/Dlss5Checks.cscovers the paths, when the section shows, the RTX series by name, how Add sorts the two files (the FP16 file without asking NVIDIA's check), the record of placed files, changed files and a file put there by hand, a failed record write, linked destination directories, files refused before and after the copy, replace and remove, the signer's organisation read alone, a file held by a running game (Windows), Storage and Remove everything's line, and on Windows the real signature check (an unsigned file, the .NET host signed by Microsoft, NVIDIA'snvapi64.dllwhen present). The test files are a few MB and made in the test; no NVIDIA file is in the repository.RemoveEverythingChecks.cshas a Windows case: the launcher's copy goes, a file put there by hand stays and is listed as kept.tests/test_launcher_core.py --longshotchecks that the launcher's FP16 list is Longshot'skFp16Known. It is skipped for a Longshot from before #2513, such as the pinned one.launcher-settings-dlss5,launcher-settings-dlss5-rtx40,storage-dlss5,storage-remove-everything-dlss5.Testing
Tested (Windows 11, RTX 5090; this branch on main
5f145106):pr-2513-76252ff9). That build had noRX_VK_DLSS_DIRand no DLSS 5 file in its ownngx.%LOCALAPPDATA%\Longshot\ngx.%USERPROFILE%\AppData\Local\Longshot\ngx\fp16(… the known file)" and "DLSS 5: NVIDIA's nvngx_dlssnr.dll found in%USERPROFILE%\AppData\Local\Longshot\ngx: the Graphics tab's DLSS 5 rows show".dotnet build LongshotLauncher.slnx -c Release -p:RestoreLockedMode=true: 0 warnings, 0 errors.python -I tests/test_launcher_core.py: on this Windows PC, main itself stops atSavesChecks, as #265 found too. I ran every check group on its own (a local edit, not in this branch) on main and on this branch:SavesChecks(a link check), andSteamChecksandRouteChecks(Linux paths);Dlss5Checksand the Windows Remove everything case pass.check_dlss5_fp16against Longshot main68ab0bc7: the lists match; a changed hash is caught; a Longshot without the header is skipped.test_release.py: 42 of 43 pass.test_prune_keeps_the_newest_nightlies_and_everything_elsefails on main on this PC too.Core/Dlss5Files.cs, into a scratchngxfolder; the files are not in the repository):nvngx_dlssnr.dll310.9.16 (266,424,944 bytes, signed by NVIDIA Corporation) and the FP16 file (276,162,560 bytes, the known hash): each is sorted to its own place (0.6 s and 0.3 s). Another NVIDIA DLL (nvapi64.dll) is refused.Still to test
A review of the whole diff before opening found that Remove everything would have deleted files put there by hand, a stale Storage measure, Add's busy state left on after an unexpected error, a loose match on the signer's name, and the partial measure above. All are fixed in the last commit, with checks.
Risks
Screenshots
In the first comment: the Settings section on an RTX 5090 with both files and on an RTX 4070 with none, Storage's Your data, and Remove everything's confirmation, drawn by
tools/screenshots.Co-Authored-By: Claude Opus 5.5 [email protected]
🤖 Generated with Claude Code
Screenshots, drawn headless by
tools/screenshots(the scenes in this PR; stand-in files of the real sizes, no NVIDIA file):Settings on an RTX 5090, both files added (
launcher-settings-dlss5)Settings on an RTX 4070, no file added (
launcher-settings-dlss5-rtx40): the GPU line says it runs the FP16 fileStorage › Your data (
storage-dlss5): the copies with their size, removed in Settings onlyRemove everything (
storage-remove-everything-dlss5): the copies go, the player's own files stay@fix
1dd0a6b09cc588fbe690Recommendation: Approve. The reported Windows run shows that players can add and use the files, but the requested RTX 20–40 and Linux checks remain outstanding. An interrupted replacement can also leave an existing launcher copy unrecognized. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
c588fbe690. I rebased it ontomain(1e5e5ed842).Conflicts resolved
Changed
Nothing was built or run: the checks run again on the new head.
Players can add their own DLSS 5 files through Settings for use by Longshot versions. The fix strengthens ownership checks and moves Settings checks off the UI thread, at the cost of hashing installed files.
Should fix (1): not blocking, but worth doing before merging.
Core/Dlss5Files.cs:179: The ownership record is replaced before the destination file, leaving the two inconsistent if the launcher stops between those operations. (more on the line) Do: Make the record and replacement recoverable across interruption, for example by recording a pending replacement and reconciling it on the next ownership check.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L6.Checks: they run again on this head; a failure shows on the pull request.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports adding both real files and running the FP16 model on Windows 11 with an RTX 5090. The revised ownership and background-check code has not yet been run.
Other systems: The feature is offered on Windows; Linux visibility and RTX 20–40 use remain untested. Storage and Remove everything also depend on the ownership record.
Switches: No switches added, changed or removed.
Reviewed:
c588fbe690against1e5e5ed842: Read AGENTS.md, CONTRIBUTING.md, Core/Dlss5Files.cs, App/ViewModels/Dlss5FilesViewModel.cs, the fix diff, and the relevant Storage and Remove everything callers. Skimmed the base diff's file list and commits; the other changed files, translations, generated assets and screenshot images were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run the project were executed. CI has not run on this head; the reported Windows tests predate the fix.
Overlaps and merge order: PR #265 also changes Settings; the description flags a possible merge conflict. The pull request is currently reported as not mergeable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
@ -0,0 +176,4 @@Directory.CreateDirectory(Path.GetDirectoryName(place)!);CheckDirectories(Path.GetDirectoryName(place)!);// Record the temporary file's identity first. If the record cannot be written, the old file stays in place.var previous = Record(folder);L6 (should fix): The ownership record is replaced before the destination file, leaving the two inconsistent if the launcher stops between those operations.
When: If the launcher exits or the PC loses power after writing the new record but before moving the temporary file, the previous launcher-installed file remains in place but no longer matches the record. Settings treats it as the player's file, and Remove everything leaves it behind.
Do: Make the record and replacement recoverable across interruption, for example by recording a pending replacement and reconciling it on the next ownership check.
@ -0,0 +313,4 @@else throw new IOException("File identity is unavailable.");var details = new FileInfo(path);return new Entry(details.Length, details.LastWriteTimeUtc.Ticks, identity,sha256 ?? Convert.ToHexStringLower(SHA256.HashData(file)));L5 (should fix): Ownership checks now hash entire model files synchronously on the UI thread.
When: When both files are installed, constructing or refreshing the Settings rows reads roughly 542 MB before the window can respond; Remove performs additional synchronous checks. Slower storage can make the launcher visibly pause.
Do: Perform ownership hashing off the UI thread and update the rows when the results arrive, while retaining a fresh ownership check before deletion.
Closing in favour of #328: the launcher is Rust + Slint since #284, so this C# PR can't merge. #328 ports it, with the fixes for L5 (no hashing on the window's thread: the rows use a quick match, a delete checks the SHA-256 off it) and L6 (a pending record line while a copy is put in place, settled on the next check) from the review above.
Pull request closed