fix(vk): DLSS Frame Generation through Streamline starts again, in the sandboxed game too #3068
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
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/Longshot!3068
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/streamline-sandboxed-start"
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?
Summary
DLSS Frame Generation through Streamline does not work on
main(2ca7d4f74, Windows). The game never starts Streamline, says nothing, and uses NGX instead. With this PR it starts, makes frames and spaces them, with the sandbox on.To see it on
main: a Windows build with Streamline's files besidelongshot-game.exe, an NVIDIA RTX card, Upscaler at NVIDIA DLSS, Frame generation at Fixed 2x by DLSS FG, "DLSS FG through" at Streamline. The log has novk: Streamline startedline and there is nosl.log.Three things stopped it, one behind the other:
mkwvk_initloads Vulkan (and decides on Streamline) and makes the device before the host hands over the settings, so everything read there withsettings_start()was 0: frame generation looked off. Since #2822; before it, Streamline's code read the settings file itself (from the code, not run).MkwVkHostnow gives them first (version 89).sl.pclasks what%ProgramData%\NVIDIA\NGX\modelsis as it loads. Refused, it is unloaded,sl.reflexafter it, and DLSS FG with them. The folder is now listed alone.How the sandbox stays as strict:
sl.interposer.dll, and only when it is a folder of its own, not a link (any program may write underC:\ProgramData\NVIDIA).longshot_vk.dll. The builder resolves links in the game folder path, but refuses a link in the layer folder's path under the resolved game folder.Read first:
init_bodyinvk_main.cpp,nvidia_modelsandprepare_layerinsandbox_windows/gather.rs,layer_manifest_namesindlssg_rules.h.Testing
Tested: Windows 11 (26300), RTX 5080, NVIDIA 621.47, llvm-mingw, sandbox on in every run (
sandbox: in the AppContainer), Link's house in Kokiri Forest, 1080p output, 1920x1080 at 360 Hz.main, Streamline chosen: novk: Streamlineline, nosl.log; NGX made the frames. A temporary log line showed why: settings generation 0,could1, starts 0.Streamline started,ready (up to 6x),on, 2x; the layer's own recording is in Measurements.sl.logis indiagnostics\logs. The person I work for looked at the picture before the layer's fix and said it looked right; nobody has judged it with the layer running.tests/test_settings_before_start.pyfails onmainand passes here. The Rust tests of both sandbox parts, with their refusals: what is in, beside or above the models folder, writes, renames, removals, a link in its place, a manifest naming another DLL.mise run test: 831 passed, 2 failed, 51 skipped. The two,test_i18n_complete.py(untranslated ReShade preset names) andtest_lifter.py(sites' list of hook sites), fail the same way onmain.mise run lintpasses; clippy passes onbuild-core(Windows target, warnings as errors). Linux: not built or run;rx_backend.c,vk_main.cpp,vk_dlssg_layer.cppandvk_dlssg.cpppass a syntax check with gcc / g++ on Ubuntu 24.04.Still to test:
main(by hand)Measurements
Verdict: Streamline goes from never starting to 2x.
Setup: as Testing; Fixed 2x by DLSS FG, NVIDIA DLSS, game cap 60; about 60 s in play, one run a row.
2ca7d4f7454f67de44one present held)The same run before the layer's manifest: frames 596 shown for 300 made (a temporary counter). It says nothing about frame pacing against
main, which shows no Streamline frames.Risks
settings_start()inmkwvk_init) now have their saved values instead of 0, not only Streamline's: the mesh path, robust buffers, the present queue, the game queue's priority and others. They default to Auto or Off, so a player who never changed one should see no difference; one who did now gets it, as documented.longshot_vk_layer\VkLayer_longshot_streamline.json.Not changed: the file layer's list of modules it has patched never lets go of an address (
hos_file_windows.c,is_patched). It may skip a DLL loaded where another was unloaded; not shown, and not a way out by my reading.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.MKWVK_API_VERSIONbumped (MkwVkHostorMkwVkRendereringpu/vk/vk_api.hchanged).Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11 (26300), RTX 5080, NVIDIA 621.47, sandbox on, Link's house in Kokiri Forest: Streamline starts and shows about 120 frames a second from the game's 60 for about a minute, and the layer under it reads when they reach the screen. NGX still works when it is chosen. No crash.
@review
Recommendation: Approve. A game folder reached through a junction cannot get the layer manifest, so its Streamline presents lose the layer’s pacing correction. The reported run shows Streamline producing frames on an RTX 5080, but the resulting picture and other affected platforms still need testing. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change hands saved settings to the renderer before Vulkan initialization, grants Streamline limited access to NVIDIA’s models folder, and prepares the layer manifest before a sandboxed start. It restores Streamline frame generation in the reported Windows run, at the cost of changing early renderer settings and sandbox startup behavior across platforms.
Should fix (1): not blocking, but worth doing before merging.
builder/crates/build-core/src/sandbox_windows/gather.rs:279: The manifest preparation rejects a junction anywhere above the layer directory, including a junction used to move the game folder. (more on the line) Do: Resolve and validate the game folder separately, then safely prepare the layer directory under its resolved location while still refusing a link substituted for the layer directory itself; add a junction case to the tests.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes, for starting Streamline in the reported case: on Windows 11 with an RTX 5080, main did not start Streamline, while this head reported 2x and about 120 layer-observed presents per second from a 60 fps game. The single run does not establish picture correctness or frame pacing.
Other systems: Early settings affect Vulkan device creation on Windows and Linux, including NVIDIA, AMD, Intel and Steam Deck. The manifest and models-folder changes affect Windows sandbox starts. The reported run covers Windows on an RTX 5080; picture judgment, other NVIDIA generations, AMD or Intel starts and Linux starts remain outstanding.
Switches: None added, changed or removed.
Reviewed:
54f67de447against2ca7d4f741: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the complete diff and commit messages; inspected the changed settings, manifest and sandbox code and relevant callers, grants and path resolution. Skimmed the changed tests and documentation. docs/review-checklist.md and the adjacent Tooling checkout were absent. The large changed code files and all dependent code were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build, execute tests or run project scripts were used. The author reports a Windows RTX 5080 game run and syntax checks on Linux; CI was still running.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -250,0 +276,4 @@}make_dirs(&dir);if !is_dir(Some(&dir)) || !resolve(&dir, false).is_ok_and(|r| super::same(&r, &dir)) {return None;L1 (should fix): The manifest preparation rejects a junction anywhere above the layer directory, including a junction used to move the game folder.
When: When the game is started through a junction to its installation, real_path with follow=false rejects that ancestor. No manifest is written, and the sandboxed renderer cannot write one, so Streamline starts without the layer that reads and corrects its presents.
Do: Resolve and validate the game folder separately, then safely prepare the layer directory under its resolved location while still refusing a link substituted for the layer directory itself; add a junction case to the tests.
54f67de447fbd9701e92WIP: fix(vk): DLSS Frame Generation through Streamline starts again, in the sandboxed game tooto fix(vk): DLSS Frame Generation through Streamline starts again, in the sandboxed game too@fix
fbd9701e926c914a5c8aRecommendation: Approve. The code is ready: only testing is left. Streamline starts and produces frames on the tested RTX 5080, but the restored layer’s picture and pacing have not been judged. The changed initialization paths also need runs on the other affected systems. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
6c914a5c8a. I rebased it ontomain(238f4f65ff). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change restores Streamline frame generation in the Windows sandbox by supplying settings earlier, allowing the NVIDIA models folder to be listed, and preparing the layer manifest before launch. The latest fix also prepares the manifest through a game-folder junction.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
Checks: they run again on this head; a failure shows on the pull request.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven overall: the reported RTX 5080 run shows about 120 presents per second from a 60 fps game, but nobody has judged the picture or pacing with the restored layer. The report contains one run per side.
Other systems: Early settings and initialization also affect Linux and other Windows GPU configurations; those paths have not been run. A real Windows junction case has not yet been tested.
Switches: No switches added, changed, or removed by the latest fix.
Reviewed:
6c914a5c8aagainst238f4f65ff: Read the latest fix diff and the manifest preparation code and tests in gather.rs. Read the repository instructions and PR template, and inspected the overall diff and file list; the overall diff output was truncated, so not all changed code was read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The author reports a Windows RTX 5080 game run and game-free checks; CI has not yet run on this head.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.