Idea: on integrated GPUs without VRAM mirrors, end the waits that don't need a split submission's last part (ROG Ally Z1 Extreme measurements: +6 % with 0 flashes) #1190
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#1190
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The idea
On a ROG Ally without VRAM mirrors, the waits for a split submission's last part (
e0dbf40c, #2419 on the old tracker) still cost speed. Most of that comes back without bringing back the flashes that commit fixed. Two things worked here:RX_VK_READBACK_LATEwith one more size,8b040. No code change:RX_VK_READBACK_LATE=newest,3980,9b040,1b580,8b040.RX_VK_LOG_READBACK_RANGESshows two0x8b040-byte readbacks per frame, each waiting ~16.5 ms in Market Town and Kokiri Forest.RX_VK_OCC_LOG=1: the same share of 0 counts per spot, 0 left visible).Let only the capture's write-back wait (
vk_timeline_wait) end at the submission's first part. I tried this as a local patch, split by wait site:rb: the readback wait ininvalidate();sync: the fence waits innvnSyncWait;cap: the capture wait.On an RTX 4090 laptop with
RX_VK_MIRROR=0and the compute mesh fallback (which flashes far more readily than the Ally):e0dbf40cfixed;rb+cap/rb+sync: 0 flashes in ~65,000 presents;sync+cap: 1 flash, in a menu.On top of (1),
capalone gives another +2 % on the Ally (Hyrule Field +3.5 %), with 0 flashes on both machines.syncgives nothing.Patch (applies to
6fb13fe5): https://github.com/Predator04/hookshot-rog-ally/blob/longshot-ally/patches/0004-vk-RX_VK_FENCE_FIRST_PART-per-site-on-6fb13fe5.patchMeasurements (Ally, game fps, 2 interleaved rounds after a warm-up, each spot with 4 camera views and a 25 s walk; route = mean of Kokiri Forest, Hyrule Field, Market Town):
newest,3980,9b040,1b5808b0408b040+ capture wait at first partThe last row is the ceiling (~+9 %). The gap between it and the safe setting is the fence wait on a whole submission. A fix that keeps the first-part mapping safe on mirrorless iGPUs would close it.
Flash counts use
RX_VK_FLASH=1withRX_VK_SHOT_EVERY=1:Setup:
6fb13fe5(rc.5's code), built from source.frame_generation=2.Anything else
6fb13fe5, with no gain:RX_VK_REPLAY_PIN=0,HOS_RESERVE_CORE=0,HOS_NATIVE_ZSTD,HOS_NATIVE_ZSTD_FRAMES,RX_VK_PASS_BARRIER=game,RX_VK_BATCH=1(slower),RX_VK_CHUNK=240,HOS_SHORT_SLEEP_POLLERS=2. A lower output resolution gave ~1 %.02903b04(#609) take any rate from 20 to 59 (HOS_FPS_MAX=40holds exactly 40, game speed stepped in real time). Patch with tests: https://github.com/Predator04/hookshot-rog-ally/blob/longshot-ally/patches/0007-host-HOS_FPS_MAX-20-59-on-the-hosts-30-cap-pacer.patch. On the Ally, 36 holds everywhere and 40 holds except in Hyrule Field's heaviest views. I can open it as its own issue if that's useful.Possibly related, for context:
Update after testing main
5c284721: on the ROG Ally, #977's early reads (on by default without mirrors) already get what this issue asked for. Neither of my two suggestions adds anything on main, so I think this can be closed.Ally Z1 Extreme, game fps over the same route (Kokiri Forest, Hyrule Field, Market Town; 2 rounds, unlocked, both builds warm):
6fb13fe5,READBACK_LATE=newest,3980,9b040,1b580,8b040+FENCE_FIRST_PART=cap5c284721, same settings5c284721, withoutcap5c284721,READBACK_LATE=newestonly, nocap5c284721, the size list withRX_VK_READBACK_EARLY=0All rows on
5c284721are within noise of each other.newestonly, they fire and give the same speed. Unlike the size list, they read the current frame's data, sonewestalone is the better choice on main.RTX 4090 laptop with
RX_VK_MIRROR=0and the compute mesh fallback,RX_VK_FLASH=1, a shot at every present:5c284721above, 2 rounds, 3 spots each).newestonly, the early reads waited 160-219 times per spot.RX_VK_LOG_EARLY_CHECK=1gave "100 unchanged, 0 changed" at all three spots.I haven't re-measured the "all three wait sites" row on main, so I can't say whether any gap is left there.
These builds also carry local patches that only add logging, off-by-default switches, and the 20-59 frame cap.
On this Deck OLED,
newestimproves Kokiri standing by about 3.8%, but the additional size rules add no resolved Kokiri FPS benefit. Hyrule Field turning is less conclusive and includes an adversenewestsignal. No default change proposed.This tests the rule string discussed here, not the separate capture-first-part patch. It uses p0lux's existing opt-in from #238, on main
544229a2with early reads at main's default; no renderer change between performance arms.Configuration: Steam Deck OLED, 16 GB, RADV VANGOGH / Mesa 26.2.0-devel; the Deck's own 1280×800 / 90 Hz screen, AC, 15 W, main's
profile_peakclock hold, not manual 1600 MHz. Pinned H options: saved Minimum preset with overrides, game docked profile (handheld_profile=0), 1280×800 output, fixed 50% render, the game's own upscaler, frame generation off. This is not Quality Auto. The same executable/renderer and unchanged options were used throughout the performance runs.Method: a warm-up per arm, then four rotated rounds:
U N B T / N T U B / T B N U / B U T N. The fourth row was predeclared as the extension; it was added after the initial Field exclusions, and both scenes' tables include it. Kokiri standing targets 45 s (logged frame durations 44.88–48.01 s); Field turning targets 30 s (29.76–32.07 s). Performance windows require settled pipeline/program counters and no queued jobs, omitted draws or new compilation across their bracketing checks. All exclusions remain; warm-ups and diagnostic safety runs do not enter these estimates.RX_VK_READBACK_LATEnewestnewest,3980,9b040,1b580newest,3980,9b040,1b580,8b040The first estimate below is the ratio of admitted-arm medians; the second is the median percentage change using only complete within-round pairs. They need not be the same, especially with exclusions.
8b040conditional on TKokiri: newest's paired changes are +3.44, +3.98, +4.92, +3.27%; every N run exceeds every U run (observed ranges separated by 0.72 fps). The independently bracketed bridge-present rate also improves about 3.8%. Process CPU milliseconds per renderer present are essentially unchanged (+0.01% by ratio of medians, overlapping ranges). The 1% low improves 6.47% and p99 decreases 4.17%, but both observed ranges overlap. The 1% low is 1000 divided by the mean of the slowest 1% of logged frame times.
The logged readback wait-path share rises 45.8% → 69.7%, while mean duration per counted wait falls 1.36 → 0.45 ms: more but shorter logged waits, not a measured reduction in process CPU work. Timed GPU work rises 0.76%, logged replay submit 5.74% and draw 8.04%; these are not separate additive frame-critical-path costs or an isolated code-efficiency measurement.
Field remains provisional: only 2/4 U windows, 4/4 N, 3/4 T and 3/4 B were admitted. Three exclusions were queued jobs; one was new pipelines inside the window. The surviving U→N FPS ranges are apart and process CPU per present rises 3.04%; both complete U→N pairs are slower. N→B's positive signal is also reported, but its extra four sizes are bundled. T→B has only two complete pairs and overlapping arm FPS ranges. These data do not establish which individual size helps, that B beats defaults, or that newest is harmless across scenes.
Safety scope: on a separate diagnostic renderer, all 8 tested K/F intervals had complete consecutive flash-comparison coverage and zero detected flashes; the sky/exposure and tree/foliage/occlusion spot checks were inspected without an obvious new artifact. Those runs supply no performance ordering. This is limited-route evidence, not proof of generally current readback values or universal picture safety.
One Deck, one session and shared arm data: the contrasts are not independent confirmations, and observed range separation is not a significance test. Kokiri-standing gains can coexist with the Field null results reported elsewhere; these are different scenes, settings, clocks and main revisions. This also does not overturn the later Ally update here that the extra suggestions added nothing resolved after early reads. The result supports keeping the rules opt-in, not a blanket Deck recommendation.
Instrumentation caveat for the Steam Deck numbers in our comment above: recurring long frames have nearly the same cadence as our /proc memory sampler. We are investigating an observer effect; no sampler-off control has established its size or whether it changes the arm contrasts. The tail figures (1% low, p95/p99, long-frame counts, maxima) and FPS comparisons include that instrumentation and must not yet be treated as unsampled player experience. The raw results and exclusions are unchanged.
Follow-up to the instrumentation caveat above: a sampler-cadence control on the same Deck moved the recurring long frames with the memory sampler's period (5.8 → 17.8 → 5.8 s), with every Kokiri interval over 100 ms intersecting its
smaps_rollupread. That strengthens the observer-effect caveat for our Deck tail numbers; it doesn't estimate unsampled FPS or show that the arm contrasts cancel. Details: #1477 (comment)