WIP: feat(vk): the per-PC decisions get one place and one log block: device_policy.h #1341
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!1341
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/device-policy"
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: feat · Risk: low · Tested on: Linux, RTX 3090 · Needs: Windows; an AMD and an Intel GPU
Why
73 rules decide by the PC (the GPU's vendor, driver, VRAM, the CPU count, the OS) in about 40 functions of 14 files. The same fact is asked several ways, switches are parsed seven ways, only two rules name a driver version, and no log shows what a PC got, so a report from an Intel or AMD card starts with guessing which rules ran. Track F of the renderer rework plan: one place for the per-PC decisions, step 1. Stacked on #1309, #1325 and #1326: review the last commit only.
What changed
gpu/vk/device_policy.h(new):DeviceFacts, filled once before the device is made, and a puredevice_policy()that works out 67 decisions from it, each field with its reason. No Vulkan calls.vk: policy:lines say the facts and every decision.astc_on_cpu,batch_on, FSR 4'stune::on, the spare captures' cap. Each keeps its own switch and its parsing.tests/test_device_policy.py(new): 18 made-up PCs with the expected value of every field.Measurements
Nothing to measure. One session as a check: Kokiri Forest 67.3 fps standing, Hyrule Field 92.0, main's draw counts and GPU times.
Hardware: Linux (CachyOS, kernel 7.3.3), RTX 3090 24 GB, NVIDIA 620.70, Ryzen 9 7900X; 2560x1440, no upscaler
Flags and settings
None added or changed.
Testing
Tested: Linux, RTX 3090: built; one session through Kokiri Forest and Hyrule Field, both drew as main does; the five policy lines were printed. Of the four converted sites, this PC takes the same side as before on each (all off or unlimited).
Not tested:
tests/run_all.pyand the new check, whose about 1,200 expected values were worked out by hand: not run on this PC.Must be tested:
vk: submits: batchedshould read as on main (Test Farm:@Beanstalk steamdeck: main against this PR, Kokiri Forest and Hyrule Field).Risks
What could break: a converted site taking the other side on a PC this one is not, or the Windows build.
Turning it off: there is no switch; revert the commit.
Compatibility: none: no cache is rebuilt,
MKWVK_API_VERSIONstays, no setting changes.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: one session through Kokiri Forest and Hyrule Field at 2560x1440; both drew as main, and the five vk: policy: lines were printed.
A second commit is on this branch. Unlike the first, it changes behaviour on GPUs this PC is not, so it needs runs there before it leaves WIP.
One reader, one rule.
device_policy_envreads 15 switches of the converted sites: unset or empty is the PC's default, an off word is off, anything else is on; numbers are digits only and in range, else ignored and said in the log. Values whose meaning changes:=on/=trueonRX_VK_BATCH,RX_VK_MIRROR,RX_VK_OCC_COPY,RX_VK_COMPUTE_SERIAL(were off, now on); an empty value on nine switches (was off, now the default);RX_VK_WORKERS=0, a word, or over 16 (was 1 or 16, now ignored); negative or non-numeric sizes (were huge or 0, now ignored).0and1mean what they did everywhere.docs/development/device-policy.md(new) has the table.The log block marks a value its switch set with
*, names ignored values, and gives the driver version each driver fix that is on was seen on:Four rules now test the driver their own comment names, not the vendor:
RX_VK_NO_SUBGROUP_PIN=1on a 64-lane card keeps batching, and (by reading, not a log) RADV on Vega and Raven/Picasso APUs gains batching.Each is one commented line in
device_policy()that says how to go back. Left for hardware nobody here has: the native add's list for other Intel families, the equal-depth margin and part split on ANV, the small-card sizes.Run in the game (RTX 3090, NVIDIA 620.70, Linux): two sessions through Kokiri Forest, Hyrule Field and the Market, one with three switches set. Scenes drew as main (66.3 / 89.9 / 69.3 fps and 65.2 / 91.5 / 69.0); the block printed as above. None of the four corrected rules applies to this card. Not tested: any AMD or Intel GPU, Windows (not compiled), and
tests/run_all.py: nine existing checks were edited by reading alone.Must be tested: a Steam Deck and a desktop RADV card (
@Beanstalk steamdeck: main against this PR, Kokiri Forest, Hyrule Field, the Market), Intel on Linux, and Windows AMD and Intel for the build.Beanstalk test farm
Commit
99d7880· tier untrusted · approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.Folded into #1309, which is now the one pull request for switches and the per-GPU rules. The commits are unchanged apart from being rebased into one stack and carrying the fixes the check suite asked for; nothing was dropped.
Pull request closed