WIP: refactor(shaders): 15 kill switches the translation read are deleted, and its per-PC rules read the device policy #1390
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!1390
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:refactor/shader-stamp-batch"
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: refactor · Risk: high · Tested on: Linux, RTX 3090 · Needs: AMD (Windows and RADV), Intel, a card without f16
Why
Merging this makes every player's shaders translate again once: the first start after the update prepares them anew (about 5 minutes measured on a Ryzen 9 7900X with an RTX 3090; "minutes on some PCs" per the README; longer where preparation is slow). That is why these changes were kept out of #1309 and #1341 and are made here together, so the cost is paid once. Track F of the renderer rework plan. Stacked on #1309 and #1341: review the last commit only. If another change to the translation is already planned, this should ride with it.
What changed
15 kill switches the translation read are deleted with the older paths they kept:
RX_VK_FOLLOW_GRAPHICS,HANDLES_LIVE,MESH_NO_DEFAULTS,MESH_NO_ZERO,MMA_NO_LDSM_BARRIER,SHARED_NO_LDS_BARRIER,NO_EXTREGS,NATIVE_MMA_KEYS,NO_CBUF_LOAD_RULE,PTR_SPLIT_FALLBACK,NO_FOLLOW,NO_DRAW_PARAMS,SHARED_48K,PICK_BIND_GEN,REGISTER_AT_ONCE(allRX_VK_). Each is aGONErow; their names leave the stamp's list and the bake's mirror (nx2/bake_ds/bake_ds.cpp,nx2/make_game.py), and a run that still sets one keeps its cache.7 are kept, each for a reason:
RX_VK_CAPTURE(twelve uses and a whole second collection path: not mechanical),HANDLE_TABLES(its default follows the GPU),MESH_FB_LAYOUT(a second emitter layout with a measured docs row),NAN_GUARD(the way back from a guard whose NaN's source is not known),NATIVE_MMA(a third state, the only way to the exact expansion),NETWORK_KEEP(the README tells players to set it),NO_F16(puts a capable card on the path of cards without f16).The per-PC rules in the stamped files read the device policy (
gpu/vk/device_policy.h, #1341): warp64, the fragment shuffle fallback, the gather offset, the Deku web loads, the networks left out.gpu/vk/vk_vendor.his folded into it and deleted. For a given PC the values the stamp folds are the same as before; one word is added for the two rules that used to be stamped text.gpu/vk/eden/is edited (it carries Longshot's own changes and has no pinned tree hash);siritandcompatare not.Not changed, on purpose: the order in which
vk_bank.cppbumps a slot's version and then the registration generation. A review of other work proposed swapping them; the readers (program_for, the descriptor reuse) read the generation first and rely on this order, and the swap would create the race it meant to fix. A comment now says so.Measurements
Verdict: the same picture and frame rate on this PC.
Hardware: CachyOS (kernel 7.3.3), RTX 3090 24 GB, NVIDIA 620.70, Ryzen 9 7900X, 32 GB; 2560x1440, no upscaler.
Method: a new runtime (every shader translated and prepared again), then sessions through the job queue's timing mode; screenshots standing in each area, compared with ImageMagick's mean absolute error (0 to 1).
Hyrule Field's 0.013 against 0.007 was checked against four more sessions of earlier builds: they differ from the build before by 0.0065 to 0.0113 and from this one by 0.0088 to 0.0131, which overlap; side by side the two pictures are the same scene with the fairy and the fog elsewhere.
Flags and settings
15 switches removed, none added.
Testing
Tested: Linux, RTX 3090 (NVIDIA 620.70): the whole shader set translated and prepared again with 0 programs failed; three sessions through the three areas as above, no error line;
RX_VK_NO_FOLLOW=1set on purpose was answeredis set, and is no longer a switch (since 2026-11-17).Not tested:
tests/run_all.py: 13 existing checks were edited by reading alone.nx2/bake_dswas edited and not compiled (the dev build does not build it).Must be tested:
@Beanstalk windows amd, windows intel and steamdeck: main against this PR, Kokiri Forest, Hyrule Field, the Market)nx2/bake_ds) to see it compiles.Risks
What could break: a removal that kept the wrong side changes generated shader code for everyone on that path; the paths this PC does not take are the ones at risk. A value the stamp no longer folds would leave a PC with shaders translated for another rule.
Turning it off: revert the commit (shaders translate once more).
Compatibility: the translator's stamp changes: the program cache, the prepare record and the pipeline cache files are made again once.
MKWVK_API_VERSIONstays.Issues
See #1300
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 on this PC; left to the forge's checks.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
Tested in game: Linux, RTX 3090, NVIDIA 620.70: every shader translated and prepared again (0 failed), three sessions through Kokiri Forest, Hyrule Field and the Market at 2560x1440 with main's frame rates, and screenshots within the difference between two sessions of the build before.
8d1f4c949e41f445ea35View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.