WIP: perf(vk): report words looked up through a hash index and merged in place #1993
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1993
Loading…
Reference in a new issue
No description provided.
Delete branch "siantm/Longshot:perf/vk-report-words"
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
The replay keeps two sorted sets of the words the CPU noted as its own (
cpu_words_merge, the report words), andeach merge of a report's new words looked every word up with two binary searches over those sets (the big one is
mostly cache misses) and merged with
std::inplace_merge, which asks for a temporary buffer at every merge.With this, a hash index (
WordIndex) holds both sets' words, so the two binary searches a noted word took are one hashlookup (one slot, or a few on a collision); only the fresh words are sorted, and
sorted_mergemerges them from the backin place, with no separate merge buffer (the destination vector can still grow, as before). The index looks a word up
before it grows, so a batch of known words never grows it. Its table is optional: 32 KB at first, doubled as it fills,
at most 1 MB (65,536 words half full, the most
memory_cpu_ownedkeeps), asked for with a nothrow new in aNewNothrowscope; one it cannot have (refused at the commit limit, or past 1 MB) and the merge looks the words up inthe sets as main does, and the index is built again, fit to the sets, at the next merge.
memory_cpu_owned's forgetfrees the table with the sets.
cut_cpu_wordsis unchanged. The sets hold the same words as before after every merge;the result expected is less CPU time on the replaying thread at each merge.
RX_VK_LOG_WRITEBACK=1(diagnostics) also logs, every 600 write-back submissions, the merges' count, mean and max timeby kind (plain, building the index, growing it, without it) and the index's slots: what a frame-time outlier at a
merge cost. The line is built under
cpu_words_muand logged after it is let go, so a slow log write does not hold upthe guest CPU's
memory_cpu_owned.No switch: a revert gives back main's code.
From 92fa6e19 on
exp/x86-asm-sync.Read first:
WordIndex,sorted_mergeandcpu_words_mergeingpu/vk/vk_memory.cpp, thentests/test_report_words.py.Testing
Tested: Windows 11, i7-9700, RTX 4060, the builder's llvm-mingw clang 23. Head
4422e0fdon main9dd41326(rebased from
f1f2dc5bwithout a conflict;git range-diff: the three earlier commits unchanged), light jobfb-dy1993-1of this PC's job queue, the checks in a hidden console:tests/test_report_words.pyandtests/test_mirror_bookkeeping.pypass, andgpu/vk/vk_memory.cppcompiled (syntax) with the game build's owncommand; the
--changedrun below was not repeated on this main. Earlier, at the head then,ecd1b8a4on mainf1f2dc5b, build jobs of this PC's job queue (fb-1993-1,fb-1996-1,fb-1993-base,fb-1993-2):tests/test_report_words.pyof the test commitacda2f8dagainst the PR's own code (ceb34693) fails, at each newcheck run first (the forget growing the table to 2 MB and keeping it; a known-only batch doubling it; the run stopped at the refused
table), and passes at the head, with
--cxxand with the compiler it picks itself;tests/test_mirror_bookkeeping.pypasses; every check
tests/run_all.py --strict --changed origin/mainpicks at the head: 905 checks, 728 passed, 129failed, 48 skipped (Linux only, or a tool this PC lacks). 66 of the 129 are renderer checks that did not compile in that
run, at the head or on main (no Vulkan headers under
--strict: not run); run again with the Vulkan headers (RX_CPMset,--strict, 20 min per check) in build jobfb-vkfix-1at the head and on main @f1f2dc5b: passes here and on main (46):tests/test_antilag.py,tests/test_async_safe_frees.py,tests/test_capture_dimensions.py,tests/test_capture_resources.py,tests/test_coopmat_probe_failures.py,tests/test_desc_counts.py,tests/test_device_policy.py,tests/test_dummy_views.py,tests/test_dump_readback.py,tests/test_fallback_pipeline_state.py,tests/test_framegen_resources.py,tests/test_framelog_sink.py,tests/test_fsr3_release_frees.py,tests/test_fsr3fi_hud_mask.py,tests/test_fsr4_bind_dispatch.py,tests/test_image_view_retry.py,tests/test_import_buffer_binding.py,tests/test_import_reach.py,tests/test_inline_write_order.py,tests/test_lost_wait_said.py,tests/test_pass_hazard.py,tests/test_pcache_header_read.py,tests/test_pipeline_key_values.py,tests/test_pipeline_state_portable.py,tests/test_pipeline_states.py,tests/test_program_answer_domains.py,tests/test_push_state.py,tests/test_recorder_parts.py,tests/test_same_draw.py,tests/test_same_dyn.py,tests/test_sparse_bind_failure.py,tests/test_sparse_bind_ranges.py,tests/test_split_ub_flush.py,tests/test_taau_typed_dispatch.py,tests/test_table_track.py,tests/test_texture_staging_publication.py,tests/test_ub_snapshot_default.py,tests/test_ui_texture_upload.py,tests/test_vendor_fixes.py,tests/test_vertex_bind.py,tests/test_vertex_bind_range.py,tests/test_vulkan_clear_mip.py,tests/test_vulkan_copy_span.py,tests/test_vulkan_copy_span_gpu_compile.py,tests/test_wb_diff_observations_gpu.py,tests/test_widen_alpha.py; passes here, fails on main (1):tests/test_recording_admission.py(on main:FAIL: worker slot ownership); fails on main too, headers found (19):tests/test_capture_readback_visibility.py,tests/test_draw_binds.py,tests/test_draw_stream_visibility.py,tests/test_fsr_image_retirement.py,tests/test_fsr_uniform_ownership.py,tests/test_low_vram_texture_mips.py,tests/test_pass_barrier.py,tests/test_present_queue_default.py,tests/test_present_source_crop.py,tests/test_recorder_own_idle.py,tests/test_recorder_sync.py,tests/test_replay_write_order.py,tests/test_sampler_admission.py,tests/test_staging_burst.py,tests/test_target_reuse_memory.py,tests/test_texel_buffer_ownership.py,tests/test_ub_update_batch.py,tests/test_ui_record.py,tests/test_vk_occlusion_queries.py. Of the other 63, 61 fail on main @f1f2dc5btoo, run from a base worktree (most for a tool this PC lacks under--strict;tests/test_vbytes.pya 600 s timeout on both, not run again: it hangs on this PC), andthe other two (
tests/test_mesh_args_cleanup.py,tests/test_oot_wide_bubble.py) timed out compiling under thatrun's load, pass on main, and pass at the head run again alone;
gpu/vk/vk_memory.cppcompiled (syntax) with the gamebuild's own command.
It has NOT run in the game on this PC yet.
Still to test:
house and out, and a heavy area (Hyrule Field, three minutes running and turning the camera): main @
9dd41326against this branch, same build type, driver, save, route and settings, each warmed up a minute in the scene first,
interleaved (ABBA), at least two runs each, with
RX_VK_LOG_WRITEBACK=1on this branch, expecting the same picturethrough the scene changes and no FATAL; report average FPS, 1% lows, median and p99 frame times, the process's RAM and
VRAM, and the report words' merge line (count, mean and max by kind); a gain is median and p99 frame time lower than
on main with no merge kind's max near a frame (by hand)
9dd41326against thisbranch, warmed up, ABBA, expecting the same picture and no FATAL, and the same figures as above (by hand or on the
farm, not run yet)
python3 -I -B tests/test_report_words.pywith GCC and with Clang(
--cxx g++,--cxx clang++), expecting PASS, and the fulltests/run_all.pyand the lint (by hand)tests/run_all.pyand the lint at the head (by hand)Measurements
Verdict: not measured: no micro-benchmark of this port and no run in the game on this PC yet; the in-game A/B is
in Still to test. No switch: the in-game A/B is this branch against main @
9dd41326. How the gain on the number thischange targets (the merge time) will be shown against main (a replay-thread profile of both sides, or the
micro-benchmark rerun with main's and this head's
cpu_words_merge): pending.Risks
What could break: a word lost or kept twice in the sets would show as a CPU write the replay treats as the GPU's (or
the other way round): a wrong value read back, a flicker or a stale texture in any scene. The test runs 800 rounds of
merges (known words only, new only, mixed, repeats) against
std::setover 16,384 addresses, the recent set promotedon the way, and checks the sets equal after each; the forget at 65,536 words and a forgotten word noted again are
check_clear's, a known-only batch at the half-full boundarycheck_known_at_boundary's, and a table refused in themiddle of a batch
check_refused's (the fixture's operator new refusing as the renderer's new_handler does at thecommit limit). RAM: the index keeps at most 1 MB (131,072 slots) and needs 1.5 MB at the moment it grows to that (the
old table and the new); 32 KB at first; freed when the sets are forgotten. Turn it off: a revert is enough. 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
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.Recommendation: Request changes. A batch containing only known report words can trigger a full rehash on the replay thread. The new index also adds a wait or shutdown path under memory pressure, and the exact-head tests and gameplay runs have yet to establish a net gain.
The patch keeps CPU-written counter reports out of mirrored GPU write-backs as before. It trades two binary searches per word and a temporary merge buffer for a persistent hash table and a backward merge. The game-free check covers ownership and write-back cuts. Players with mirrors enabled pay the extra RAM and replay-thread work on growth and reset.
@fixwill do (7)gpu/vk/vk_memory.cpp:4494: Check whether the word already exists before growing the table. (more on the line)gpu/vk/vk_memory.cpp:4504: Make the index optional when its allocation fails. (more on the line)gpu/vk/vk_memory.cpp:4509: Make reset proportional to occupied slots or use generation tags. Handle the forget threshold without growing the index for words about to be discarded.tests/test_report_words.py:21: Declare RUN_ALL_ARGS = ["--cxx", "{cxx}"] so the check uses the runner's selected C++ compiler. A Windows setup with only llvm-mingw clang++ on PATH can fail looking for g++, and on Linux CXX=clang++ can silently exercise g++ again. Honor CXX for direct invocation too while keeping the explicit --cxx override.For the author (3) (a run, a measurement or a decision)
gpu/vk/vk_memory.cpp:4509: Measure the first merge after ownership is forgotten and the retained RAM after a high-water mark. (more on the line)Checks: Still running:
CI / Conventional Commit title (pull_request),CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request),CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request),CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request),CI / Workflow lint (actionlint) (pull_request),CI / Website build and checks (pull_request),Guide screenshots / Guide images and local UI source review (pull_request),Third-party parts / As their notes say (pull_request),Third-party parts / The same as upstream (pull_request),PR description / Description follows the template (pull_request_target).More: does it help, other systems, switches, what was read
Does it help: Unproven. The commit reports 56.5 to 20.2 µs per merge at 50% new words and 54.0 to 8.1 µs at 10%, with equal sets after 22,800 merges on experimental commit 92fa6e19. Those figures do not compare
da36759fwith75317e1f. There are no exact-head gameplay, frame-tail, or memory measurements.Other systems: All Windows and Linux GPUs with VRAM mirrors enabled share this path, including ordinary, sparse, and diff write-backs. Tests model ownership and byte cuts. No gameplay run verifies the picture or pacing in those modes. Mirror-disabled paths, including the default on integrated GPUs and Steam Deck, bypass the index. Allocation adds system RAM and no Vulkan resources. The patch leaves the renderer ABI, cache formats, saves, audio, input, and build flags alone.
Switches: None added, changed, or removed. The existing mirror policy still controls whether report words are tracked.
Reviewed:
da36759f52against75317e1f31: Read AGENTS.md, CONTRIBUTING.md, the Forgejo template, docs/dev/standards.md, both file diffs, and tests/test_report_words.py in full. Read the full changed region of vk_memory.cpp and traced both callers, report address translation, mirror policy, the allocation handler, the neighboring source-cut check, and compiler selection. Read the relevant architecture and development rules. The rest of vk_memory.cpp and unrelated renderer paths were outside the traced regions. No local review checklist, sibling Tooling checkout, matching recorded run, or experimental benchmark commit was available. No translations or generated files changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review. The author reports 68 of 76 selected Windows checks passed, including the report-word fixture, and all eight failures also occurred on the base. CI is pending. No game run, Linux renderer build, full-suite result, or independently verifiable exact-head benchmark was supplied.
Overlaps and merge order: None found in the available refs. The local main has advanced to
6e1521a7(#1948), which does not touch either changed file. Use current main for the final comparison.Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.
@ -4484,0 +4491,4 @@size_t n = 0;bool add(uint64_t w) { // (true: it was not there)if ((n + 1) * 2 > slot.size()) grow();const size_t mask = slot.size() - 1;L1: Check whether the word already exists before growing the table. At exactly 65,536 retained words, one repeated report makes the index allocate 2 MiB and reinsert all 65,536 entries even though the batch adds nothing. Probe first, grow only on a miss, and test that a known-only batch at the half-full boundary leaves capacity unchanged.
@ -4484,0 +4501,4 @@std::vector<uint64_t> old;old.swap(slot);slot.assign(old.empty() ? (size_t)1 << 16 : old.size() * 2, kEmpty), n = 0;for (const uint64_t w : old)L2: Make the index optional when its allocation fails. Even a single new report now asks for 512 KiB when the destination vector may already have room. At the Windows commit limit that extra request can stall replay or end the game. Allocate replacement storage before changing index state, use the renderer's NewNothrow scope for the optional allocation, and fall back to sorted-set lookup with the full pending batch intact. Exercise allocation refusal during growth after some words in the batch have already been classified.
@ -4484,0 +4506,4 @@}void clear() {if (n) std::fill(slot.begin(), slot.end(), kEmpty), n = 0;}L3: Measure the first merge after ownership is forgotten and the retained RAM after a high-water mark. A stream of fresh reports can push the table to 262,144 slots just before the ownership sets are forgotten. Every subsequent forget then makes the next small merge sweep the entire table under the replay lock. The merge averages in the commit do not isolate this cost.
da36759f52ecd1b8a499Thanks for the review (#1993 (comment)). The branch is rebased onto main @
f1f2dc5b, and the rebase left the PR's own commit unchanged (nowceb34693). On top of it are two commits:acda2f8d(the tests) andecd1b8a4(the fix). Point by point:WordIndex::addnow looks the word up first and grows the table only for a word it does not hold (ecd1b8a4).check_known_at_boundaryfills the index to exactly half (32,768 words in 65,536 slots), merges a batch of known words only, and checks the table did not change. On the PR's code it fails (the table doubles).new (std::nothrow)inside aNewNothrowscope, before the index changes (ecd1b8a4). If that allocation is refused, or the table would pass 1 MB, the rest of the batch is looked up in the sets as main does. The words the index already dropped were known words or repeats of fresh ones still at the front, so every word of the batch is still there. The index is built again, sized to the sets, at the next merge. The first table is 32 KB, not 512 KB.check_refusedrefuses the bigger table after a known and a fresh word of the batch were already classified. The fixture's operator new refuses as the renderer's new_handler does at the commit limit: a nothrow new inside aNewNothrowscope gets null, and any other new stops the run. On the PR's code the run stops.ecd1b8a4.memory_cpu_owned's forget frees the table along with the sets, so the next merge does not sweep a high-water table; it builds one sized to what the sets hold. The table stops at 1 MB (131,072 slots, 65,536 words half full, the most the sets keep before the forget), so the merge just before a forget does not grow it for words about to be dropped.check_clearchecks that no block over 1 MB is asked for across that forget and that the table is given back (it fails on the PR's code). Measuring the first merge after a forget and the RAM kept after a high-water mark needs a run in the game; it is pending, with the log line from L5.RUN_ALL_ARGS = ["--cxx", "{cxx}"]. Run on its own it usesCXX, else the first of clang++, g++ or c++ on PATH, and--cxxstill overrides (acda2f8d).RX_VK_LOG_WRITEBACK=1, every 600 write-back submissions now log the merges' count, mean and max time by kind (plain, built the index, grew it, without it) and the index's slots (ecd1b8a4; the switch row says so). The in-game comparison is pending and in Still to test: final head against main @f1f2dc5b, same build, driver, save, route and settings, Kokiri Forest and Hyrule Field, reporting that line with average FPS, 1% lows, median and p99 frame times, RAM and VRAM.--changedpicks ran, andvk_memory.cppwas compiled with the game build's own command (see below). Still to test now lists the GCC and Clang fixture runs, the Linux renderer build at the head, and the full suite and lint.check_clear(withcheck_known_at_boundaryandcheck_refusednamed beside it).Checked on this PC at the head
ecd1b8a4(mainf1f2dc5b), through the job queue (fb-1993-1,fb-1996-1,fb-1993-base,fb-1993-2): the test commit's checks fail against the PR's code, each run first in turn, and pass at the head;test_mirror_bookkeepingpasses; of the 905 checks--changedpicks, 129 failed: 127 fail on main @f1f2dc5btoo, and the other two had timed out compiling under that run's load, and pass on main and at the head run alone;vk_memory.cppcompiled with the game build's own command. The description's Summary, Testing and Risks are updated. Not run in the game on this PC yet.@Beanstalk This changes how the Vulkan replay merges the report words the CPU owns (gpu/vk): a hash index answers whether a word is kept already and the fresh words are merged in place, with no allocation; the words kept are the same as before. No switch: a revert gives back main's code. It has not run in the game on these PCs yet. Please play Kokiri Forest for three minutes after a minute's warm-up, the PR against main on the same PC, with a picture compared with main's, on Linux with NVIDIA, Linux with AMD (RADV), Windows with AMD, Windows with Intel and the Steam Deck. The same picture (no stale or flickering values), no crash and no FATAL line; frame time p99 equal to main's or better, within the run-to-run spread.
@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 (Testing; no push, the head is still
ecd1b8a4). 66 of the 129 checks the--changedrun counted as failing (and as failing on main as well) were renderer checks that had not compiled, at the head or on main: this PC's run had no Vulkan headers, and under--strictthey stopped atnot found: vulkan_headers. Run again with the headers (RX_CPMset,--strict, 20 min per check) in build jobfb-vkfix-1atecd1b8a4and on main @f1f2dc5b: 46 pass here and on main, 19 fail on main too with the headers found, andtests/test_recording_admission.pypasses here and fails on main (worker slot ownership). None fails only at this head. The per-check list is in Testing;tests/test_vbytes.pywas not run again (it hangs on this PC).Verdict: Comment. Would approve once out of WIP and the farm run is in, because the index keeps the same words main keeps. Every point of BeanBot's review is now fixed in the code, each with a check that fails on the first commit. The fallback is main's own lookup. What is still open is evidence: the in-game A/B, and a measured gain on the number the change targets, which the standards ask for before merge.
For players with VRAM mirrors on (every discrete card), the replay thread spends less time on each write-back's report-word merge: one hash probe per noted word instead of two binary searches, only the fresh words sorted, and no
inplace_mergebuffer. The cost is up to 1 MB of RAM (1.5 MB while it grows to that), freed at the forget. Without mirrors (the Steam Deck, integrated GPUs)memory_cpu_ownedreturns early and nothing changes.Reviewed:
ecd1b8a4againstf1f2dc5b(the merge base). Read in full: theWordIndex,MergeTimes,sorted_merge,cpu_words_merge,memory_cpu_ownedandcut_cpu_wordsregion ofgpu/vk/vk_memory.cpp, the new log block inmemory_end_submission,gpu/vk/vk_new.h,tests/test_report_words.py,tests/mirror_bookkeeping_test.cppand theswitches.defrow. BeanBot's commitda36759fis no longer on the forge, so its points were judged against the current code and the reply. Nothing run (a code review). It merges cleanly onto current main (9dd41326) in agit merge-tree.Fixed in this review: nothing.
Checked and fine:
addprobes before it grows, so a batch of known words never grows the table.check_known_at_boundaryfills it to exactly half and would fail without the lookup that comes first.resizeasks for the table withnew (std::nothrow)inside aNewNothrowscope (the same pattern as the staging block at :1174), and leaves the index as it was on a refusal. In the fallback,[fresh, i)holds only known words and repeats of fresh words, so erasing it before the sort and binary searches keeps every new word. The fresh words already added to the index are not in the sets yet, so they still come out fresh.check_refusedcovers a refusal in mid-batch and a refused first table, through anoperator newthat stops the run as the new_handler does.kMax(1 MB, 65,536 words) means the merge just before a forget falls back to main's path instead of doubling to 2 MB.check_clear'sbiggest <= 1 MBwould catch the cap being removed.n == sizesinvariant: nothing butcpu_words_mergeand the forget changes the two sets (cut_cpu_wordsonly reads them), so the steady state never rebuilds. Sets past 65,536 (acut_cpu_wordsmerge before the nextmemory_cpu_ownedforgets) failbuildat the size check before any allocation and take main's path.sorted_mergefrom the back is correct, with ties, an emptyintoand an empty batch. Its source and destination are different vectors at both call sites.resize's swap-and-reinsert,probewithcap == 0guarded, andkEmptycan never be an 8-aligned word.RUN_ALL_ARGS = ["--cxx", "{cxx}"], withCXXand then the PATH order when run on its own.RX_VK_LOG_WRITEBACKis set, asteady_clockpair a merge. The switch row describes the new line.Suggestions (the author may take or leave)
vk_memory.cpp:7381:logfruns inside thecpu_words_muscope.memory_cpu_ownedtakes that lock on the guest-CPU side, so a slow log write stalls a report write. Buildm(and copycap) under the lock, and calllogfafter it. This only happens with diagnostics on.Questions
cpu_words_merge. Either would give the "number the change targets" column.Testing: the author ran the fixture and
--changedchecks on Windows (llvm-mingw clang), with the failures matched against main. CI is pending (blocked on approval). No in-game run yet. The farm request (comment 63660) is waiting for a BigBean. Still missing: the in-game A/B on Tier 1 discrete cards (Windows and Linux, NVIDIA and AMD), the merge-time line from a branch run, and the Linux build, full suite and lint (BeanBot's L6). These hold the merge, not this verdict.Overlaps and merge order: #2029 adds
retired_heldright aftercut_cpu_words(context only, no shared lines). The other PRs that touchvk_memory.cpp(#2052, #2051, #2028, #2027, #2002, #759) change other parts of the file. No duplicate. Any order works. Theswitches.defrow will need the usual rebase.@ -7291,2 +7378,4 @@logf("vk: write-back a submission, by pool:%s", s.c_str());by_pool.clear();{ // (the report words' merges since the last line, by kind: what a frame-time outlier there cost)std::lock_guard lk(cpu_words_mu);Suggestion: logf runs while cpu_words_mu is held, and memory_cpu_owned (the guest-CPU side) waits on that lock. Build the string (and copy cap) under the lock, then log after it. Diagnostics only.
Beanstalk test farm · an earlier run: commit
ecd1b8a(the newer results are in a comment below)Commit
ecd1b8a· approved by dyst (👍 on siantm's request) (reviewed) · dashboard⚠️ Note: The measurement is stationary after a short scripted walk; the farm cannot drive gameplay concurrently with a measure step, and two pictures cannot rule out intermittent flicker.
⚠️ Note: The 5% p99 tolerance is a fixed approximation: the plan cannot set its threshold from the observed run-to-run spread.
⚠️ Note: The Deck and integrated GPUs may not exercise the changed merge because VRAM mirrors are disabled.
Started at 10:07 UTC.
Estimate: done in about 2 h 30 min, from the queue and the testers online now; some jobs can't start yet.
linux+nvidialinux+amd+radvwindows+amdwindows+intelsteamdeckWhy it failed
linux+amd+radv:kokiri-forestscreenshot.max_diff:0.2 → 0.8; limit 0.0linux+amd+radv:kokiri-forestscreenshot.max_diff:0.1 → 0.8; limit 0.0linux+amd+radv:kokiri-forestforest.frametime_p99_ms.max_delta_pct:32.9 → 40.2 (+22.3%); limit 5.0What was tested
What will be tested · AI plan (
gpt-6.1-terra)On five requested hardware targets, main and the PR each run twice in Kokiri Forest, with a one-minute warm-up and three-minute measurement per run. Pictures, crashes, FATAL logs and frame-time p99 are compared; a picture mismatch, crash, FATAL line or p99 regression over 5% fails. Each tester spends about 36 minutes on game runs; Windows Intel will wait for a matching tester. No tester online now matches windows+intel: that target waits for one.
kokiri-start, then teleport to Kokiri Forest, move the stick, take the picture forest-start to compare with main, measure forest for 3 min (after 60 s warm-up), take the picture forest-end to compare with main; 2 runs on each side.Measurements on `linux+amd+radv`, for the PR description
Verdict: fail on linux+amd+radv (2 reports):
kokiri-forest screenshot.max_diff;kokiri-forest forest.frametime_p99_ms.max_delta_pct (+22.3%)failed.Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 9070 (RADV GFX1201), 26.0.8AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAMScene: kokiri-forest, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); kokiri-forest: 2 game starts a side, forest 180 s after 60 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)f1f2dc5ecd1b8aFlags and settings
None: the plan varied no setting, switch or build option.
As Markdown for the PR description:
The testers' hardware
linux+amd+radvAMD Radeon RX 9070 (RADV GFX1201), 26.0.8AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAMlinux+amd+radvAMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAMecd1b8a4994422e0fd49Beanstalk test farm
Commit
4422e0f· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.Thanks for the review (#1993 (comment)). The branch is rebased onto main @
9dd41326without a conflict (the three earlier commits unchanged, now4c15eaeb,e3e4fca1,11d9c417), with one commit on top,4422e0fd.vk_memory.cpp:7381,logfundercpu_words_mu(#1993 (comment)): taken. The merge line is now built andcapcopied under the lock, andlogfruns after the lock is let go (4422e0fd). The line's content is unchanged.ecd1b8a4, which the farm run started on.Checked at
4422e0fdon main9dd41326in light jobfb-dy1993-1:tests/test_report_words.pyandtests/test_mirror_bookkeeping.pypass, andvk_memory.cppcompiles (syntax) with the game build's own command. The--changedrun was not repeated on this main. The description's Summary, Testing and Measurements are updated.@Beanstalk This changes how the Vulkan replay merges the report words the CPU owns at write-backs (gpu/vk): a hash index answers whether a word is kept already and the fresh words are merged in place, with no allocation; the words kept are the same as before. It acts where VRAM mirrors are on (discrete GPUs). No switch: a revert gives back main's code. Please play Kokiri Forest and Hyrule Field, two minutes each after a minute's warm-up, the PR against main on the same PC, with RX_VK_LOG_WRITEBACK=1 on both sides and a picture in each scene compared with main's, on Linux with NVIDIA, Linux with AMD (RADV), Windows with AMD and Windows with NVIDIA. The same picture as main (no stale or flickering values), no crash and no FATAL line; frame time p99 equal to main's, within the run-to-run spread; on the PR's side the "report words' merges" line every 600 write-back submissions.
@siantm only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.Re the Test Farm's Linux RADV result on
ecd1b8a4(65805): both sides were built on this PR's basef1f2dc5b. The pictures show the same view; the difference is the forest's drifting mist, present in both main frames and absent in the PR's (the same RX 9070 tester shows it the other way round on #1996 with that PR's switch at 0, which is main's code), so it is the scene varying rather than this change. The p99 gap on the RX 580 is inside main's own spread on that tester (main's two runs 23.4 and 42.3 ms); one figure is not explained yet: its median, +0.7 ms in both PR runs (two runs a side). A differential check of this PR's word index against main's sets (4 seeds × 3,000,000 rounds, about 2.4 million cuts and 152 forgets) found the two identical every time. A repeat run on the RX 580 with the picture at an input-free point and main against itself, four runs a side, is asked to confirm or drop the median figure; until then it is pending.@Beanstalk This replaces my request 66243 on this head (please do not run that one) with one targeted run. It changes how the Vulkan replay merges the report words the CPU owns at write-backs (gpu/vk); no switch, a revert gives back main's code. An earlier run on an older head showed a picture difference and a p50 about 0.7 ms higher on Linux with AMD; this run is to confirm or drop that. Please run on the tester manasuazo (Linux, RADV, RX 580; tag tester-manasuazo) if it can be chosen, else on Linux with AMD (RADV): Kokiri Forest from its start save; take the picture at a fixed point with no input, right after the save settles, and one main-against-itself picture; then measure three minutes after a minute's warm-up, the PR against main on the same PC in ABBA order twice (four runs a side). Please report the picture difference beside main-against-itself, and p50 and p99 frame times beside main's own run-to-run spread. No crash and no FATAL line.
@siantm only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.