fix(vk): precompile the Hyrule drawbridge scene pipelines #1615
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1615
Loading…
Reference in a new issue
No description provided.
Delete branch "SonnikBoom/Longshot:fix/715-drawbridge-pipelines"
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: CachyOS Linux, RX 9070 XT · Needs: Windows 11, AMD Radeon
TL;DR
This PR adds recorded Hyrule Castle drawbridge pipelines to normal Most shader preparation for #715. In four Linux cold starts, both stock runs skipped 17 draws in the scene and both PR runs skipped zero. Preparation times overlapped and the two caches grew by 0.60 MiB combined. Validation of Ganondorf's white first appearance on Windows remains open.
Breakdown
Why
When the drawbridge scene requests a pipeline that is still being created, its draw can be skipped. The shipped preparation list can cover more of this route by including its recorded states. See #715.
How to reproduce
Seen on: CachyOS Linux, RX 9070 XT, Mesa RADV 26.2.6-arch3.1 for the skipped draws. The white first appearance was reported separately in #715 on Windows.
Settings and switches: Fresh game and Mesa shader caches, normal
--prepare-shaders --compile-shaders most, 2560 × 1440, in-game upscaler, SDR, frame generation off.Steps: Load a child Link save near the Hyrule Castle drawbridge. Approach the drawbridge, watch Zelda and Impa ride past, then watch behind Link when Ganondorf first comes into view.
Expected: Ganondorf appears fully textured from the first visible frame and draws have their pipelines ready.
Actual: On Linux, the frame trace counted 17 skipped draws across the scene on each stock run. Ganondorf was fully textured at first appearance in both earlier Linux visual checks.
What changed
Add a contribution to the shipped pipeline state list. The existing Most preparation imports its 98 graphics and 11 mesh pipeline states.
assets/pipeline_states/contrib/sonnikboom-hyrule-drawbridge.bin.xzcontains the recorded pipeline states.assets/pipeline_states/contrib/sonnikboom-hyrule-drawbridge.mddescribes the capture route and provenance.Measurements
Verdict: The drawbridge scene went from 17 skipped draws on each stock run to zero on each PR run. Most preparation times overlapped. The two on-disk caches grew by 0.60 MiB combined.
Hardware: CachyOS Linux, Radeon RX 9070 XT, Mesa RADV 26.2.6-arch3.1, Ryzen 7 9800X3D, approximately 62 GiB RAM.
Scene: Child Link at the Hyrule Castle drawbridge, headless at 2560 × 1440, in-game upscaler, SDR, frame generation off.
Method: Two interleaved pairs (main, PR, main, PR) with independent empty Longshot and Mesa shader caches. Both variants used the same
38990574runtime, save, settings and scripted inputs. The PR variant substituted the shipped list generated at4a5961e2. Measure the wall time of Most preparation, then sum the file sizes in each cache directory immediately after preparation exits. Sumleft_outfor the first 2,901 presents from the cutscene event in the frame trace.How to reproduce: In each fresh directory run
--prepare-shaders --compile-shaders most. Record time and cache sizes before launching the game. Follow the drawbridge route above with the same save and frame tracing enabled.38990574The cache sizes and pipeline counts agreed across both runs of each variant. The on-disk differences were 554,664 B in the Longshot cache and 71,459 B in the Mesa cache. The preparation-time ranges overlapped.
The PR was rebased onto
2f1c0c9cafter these runs. The shipped lists and shader/pipeline preparation code are identical to the measured comparison. The intervening changes adjust guest scheduling and how Auto picks the render and recorder threads. Auto picks both threads on this machine under either rule. The exact in-game draw counts above are for the measured runtime.In the earlier Linux pair on the
876dc360baseline, Ganondorf was fully textured from his first appearance on both cold starts, and skipped draws across the scene went from 13 to zero.Flags and settings
None.
Testing
Tested: Four fresh-cache runs through the drawbridge scene on CachyOS Linux, RX 9070 XT and RADV. The shipped-list check found all 109 scene records with the PR and zero on stock. The preparation logs show 23 more graphics or mesh pipelines built and no failed pipeline builds in either variant.
The game-free suite on the measured PR snapshot reported 672 passes and 107 skips. Its 40 failing checks also failed on the unchanged baseline. The deferred
tests/test_vbytes.pycheck was rerun and reached the 600-second timeout on both revisions. On the rebased head, the six focused checks for pipeline-state sources, prepared stamps, tested configurations, threaded rendering, frame traces and the guest barrier all passed.Game-free failures and timeout also reproduced on main
Not tested: Windows. Validation of the original white first appearance from #715 remains open.
Must be tested:
Risks
What could break: The contribution added 0.60 MiB to the combined prepared caches on this Linux setup. Most prepared 23 extra graphics or mesh pipelines. The measured preparation-time ranges overlapped.
Turning it off: Revert the commit.
Compatibility: The added states use the existing state-list format and shader preparation path.
Issues
See #715.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md).Tested in game: CachyOS Linux, Radeon RX 9070 XT, Mesa RADV 26.2.6-arch3.1. At the Hyrule Castle drawbridge, Ganondorf was fully textured from his first appearance on both cold starts after Most shader preparation. The frame trace counted 13 skipped draws across the scene on the baseline and 0 with the added pipeline states. Windows validation is pending.
3ca5a6adfca6f0e53b5eRepeated the fresh-cache Linux comparison in two interleaved pairs. Both stock runs had 17 skipped draws at the drawbridge and both PR runs had zero. Median Most preparation was 336.2 s on stock and 323.5 s with the PR, with overlapping run times. The Longshot and Mesa caches grew by 0.60 MiB combined. The rebase leaves the shipped lists and preparation code from the comparison intact. Windows validation of Ganondorf's first appearance remains open.
WIP: fix(vk): precompile the Hyrule drawbridge scene pipelinesto fix(vk): precompile the Hyrule drawbridge scene pipelinesFrom the code and the evidence this looks right. I'm leaving it as a comment rather than an approval until the Windows AMD run that its own Must be tested names has been posted.
What I checked
assets/pipeline_states/contrib/is the place for one contributor's list.tour.bin.xzis written only by the pipeline tour, and this PR leaves it alone. The file is a single xz block holdingHKSTATE2with 109 whole 552-byte records and nothing after them (12 + 109 × 552 = 60,180 B). The note has exactly the lineswrite_notewrites, and itsPipelines: 109matches the list.assets/pipeline_states/README.mddescribes. They contain no shader code, assets or saves.treverflume-rtx-3060-laptop) and in one list from an RX 9070 (veridor-rx-9070). Whether the white first appearance from #715 is gone on Windows is still open, as the description says.COMPUTE_MOSTbudget and no memory kept at each start. A preparation-time difference that small cannot show in two runs, and the measured ranges overlap.Suggestion (not blocking)
Since the fork point, main has merged #1688, which adds 38 contributed lists with 12,001 pipelines. 18 of this list's 109 records are now in those lists. The merge keeps each pipeline once, so this costs nothing at build or run time. It does go against the README's rule that a contributed list holds only what no other list holds when it is added. It also means the stock side of the measurement (17 skipped draws) is from a main without #1688, so on today's main the stock count may be lower. To fix both, rebase, run
nx2/pipeline_states.py add sonnikboom-hyrule-drawbridge ...again with the same name and yourlongshot_pipeline_states.bin, and update the note's count. If you can, also repeat one stock run on current main so the PR says what it still adds there.Measurements
Two interleaved pairs on one PC (RX 9070 XT, RADV), from empty Longshot and Mesa caches, with the same save, settings and scripted route on both sides. Skipped draws went from 17/17 to 0/0 over 2,901 presents (13 → 0 in the earlier pair). The counts are identical within each variant, so the spread doesn't come into it. Preparation time was 347.8/324.5 s on main against 326.1/320.8 s here. That is within run-to-run spread, and the description correctly claims no gain. Caches grew by 554,664 B (Longshot) and 71,459 B (Mesa). The measurement is valid and goes the right way for a fix. It was measured before the rebase, but the description shows that the lists and preparation code are unchanged since then. Still needed: the Windows 11 AMD (Adrenalin) run named in Must be tested. An NVIDIA run of the same route would also confirm Ganondorf's first frame there, though nothing in the change is vendor-specific.
@ -0,0 +7,4 @@- Build: main at 430eef4f (runtime source b9daf11e)- Settings: SDR, 16:9, game upscaler, frame generation off, no mods; headless and windowed- Route: Issue #715: approach the Hyrule Castle Town drawbridge as child Link before the Door of Time, then watch Zelda and Impa escape and Ganondorf ride into view.- Pipelines: 109After rebasing onto current main, 18 of these 109 are already in lists merged by #1688 (treverflume-rtx-3060-laptop, haruhiro88-rtx-5070 and others). Running
addagain with the same name would drop them, and this count would change with it.