perf(vk): the renderer's play profile covers the compute fallback, the overworld and the dungeons #599
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!599
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/vk-profile-fallback"
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
The renderer's committed play profile came from one 3090 session in Kokiri Forest and the Market, so GPUs without mesh shaders (whose frames go through the compute fallback) and most areas got no counts. This adds two recordings from an RX 580 across 28 of the 31 teleport destinations. Follows #569; part of #505's "ship play profiles".
How to reproduce
The recordings, on Linux with a base of main (
scripts/dev_packs.py base):OOT_WORK=<empty folder> RX_RELEASE=1 RX_VK_ONLY=1 RX_VK_PGO=gen python -I nx2/build.py --standalone, itssa/build/longshot_vk.socopied over a runtime's (dev_packs.py packwithRX_VK_PGO=genbuilds nothing when the tree is the base's: a pack is only rebuilt for changed files).RX_VK_PGO_FILE=<file>,<file>.resetonce Link is controllable, then the Insert menu's Debug teleport to each destination (live input!cheat 1000+index), a few seconds standing, the camera turned, a short run;<file>.dumpat the end.llvm-profdata merge -o merged.profdata <the committed profile, unpacked> <recordings>andxz -9e.What changed
assets/profiles/longshot_vk.profdata.xzreplaced by the merge of the committed profile and two new recordings (166 KB). 1,744 renderer functions ran in at least one recording (1,660 before); 76 of them never ran in the old profile, among them the compute fallback's draw path (fallback_record,fallback_buffers,fallback_task_groups,fallback_pipelines_readyingpu/vk/vk_draw.cpp).assets/profiles/README.md: the three recordings (GPU, driver, build, route, what didn't teleport), and that the merged profile is not measured yet.No code changes: every renderer build already compiles with this file (#569); a new profile recompiles the renderer's own 35 files once.
Measurements
Not measured: the profile's effect was measured for the first recording alone (-4 to -5 % frame time standing, -3 % running in the Market on an RTX 3090,
assets/profiles/README.md). This change adds counts for code the old profile never saw (mainly the compute fallback) and leaves the mesh-shader path's counts in place; on the lab RX 580 the frame time varies by more between sessions (±2 ms) than this could move. A before/after on a GPU without mesh shaders that isn't GPU-bound would settle it.What the lab's build of main shows: the build compiles the renderer with the committed profile (
the Vulkan back end: built with the profile .../work/longshot_vk.shipped.profdata) and LLVM 23.1.5 reads it.Flags and settings
None.
Testing
Tested: the merge with
llvm-profdata23.1.5 (showreads the result: 4,739 functions, 1,744 with counts). The recordings: RX 580, RADV POLARIS10, Linux, i7-9700K, child Link: 16 overworld destinations (532 s; Hyrule Castle and Gerudo Fortress, adult only, didn't teleport) and 12 dungeon destinations plus Desert Colossus (265 s; the Spirit Temple didn't teleport). No local checks run (tests/run_all.py); no build with the new file yet.Not tested: a build of this PR (the file is the same format and LLVM as the one the lab's build of main read); Windows (llvm-mingw reading it: the file before this one is the same format); any frame-time effect.
Must be tested: a frame-time A/B on a GPU without mesh shaders (old profile against this one); a Windows build reading it (the build log names the profile, or says it couldn't read it and builds without).
Risks
A profile changes how the renderer's code is laid out and inlined, never what it does: the worst case is a little slower, not wrong. Code the new recordings ran more often gets favoured; the 3090's mesh-shader counts stay in the merge. A compiler that can't read the file builds without it. Reverting the commit restores the old profile.
Issues
See #505
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). (not run here: left to CI)third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.🤖 Generated with Claude Code
WIP: perf(vk): the renderer's play profile covers the compute fallback, the overworld and the dungeonsto perf(vk): the renderer's play profile covers the compute fallback, the overworld and the dungeons