WIP: fix(vk): the shipped state list is made behind the preparing screen, and a half-written pipeline list is cut back #1161
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!1161
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:fix/pipeline-list-fixes"
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?
Type: fix · Risk: low · Tested on: Linux, RTX 4070 Ti (game-free checks) · Needs: none
Why
Two ways pipelines that should have been ready were built in play instead, as a stutter: an update prepared behind the preparing screen skipped the shipped state list, and a pipeline list or notes file left half-written by a crash or a full disk had every later run's pipelines appended after the broken end, where they were never read back.
Restored from Hookshot 2982, Hookshot 2983, by Joey Magnus, jarynclouatre, and split out of #287 so it can be reviewed and merged on its own.
What changed
prepare_with_screencallsstate_list_run()for an update beforeprecompile_run, as the console start already does.cut_part_recordcuts a pipeline list or notes file back to its last whole record before it is appended to.Commits, each with its original author and message:
d217bfe5fix(vk): a background-prepared update makes the state list's pipelines behind the preparing screen too (jarynclouatre)With
RX_VK_PREPARE_BACKGROUND=1, an update builds what the notes namebefore the game and the rest behind it. A start with console progress
(
started_upingpu/vk/vk_main.cpp) makes the shipped state list'spipelines first:
if (update) state_list_run();beforeprecompile_run. The preparing screen's worker (prepare_with_screen)has no such call, so a start that shows the screen left those pipelines
out, and they were built when first drawn, in play.
Change
The screen's worker calls
state_list_run()for an update at the samepoint, before
precompile_run, inside its!prepare_stopped()check. Astopped preparation still skips it. Nothing is added to the screen:
state_list_runtakes no progress callback.Testing
tests/test_prepare_screen_sequence.py: both step sequences arecut from the source and run against stand-ins that record each call. For
an update, both make the state list once, before
precompile_run, thenstart the background pass. When it is not an update, neither makes the
list. A stopped screen worker makes neither the list nor the precompile.
On main the screen's update sequence has no state list; here it passes.
on main on this machine (
test_bake_portability:zstandardis notinstalled;
nx2/test_texture_init_barrier.py:clang++is notinstalled).
Restored-from: https://github.com/NotRexed/Hookshot/pull/2982
47ce4192fix(vk): a half-written last record is cut off before the pipeline lists are added to (jarynclouatre)A crash or a full disk while the game writes
hookshot_pipeline_states.bincan leave it ending in part of a record.state_open_lockedingpu/vk/vk_draw.cppreads the whole records,sets
keep, and opens the file with"ab", so every later run addedits new pipelines after the broken end. They were never read back: those
pipelines were built again in play at each start, and "Save my pipeline
list" sent a list whose end was garbage.
notes_open_lockeddoes thesame with the pipeline notes, also on its
knownpath, where the fileis not read at all.
Change
A small
cut_part_record(path, header, record)cuts the file back toits last whole record with
std::filesystem::resize_fileand logs it.Both opens call it before appending: the state list when it keeps the
list, the notes when the stamp and record size match. The whole records
stay; a list that ends on a record's edge is left alone, and one shorter
than its header starts new as before.
Testing
tests/test_state_list_part_record.py:state_open_locked,notes_open_lockedand the helper are cut from the source and run onlists of their own: one whole record followed by 0 bytes, 1 byte, and a
record's size less one of the next. A new record is added as play adds
one, then the file is read back: both records there, the file a whole
number of records. The notes the same, with their records read before
the open and without. On main the part-record cases fail; here they
pass.
tests/test_pipeline_state_computes.pycompilesstate_open_lockedtoo; its fixture now takes the helper along.
hookshot_vk.so).on main on this machine (
test_bake_portability:zstandardis notinstalled;
nx2/test_texture_init_barrier.py:clang++is notinstalled).
Restored-from: https://github.com/NotRexed/Hookshot/pull/2983
2f69945ftest: the prepare sequence's stand-ins have main's compile_all (Compile shaders on All) (Joey Magnus)Measurements
Verdict: nothing to measure: a correctness fix off the frame path, covered by game-free checks.
Flags and settings
None.
Testing
Tested: On Linux (kernel 7.0), RTX 4070 Ti,
main@71b1edd8, this PR @2f69945f:the checks that read the changed files (tests/run_all.py --changed origin/main)pass. The full suite (tests/run_all.py) has not been run on this branch yet; a comment will follow when it has.Not tested: An update with the preparing screen; a cut list in the game. Opened as work in progress until it runs in the game.
Must be tested:
Risks
What could break: the preparing screen's order, and the pipeline lists' files.
Turning it off: revert the commit.
Compatibility: A list with a broken end is cut back once, logged.
Checklist
Everyone
type(scope): description) of the status line's type.main.third_party/untouched (a new folder with aPROVENANCE.mdinstead).python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).When it applies
mainand passing here.Tested in game: Linux (Ubuntu 26.04.1, kernel 7.0.0-43), RTX 4070 Ti 12 GB, NVIDIA 595.99.02, Ryzen 7 9800X3D: this branch built together with the other 18 split from #218 and #284-#288, merged onto main @
71b1edd8(make_game.py --update, build v3.0.0-rc.5-82-g5952bb3d), then played by a scripted tour through the control bridge (scripts/memtour.py: a save loaded, Zora's Domain, the Market, Hyrule Field and Death Mountain Trail, 40 s each with walking and camera swings). All 4 stops reached, a clean quit, and no device loss or Vulkan error in the log. The pipeline notes and state list loaded at start (32,886 noted pipelines found). The background-prepared update and a half-written last record were not reproduced in the game; the checks cover them.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.