fix(vk): one slow load no longer takes an install back to loading before the title #94
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!94
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/load-wait-rule"
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?
Why
Loads at create calls have a safety net: a session whose first uses wait too long for their loads leaves
longshot_load_start.txt, and every later start loads all listed programs before the title again. One wait over 100 ms was enough to leave it, and the marker is permanent and costs memory at every later start. On an RTX 3090, while other work was taking the PC's memory, one first use waited 261 ms for a load (322 ms in that session). The next start of that healthy install loaded everything before the title: 8.6 GB of heap in use in the first area where the session before had 4.2 GB.What changed
gpu/vk/load_default.h, used fromgpu/vk/vk_programs.cpp; the preparation's cleanup ingpu/vk/vk_draw.cpp):longshot_load_start.txt.waited, which the next start takes away, so it is two sessions running, not two ever. A preparation removes it with the marker.RX_VK_LOADrow ofdocs/development.mddescribes the new rule.tests/test_load_default.pyandtests/load_default_test.cpp: the measured sessions below against the rule, the strike file written and taken once, a preparation removing it.Flags and settings
None. No switch, menu row or ini key is added or changed. What changes is when the default of
RX_VK_LOADgoes back tostart(the rule above), and one new file beside the marker in the game folder,longshot_load_start.txt.waited.Measurements
main:
4dd972a8(2026-11-12)this PR: fix/load-wait-rule @
3a297868Hardware: RTX 3090, Linux, and RTX 4070 SUPER, for the healthy sessions and the injected runs; RX 580, 16 GB, for the sessions where loads at create do not work (drivers, CPUs and the other PCs' RAM not recorded in this description)
Scene: a short session: the first area, a teleport, a second area (a tour)
Method: the first-use waits for loads each session logged, and the files it left; for this PR, real starts in a folder of its own prepared by
--prepare-shaders(the table under "Game runs")How to reproduce: prepare a game folder with
--prepare-shaders, start it withRX_VK_LOAD=create, play the first area, a teleport and a second area, and read the log's line on the first-use waits and whetherlongshot_load_start.txtorlongshot_load_start.txt.waitedis in the game folder after; then start without the switch to see what the default picksWhat each column is, and on which commit. The main column is the old rule, as main @
4dd972a8has it (the commit this change was made on), applied to each session's waits. The sessions that ran on main itself (the one bad moment, and the RX 580's two sessions below) ran on main before this change; their commits are not recorded in this description. The game runs of this PR were made on3a297868, the commit before the merge of main that brought the rename (same code, old file names), because the build tool at hand could not build a game folder from the renamed tree; the branch's final commit,d0dd2a4c, has not run in a game. The RX 580 has not run the new rule: its row is the rule applied to its measured sessions.4dd972a83a297868The RX 580 on the old rule, for reference
Main before this change, loads at create calls forced (
RX_VK_LOAD=create), a cold preparation and two sessions of the same tour:The new rule gives the same result on these two sessions: nothing after the first, the marker after the second (over 2 s). That PC is not over the limit in every session; it is taken back at the first one that is.
Game runs
RTX 3090, Linux, a folder of its own prepared by
--prepare-shaders; each row is a real start and a short session (the first area, a teleport, a second area), started withRX_VK_LOAD=create. The "next start" column is a start without that switch, to show what the default picks.The long waits were injected: a test-only switch, not part of this change, makes the first N first uses that meet an unfinished load take a set time longer, inside the time the safety net measures. The rule's own code ran unchanged. No long wait could be produced without it on this PC (see the last row).
.waited.waited.waited--prepare-shaders)RX_VK_LOAD_WORKERS=0), nothing injectedNot measured: the bug reproduced and gone as one pair of runs at two named commits (the bad moment happened once on main and could not be produced again on this PC without the injection); fps and frame times, which this change does not target. The log lines are quoted in the table in part, not pasted whole.
Testing
Tested: On the merged branch (
b6289b31, main316f9319merged in):tests/run_all.pygave 465 passed, 2 failed, 69 skipped; the two failures aretests/test_bake_portability.py(nozstandardmodule on this PC) andtests/test_builder_log_read_only.py(no Tk library here), which fail the same way onmainhere and read none of the changed files.tests/test_load_default.pyfrom this PR fails against main 316f9319's renderer source ("vk_programs.cpp does not use load_default.h's rule") and passes here. The whole renderer library builds on that tree for Windows with llvm-mingw (clang 23.1.5,--target=x86_64-w64-mingw32: 205 files, 0 failed,longshot_vk.dlllinked) and for Linux (206 files, 0 failed), FSR on and DLSS off in both;tests/test_utf8_paths.pypasses with the Windows probe built. The DLL was not run on Windows. Also: -tests/test_load_default.py: the measured sessions above against the rule, the strike file written and taken once, a preparation removing it.Not tested:
tests/run_all.py).Needs other testers:
RX_VK_LOAD=create): the tour above after a preparation, expectinglongshot_load_start.txtafter the first session whose counted waits are over 2 s, and nothing after a session under 500 ms (test request T-QYLD)Screenshots
Nothing on screen.
Risk and rollback
A PC between 500 ms and 2 s of counted waits a session now has two such sessions before it goes back to loading before the title, where it had one. A PC whose every first use runs its own load in under 20 ms is not taken back at all, however many there are. There is no switch for the rule:
RX_VK_LOAD=startforces loading before the title on any install, and reverting the commit brings the old rule back. A leftoverlongshot_load_start.txt.waitedis removed by the next start or by a preparation.Reviewer notes
Read
gpu/vk/load_default.hfirst (the rule and the strike file), then its use ingpu/vk/vk_programs.cpp. The test-only switch that injected the waits is not in this PR, on purpose.Issues
None.
Checklist
For everyone
type(scope): description).main. (By a merge: main316f9319is merged into the branch.)python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested-configurations.mdfor each measured run.mainand passing here.tests/that reads changed source updated in this PR, not weakened.The description is now in the template's sections. No code changed and no new numbers: the same facts as before, with the commits the measurements were taken on named, and the checklist ticked only where true. It stays work in progress: the full test suite was not run, the test request is not open, and the game runs were on the commit before the rename.
Brought up to date: main merged in (
b6289b31), the full suite run on the merged tree, the PR's test shown failing on main and passing here, the renderer built for Windows (llvm-mingw) and Linux, rows added to docs/tested-configurations.md (2bc0c0b4), test request T-QYLD opened, and the checklist gone through again: boxes that do not apply are deleted.WIP: fix(vk): one slow load no longer takes an install back to loading before the titleto fix(vk): one slow load no longer takes an install back to loading before the title