WIP: perf(vk): with the render thread, a readback over a texture's storage waits for its place in the queue, not the whole queue (RX_VK_ASYNC_PARTS) #2211
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2211
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:perf/vk-async-parts"
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?
Summary
With the replay on the render thread (
RX_VK_ASYNC=1, the Threaded rendering row), a readback over a texture's storage(
invalidate, textures the GPU wrote there) waits for the whole hand-over queue to be replayed (wait_queue_empty) andthen takes
replay_muto write the texels back, which the render thread holds for each submission's whole replay.RX_VK_ASYNC_PARTS=1takes the other order there: the readback waits for the submits handed over before it to be replayed(
async_catch_up: the jobs after the last submit are not waited for unless a queue is stopped; nothing is forced past await), and the texture's texels go to guest memory by a job in its place among the jobs (
async_texels_to_guest,JOB_TEXELS_TO_GUEST), so the reading thread no longer takesreplay_mu.enqueuenow numbers the jobs and notes the lastsubmit; a job done tells the waiters. A buffer readback is main's, the switch on or off. Not used with
RX_VK_PER_QUEUE_FENCES=0or without the render thread. The result expected: shorter waits for the readbacks over atexture's storage with the render thread on.
The switch:
RX_VK_ASYNC_PARTS(new, kindattempt, bool, its row ingpu/vk/switches.def), off by default: unset ismain's code. It follows dazemc's reviews of #2212 (72465) and of this one (72494): it stays off until its own in-game
comparison exists.
1(any value but empty,0,false,offorno) turns it on; the log says so.Since the first push, the buffer readback's catch-up is gone (dazemc, 72494 point 1). The branch (bd3ea307) put
async_catch_upthere while the render thread's buffer readback still waited for the whole queue, forced, then the maintimeline (its note: Kokiri Forest, i7-9700, 54-58 ms of readback waits a frame), so it was the shorter wait there. Main has
since taken that wait out (the comment above it in
invalidate): on main the catch-up only added waits, the replay of everysubmit handed over before the read, then the part of the newest work it had just recorded. Gone with it: the readbacks'
RX_VK_ASYNC_PARTSline every 3000 calls (async_rb), the countersasync_queue_waitsandasync_real_waits, andasync_present_valuewithq_present_value;tests/test_readback_part.pyis main's again.From bd3ea307 and 4eed88f7 on
exp/x86-asm-sync, without the branch's general render-thread wait statistics and withoutits buffer readback catch-up.
Read first:
async_catch_up,async_texels_to_guest, the texture-storage end ofinvalidateandenqueueingpu/vk/vk_replay.cpp, thentests/test_async_parts.py.Testing
Tested: Windows 11, i7-9700, RTX 4060, the builder's llvm-mingw clang 23. One build job of this PC's job queue (batch
fx2212-r1, summaryb-fx2212.log), the checks in a hidden console withtests/run_all.py --strict --exact --jobs 2 --timeout 1200. Head756da265on maina2dc5385: its own checks pass (logfx2212-11-head.log):tests/test_async_parts.py(the switch's read in fresh processes included, off when unset),tests/test_readback_part.pyandnx2/test_timeline_modes.py. The failing test first:tests/test_async_parts.pyat78652994fails (the switch on caught up on the buffer readback, logfx2212-11-buftest.log) and passes at756da265; ata8d87dcd(the test's gaps closed, on the first push's code) it passes. Mutants (logfx2212-mut2211.log; the files taken from git, one edit each): the buffer catch-up put back, the texels' return moved afterreplay_muis taken, the texels' wait without its condition, its early return gone, the guest-memory fallback taken underq_mu, and the switch on when unset each fail the test at the head; the four that apply to9751e510pass its test there. Every check--changed a2dc5385picks (logfx2212-11-changed.log): 156 checks, 145 passed, 11 failed, 5 skipped (Windows: they run on Linux or need a Vulkan device). The 11 fail on maina2dc5385too (batchfx2212-r1m, logfx2212-main11.log):tests/test_crash_dialog.py,tests/test_dev_ab.py,tests/test_dev_packs.py,tests/test_draw_stream_visibility.py,tests/test_fsr_uniform_ownership.py,tests/test_input_movie.py,tests/test_menu_keys.py,tests/test_perf_report.py,tests/test_sim_turf_pools.py,tests/test_switch_table.py,tests/test_vibration_menu.py. The game build's renderer alone in the same job,RX_VK_ONLY=1 python -I nx2/build.py --standalone --jobs 2at this head (everygpu/vk/*.cpp; no game, nothing run): compiled with 0 failed and linkedlongshot_vk.dll(logfx2212-vk-async-parts-vkbuild.log).Its path has not run in the game on this PC: the scripted pause and save starts in Measurements ran on main
9dd41326,whose readbacks this change would change, and none reached that path.
Still to test:
RX_VK_ASYNC_PARTS=1,RX_VK_ASYNC_FENCESunset in every run, 120 s runs, a warm-up a side then 8 interleaved a side, expecting the same picture, no FATAL or hang, theinvalidate ... textures there; the catch-ups waited ... ms eachline lower with=1, and draw time and game time a frame the same or lower. If no scene has such readbacks, that is said here, and the switch has nothing to show on this PC (by hand)a2dc5385, this branch unset and this branch withRX_VK_ASYNC_PARTS=1, warmed up, ABBA, expecting the same picture, no FATAL and no hang, and a median frame time with=1the same as unset and main; whether Kokiri Forest reaches the readback this changes at all is not known (Measurements) (Test Farm: linux+nvidia, linux+amd, windows+amd, windows+intel, steamdeck: Kokiri Forest three minutes, Threaded rendering on: main @a2dc5385, this branch unset and this branch with RX_VK_ASYNC_PARTS=1, warmed up, ABBA, the log, frame times and a screenshot)python3 -I -B tests/test_async_parts.py, expecting PASS (by hand)RX_VK_ASYNC_PARTSand #2212'sRX_VK_ASYNC_FENCESon the same side in both arms (unset, main's paths, unless the A/B is of them). Both move when the game's threads and the render thread wait for each other: the texels' job runs on the render thread underreplay_mubetween its jobs, and with the fences a fence's wait ends earlier, so frames are handed over earlier (by hand)Measurements
Verdict: not made to act by any means tried; withdrawn. This change's one path is a readback inside a GPU-written
texture's storage, and no run has produced one. On this PC, on main
9dd41326with Threaded rendering at its default (therender thread on), a scripted start opened and closed the pause menu six times, and scripted starts saved through the pause
menu's System page (held job
reach2211): the fourth made a real save (the save slot'scaption.savwritten again, with anew thumbnail of the scene), after three that did not (the first pressed B, which closes the menu; the second turned the
pages too fast; the third took the confirmation's default, Cancel). Every render-thread line read
0 in one(30 lines inthe pause start, 26 in the start that saved), and no run logged a readback in a live texture's storage. The 492 runs on
disk (10,491 render-thread lines) and an outside tester's 36 runs on a Radeon 860M read the same zero.
RX_VK_ASYNC_PARTSships off (
attempt); its on side, what this proposes, has never run in play, so nothing is measured, and the change iswithdrawn: closed by the author together with #2212, which is built on it; the branch stays on the fork.
Where the switch acts, read from this PC's logs (492 game runs on disk with the render thread's line, builds of main and of
other pull requests, Threaded rendering on: Kokiri Forest, the Market, Hyrule Field, Link's house and others): the render
thread's line every 600 presents (
readbacks: N next to a texture's storage (no catch-up), M in one) read M = 0 in all10,491 of its lines. No run logged
a readback in a live texture's storage, and no run reached theinvalidate ... textures there; the catch-ups waitedline, which comes once per 300 readbacks over a texture the GPU wrote. The readbacks next to atexture's storage, which this does not change, were about 25,000 a run in Kokiri Forest. So standing in these scenes does
not reach the change. What might reach it is an interaction. A save writes a thumbnail of the scene into
caption.sav(a JPEG the file select shows,
host/control.c), and making it is likely to read a rendered picture back. Our code cannottell whether that read lands in a texture's storage the GPU wrote, or whether the pause menu makes such a read: the game
decides that. The scripted pause menus and the save in the Verdict counted it: none.
A third party's run (Jer9, 2026-11-23, comment on this pull request), as he reported it: Windows 11, Radeon 860M iGPU
(Ryzen AI 7 350, RDNA 3.5, Adrenalin 26.10.1), built from #2212's head
c314a21ewithRX_VK_ASYNC_FENCES=0(#2211'spath),
dev.py ab --separate --runs 3 --seconds 45,RX_VK_ASYNC_PARTS=0against=1, the Market and Kokiri Forest.0 in oneand 0 catch-ups, in these 12 runs and in 24 more of #2212 in four scenes. So,as he says, his figures are a stability and no-regression check on Windows AMD, not a speed-up.
RX_VK_ASYNC_PARTS=1logged on every=1run.In Kokiri Forest one
=1run is left out: it landed at the lighter spot (the early teleport after loadingkokiri-startsometimes lands in one of two places).
dev.py abscenes, GPU-bound at a 67 % render scale on an 8-CU iGPU, three runs a side, andRX_VK_ASYNC=1forced where main's Auto leaves Threaded rendering off on that GPU.Risks
What could break with
RX_VK_ASYNC_PARTS=1: a readback over a texture's storage that does not wait for the work that writesit would read old texels (a wrong value or picture for a frame); one that waits for work stopped behind it would hang. Two
bounded stalls are kept, both from main's
wait_queue_empty(dazemc, 72494): with a queue stopped, the readback waits forevery job handed over before it, which can be a held present, so up to the replay's
hold_ms; and with a queue stopped atan event stored in guest memory (
ev_wait_in_memory) it is main's whole-queue wait, which has no bound. A buffer readbackreads what it reads on main: nothing it depends on moves (
memory_writeback_value's pages are noted at the replay's partends, its part wait is the recordings' timeline's,
memory_rb_refreshis the recording's; the texels' job writes onlytextures' texels into guest memory and their own state). The tests run the real
async_catch_upandasync_texels_to_guestagainst a stand-in hand-over queue, a replay thread that runs on its own and the render thread'swait_queue_empty, and the real texture-storage end and buffer catch-up ofinvalidate. Off by default: unset is main'scode. Renderer code: the runtime is rebuilt; nothing changes for players' saves, options or caches.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Possibly related, for context:
@Beanstalk This changes readbacks of GPU results with Threaded rendering on, the default (gpu/vk): a readback waits for the part of the submission that writes it back; RX_VK_ASYNC_PARTS=0 turns it off. Please start from the kokiri-start save and take the picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between (a picture during the load's fade-in from black is not comparable), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest and Hyrule Field, two minutes each; at least two starts a side, interleaved, the PR against main on the same PC, on the PR's side unset (the default, on) and with RX_VK_ASYNC_PARTS=0 (off), on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; with it unset, frame time p99 equal to main's or better, within the run-to-run spread, and equal to RX_VK_ASYNC_PARTS=0 or better. The log must have no FATAL, device lost or validation error line. No exposure flash and no fog from the frame before in any picture. Please report the log's "vk: readbacks of GPU results" lines (what the readbacks waited for) on both sides.
@siantm only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was for9751e51, and the PR has changed since (756da26), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.Read of
9751e510on maina2dc5385(+395, five files). The design is careful,=0is main exactly, and the test is real. The strongest thing is that #2211 does not only shorten texture readbacks: it also puts a catch-up back on the ordinary buffer readback — the one the code says was removed for 7.5–11 ms a readback — and it ships on with no run.1. The buffer readback gains the catch-up its own comment says was removed. With
partson (the default), any readback of a range with a live write-back now runsasync_catch_up()(gpu/vk/vk_replay.cpp:4071-4078), which waits until the replay thread has reached the last submit handed over before the read (async_catch_up,:7878-7894). The paragraph directly above the line still reads "RX_VK_ASYNC=1, the render thread: no catch-up either … Catching up instead (the older replay thread, removed) held the game's job threads for the whole replay of the frame, 7.5-11 ms a readback in the Market, and forced half of the stopped submissions past their waits (the flashes)" (:4046-4053). The new catch-up drops the forcing (which is the better half of that fix) but keeps the wait for the replay to reach the read, which is where the 7.5–11 ms went; andw = !behind || exact || partsnow reports every such read as one that waited (:4078). The description frames the win as the texture path and says "The result expected: shorter readback waits"; on this path the wait is longer than main's (which was none). OoT's exposure-meter read is exactly this path, once a frame. If the catch-up is only there to make the writer's part known, main already falls back towait_recorded/readback_wait_valuewhen it is not — so what does it buy that the A/B can show? If it is needed, the comment above needs replacing, not just appending to.2. Default vs evidence. Same as #2212:
RX_VK_ASYNC_PARTSships on (switches.def:302) while Measurements says "no measurement chose that default yet" and Testing says "It has NOT run in the game on this PC yet".RX_VK_ASYNCis Auto-on from 4 physical cores, so this is most PCs' readback path. The in-game ABBA (unset lower than=0and than main,=0the same as main) is the evidence the switch rule asks for; until it exists the measured side is=0. With the buffer-path point above, I would hold the default off (attempt) until then.The spot checks:
wait_queue_empty()forasync_catch_up()then aJOB_TEXELS_TO_GUESTjob that runstexture_flush_to_guest(the job's own flush does a bounded GPU readback wait,flush_textures→readback_submit_wait), andinvalidatereturns without takingreplay_mu(:4263-4285); and the buffer path gains the catch-up above. The writer's part wait (wait_recorded_part/wait_recorded) is unchanged.async_catch_upcapturesq_last_submitat the call, the texels job is enqueued after that and before any later submit, and a part's signal only depends on the recordings' timeline advancing, which the replay does itself. Theq_reachedwaits are underq_muagainstq_doneincremented there, and the notify is afterq_done++(:7795-7801), so no lost wakeup. Two bounded stalls to know about, both pre-existing inwait_queue_empty: a readback with a blocked queue waits for every job handed over before it (:7887), which can include a held present, so up to the replay'shold_ms; and theev_wait_in_memoryfallback is an unboundedwait_queue_empty(:7891-7893) — that one is documented as the guest-memory-event case.=0is main:partsfalse leaveselse if (behind)with only theexacttest,was before,sync_settle/wait_queue_emptythentexture_flush_to_guestunderreplay_mufor textures.enqueue's newseq/q_last_submit/q_present_valuewrites and the two thread-local counters are inert.async_catch_upandasync_texels_to_guestagainst a stand-in queue (tests/test_async_parts.py:87-132) and asserts the wiring (:225-244), so on main it fails at the extraction. Gaps: the stand-in replay only advances while a waiter is present and itswait_queue_emptyonly counts, so a lost wakeup or the unbounded fallback is not exercised; andinvalidateis only grepped, so the new buffer catch-up is asserted to exist — where it fires and what it costs is not.q_reached/q_reach_waitersis notified afterq_done++and byasync_fences_doneunderq_mu, so a catch-up waiter and a fence waiter cannot miss each other; the texels job carries no queue or value, soaq_last/async_fences_doneignore it. A present can queue behind the texels job, but that is the same serialisation the oldreplay_muflush had, and no cycle exists with a fence:async_wait_fencewaits for submits to be recorded, and the texels job is not a submit.invalidate,enqueue, the job loop and the three new functions; the barrier-split branch isvk_texture.cppplus onevk_replay.cppframe-line hunk, and the #1988 line fix isSlowWatch/do_present— rebase only. The measurement pin is the same as for #2212: a #1988 present/texture-stall A/B must have bothRX_VK_ASYNC_PARTSandRX_VK_ASYNC_FENCESon the same side in both arms.No approval (WIP), and no claim on it.
WIP: perf(vk): with the render thread, a readback can wait for its place in the queue and its write-back's part (RX_VK_ASYNC_PARTS)to WIP: perf(vk): with the render thread, a readback over a texture's storage waits for its place in the queue, not the whole queue (RX_VK_ASYNC_PARTS)Thank you for the read. New head
756da265on maina2dc5385:9751e510unchanged, four commits on it.You were right. The branch (bd3ea307) put the catch-up on the buffer readback while the render thread's buffer readback there still waited for the whole queue, forced, then the main timeline (its note: Kokiri Forest, i7-9700, 54-58 ms of readback waits a frame), so there it was the shorter wait. Main has since taken that wait out (
:4046-4053), and ported onto main it only added waits: the replay of every submit handed over before the read, the wait the removed catch-up's 7.5-11 ms went into, then the part of the newest work it had just recorded. The buffer path needs none of it for what this claims, which is the texture-storage readback. Test first,78652994(the catch-up block ofinvalidatecut and run: on the render thread, the switch on or off, no catch-up, no wait for the queue, not counted as a wait; it fails at the first push's code), then756da265: the buffer readback is main's line for line, the switch on or off, so the comment above it holds as it stands. Gone with it, as only it fed them: the readbacks'RX_VK_ASYNC_PARTSline every 3000 calls (async_rb),async_queue_waits,async_real_waits,async_present_valueandq_present_value;tests/test_readback_part.pyis main's again. Nothing the buffer read depends on moves with the switch on:memory_writeback_value's pages are noted at the replay's part ends, its part wait is the recordings' timeline's,memory_rb_refreshis the recording's, and the texels' job writes only textures' texels into guest memory and their own state. The title and the description now claim the texture-storage path only.Done in
8386cf0a:RX_VK_ASYNC_PARTSships off, kindattempt:env_on, its row, the log line, the test's switch read (off when unset) and the description, which says the on side is proposed and unmeasured. The A/B sets=1.The test (
a8d87dcd,78652994): the stand-in replay now finishes jobs on its own, a waiter or not, and tells the waiters asreplay_thread_maindoes;wait_queue_emptyis the render thread's (every job handed over before it done, takingq_mu); new cases: jobs finished while nobody waited, the texels' job done at its hand-over before its reader looks, wakeups for the jobs before the texels' job, 200 reads racing the replay, and a watchdog that fails a wait that does not end.invalidate's texture-storage end and its buffer catch-up are cut and run, not grepped. Mutants that fail the new test and passed the old one: the texels' wait without its condition (a lost wakeup), its early return gone, the guest-memory fallback taken underq_mu, and the texels' return moved afterreplay_muis taken.Deadlock: thank you; the two bounded stalls you name, both from
wait_queue_empty, are in Risks as kept from main (a stopped queue: every job before the read, a held present up tohold_ms; an event in guest memory: the whole-queue wait, unbounded).With #2212 and our lanes: agreed; both switches are off by default now, and Still to test pins them to the same side in both arms of any #1988 present or texture-stall A/B.
Checks (one queue job,
fx2212-r1): its own checks pass at the head;tests/test_async_parts.pyfails at78652994and passes at756da265; every mutant above fails at the head;--changed a2dc5385145 passed, 11 failed, each failing on main too; the renderer compiles and links. Pushed with a lease,9751e510unchanged under the new commits.No game run yet; the description is updated.
@Beanstalk This replaces my request 71757, made for the earlier head
9751e510, where the switch was on by default. This adds RX_VK_ASYNC_PARTS, an attempt off by default: with RX_VK_ASYNC_PARTS=1 and Threaded rendering on (the default), a readback over a texture's storage waits only for the part of the submission that writes it back (gpu/vk); unset, it is main's way. Please start from the kokiri-start save and take the picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between (a picture during the load's fade-in from black is not comparable), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest and Hyrule Field, two minutes each; at least two starts a side, interleaved, the PR against main on the same PC, on the PR's side unset (the default, off) and with RX_VK_ASYNC_PARTS=1 (on), on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. RX_VK_ASYNC_FENCES stays unset on every side. The same picture as main within main's own difference from itself; unset, frame time p99 equal to main's; with RX_VK_ASYNC_PARTS=1, equal to unset or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line. No hang, no exposure flash and no fog from the frame before in any picture. Please report the log's "vk: readbacks of GPU results" lines (what the readbacks waited for) on both sides.@siantm only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.Description: corrected where this can show anything. This PC's game logs on disk (182 runs with Threaded rendering on: Kokiri Forest, the Market, Hyrule Field, Link's house) show no readback over a live texture's storage: the render thread's per-600-presents count of such readbacks was 0 throughout, and no run reached the line logged once per 300 readbacks over a texture the GPU wrote. So Kokiri Forest and Hyrule Field, which Still to test named, may not reach the change at all. Still to test now starts with a census on main over ten scenes, and the A/B (unset against
RX_VK_ASYNC_PARTS=1, 8 runs a side) goes to the scene where the census finds those readbacks. No code change; head still756da265.@Beanstalk This replaces my request 72691 on this head and the corrections under it, in a form the farm can run: it cannot time a picture from the first frame that is not a uniform colour (its answer on #2131), so each picture here follows a fixed wait after the map event. This adds RX_VK_ASYNC_PARTS, an attempt off by default: with RX_VK_ASYNC_PARTS=1 and Threaded rendering on (the default), a readback over a texture's storage waits only for the part of the submission that writes it back (gpu/vk); unset, it is main's way. Please start from the kokiri-start save and take the picture 10 s (600 frames at 60 fps) after the map event that ends the load, a fixed wait with no input in between (the farm cannot time it from the first frame that is not a uniform colour), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest and Hyrule Field, two minutes each; at least two starts a side, interleaved, the PR against main on the same PC, on the PR's side unset (the default, off) and with RX_VK_ASYNC_PARTS=1 (on), on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. RX_VK_ASYNC_FENCES stays unset on every side. The same picture as main within main's own difference from itself; unset, frame time p99 equal to main's; with RX_VK_ASYNC_PARTS=1, equal to unset or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line. No hang, no exposure flash and no fog from the frame before in any picture. Please report the log's "vk: readbacks of GPU results" lines (what the readbacks waited for) on both sides.
@siantm only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.Windows 11 + AMD Radeon 860M (Ryzen AI 7 350, RDNA 3.5 iGPU, Adrenalin 26.10.1 LLPC) check, built from the follow-up PR #2212 head
c314a21e(which stacks directly on #2211756da265overmaina2dc5385,longshot_vk.dllpack).Why one build from
#2212tests#2211#2212is the follow-up PR stacked on#2211(sharing#2211'sq_reachedcondition variable). All#2212changes are gated behindRX_VK_ASYNC_FENCES(off by default, explicitly set toRX_VK_ASYNC_FENCES=0here), so withRX_VK_ASYNC_FENCES=0the binary runs#2211's exact code path (async_fences()false, leavingfence_q,wait_inner, andenqueueunchanged).Settings:
dev.py ab --separate --runs 3 --seconds 45 --warmup 10, 67% render scale (2560x1440 output), uncapped (HOS_FPS_MAX=1000), V-Sync and framegen off,RX_VK_ASYNC=1,RX_VK_ASYNC_FENCES=0.Key finding:
#2211's path did not fire in standingdev.py abscenesAcross all 12 runs here (
marketandkokiri-forest) — and all 24 runs of the follow-up#2212A/B across 4 scenes (market,kokiri-forest,hyrule-field,deku-tree, 36 runs total) — everyvk: the render threadlog line reported0 in onetexture-storage readbacks and0 catch-upsduring play:Since
756da265removed the buffer-readback catch-up,RX_VK_ASYNC_PARTS=1only acts on readbacks in a GPU-written texture's storage (in one > 0). Because none occurred in these standing scenes, the numbers below are not a measured speedup for#2211— they are a Windows AMD stability / no-regression check (=1variance vs=0).Results (stability / no-regression only —
0 in onereadbacks)Market (
market, standing, 3 matched pairs):RX_VK_ASYNC_PARTS=0(A1 / A2 / A3)RX_VK_ASYNC_PARTS=1(B1 / B2 / B3)28.4 / 32.2 / 30.0(median 30.0)32.2 / 32.6 / 31.2(median 32.2)0 in one)25.3 / 28.5 / 20.8(median 25.3)27.6 / 27.6 / 26.9(median 27.6)35.07 / 30.99 / 32.72 ms(32.72 ms)30.96 / 30.54 / 31.90 ms(30.96 ms)39.45 / 35.11 / 48.16 ms(39.45 ms)36.20 / 36.28 / 37.22 ms(36.28 ms)Kokiri Forest (
kokiri-forest, standing;B2excluded forkokiri-startspot mismatch):B2(39.0 fps,25.55 msmedian) teleported early (35.4 svs37.6–40.1 s) and landed at the lighterkokiri-startspot (1287textures /2658 MBvs1517–1561textures /2731–2936 MBon all other 5 runs), so it is excluded.=0(A1 / A2 / A3):32.0 / 31.9 / 31.8fps, 1% low28.9 / 28.1 / 28.4fps, p9934.65 / 35.64 / 35.19 ms;=1(B1 / B3):29.9 / 32.2fps, 1% low20.4 / 28.6fps, p9949.02 / 34.95 ms.Logs, follow-up (
#2212), and limitsFATAL,VK_ERROR, device-lost, or validation lines across all 12 runs;vk: RX_VK_ASYNC_PARTS=1 (an attempt, off unless set)logged on all=1runs.#2212: The stacked follow-up PR#2212(RX_VK_ASYNC_FENCES) was also A/B tested additively on top ofRX_VK_ASYNC_PARTS=1across 4 scenes on this PC (market,kokiri-forest,hyrule-field,deku-tree): 0 errors, with frame times falling within GPU-bound run-to-run variance at 67% render scale of 2560x1440 (~30 fps,12.0–26.2 ms/framefence waits /23.0–51.0 ms/frametotal across threads invk: host time in GPU resource waits).dev.py abscenes, GPU-bound at 67% render scale on an 8-CU iGPU (whereRX_VK_ASYNC=1is forced on a non-mirrored iGPU, vsAutooff onmain). Benchmarking#2211's actual path will require a scene/route or interaction that producesin one > 0texture-storage readbacks (e.g., pause menu / save thumbnail).@Jer9 thank you for this, and for reading the render thread's line before the frame times: that is the right reading. Your run is now in Measurements as a third party's, with the limits you gave (iGPU, GPU-bound at 67 %, three runs a side,
RX_VK_ASYNC=1forced where main's Auto leaves it off).Our own logs agree. On this PC, 492 game runs on disk carry that line, 10,491 lines in all, and every one reads
0 in one. No run has loggeda readback in a live texture's storage. So this change has not yet been seen to act in play on any PC, and the description now says so first.On your suggestion: the code shows one interaction that is likely to read a rendered picture back. A save writes a JPEG thumbnail of the scene into
caption.sav, which the file select shows (host/control.c). Whether that read, or anything in the pause menu, lands in a texture's storage the GPU wrote, our code cannot tell, because the game decides how it makes the picture. So I've set up the smallest run that would show it: two scripted starts on main fromkokiri-start, Threaded rendering on. One opens and closes the pause menu six times. The other answers the save prompt twice and checks that the save's files changed. It countsin oneand the live-storage lines in each start. If either reaches it, the A/B runs there.@Jer9 your suggestion was tried (Measurements, Verdict): on this PC, on main with Threaded rendering on, the pause menu opened and closed six times, and a scripted save through the pause menu made one confirmed save (the save slot's thumbnail written again). Neither produced a readback inside a GPU-written texture's storage, the one path this changes: every render-thread line read
0 in one, as in the 492 runs on disk and your 36.So the change has not been made to act by any means tried, and it is withdrawn, with #2212, which is built on it. Thank you for your runs and the suggestion. The branch
perf/vk-async-partsstays on the fork, and this can be reopened.Pull request closed