feat(settings): add your own DLSS 5 files on Windows #328

Merged
llun merged 3 commits from pmwork-personal/LongshotLauncher:feat/dlss5-files-rust into main 2026-11-28 03:18:09 +00:00
Member

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.dll into a folder by hand. With this, they add the files they already have in Settings, and the launcher copies each one once to the folder every version's game looks in.

This is #282 (the same feature for the C# launcher) ported to the Rust launcher, which replaced it in #284, with the fix from #282's review for a replace that is stopped half way (L6). #282 is closed in favour of this one.

What changed

  • Settings › Game › DLSS 5 FILES (EXPERIMENTAL), the last block of the Game page, after the NVIDIA shader cache row. It shows on Windows with an NVIDIA RTX GPU, or when no GPU is found. The game uses these files on Windows only, so Linux and other GPUs see no change.
    • One Add DLSS 5 file… button (one file, or both from one folder). The launcher tells by each file's content which of the two it is, so the player does not have to know. Beside it: the copy's progress, then where each file went or why it was refused.
    • Two rows, NVIDIA's file (RTX 50) and Community FP16 file (RTX 20, 30, 40 and 50), each with what is in place and, for the launcher's own copy only, Remove.
    • A line for this PC's GPU (read from the registry's display adapters): an RTX 50 runs both files (the game's DLSS 5 model row then chooses one, after a restart); RTX 20 to 40 run the FP16 file.
    • The hint says that Longshot does not include or download DLSS 5, where the copies go, that a version needs NVIDIA DLSS, and that a file in a version's own ngx folder comes first.
  • Where the copies go: %LOCALAPPDATA%\Longshot\ngx\nvngx_dlssnr.dll and %LOCALAPPDATA%\Longshot\ngx\fp16\nvngx_dlssnr.dll, whatever the file was called. Longshot's gpu/vk/vk_dlss.cpp looks there after RX_VK_DLSS_DIR and the game folder's ngx.
    • One copy for every version: the folder is shared by all versions and kept by updates, so no build, update or new version copies the files again (they are about 540 MB together). Adding a newer file replaces the old copy.
    • A copy, not RX_VK_DLSS_DIR and not a link: an environment variable works only when the launcher starts the game and would override a player's own; with a copy the player can move or delete the original.
    • No new setting: the files in the folder are the state. Files put there by hand, or in a version's ngx folder, work as before.
  • What the launcher placed (src/dlss5.rs): a record beside the copies, .longshot-launcher-placed.txt (its name starts with a dot, never nvngx_). Each line holds a copy's bytes, last write time, file identity (volume and file index on Windows, device and inode elsewhere) and SHA-256. A file the record does not match is the player's: put there by hand (Longshot's guide has players do that), or changed since. Its row says "Put here by hand", it has no Remove, and Storage and Remove everything leave it out.
    • Adding where a file is in place: the file there is read whole first. The same file needs no copy: the launcher's already ("This file is already in place."), or one put there by hand, which becomes the launcher's copy without a copy (the file added from stays). A different file of the launcher's is replaced. A different file put there by hand stops the Add: a dialog names it with its size, Replace deletes it and copies the picked file there, Cancel keeps it ("Kept the file put there by hand. Nothing was copied."). Replace counts only for that file as it was shown: if it changed meanwhile, the dialog asks again.
    • A replace stopped half way (#282's L6): the record first takes the new copy as pending., then the copy is moved over the old one in one step, then the record takes it as placed. Whichever copy is in place after a crash or power loss between the steps still matches the record, so it stays the launcher's. The next Settings check settles a pending line (in place: placed; not in place: dropped), never while an Add or Remove runs. If the record cannot be written, the Add stops and the old copy stays.
    • The rows, Storage and Remove everything's list use the quick match (bytes, time, identity). A delete first checks the SHA-256 too.
    • Every Add and Remove settles the record first, so a second stopped Add can never overwrite the pending line of a first one. A record that is there but cannot be read stops the Add or Remove (it would be written again without what it holds). Lines the launcher cannot read (damaged, or from a newer launcher) are kept as they are.
    • An Add that never finished (the launcher stopped mid-copy) can leave a temporary copy; the next check deletes the launcher's own temporary copies once they are 10 minutes old. While an Add or Remove runs, the window does not close and navigation waits (the top bar, Settings' categories and Manage storage), as for the launcher's other long operations.
    • One at a time across launchers: a portable and an installed launcher share the folder, so Add, Remove and the settling of the record hold a mutex named for it (Local\LongshotLauncher.Dlss5Files) besides the launcher's own lock. Settling skips while another launcher works.
  • The checks:
    • Before any copy: the file is there, is a Windows program file (MZ) and has a DLSS 5 model's size.
    • The file is read once, hashed as it is copied into a temporary file beside its place (.longshot-launcher-*.tmp: NGX never takes it).
    • The copy is then sorted by its content. One of Longshot's gpu/vk/dlss_nr_model.h kFp16Known (size and SHA-256 CDFA6C1E…FEABF3ED) is the FP16 file. Any other file must carry a valid embedded signature whose signer's organisation (the certificate subject's O attribute alone) is NVIDIA Corporation (WinVerifyTrust, offline: NGX loads only NVIDIA-signed files), and its description must say DLSSNR: then it is NVIDIA's file. Anything else is refused, another NVIDIA DLL with its own reason.
    • No folder from %LOCALAPPDATA%\Longshot down may be a junction or a symbolic link: the launcher never writes or deletes through one, and never removes a linked fp16 folder. A link above it (an AppData or profile folder moved to another drive) is the system's, and allowed.
    • The file in place, picked again by any path to it (another spelling, a hard link, a path through a junction), is refused as already in place: the check compares the file's identity, not the path text.
    • A refused or failed Add leaves the files in place and no temporary file.
    • Add and Remove run off the window's thread, one at a time, and are refused while Longshot runs, because the game holds the files.
  • Remove deletes only the launcher's copy (after the SHA-256 check) and its record line, then the fp16 and ngx folders 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.
  • Storage: the launcher's copies show under Your data as DLSS 5 files with their size. They are not removable there; Settings removes them.
  • Remove everything: the review lists the launcher's copies, and the run deletes them. A file that is no longer the launcher's at that moment stays. A file put there by hand is not listed.
  • Texts: 34 new texts in the 12 full catalogs: 27 from #282's translations, 2 new refusals (a linked folder; a file in place that is not the launcher's copy), and 5 for the replace dialog and the same file already in place. The game's own row names ("Graphics", "DLSS 5 model") stay in English, as the game shows them.
  • Checks and CI:
    • src/dlss5/tests.rs: the places, when the section shows, the RTX series by name, how one Add sorts the two files (the FP16 file without asking NVIDIA's check, NVIDIA's check on the copy), files refused before and after the copy, replace, remove and the empty folders, a file put there by hand, a replacement with the same size and time, an edit in place caught before a delete, a damaged record, a record that cannot be written, an Add stopped before and after the move and the record settled after it, a junction (Windows) or symbolic link (Linux) at the ancestor, ngx and fp16, a file held by the game (Windows), the file in place picked again by another path, a linked fp16 folder left alone, a link above the Longshot folder, a stale temporary copy cleaned up (and a fresh one and another file kept), an Add that settles a stopped one, a record that cannot be read, an Add that asks before replacing a file put there by hand (and asks again when that file changed before the answer), the same file already in place (taken over, or already the launcher's: nothing copied), one launcher at a time through the named mutex (Windows), and on Windows the real check (an unsigned file, Microsoft's own DLLs, NVIDIA's nvapi64.dll when present, also under the temporary name). The test files are a few MB and made in the test; no NVIDIA file is in the repository. An ignored test, real_dlss5_files, runs the real files when LONGSHOT_DLSS5_NVIDIA / LONGSHOT_DLSS5_FP16 name them.
    • src/storage/cleanup.rs: Remove everything takes the launcher's copy and leaves one put there by hand.
    • tests/test_launcher_core.py --longshot: the launcher's FP16 list is the pinned Longshot's kFp16Known. CI's sparse checkout gets gpu/vk/dlss_nr_model.h for it.
    • Cargo.toml: the windows-sys features for WinTrust and CryptoAPI (no new crate; Cargo.lock unchanged).
  • README: a DLSS 5 files part under Inside the launcher; docs/ci.md names the new comparison.

Testing

Tested (Windows 11, RTX 5090; this branch on main ae619e2):

  • cargo clippy --locked --workspace --all-targets -- -D warnings: clean.
  • cargo fmt --all -- --check: clean.
  • python -I tests/test_launcher_core.py --longshot <pinned 7015105c>: the contract check (with the new FP16 comparison) and the 15 catalogs pass. cargo test on this Windows PC: 178 pass, 11 fail. Main ae619e2 on the same PC: 154 pass, the same 11 fail (folders, game recovery, registry, Steam library, versions, home, storage: mostly paths that mix / and \). The 24 new tests pass.
  • Tooling's test_release.py at the pinned 8f6f6c97: 46 tests pass.
  • With the real files (the ignored real_dlss5_files test, into a temporary folder; the files are not in the repository): NVIDIA's nvngx_dlssnr.dll 310.9.16 (266,424,944 bytes, signed by NVIDIA Corporation) is sorted as NVIDIA's file; the FP16 file (276,162,560 bytes, the known hash) as the FP16 file; Remove deletes both copies, the record and the empty folders; the originals stay.
  • A review of the whole diff before opening found: Linux dead code in two Windows-made types (CI's Linux clippy), the in-place check by path text, a temporary copy left when the window closed mid-copy, a linked fp16 folder that Remove could delete and a settle that did not check for links, a pending line a second stopped Add could overwrite, a record read that hid errors and dropped lines, and a link check that also refused links above the Longshot folder. All are fixed, with tests.
  • By hand, this branch's debug build on this PC (a scratch launcher home and a scratch LOCALAPPDATA, so nothing of the player's was changed; the real files were only read):
    • With both files put in the scratch ngx by hand: both rows say "Put here by hand (254.1 MiB / 263.4 MiB). The launcher leaves it alone." with no Remove; the RTX 50 line and the hint show.
    • Add DLSS 5 file… with NVIDIA's real file: "Copying and checking… N%", then "Added as NVIDIA's file. …", and the row says "Added (254.1 MiB)." with Remove. The same with the FP16 file, sorted to fp16.
    • NVIDIA's nvapi64.dll (560 KB) is refused before any copy ("This is not a DLSS 5 file"); NVIDIA's DLSS upscaler nvngx_dlss.dll (59 MB, signed by NVIDIA) is refused after the check ("This NVIDIA file is not the DLSS 5 model"). Both rows stay as they were.
    • Remove on the FP16 row: "Removed. The file you added it from is not touched."; the copy, its record line and the empty fp16 folder go; NVIDIA's copy and the record stay; no temporary file is left.
    • Storage › Your data lists DLSS 5 files (254.1 MiB, not removable there); Remove everything's review lists the copy (closed with Keep).

Still to test

  • An RTX 20, 30 or 40 PC: the GPU line, and the FP16 file running.
  • Linux: the section hidden, and CI's checks.

Risks

  • The signature check is offline, so revocation is not checked (as in the Bloodborne port). NGX checks the signature again when the game loads the file.
  • A change to the FP16 file in place that keeps its size, time and identity shows as the launcher's in the rows until a Remove, whose SHA-256 check then refuses it. Hashing 540 MB each time Settings or Storage opens was the alternative.

Screenshots

In the first comment: the section with the files put there by hand, after both Adds, Storage's Your data, and Remove everything's review (this branch's debug build, scratch folders).

Co-Authored-By: Claude Opus 5.5 [email protected]

🤖 Generated with Claude Code

Longshot runs NVIDIA's DLSS 5 since [Longshot #2503](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2503), and on RTX 20, 30 and 40 the community FP16 file since [Longshot #2513](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2513), but it never ships or downloads either file: today players copy `nvngx_dlssnr.dll` into a folder by hand. With this, they add the files they already have in Settings, and the launcher copies each one once to the folder every version's game looks in. This is #282 (the same feature for the C# launcher) ported to the Rust launcher, which replaced it in #284, with the fix from #282's review for a replace that is stopped half way (L6). #282 is closed in favour of this one. ## What changed - **Settings › Game › DLSS 5 FILES (EXPERIMENTAL)**, the last block of the Game page, after the NVIDIA shader cache row. It shows on Windows with an NVIDIA RTX GPU, or when no GPU is found. The game uses these files on Windows only, so Linux and other GPUs see no change. - One **Add DLSS 5 file…** button (one file, or both from one folder). The launcher tells by each file's content which of the two it is, so the player does not have to know. Beside it: the copy's progress, then where each file went or why it was refused. - Two rows, **NVIDIA's file** (RTX 50) and **Community FP16 file** (RTX 20, 30, 40 and 50), each with what is in place and, for the launcher's own copy only, **Remove**. - A line for this PC's GPU (read from the registry's display adapters): an RTX 50 runs both files (the game's DLSS 5 model row then chooses one, after a restart); RTX 20 to 40 run the FP16 file. - The hint says that Longshot does not include or download DLSS 5, where the copies go, that a version needs NVIDIA DLSS, and that a file in a version's own `ngx` folder comes first. - **Where the copies go:** `%LOCALAPPDATA%\Longshot\ngx\nvngx_dlssnr.dll` and `%LOCALAPPDATA%\Longshot\ngx\fp16\nvngx_dlssnr.dll`, whatever the file was called. Longshot's `gpu/vk/vk_dlss.cpp` looks there after `RX_VK_DLSS_DIR` and the game folder's `ngx`. - **One copy for every version:** the folder is shared by all versions and kept by updates, so no build, update or new version copies the files again (they are about 540 MB together). Adding a newer file replaces the old copy. - **A copy, not `RX_VK_DLSS_DIR` and not a link:** an environment variable works only when the launcher starts the game and would override a player's own; with a copy the player can move or delete the original. - **No new setting:** the files in the folder are the state. Files put there by hand, or in a version's `ngx` folder, work as before. - **What the launcher placed** (`src/dlss5.rs`): a record beside the copies, `.longshot-launcher-placed.txt` (its name starts with a dot, never `nvngx_`). Each line holds a copy's bytes, last write time, file identity (volume and file index on Windows, device and inode elsewhere) and SHA-256. A file the record does not match is the player's: put there by hand (Longshot's guide has players do that), or changed since. Its row says "Put here by hand", it has no Remove, and Storage and Remove everything leave it out. - **Adding where a file is in place:** the file there is read whole first. The same file needs no copy: the launcher's already ("This file is already in place."), or one put there by hand, which becomes the launcher's copy without a copy (the file added from stays). A different file of the launcher's is replaced. A different file put there by hand stops the Add: a dialog names it with its size, **Replace** deletes it and copies the picked file there, **Cancel** keeps it ("Kept the file put there by hand. Nothing was copied."). Replace counts only for that file as it was shown: if it changed meanwhile, the dialog asks again. - **A replace stopped half way (#282's L6):** the record first takes the new copy as `pending.`, then the copy is moved over the old one in one step, then the record takes it as placed. Whichever copy is in place after a crash or power loss between the steps still matches the record, so it stays the launcher's. The next Settings check settles a pending line (in place: placed; not in place: dropped), never while an Add or Remove runs. If the record cannot be written, the Add stops and the old copy stays. - The rows, Storage and Remove everything's list use the quick match (bytes, time, identity). A delete first checks the SHA-256 too. - Every Add and Remove settles the record first, so a second stopped Add can never overwrite the pending line of a first one. A record that is there but cannot be read stops the Add or Remove (it would be written again without what it holds). Lines the launcher cannot read (damaged, or from a newer launcher) are kept as they are. - An Add that never finished (the launcher stopped mid-copy) can leave a temporary copy; the next check deletes the launcher's own temporary copies once they are 10 minutes old. While an Add or Remove runs, the window does not close and navigation waits (the top bar, Settings' categories and Manage storage), as for the launcher's other long operations. - **One at a time across launchers:** a portable and an installed launcher share the folder, so Add, Remove and the settling of the record hold a mutex named for it (`Local\LongshotLauncher.Dlss5Files`) besides the launcher's own lock. Settling skips while another launcher works. - **The checks:** - Before any copy: the file is there, is a Windows program file (`MZ`) and has a DLSS 5 model's size. - The file is read once, hashed as it is copied into a temporary file beside its place (`.longshot-launcher-*.tmp`: NGX never takes it). - The copy is then sorted by its content. One of Longshot's `gpu/vk/dlss_nr_model.h` `kFp16Known` (size and SHA-256 `CDFA6C1E…FEABF3ED`) is the FP16 file. Any other file must carry a valid embedded signature whose signer's organisation (the certificate subject's O attribute alone) is NVIDIA Corporation (WinVerifyTrust, offline: NGX loads only NVIDIA-signed files), and its description must say DLSSNR: then it is NVIDIA's file. Anything else is refused, another NVIDIA DLL with its own reason. - No folder from `%LOCALAPPDATA%\Longshot` down may be a junction or a symbolic link: the launcher never writes or deletes through one, and never removes a linked `fp16` folder. A link above it (an AppData or profile folder moved to another drive) is the system's, and allowed. - The file in place, picked again by any path to it (another spelling, a hard link, a path through a junction), is refused as already in place: the check compares the file's identity, not the path text. - A refused or failed Add leaves the files in place and no temporary file. - Add and Remove run off the window's thread, one at a time, and are refused while Longshot runs, because the game holds the files. - **Remove** deletes only the launcher's copy (after the SHA-256 check) and its record line, then the `fp16` and `ngx` folders 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. - **Storage:** the launcher's copies show under **Your data** as **DLSS 5 files** with their size. They are not removable there; Settings removes them. - **Remove everything:** the review lists the launcher's copies, and the run deletes them. A file that is no longer the launcher's at that moment stays. A file put there by hand is not listed. - **Texts:** 34 new texts in the 12 full catalogs: 27 from #282's translations, 2 new refusals (a linked folder; a file in place that is not the launcher's copy), and 5 for the replace dialog and the same file already in place. The game's own row names ("Graphics", "DLSS 5 model") stay in English, as the game shows them. - **Checks and CI:** - `src/dlss5/tests.rs`: the places, when the section shows, the RTX series by name, how one Add sorts the two files (the FP16 file without asking NVIDIA's check, NVIDIA's check on the copy), files refused before and after the copy, replace, remove and the empty folders, a file put there by hand, a replacement with the same size and time, an edit in place caught before a delete, a damaged record, a record that cannot be written, an Add stopped before and after the move and the record settled after it, a junction (Windows) or symbolic link (Linux) at the ancestor, `ngx` and `fp16`, a file held by the game (Windows), the file in place picked again by another path, a linked `fp16` folder left alone, a link above the Longshot folder, a stale temporary copy cleaned up (and a fresh one and another file kept), an Add that settles a stopped one, a record that cannot be read, an Add that asks before replacing a file put there by hand (and asks again when that file changed before the answer), the same file already in place (taken over, or already the launcher's: nothing copied), one launcher at a time through the named mutex (Windows), and on Windows the real check (an unsigned file, Microsoft's own DLLs, NVIDIA's `nvapi64.dll` when present, also under the temporary name). The test files are a few MB and made in the test; no NVIDIA file is in the repository. An ignored test, `real_dlss5_files`, runs the real files when `LONGSHOT_DLSS5_NVIDIA` / `LONGSHOT_DLSS5_FP16` name them. - `src/storage/cleanup.rs`: Remove everything takes the launcher's copy and leaves one put there by hand. - `tests/test_launcher_core.py --longshot`: the launcher's FP16 list is the pinned Longshot's `kFp16Known`. CI's sparse checkout gets `gpu/vk/dlss_nr_model.h` for it. - `Cargo.toml`: the windows-sys features for WinTrust and CryptoAPI (no new crate; `Cargo.lock` unchanged). - README: a *DLSS 5 files* part under *Inside the launcher*; `docs/ci.md` names the new comparison. ## Testing **Tested** (Windows 11, RTX 5090; this branch on main `ae619e2`): - `cargo clippy --locked --workspace --all-targets -- -D warnings`: clean. - `cargo fmt --all -- --check`: clean. - `python -I tests/test_launcher_core.py --longshot <pinned 7015105c>`: the contract check (with the new FP16 comparison) and the 15 catalogs pass. `cargo test` on this Windows PC: 178 pass, 11 fail. Main `ae619e2` on the same PC: 154 pass, the same 11 fail (folders, game recovery, registry, Steam library, versions, home, storage: mostly paths that mix `/` and `\`). The 24 new tests pass. - Tooling's `test_release.py` at the pinned `8f6f6c97`: 46 tests pass. - **With the real files** (the ignored `real_dlss5_files` test, into a temporary folder; the files are not in the repository): NVIDIA's `nvngx_dlssnr.dll` 310.9.16 (266,424,944 bytes, signed by NVIDIA Corporation) is sorted as NVIDIA's file; the FP16 file (276,162,560 bytes, the known hash) as the FP16 file; Remove deletes both copies, the record and the empty folders; the originals stay. - A review of the whole diff before opening found: Linux dead code in two Windows-made types (CI's Linux clippy), the in-place check by path text, a temporary copy left when the window closed mid-copy, a linked `fp16` folder that Remove could delete and a settle that did not check for links, a pending line a second stopped Add could overwrite, a record read that hid errors and dropped lines, and a link check that also refused links above the Longshot folder. All are fixed, with tests. - **By hand, this branch's debug build on this PC** (a scratch launcher home and a scratch `LOCALAPPDATA`, so nothing of the player's was changed; the real files were only read): - With both files put in the scratch `ngx` by hand: both rows say "Put here by hand (254.1 MiB / 263.4 MiB). The launcher leaves it alone." with no Remove; the RTX 50 line and the hint show. - **Add DLSS 5 file…** with NVIDIA's real file: "Copying and checking… N%", then "Added as NVIDIA's file. …", and the row says "Added (254.1 MiB)." with Remove. The same with the FP16 file, sorted to `fp16`. - NVIDIA's `nvapi64.dll` (560 KB) is refused before any copy ("This is not a DLSS 5 file"); NVIDIA's DLSS upscaler `nvngx_dlss.dll` (59 MB, signed by NVIDIA) is refused after the check ("This NVIDIA file is not the DLSS 5 model"). Both rows stay as they were. - **Remove** on the FP16 row: "Removed. The file you added it from is not touched."; the copy, its record line and the empty `fp16` folder go; NVIDIA's copy and the record stay; no temporary file is left. - Storage › Your data lists **DLSS 5 files** (254.1 MiB, not removable there); Remove everything's review lists the copy (closed with Keep). **Still to test** - An RTX 20, 30 or 40 PC: the GPU line, and the FP16 file running. - Linux: the section hidden, and CI's checks. ## Risks - The signature check is offline, so revocation is not checked (as in the Bloodborne port). NGX checks the signature again when the game loads the file. - A change to the FP16 file in place that keeps its size, time and identity shows as the launcher's in the rows until a Remove, whose SHA-256 check then refuses it. Hashing 540 MB each time Settings or Storage opens was the alternative. ## Screenshots In the first comment: the section with the files put there by hand, after both Adds, Storage's Your data, and Remove everything's review (this branch's debug build, scratch folders). Co-Authored-By: Claude Opus 5.5 <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(settings): add your own DLSS 5 files on Windows
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
PR title / Conventional Commit title (pull_request) Successful in 7s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 13s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
507e57972c
Settings > Game gets a DLSS 5 FILES (EXPERIMENTAL) section. One Add sorts each
file by its content (NVIDIA's signed DLSSNR model, or the known community FP16
file) and copies it once to %LOCALAPPDATA%\Longshot\ngx, where every version's
game looks. A record beside the copies tells the launcher's copies from files
put there by hand, also after a replace stopped half way; Remove, Storage and
Remove everything handle only the launcher's copies. Port of #282 to the Rust
launcher, with the fix from its review (L6).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Screenshots of this branch's debug build on Windows 11 with an RTX 5090, in a scratch launcher home and a scratch LOCALAPPDATA (so the paths are test folders).

Settings › Game, with both files put in ngx by hand: the player's files, no Remove.

Settings, DLSS 5 files put there by hand

After Add DLSS 5 file… with each real file: each sorted to its place, now the launcher's copy with Remove.

Settings, both DLSS 5 files added

Storage › Your data (after the FP16 copy was removed in Settings): the launcher's copy of NVIDIA's file, not removable here.

Storage, Your data with DLSS 5 files

Remove everything's review lists the launcher's copy.

Remove everything review

Screenshots of this branch's debug build on Windows 11 with an RTX 5090, in a scratch launcher home and a scratch `LOCALAPPDATA` (so the paths are test folders). **Settings › Game, with both files put in `ngx` by hand:** the player's files, no Remove. ![Settings, DLSS 5 files put there by hand](https://git.magicbean.dev/attachments/06eb6673-736c-4165-8254-501c6651344a) **After Add DLSS 5 file… with each real file:** each sorted to its place, now the launcher's copy with Remove. ![Settings, both DLSS 5 files added](https://git.magicbean.dev/attachments/655d5e59-c0bf-4a30-8af8-f5013e99989c) **Storage › Your data** (after the FP16 copy was removed in Settings): the launcher's copy of NVIDIA's file, not removable here. ![Storage, Your data with DLSS 5 files](https://git.magicbean.dev/attachments/32cbccaf-3d98-42b0-8b38-33eb7ef60fc4) **Remove everything's review** lists the launcher's copy. ![Remove everything review](https://git.magicbean.dev/attachments/d965fd70-9975-41bb-bcfd-64cf687f20a0)
Member
@review
BeanBot left a comment

Recommendation: Request changes. Adding a file can silently overwrite the player's only copy of a file they placed by hand, despite the UI saying the launcher leaves it alone. The ownership record can also lose entries when two launcher instances operate concurrently.

The feature lets Windows players copy their existing DLSS 5 files into the shared game folder and manage launcher-owned copies in Settings and Storage. The reported Windows checks show that both real files can be classified and copied, but replacing an existing player-owned file needs an explicit safeguard.

Blocking (1): must change before merging.

  1. L1 src/dlss5.rs:473: Adding a file replaces an existing player-owned file without warning or confirmation, although its row says the launcher leaves it alone. (more on the line) Do: Before replacing a destination that is not launcher-owned, show which file will be replaced and require explicit confirmation, or refuse the replacement until the player moves it.

Should fix (2): not blocking, but worth doing before merging.

  • L2 src/dlss5.rs:140: The lock serializes record updates only within one launcher process. (more on the line) Do: Use a cross-process lock for the shared folder around reconciliation and the complete record update and file operation.
  • L3 ui/main.slint:172: The new navigation lock does not prevent switching Settings categories while a DLSS operation runs. (more on the line) Do: Apply the DLSS busy state to Settings category navigation as well, or keep the operation's progress and result visible across categories.

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)

  • L4: The supplied runs do not show a game loading a file from the shared folder. When: The real-file test verifies classification, placement and removal, but does not establish that a supported Longshot build finds and uses the installed model. Do: Run a DLSS-enabled Longshot build with a file added through Settings and verify the model works in game; an RTX 20, 30 or 40 run with the FP16 file would cover the outstanding intended hardware.

@fix can do L1, L2 and L3.

Checks: Still running: CI / Rust formatting, lint and tests (pull_request), CI / Release packages and stable upgrades (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Unproven end to end: the author reports successful classification and copying of both real files on Windows 11 with an RTX 5090, but does not report launching Longshot with either copied file. This is not a performance change.

Other systems: The section is hidden on Linux; the ownership and cleanup code is also exercised by synthetic cross-platform tests. Windows file identity, signatures, junctions, Storage and Remove everything are affected. RTX 20–40 gameplay with the shared FP16 copy remains untested in the supplied runs.

Switches: No production switches added, changed or removed. The ignored real-file test accepts LONGSHOT_DLSS5_NVIDIA and LONGSHOT_DLSS5_FP16; neither is set by default.

Reviewed: 507e57972c against ae619e2dbc: Read AGENTS.md and CONTRIBUTING.md; no review checklist or pull request template was present at the named paths. Read the commit, full new DLSS code and tests, the storage cleanup code, and the UI changes; traced filesystem helpers, navigation and callers. Reviewed the remaining diffs and skimmed translations and reported runs. The rest of the existing UI and storage files were read around the affected paths rather than in full.; nothing run (a code review).

Checked and fine:

  • The commit has the required AI co-author trailer and the change contains synthetic test fixtures rather than game files.
  • The reported Windows run classified both real files and exercised add, remove, Storage and the removal review.
  • The record preserves a pending replacement across an interrupted move, and deletion performs a full hash check.
  • The changes use wide Windows APIs for signature and version-resource paths.

Testing: Read-only review; no project code, tests or builds were run. Both CI jobs are still running.

Overlaps and merge order: #282 is closed in favour of this Rust implementation; no merge ordering is needed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Adding a file can silently overwrite the player's only copy of a file they placed by hand, despite the UI saying the launcher leaves it alone. The ownership record can also lose entries when two launcher instances operate concurrently. The feature lets Windows players copy their existing DLSS 5 files into the shared game folder and manage launcher-owned copies in Settings and Storage. The reported Windows checks show that both real files can be classified and copied, but replacing an existing player-owned file needs an explicit safeguard. **Blocking (1)**: must change before merging. 1. **L1** `src/dlss5.rs:473`: Adding a file replaces an existing player-owned file without warning or confirmation, although its row says the launcher leaves it alone. (more on the line) **Do:** Before replacing a destination that is not launcher-owned, show which file will be replaced and require explicit confirmation, or refuse the replacement until the player moves it. **Should fix (2)**: not blocking, but worth doing before merging. - **L2** `src/dlss5.rs:140`: The lock serializes record updates only within one launcher process. (more on the line) **Do:** Use a cross-process lock for the shared folder around reconciliation and the complete record update and file operation. - **L3** `ui/main.slint:172`: The new navigation lock does not prevent switching Settings categories while a DLSS operation runs. (more on the line) **Do:** Apply the DLSS busy state to Settings category navigation as well, or keep the operation's progress and result visible across categories. **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) - **L4**: The supplied runs do not show a game loading a file from the shared folder. *When:* The real-file test verifies classification, placement and removal, but does not establish that a supported Longshot build finds and uses the installed model. **Do:** Run a DLSS-enabled Longshot build with a file added through Settings and verify the model works in game; an RTX 20, 30 or 40 run with the FP16 file would cover the outstanding intended hardware. `@fix` can do L1, L2 and L3. **Checks:** Still running: `CI / Rust formatting, lint and tests (pull_request)`, `CI / Release packages and stable upgrades (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven end to end: the author reports successful classification and copying of both real files on Windows 11 with an RTX 5090, but does not report launching Longshot with either copied file. This is not a performance change. **Other systems:** The section is hidden on Linux; the ownership and cleanup code is also exercised by synthetic cross-platform tests. Windows file identity, signatures, junctions, Storage and Remove everything are affected. RTX 20–40 gameplay with the shared FP16 copy remains untested in the supplied runs. **Switches:** No production switches added, changed or removed. The ignored real-file test accepts LONGSHOT_DLSS5_NVIDIA and LONGSHOT_DLSS5_FP16; neither is set by default. **Reviewed:** 507e57972cba against ae619e2dbc20: Read AGENTS.md and CONTRIBUTING.md; no review checklist or pull request template was present at the named paths. Read the commit, full new DLSS code and tests, the storage cleanup code, and the UI changes; traced filesystem helpers, navigation and callers. Reviewed the remaining diffs and skimmed translations and reported runs. The rest of the existing UI and storage files were read around the affected paths rather than in full.; nothing run (a code review). **Checked and fine:** - The commit has the required AI co-author trailer and the change contains synthetic test fixtures rather than game files. - The reported Windows run classified both real files and exercised add, remove, Storage and the removal review. - The record preserves a pending replacement across an interrupted move, and deletion performs a full hash check. - The changes use wide Windows APIs for signature and version-resource paths. **Testing:** Read-only review; no project code, tests or builds were run. Both CI jobs are still running. **Overlaps and merge order:** #282 is closed in favour of this Rust implementation; no merge ordering is needed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -0,0 +137,4 @@
#[cfg(not(windows))]
{
let _ = path;
NvidiaCheck::NotNvidia
Member

L2 (should fix): The lock serializes record updates only within one launcher process.

When: An installed and a portable launcher add different models at the same time. Both can read the same record and then write their own version, so one placed file loses its ownership entry and appears as put there by hand; Remove and Remove everything cannot remove it.

Do: Use a cross-process lock for the shared folder around reconciliation and the complete record update and file operation.

**L2** (should fix): The lock serializes record updates only within one launcher process. *When:* An installed and a portable launcher add different models at the same time. Both can read the same record and then write their own version, so one placed file loses its ownership entry and appears as put there by hand; Remove and Remove everything cannot remove it. **Do:** Use a cross-process lock for the shared folder around reconciliation and the complete record update and file operation.
@ -0,0 +470,4 @@
let mut record = Record::read(folder)?;
record.pending.insert(kind, entry.clone());
record.write(folder)?;
if let Err(error) = copy.persist(&destination) {
Member

L1 (blocking): Adding a file replaces an existing player-owned file without warning or confirmation, although its row says the launcher leaves it alone.

When: A player has their only copy of a model in the shared ngx folder and selects another model of the same kind. The temporary copy is persisted over the existing file, destroying the player's file without a chance to keep it.

Do: Before replacing a destination that is not launcher-owned, show which file will be replaced and require explicit confirmation, or refuse the replacement until the player moves it.

**L1** (blocking): Adding a file replaces an existing player-owned file without warning or confirmation, although its row says the launcher leaves it alone. *When:* A player has their only copy of a model in the shared ngx folder and selects another model of the same kind. The temporary copy is persisted over the existing file, destroying the player's file without a chance to keep it. **Do:** Before replacing a destination that is not launcher-owned, show which file will be replaced and require explicit confirmation, or refuse the replacement until the player moves it.
@ -166,3 +170,3 @@
out property <bool> editing-text: Ink.editing-text;
changed page => { Ink.editing-text = false; }
out property <bool> navigation-locked: (root.page == Page.launch && Game.show-log) || (root.page == Page.build && Game.folders-open) || Game.busy || Players.busy || Mods.busy || Preferences.cleaning || Preferences.changing-folder || Preferences.romfs-running || Updates.applying;
out property <bool> navigation-locked: (root.page == Page.launch && Game.show-log) || (root.page == Page.build && Game.folders-open) || Game.busy || Players.busy || Mods.busy || Preferences.cleaning || Preferences.changing-folder || Preferences.romfs-running || Preferences.dlss5-busy || Updates.applying;
Member

L3 (should fix): The new navigation lock does not prevent switching Settings categories while a DLSS operation runs.

When: During a long copy, the category buttons can switch to Storage or another Settings page because their handler checks only Players.busy and Preferences.cleaning. The progress and result disappear from view even though the operation is still running.

Do: Apply the DLSS busy state to Settings category navigation as well, or keep the operation's progress and result visible across categories.

**L3** (should fix): The new navigation lock does not prevent switching Settings categories while a DLSS operation runs. *When:* During a long copy, the category buttons can switch to Storage or another Settings page because their handler checks only Players.busy and Preferences.cleaning. The progress and result disappear from view even though the operation is still running. **Do:** Apply the DLSS busy state to Settings category navigation as well, or keep the operation's progress and result visible across categories.
Author
Member

L4 (a game run with a file added in Settings): the launcher's part ends at the file in the folder, and that part is covered. Each copy is byte for byte the file picked (one_add_tells_the_two_files_apart_by_their_content, and the real-file run), at %LOCALAPPDATA%\Longshot\ngx\nvngx_dlssnr.dll and ngx\fp16\nvngx_dlssnr.dll: the folder Longshot's gpu/vk/vk_dlss.cpp searches after RX_VK_DLSS_DIR and the game's own ngx.

The game side already ran with these very files in that folder, for #282 (RTX 5090, Longshot #2513's build pr-2513-76252ff9): its log found NVIDIA's file and the known FP16 file in %LOCALAPPDATA%\Longshot\ngx and ngx\fp16, and DLSS 5 ran with the FP16 file ("the community FP16 file, direct"). This launcher writes the same bytes to the same paths, so nothing the game reads changes.

An RTX 20, 30 or 40 run of the FP16 file tests Longshot #2513's path more than this PR; it needs a card that isn't here (a tester or the Test Farm).

L1 to L3 are being fixed in the next push.

**L4** (a game run with a file added in Settings): the launcher's part ends at the file in the folder, and that part is covered. Each copy is byte for byte the file picked (`one_add_tells_the_two_files_apart_by_their_content`, and the real-file run), at `%LOCALAPPDATA%\Longshot\ngx\nvngx_dlssnr.dll` and `ngx\fp16\nvngx_dlssnr.dll`: the folder Longshot's `gpu/vk/vk_dlss.cpp` searches after `RX_VK_DLSS_DIR` and the game's own `ngx`. The game side already ran with these very files in that folder, for #282 (RTX 5090, Longshot #2513's build `pr-2513-76252ff9`): its log found NVIDIA's file and the known FP16 file in `%LOCALAPPDATA%\Longshot\ngx` and `ngx\fp16`, and DLSS 5 ran with the FP16 file ("the community FP16 file, direct"). This launcher writes the same bytes to the same paths, so nothing the game reads changes. An RTX 20, 30 or 40 run of the FP16 file tests Longshot #2513's path more than this PR; it needs a card that isn't here (a tester or the Test Farm). L1 to L3 are being fixed in the next push.
fix(settings): ask before replacing a DLSS 5 file put there by hand
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 13s
PR title / Conventional Commit title (pull_request) Successful in 8s
CI / Rust formatting, lint and tests (pull_request) Has been cancelled
CI / Release packages and stable upgrades (pull_request) Has been cancelled
1c3ad768d3
BeanBot's review of #328. L1: an Add reads the file already in the place
first. The same file needs no copy (one put there by hand becomes the
launcher's copy); a different file put there by hand stops the Add, and a
dialog names it: Replace (only that file as it was shown) or Cancel. L2: Add,
Remove and settling also hold a mutex named for the folder, so a portable and
an installed launcher take turns. L3: Settings' categories and Manage storage
wait while an Add or Remove runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Fixed in 1c3ad76 (tests first in the same commit; clippy, rustfmt and the catalogs clean, 178 tests pass here, the same 11 Windows-only failures as main):

L1 (a file put there by hand replaced without asking): an Add now reads the file already in the place before anything moves.

  • The same file needs no copy: if it is the launcher's already, "This file is already in place."; if it was put there by hand, it becomes the launcher's copy without a copy ("Nothing was copied: it is the launcher's copy now."), and the file it was added from stays.
  • A different file put there by hand stops the Add. A dialog names it with its size: Replace deletes it and copies the picked file there, Cancel keeps it ("Kept the file put there by hand. Nothing was copied."). Replace counts only for that file as it was shown (path, size, time, identity and SHA-256): if it changed before the answer, the dialog asks again.
  • A different file of the launcher's own is replaced as before.

L2 (one launcher at a time): Add, Remove and the settling of the record also hold a mutex named for the folder, Local\LongshotLauncher.Dlss5Files, shared by every launcher of the user, so a portable and an installed launcher take turns; settling skips while another one works. one_launcher_at_a_time_across_processes checks it from two threads (the mutex belongs to its thread).

L3 (Settings' categories during a copy): the categories and Manage storage wait while an Add or Remove runs, as the top bar already did.

Checked by hand on this branch's debug build (scratch folders): NVIDIA's file put there by hand, added again: taken over, the file not rewritten; a wrong file put in fp16 by hand, the FP16 file added: the dialog below, Cancel kept it, Replace replaced it; a click on Storage during that copy stayed on Game with the progress.

The replace dialog

Fixed in 1c3ad76 (tests first in the same commit; clippy, rustfmt and the catalogs clean, 178 tests pass here, the same 11 Windows-only failures as `main`): **L1** (a file put there by hand replaced without asking): an Add now reads the file already in the place before anything moves. - The same file needs no copy: if it is the launcher's already, "This file is already in place."; if it was put there by hand, it becomes the launcher's copy without a copy ("Nothing was copied: it is the launcher's copy now."), and the file it was added from stays. - A different file put there by hand stops the Add. A dialog names it with its size: **Replace** deletes it and copies the picked file there, **Cancel** keeps it ("Kept the file put there by hand. Nothing was copied."). Replace counts only for that file as it was shown (path, size, time, identity and SHA-256): if it changed before the answer, the dialog asks again. - A different file of the launcher's own is replaced as before. **L2** (one launcher at a time): Add, Remove and the settling of the record also hold a mutex named for the folder, `Local\LongshotLauncher.Dlss5Files`, shared by every launcher of the user, so a portable and an installed launcher take turns; settling skips while another one works. `one_launcher_at_a_time_across_processes` checks it from two threads (the mutex belongs to its thread). **L3** (Settings' categories during a copy): the categories and Manage storage wait while an Add or Remove runs, as the top bar already did. Checked by hand on this branch's debug build (scratch folders): NVIDIA's file put there by hand, added again: taken over, the file not rewritten; a wrong file put in `fp16` by hand, the FP16 file added: the dialog below, Cancel kept it, Replace replaced it; a click on Storage during that copy stayed on Game with the progress. ![The replace dialog](https://git.magicbean.dev/attachments/146b03c0-f536-4051-a22f-37956b173443)
Member
@review
BeanBot left a comment

Recommendation: Approve. The replacement prompt and navigation lock address the player-facing issues, and the supplied game run shows the shared-folder integration working. Cross-process locking works when the Windows mutex is acquired, though acquisition failure still leaves a minor gap. Recommend approval; not approved on the forge.

Players can add their own DLSS 5 files through Settings and share the copies across game versions. The change adds file validation and ownership tracking, at the cost of additional filesystem and UI logic.

Should fix (1): not blocking, but worth doing before merging.

  • L2 src/dlss5.rs:140: An operation proceeds without the cross-process lock when mutex acquisition fails. When: If Windows cannot create or wait for the named mutex, exclusive stores None and an Add or Remove can update the record concurrently with another launcher. Do: Return an error when the shared mutex cannot be acquired and stop the operation before accessing the record.

@fix can do L2.

Since the last review (on 507e57972c)
Resolved: L1 (Adding a file replaces an existing player-owned file without warning or confirmation, alth…); L3 (The new navigation lock does not prevent switching Settings categories while a DLSS operat…); L4 (The supplied runs do not show a game loading a file from the shared folder.)
Still open: L2 (An operation proceeds without the cross-process lock when mutex acquisition fails.)

Checks: Still running: CI / Rust formatting, lint and tests (pull_request), CI / Release packages and stable upgrades (pull_request).

Also noticed (2; not asked for, not blocking)
  • The Local mutex namespace does not coordinate launcher instances running in different Windows sessions that share the same profile.
  • An RTX 20, 30 or 40 game run would exercise the FP16 path on those cards.
More: does it help, other systems, switches, what was read

Does it help: Yes. The author reports that both real files were sorted into the expected shared paths on Windows 11, and that Longshot previously loaded those same files from those paths on an RTX 5090. This is not a performance change.

Other systems: The feature is Windows-only; Linux hides the section. Storage and Remove everything use the ownership record, while the named mutex coordinates launcher instances in the same Windows session. An RTX 20–40 game run remains unreported.

Switches: No player-facing switches added or changed. The ignored real-file test uses LONGSHOT_DLSS5_NVIDIA and LONGSHOT_DLSS5_FP16; neither affects normal launcher operation.

Reviewed: 1c3ad768d3 against ae619e2dbc: Read AGENTS.md, CONTRIBUTING.md, src/preferences/dlss5.rs and src/dlss5/windows.rs in full; reviewed the fix diff, relevant portions of src/dlss5.rs, its tests, Settings and storage callers. Skimmed translations and the remaining pull-request diff; the other changed code files were not read in full.; nothing run (a code review).

Checked and fine:

  • A changed player-owned destination is checked again against the confirmation before replacement.
  • Settings category navigation waits during an Add or Remove.
  • The reported real-file tests preserve the source files.

Testing: No commands from the project or tests were run. The author reports Windows checks and manual tests; both CI jobs are still running.

Overlaps and merge order: LongshotLauncher #282 is closed in favour of this pull request.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The replacement prompt and navigation lock address the player-facing issues, and the supplied game run shows the shared-folder integration working. Cross-process locking works when the Windows mutex is acquired, though acquisition failure still leaves a minor gap. Recommend approval; not approved on the forge. Players can add their own DLSS 5 files through Settings and share the copies across game versions. The change adds file validation and ownership tracking, at the cost of additional filesystem and UI logic. **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `src/dlss5.rs:140`: An operation proceeds without the cross-process lock when mutex acquisition fails. *When:* If Windows cannot create or wait for the named mutex, exclusive stores None and an Add or Remove can update the record concurrently with another launcher. **Do:** Return an error when the shared mutex cannot be acquired and stop the operation before accessing the record. `@fix` can do L2. **Since the last review** (on 507e57972cba) Resolved: L1 (Adding a file replaces an existing player-owned file without warning or confirmation, alth…); L3 (The new navigation lock does not prevent switching Settings categories while a DLSS operat…); L4 (The supplied runs do not show a game loading a file from the shared folder.) Still open: L2 (An operation proceeds without the cross-process lock when mutex acquisition fails.) **Checks:** Still running: `CI / Rust formatting, lint and tests (pull_request)`, `CI / Release packages and stable upgrades (pull_request)`. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The Local mutex namespace does not coordinate launcher instances running in different Windows sessions that share the same profile. - An RTX 20, 30 or 40 game run would exercise the FP16 path on those cards. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that both real files were sorted into the expected shared paths on Windows 11, and that Longshot previously loaded those same files from those paths on an RTX 5090. This is not a performance change. **Other systems:** The feature is Windows-only; Linux hides the section. Storage and Remove everything use the ownership record, while the named mutex coordinates launcher instances in the same Windows session. An RTX 20–40 game run remains unreported. **Switches:** No player-facing switches added or changed. The ignored real-file test uses LONGSHOT_DLSS5_NVIDIA and LONGSHOT_DLSS5_FP16; neither affects normal launcher operation. **Reviewed:** 1c3ad768d38c against ae619e2dbc20: Read AGENTS.md, CONTRIBUTING.md, src/preferences/dlss5.rs and src/dlss5/windows.rs in full; reviewed the fix diff, relevant portions of src/dlss5.rs, its tests, Settings and storage callers. Skimmed translations and the remaining pull-request diff; the other changed code files were not read in full.; nothing run (a code review). **Checked and fine:** - A changed player-owned destination is checked again against the confirmation before replacement. - Settings category navigation waits during an Add or Remove. - The reported real-file tests preserve the source files. **Testing:** No commands from the project or tests were run. The author reports Windows checks and manual tests; both CI jobs are still running. **Overlaps and merge order:** LongshotLauncher #282 is closed in favour of this pull request. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Member
@fix
fix(dlss5): stop operations when shared mutex acquisition fails
Some checks are pending
CI / What the change needs (pull_request) Successful in 7s
PR title / Conventional Commit title (pull_request) Successful in 6s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 11s
CI / Rust formatting, lint and tests (pull_request) Has started running
CI / Release packages and stable upgrades (pull_request) Has started running
4486b37fdb
As the review on #328 asked.
BeanBot left a comment

Recommendation: Approve. The mutex failure path now stops Add, Remove and bulk DLSS file cleanup before they can change the shared record. The fix preserves the feature and the normal wait and nonblocking settle behavior. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 4486b37fdb.

Changed

  • Cross-process lock failure in src/dlss5.rs:155: Mutex creation and wait failures now return errors; Add, Remove, and bulk cleanup stop before accessing the record. Settling still skips a held mutex. Updated the mutex test for the new result type; tests were not run.

Nothing was built or run: the checks run again on the new head.

Players can add their own DLSS 5 files through Settings and share the copies across game versions. The fix adds error handling around the shared mutex at a small complexity cost.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (3; not asked for, not blocking)
  • The Local mutex namespace does not coordinate launcher instances running in different Windows sessions that share the same profile.
  • An RTX 20, 30 or 40 game run would exercise the FP16 path on those cards.
  • Remove everything can have removed other listed data before a DLSS mutex failure is reported, as with other errors during cleanup.
More: does it help, other systems, switches, what was read

Does it help: Yes. The reported Windows tests and manual checks show that the launcher sorts, copies and removes the real files; the author also reports a game run using the same files at the same paths. Mutex failure handling has been checked in code but has not been run on this head.

Other systems: The shared mutex applies on Windows; Linux retains the local lock and does not offer the feature. Remove everything now reports a mutex error instead of removing DLSS files without the lock.

Switches: No switches added or changed by the fix. The feature adds no player setting; the ignored real-file test uses LONGSHOT_DLSS5_NVIDIA and LONGSHOT_DLSS5_FP16 to locate test files.

Reviewed: 4486b37fdb against ae619e2dbc: Read AGENTS.md, CONTRIBUTING.md, the fix diff, src/preferences/dlss5.rs and src/storage/cleanup.rs in full; inspected the mutex implementation, its callers and the relevant record operations in src/dlss5.rs. The original feature diff, tests, translations, UI and other changed files were not read in full for this re-check.; nothing run (a code review).

Checked and fine:

  • The acquired lock remains held for the Add or Remove operation.
  • A nonblocking mutex timeout skips settling; an abandoned mutex is acquired and the record is reconciled.
  • Failed mutex waits close the handle, and successful locks release it on drop.

Testing: No commands that run the project or tests were executed. The fix report says tests were not run; CI has not yet run on this head. The PR reports Windows tests and manual feature checks on the preceding head.

Overlaps and merge order: None found in the supplied context; #282 is closed in favor of this pull request.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The mutex failure path now stops Add, Remove and bulk DLSS file cleanup before they can change the shared record. The fix preserves the feature and the normal wait and nonblocking settle behavior. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 4486b37fdb4e. **Changed** - **Cross-process lock failure in src/dlss5.rs:155**: Mutex creation and wait failures now return errors; Add, Remove, and bulk cleanup stop before accessing the record. Settling still skips a held mutex. Updated the mutex test for the new result type; tests were not run. Nothing was built or run: the checks run again on the new head. Players can add their own DLSS 5 files through Settings and share the copies across game versions. The fix adds error handling around the shared mutex at a small complexity cost. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - The Local mutex namespace does not coordinate launcher instances running in different Windows sessions that share the same profile. - An RTX 20, 30 or 40 game run would exercise the FP16 path on those cards. - Remove everything can have removed other listed data before a DLSS mutex failure is reported, as with other errors during cleanup. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The reported Windows tests and manual checks show that the launcher sorts, copies and removes the real files; the author also reports a game run using the same files at the same paths. Mutex failure handling has been checked in code but has not been run on this head. **Other systems:** The shared mutex applies on Windows; Linux retains the local lock and does not offer the feature. Remove everything now reports a mutex error instead of removing DLSS files without the lock. **Switches:** No switches added or changed by the fix. The feature adds no player setting; the ignored real-file test uses LONGSHOT_DLSS5_NVIDIA and LONGSHOT_DLSS5_FP16 to locate test files. **Reviewed:** 4486b37fdb4e against ae619e2dbc20: Read AGENTS.md, CONTRIBUTING.md, the fix diff, src/preferences/dlss5.rs and src/storage/cleanup.rs in full; inspected the mutex implementation, its callers and the relevant record operations in src/dlss5.rs. The original feature diff, tests, translations, UI and other changed files were not read in full for this re-check.; nothing run (a code review). **Checked and fine:** - The acquired lock remains held for the Add or Remove operation. - A nonblocking mutex timeout skips settling; an abandoned mutex is acquired and the record is reconciled. - Failed mutex waits close the handle, and successful locks release it on drop. **Testing:** No commands that run the project or tests were executed. The fix report says tests were not run; CI has not yet run on this head. The PR reports Windows tests and manual feature checks on the preceding head. **Overlaps and merge order:** None found in the supplied context; #282 is closed in favor of this pull request. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
llun approved these changes 2026-11-28 03:17:36 +00:00
llun scheduled this pull request to auto merge when all checks succeed 2026-11-28 03:17:42 +00:00
llun requested review from BeanBot 2026-11-28 03:18:02 +00:00
llun merged commit 720406c6c4 into main 2026-11-28 03:18:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!328
No description provided.