refactor(vk): 111 kill switches are deleted, the host's switches join the table, and the per-PC decisions get one place and one rule #1309

Merged
HumanBean merged 5 commits from HumanBean/Longshot:refactor/kill-switches into main 2026-11-17 16:05:15 +00:00
Owner

Type: refactor · Risk: medium · Tested on: Linux, RTX 3090 · Needs: Windows (AMD, Intel); RADV, AMDVLK and ANV on Linux

Why

Track F of the renderer rework plan: fewer switches, decided in one place, the same on every driver. 177 renderer switches only turned something off or back to an older way, each keeping a second path alive that nobody runs; the host's 216 switches were in no table; and 73 rules that go by the PC were spread over 14 files, asked several ways and parsed seven ways. This is the one pull request for that track; it took in #1325, #1326 and #1341. See #1300 (the table).

What changed

Read the commits in order; each stands alone.

  1. 93 kill switches deleted from the four large renderer files, with the older paths they kept.
  2. 18 more from the smaller renderer files. Each is a GONE row that tells a run which still sets it what became of it.
  3. The host's 216 switches join the table (gpu/vk/switches.def); the start's log names every switch a run set and says a HOS_ name that is none.
  4. The per-PC decisions get one place (gpu/vk/device_policy.h): 67 decisions worked out from facts filled once, with a vk: policy: block in the log.
  5. 15 per-PC switches are read by one rule, and four rules test the driver their reason names, not the vendor: Compute for mesh draws under Automatic is RADV's (AMDVLK keeps its mesh shaders); one program's builds at a time is AMD's Windows driver's; serial compute builds are Intel's Windows driver's; batched submits use the one definition of GCN. Some odd switch values change meaning (an empty value is the PC's default, =on is on): docs/development/device-policy.md has the table.

Measurements

Verdict: no change in fps, as intended. This head against main, one session: Kokiri Forest 66.6 fps (main 63.2 to 64.9), Hyrule Field 92.4 (90.3 to 90.7), the Market 70.0 (68.0 to 72.7).

Testing

Tested:

  • python -I -B tests/run_all.py: 657 passed, 45 failed, 19 skipped. On main at 8e9cfc3a this PC has 46 checks failing (648 pass, 19 skipped); none of them is new here.
  • In the game (Linux, RTX 3090, NVIDIA 620.70, 2560x1440, no upscaler): one session of this head through Kokiri Forest, Hyrule Field and the Market, no error line; earlier sessions of each commit as it was made (nine for the first), with a removed switch and a misspelt one set on purpose and answered in the log.

Not tested:

  • Windows: not compiled.
  • The four corrected rules apply to no NVIDIA card: AMDVLK, RADV and ANV were not run.
  • AMD and Intel GPUs, an integrated GPU, a card of 8 GB or less: several removed switches guarded paths that only run there.

Must be tested:

  • A Steam Deck and a desktop RADV card, main against this PR (Test Farm: @Beanstalk steamdeck: main against this PR, Kokiri Forest, Hyrule Field, the Market).
  • Windows AMD and Windows Intel: a start and the same three areas (Test Farm: @Beanstalk windows amd and windows intel: main against this PR, Kokiri Forest, Hyrule Field, the Market).
  • Intel on Linux (ANV), by hand.

Risks

What could break: a deletion that kept the wrong side changes behaviour for everyone on that path; a corrected rule misbehaves on the driver it now reaches or no longer reaches.

Turning it off: revert a commit; each corrected rule is one commented line in device_policy() that says how to go back.

Compatibility: a run that sets a removed switch gets the default and a log line. No cache is rebuilt, MKWVK_API_VERSION stays.

Issues

See #1300

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. Built on Linux only here.
  • Docs updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9

**Type:** refactor · **Risk:** medium · **Tested on:** Linux, RTX 3090 · **Needs:** Windows (AMD, Intel); RADV, AMDVLK and ANV on Linux ## Why Track F of the [renderer rework plan](https://git.magicbean.dev/MagicBeanDev/Longshot/wiki/Renderer-rework-plan): fewer switches, decided in one place, the same on every driver. 177 renderer switches only turned something off or back to an older way, each keeping a second path alive that nobody runs; the host's 216 switches were in no table; and 73 rules that go by the PC were spread over 14 files, asked several ways and parsed seven ways. This is the one pull request for that track; it took in #1325, #1326 and #1341. See #1300 (the table). ## What changed Read the commits in order; each stands alone. 1. **93 kill switches deleted** from the four large renderer files, with the older paths they kept. 2. **18 more** from the smaller renderer files. Each is a `GONE` row that tells a run which still sets it what became of it. 3. **The host's 216 switches join the table** (`gpu/vk/switches.def`); the start's log names every switch a run set and says a `HOS_` name that is none. 4. **The per-PC decisions get one place** (`gpu/vk/device_policy.h`): 67 decisions worked out from facts filled once, with a `vk: policy:` block in the log. 5. **15 per-PC switches are read by one rule**, and **four rules test the driver their reason names, not the vendor**: Compute for mesh draws under Automatic is RADV's (AMDVLK keeps its mesh shaders); one program's builds at a time is AMD's Windows driver's; serial compute builds are Intel's Windows driver's; batched submits use the one definition of GCN. Some odd switch values change meaning (an empty value is the PC's default, `=on` is on): `docs/development/device-policy.md` has the table. ## Measurements **Verdict:** no change in fps, as intended. This head against `main`, one session: Kokiri Forest 66.6 fps (main 63.2 to 64.9), Hyrule Field 92.4 (90.3 to 90.7), the Market 70.0 (68.0 to 72.7). ## Testing **Tested:** - `python -I -B tests/run_all.py`: 657 passed, 45 failed, 19 skipped. On `main` at 8e9cfc3a this PC has 46 checks failing (648 pass, 19 skipped); none of them is new here. - In the game (Linux, RTX 3090, NVIDIA 620.70, 2560x1440, no upscaler): one session of this head through Kokiri Forest, Hyrule Field and the Market, no error line; earlier sessions of each commit as it was made (nine for the first), with a removed switch and a misspelt one set on purpose and answered in the log. **Not tested:** - Windows: not compiled. - **The four corrected rules apply to no NVIDIA card**: AMDVLK, RADV and ANV were not run. - AMD and Intel GPUs, an integrated GPU, a card of 8 GB or less: several removed switches guarded paths that only run there. **Must be tested:** - A Steam Deck and a desktop RADV card, main against this PR (Test Farm: `@Beanstalk steamdeck: main against this PR, Kokiri Forest, Hyrule Field, the Market`). - Windows AMD and Windows Intel: a start and the same three areas (Test Farm: `@Beanstalk windows amd and windows intel: main against this PR, Kokiri Forest, Hyrule Field, the Market`). - Intel on Linux (ANV), by hand. ## Risks **What could break:** a deletion that kept the wrong side changes behaviour for everyone on that path; a corrected rule misbehaves on the driver it now reaches or no longer reaches. **Turning it off:** revert a commit; each corrected rule is one commented line in `device_policy()` that says how to go back. **Compatibility:** a run that sets a removed switch gets the default and a log line. No cache is rebuilt, `MKWVK_API_VERSION` stays. ## Issues See #1300 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. Built on Linux only here. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
refactor(vk): 93 kill switches and the older paths they kept are deleted from the four large renderer files
All checks were successful
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
b9805ef295
The renderer rework plan's track F. A kill switch turned off, or back to an older way, something that is on for
every PC; nobody ships with one set, and each kept an old path alive. vk_draw.cpp 32, vk_texture.cpp 21,
vk_replay.cpp 20, vk_memory.cpp 20: the read and the path are gone, the default is the only behaviour, and each name
is a GONE row of gpu/vk/switches.def, so a run that still sets one is told. 26 are kept, each for a reason (a value
set by a tool or named in the README, a default that follows the PC, a young fix's way out).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
Author
Owner

Tested in game: RTX 3090, NVIDIA 620.70, Linux: a dev pack over base 8e9cfc3a, nine sessions through Kokiri Forest, Hyrule Field and the Market (standing and turning, 2560x1440, Threaded rendering on) interleaved with five of main. Every scene drew with main's draw counts and GPU times, the frame rates overlap main's, no session ended early.

Tested in game: RTX 3090, NVIDIA 620.70, Linux: a dev pack over base 8e9cfc3a, nine sessions through Kokiri Forest, Hyrule Field and the Market (standing and turning, 2560x1440, Threaded rendering on) interleaved with five of main. Every scene drew with main's draw counts and GPU times, the frame rates overlap main's, no session ended early.
HumanBean changed title from WIP: refactor(vk): 93 kill switches and the older paths they kept are deleted from the four large renderer files to WIP: refactor(vk): 111 kill switches and their older paths are deleted, and the host's switches join the table 2026-11-17 04:30:00 +00:00
refactor(vk): 18 more kill switches and their older paths are deleted from the smaller renderer files
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Successful in 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 14s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 23s
5742f65ca1
The renderer rework plan's track F, after the four large files (#1309). vk_vma.cpp, vk_main.cpp, vk_temporal.cpp,
vk_xfer.cpp, vk_dlss.cpp, vk_fsr4.cpp, vk_jobs.cpp, vk_reflex.cpp, vk_framegen.cpp, vk_programs.cpp and vk_progcache.cpp
lose the read and the path; each name is a GONE row of gpu/vk/switches.def. 18 are kept: the README or a script
names them, the shader cache's stamp holds them, or they are a way out that measurement runs or a driver still need.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
feat(host): the host's switches join the table: every HOS_ and LONGSHOT_ name the game reads has a row
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 17s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
2e0743237d
The renderer rework plan's track F. gpu/vk/switches.def gains the host's 216 switches (89 diagnostics, 50 that turn
something off, 23 player settings, 24 numbers, 20 that turn on something nobody ships, 8 that follow the PC), read
once each from the code. The start's report names them when set and says a HOS_ name that is none; a LONGSHOT_ name
that is none is passed over (the launcher and the Builder have their own). The host's three removed HOS_ names become
GONE rows.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dzCsAL3UdW7ft8ptL9
HumanBean force-pushed refactor/kill-switches from 2e0743237d
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 17s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
to abbc397632
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 22s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
Third-party parts / As their notes say (pull_request) Successful in 34s
PR description / Description follows the template (pull_request_target) Failing after 6s
2026-11-17 15:48:18 +00:00
Compare
HumanBean changed title from WIP: refactor(vk): 111 kill switches and their older paths are deleted, and the host's switches join the table to WIP: refactor(vk): 111 kill switches are deleted, the host's switches join the table, and the per-PC decisions get one place and one rule 2026-11-17 15:49:35 +00:00
HumanBean changed title from WIP: refactor(vk): 111 kill switches are deleted, the host's switches join the table, and the per-PC decisions get one place and one rule to refactor(vk): 111 kill switches are deleted, the host's switches join the table, and the per-PC decisions get one place and one rule 2026-11-17 16:04:41 +00:00
HumanBean deleted branch refactor/kill-switches 2026-11-17 16:05:17 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1309
No description provided.