WIP: fix(vk): one slow load no longer takes an install back to loading before the title #94
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
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:
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 (request to open)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. (Not rebased: main was merged into the branch, and main has moved on since that merge.)python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above). (Not run: only the tests that read the touched files.)third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.RX_VK_LOADrow of docs/development.md is updated.)docs/tested-configurations.mdfor each measured run. (Not added.)MKWVK_API_VERSIONbumped (gpu/vk/vk_api.h'sMkwVkHostorMkwVkRendererchanged). (n/a)mainand passing here. (tests/test_load_default.pyis extended for the new rule; it was not run against main.)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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.