WIP: test(vk): a game-free bench of the replay's per-draw path, with a census of the Vulkan commands it records #3268

Draft
klimovich008 wants to merge 7 commits from klimovich008/Longshot:perf/replay-bench into main
Member

Summary

Measuring a change to the replay thread's per-draw path (program pick, descriptors, the recording) has meant a game run:
packs, a runtime, minutes of warm-up, and frame-rate noise bigger than many of these changes. This adds a bench that
measures the real renderer without the game.

tests/replay_bench.cpp loads a built longshot_vk.dll as the game does, with a host of its own (a guest memory window
holding its pools), and writes synthetic NVN work into it: a render target, textures, uniform, storage, index and vertex
buffers, and programs of a few hand-encoded Ampere instructions that sample the textures and read the buffers, so
program_for and build_descriptors do a game draw's work. It starts the renderer windowless (start(NULL)) on the
real Vulkan device and submits each frame's command buffer as the op stream of gpu/render/rx_nvn.h, through the real
replay(), draw() and dispatch(). No game code or data.

It reports:

  • the replay's time per draw or per dispatch (scene frames against empty frames, alternated; of the fastest frames,
    the steadier, and of the medians), and the same times the scene's draws and dispatches: us a frame, to read against
    the game's frame (a gain of 0.06 us a draw is 120 us of a 10.6 ms frame, about 1 %, below a game A/B's noise);
  • with --census, every vkCmd* and descriptor update the renderer recorded, counted and hashed by kind with their
    arguments and the data they point to (barriers, passes' attachments, copy regions, clears; a bound descriptor set
    as what was written to it; handles numbered in the order first submitted, so two runs compare), and their order: each command buffer's as recorded, the buffers' as
    submitted, so a path that records parts on another thread compares with the serial one, and the same commands split
    into other buffers hash the same; how many
    of the scene's draws and dispatches reached Vulkan; a hash of the picture (copied to a buffer by the GPU after a
    scene frame) and of what the dispatches wrote. That is the check that a fast path records what its reference path
    does. (Windows; on Linux the renderer loads libvulkan itself, so the census refuses rather than report nothing.)

tests/test_replay_bench.py builds and drives it: one renderer, two renderers (--dll-b), or one renderer with a
switch on each side (--env-b; a switch the menu's settings hold is refused, as the bench has no settings), alternated
runs, B - A; neither side inherits the shell's RX_, HOS_, LONGSHOT_ or OOT_ variables; --keep-logs DIR
keeps each run's renderer log, where a switch's check mode counts. Its self-test runs in
tests/run_all.py, with no GPU. The default scene is about the Market's mix: 2000 draws, a program and its bindings
changed every second draw, 4 textures and 2 uniform buffers a stage, indexed draws, each draw's indices and the vertex
buffer it binds at a place of their own across 256 MB of 64 MB pools that the renderer imports and mirrors on its own, as
it does the game's (--geom-mb; 0 gives eight meshes in one pool, which every lookup finds again, as the game's do not).

Read first: tests/replay_bench.cpp (make_world, make_scene, the census), then docs/dev/developing.md,
"Benchmark the replay without the game".

Testing

Tested: Windows 11, Ryzen 7 5700X3D, RX 9070 XT (driver 32.0.32029.2010), the renderer built from main @ bd4586c2e and
@ 7bc53f841:

  • the self-test (llvm-mingw clang, host/nvn_layout.c with its C compiler) passes, and four broken variants fail it
    (streams without NOP_END; indexed draws without their index buffer; every draw from the first geometry place; the
    geometry's pages left unmarked). Its census checks: a pipeline bind and a draw recorded first into a second command
    buffer give the serial stream and kind hashes (handles numbered as submitted), binding one pipeline twice does not;
    a submit the driver refuses folds and counts nothing; a barrier's access masks, a pass's attachment ops and a
    clearing pass's clear value change the hash, where they lie, a clear value the pass does not clear with and a depth
    attachment's stencil value do not; descriptor sets S and T bound in either order hash differently, and the same
    writes into sets of other handles (as a pool reset gives out) hash the same. Its geometry checks: each draw's 512 bytes
    inside a pool, after the last draw's, reaching the span's end, for 1 to 2048 MB and up to N x 2048 draws; over two
    pools, the scene draws and binds each draw's own place, and those pages are marked written. The same compiled and run in WSL with Ubuntu's
    clang 21 and g++ 15;
  • main against itself, 5 runs a side, in each scene (draws, dispatches, mixed): the census the same (commands,
    their order, the picture, the storage buffers), every draw and dispatch reaching Vulkan; on this head again, one
    census run a side in each scene, with the data the commands point to: the same;
  • RX_VK_INDEX_REBASE=0 exported in the shell, main against itself: the driver names it as left out of both sides,
    and the census is the same;
  • the geometry pools mirrored: the renderer's log has 5 mirrors (320 MB: the world's pool and four of geometry), with
    sparse mirrors on, as in the game on this PC;
  • negative control, RX_VK_INDEX_REBASE=0 against main: the census names vkCmdBindIndexBuffer (28 calls vs 8000)
    and vkCmdDrawIndexed's arguments;
  • the picture changes with --textures 3 and with --ubos 1: each texture and uniform buffer shows in it;
  • tests/run_all.py --strict --changed origin/main (5 passed) and mise run lint; the full tests/run_all.py --strict
    in CI (both parts);
  • the two files compiled against main @ 7bc53f841's headers too (API 95), and run against its renderer.

The branch merges cleanly with main @ 7a014436f (still API 98); vk_api.h, rx_nvn.h and the shader-cache stamp
are untouched.

Still to test:

  • Linux with a Vulkan GPU: python3 -I tests/test_replay_bench.py --dll build-linux/.../longshot_vk.so, expecting the
    same output as on Windows (by hand; the bench's Linux loading path has not run on a GPU).

Measurements

Nothing to measure: tests/ and docs/ only, nothing the game runs changes; the bench's own baselines on main are under Baselines.

Baselines

Nothing to speed up here: a tool and its test. Its numbers for main on this PC, Windows 11, Ryzen 7 5700X3D,
RX 9070 XT, main against itself, 5 runs a side, us each in microseconds, the default scene (geometry pools):

main Scene Fastest frames, A / B B - A B - A a frame Medians, A / B Scene frame
bd4586c2e draws (2000) 1.393 / 1.363 -2.2 % -60 us 1.414 / 1.392 2.90 ms
bd4586c2e dispatches (150) 2.123 / 2.123 +0.0 % +0 us 2.148 / 2.167 0.39 ms
bd4586c2e mixed (2000 + 150) 1.444 / 1.445 +0.1 % +2 us 1.517 / 1.477 3.33 ms

With the eight meshes (--geom-mb 0, the default before the third commit), on bd4586c2e: draws 1.125 / 1.144 (+1.6 %),
dispatches 2.117 / 2.087 (-1.4 %), mixed 1.204 / 1.190 (-1.2 %); on 7bc53f841: 1.101 / 1.105, 2.087 / 2.037,
1.168 / 1.169. Over the A/A sets so far (four with the meshes, two with the pools: +1.4 % and the table's), the fastest
frames' B - A stayed within 2.2 % with draws and 2.4 % with dispatches alone: a smaller difference needs more runs (--runs 10) or a set repeated.
RX_VK_INDEX_REBASE=0 moved the time by -1.0 % to +0.6 % in four sets, inside that: the census sees what a change
records, the timing only what it costs above the noise.

Why the pools are the default: a cache of the draws' index and vertex lookups through the read spans
(RX_VK_GEOM_SPAN_FAST, not proposed) looked about 8 % faster a draw on an earlier draft of this bench, whose draws all
read one small index buffer (that scene is gone), and measured -2 % fps in the game over 3 pairs. Its check mode found 40 % of the game's lookups in a span. On
this bench, 7 runs a side, its switch off against on:

Geometry Off / on, fastest frames B - A B - A a frame Lookups found in a span
256 MB of pools (default) 1.276 / 1.272 -0.3 % -8 us 33 %
256 MB of pools, whole mirrors (RX_VK_MIRROR_SPARSE=0 both sides) 1.059 / 1.053 -0.5 % -11 us 91 %
eight meshes 1.014 / 1.022 +0.8 % +16 us 99.9 %

Risks

Nothing the game runs changes: tests/ and docs/ only. MKWVK_API_VERSION and the shader-cache stamp are untouched.
The bench builds against vk_api.h, rx_nvn.h, host/nvn_layout.c and vk_loader.h's function lists as they are, so
a member renamed or removed there fails its build in CI. CI cannot catch a new host callback the renderer calls
without a null check (as page_written, API 97): the bench's GPU run would crash on it until it gets a stub. It has
one for every such callback up to API 98, and builds from API 95 on (page_written behind MKWVK_API_VERSION >= 97),
so a branch on an older main can take the two files as they are.

A run takes 256 MB of guest memory for the geometry pools and as much VRAM for their mirrors (--geom-mb less for a
smaller card). The mirrors are the device's: sparse here, whole where a device has no strict sparse residency for
buffers, and a buffer lookup takes other paths there (main's span memo serves whole mirrors: a draw 1.06 us against
1.27 here): A/B a lookup change with RX_VK_MIRROR_SPARSE=0 on both sides too, as the table above.

What the census does not settle (in the how-to): where the renderer diffs mirrored write-backs on the GPU, that pass's
dispatch and its table's address enter the census, so two runs of one renderer could differ there (not on this PC;
RX_VK_WB_DIFF=0 on both sides then); and the storage hash holds each storage buffer's last dispatch's result, not
every dispatch's (a dispatch that never reaches Vulkan shows in the counts).

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Not a change the game runs.)
  • mise run test passes (any failure that also fails on main is named). (run_all --changed and lint; CI runs the rest.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

🤖 Generated with Claude Code

## Summary Measuring a change to the replay thread's per-draw path (program pick, descriptors, the recording) has meant a game run: packs, a runtime, minutes of warm-up, and frame-rate noise bigger than many of these changes. This adds a bench that measures the real renderer without the game. `tests/replay_bench.cpp` loads a built `longshot_vk.dll` as the game does, with a host of its own (a guest memory window holding its pools), and writes synthetic NVN work into it: a render target, textures, uniform, storage, index and vertex buffers, and programs of a few hand-encoded Ampere instructions that sample the textures and read the buffers, so `program_for` and `build_descriptors` do a game draw's work. It starts the renderer windowless (`start(NULL)`) on the real Vulkan device and submits each frame's command buffer as the op stream of `gpu/render/rx_nvn.h`, through the real `replay()`, `draw()` and `dispatch()`. No game code or data. It reports: - the replay's time per draw or per dispatch (scene frames against empty frames, alternated; of the fastest frames, the steadier, and of the medians), and the same times the scene's draws and dispatches: `us a frame`, to read against the game's frame (a gain of 0.06 us a draw is 120 us of a 10.6 ms frame, about 1 %, below a game A/B's noise); - with `--census`, every `vkCmd*` and descriptor update the renderer recorded, counted and hashed by kind with their arguments and the data they point to (barriers, passes' attachments, copy regions, clears; a bound descriptor set as what was written to it; handles numbered in the order first submitted, so two runs compare), and their order: each command buffer's as recorded, the buffers' as submitted, so a path that records parts on another thread compares with the serial one, and the same commands split into other buffers hash the same; how many of the scene's draws and dispatches reached Vulkan; a hash of the picture (copied to a buffer by the GPU after a scene frame) and of what the dispatches wrote. That is the check that a fast path records what its reference path does. (Windows; on Linux the renderer loads `libvulkan` itself, so the census refuses rather than report nothing.) `tests/test_replay_bench.py` builds and drives it: one renderer, two renderers (`--dll-b`), or one renderer with a switch on each side (`--env-b`; a switch the menu's settings hold is refused, as the bench has no settings), alternated runs, B - A; neither side inherits the shell's `RX_`, `HOS_`, `LONGSHOT_` or `OOT_` variables; `--keep-logs DIR` keeps each run's renderer log, where a switch's check mode counts. Its self-test runs in `tests/run_all.py`, with no GPU. The default scene is about the Market's mix: 2000 draws, a program and its bindings changed every second draw, 4 textures and 2 uniform buffers a stage, indexed draws, each draw's indices and the vertex buffer it binds at a place of their own across 256 MB of 64 MB pools that the renderer imports and mirrors on its own, as it does the game's (`--geom-mb`; 0 gives eight meshes in one pool, which every lookup finds again, as the game's do not). Read first: `tests/replay_bench.cpp` (`make_world`, `make_scene`, the census), then `docs/dev/developing.md`, "Benchmark the replay without the game". ## Testing **Tested:** Windows 11, Ryzen 7 5700X3D, RX 9070 XT (driver 32.0.32029.2010), the renderer built from `main` @ bd4586c2e and @ 7bc53f841: - the self-test (llvm-mingw clang, `host/nvn_layout.c` with its C compiler) passes, and four broken variants fail it (streams without `NOP_END`; indexed draws without their index buffer; every draw from the first geometry place; the geometry's pages left unmarked). Its census checks: a pipeline bind and a draw recorded first into a second command buffer give the serial stream and kind hashes (handles numbered as submitted), binding one pipeline twice does not; a submit the driver refuses folds and counts nothing; a barrier's access masks, a pass's attachment ops and a clearing pass's clear value change the hash, where they lie, a clear value the pass does not clear with and a depth attachment's stencil value do not; descriptor sets S and T bound in either order hash differently, and the same writes into sets of other handles (as a pool reset gives out) hash the same. Its geometry checks: each draw's 512 bytes inside a pool, after the last draw's, reaching the span's end, for 1 to 2048 MB and up to N x 2048 draws; over two pools, the scene draws and binds each draw's own place, and those pages are marked written. The same compiled and run in WSL with Ubuntu's clang 21 and g++ 15; - `main` against itself, 5 runs a side, in each scene (draws, dispatches, mixed): the census the same (commands, their order, the picture, the storage buffers), every draw and dispatch reaching Vulkan; on this head again, one census run a side in each scene, with the data the commands point to: the same; - `RX_VK_INDEX_REBASE=0` exported in the shell, `main` against itself: the driver names it as left out of both sides, and the census is the same; - the geometry pools mirrored: the renderer's log has 5 mirrors (320 MB: the world's pool and four of geometry), with sparse mirrors on, as in the game on this PC; - negative control, `RX_VK_INDEX_REBASE=0` against `main`: the census names `vkCmdBindIndexBuffer` (28 calls vs 8000) and `vkCmdDrawIndexed`'s arguments; - the picture changes with `--textures 3` and with `--ubos 1`: each texture and uniform buffer shows in it; - `tests/run_all.py --strict --changed origin/main` (5 passed) and `mise run lint`; the full `tests/run_all.py --strict` in CI (both parts); - the two files compiled against `main` @ 7bc53f841's headers too (API 95), and run against its renderer. The branch merges cleanly with `main` @ 7a014436f (still API 98); `vk_api.h`, `rx_nvn.h` and the shader-cache stamp are untouched. **Still to test:** - Linux with a Vulkan GPU: `python3 -I tests/test_replay_bench.py --dll build-linux/.../longshot_vk.so`, expecting the same output as on Windows (by hand; the bench's Linux loading path has not run on a GPU). ## Measurements Nothing to measure: `tests/` and `docs/` only, nothing the game runs changes; the bench's own baselines on `main` are under Baselines. ## Baselines Nothing to speed up here: a tool and its test. Its numbers for `main` on this PC, Windows 11, Ryzen 7 5700X3D, RX 9070 XT, `main` against itself, 5 runs a side, `us each` in microseconds, the default scene (geometry pools): | `main` | Scene | Fastest frames, A / B | B - A | B - A a frame | Medians, A / B | Scene frame | |---|---|---|---|---|---|---| | bd4586c2e | draws (2000) | 1.393 / 1.363 | -2.2 % | -60 us | 1.414 / 1.392 | 2.90 ms | | bd4586c2e | dispatches (150) | 2.123 / 2.123 | +0.0 % | +0 us | 2.148 / 2.167 | 0.39 ms | | bd4586c2e | mixed (2000 + 150) | 1.444 / 1.445 | +0.1 % | +2 us | 1.517 / 1.477 | 3.33 ms | With the eight meshes (`--geom-mb 0`, the default before the third commit), on bd4586c2e: draws 1.125 / 1.144 (+1.6 %), dispatches 2.117 / 2.087 (-1.4 %), mixed 1.204 / 1.190 (-1.2 %); on 7bc53f841: 1.101 / 1.105, 2.087 / 2.037, 1.168 / 1.169. Over the A/A sets so far (four with the meshes, two with the pools: +1.4 % and the table's), the fastest frames' B - A stayed within 2.2 % with draws and 2.4 % with dispatches alone: a smaller difference needs more runs (`--runs 10`) or a set repeated. `RX_VK_INDEX_REBASE=0` moved the time by -1.0 % to +0.6 % in four sets, inside that: the census sees what a change records, the timing only what it costs above the noise. Why the pools are the default: a cache of the draws' index and vertex lookups through the read spans (`RX_VK_GEOM_SPAN_FAST`, not proposed) looked about 8 % faster a draw on an earlier draft of this bench, whose draws all read one small index buffer (that scene is gone), and measured -2 % fps in the game over 3 pairs. Its check mode found 40 % of the game's lookups in a span. On this bench, 7 runs a side, its switch off against on: | Geometry | Off / on, fastest frames | B - A | B - A a frame | Lookups found in a span | |---|---|---|---|---| | 256 MB of pools (default) | 1.276 / 1.272 | -0.3 % | -8 us | 33 % | | 256 MB of pools, whole mirrors (`RX_VK_MIRROR_SPARSE=0` both sides) | 1.059 / 1.053 | -0.5 % | -11 us | 91 % | | eight meshes | 1.014 / 1.022 | +0.8 % | +16 us | 99.9 % | ## Risks Nothing the game runs changes: `tests/` and `docs/` only. `MKWVK_API_VERSION` and the shader-cache stamp are untouched. The bench builds against `vk_api.h`, `rx_nvn.h`, `host/nvn_layout.c` and `vk_loader.h`'s function lists as they are, so a member renamed or removed there fails its build in CI. CI cannot catch a new host callback the renderer calls without a null check (as `page_written`, API 97): the bench's GPU run would crash on it until it gets a stub. It has one for every such callback up to API 98, and builds from API 95 on (`page_written` behind `MKWVK_API_VERSION >= 97`), so a branch on an older `main` can take the two files as they are. A run takes 256 MB of guest memory for the geometry pools and as much VRAM for their mirrors (`--geom-mb` less for a smaller card). The mirrors are the device's: sparse here, whole where a device has no strict sparse residency for buffers, and a buffer lookup takes other paths there (main's span memo serves whole mirrors: a draw 1.06 us against 1.27 here): A/B a lookup change with `RX_VK_MIRROR_SPARSE=0` on both sides too, as the table above. What the census does not settle (in the how-to): where the renderer diffs mirrored write-backs on the GPU, that pass's dispatch and its table's address enter the census, so two runs of one renderer could differ there (not on this PC; `RX_VK_WB_DIFF=0` on both sides then); and the storage hash holds each storage buffer's last dispatch's result, not every dispatch's (a dispatch that never reaches Vulkan shows in the counts). ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. (Not a change the game runs.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (`run_all --changed` and lint; CI runs the rest.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(vk): a game-free bench of the replay's per-draw path, with a census of the Vulkan commands it records
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
5a0a3f2f06
tests/replay_bench.cpp loads a built longshot_vk.dll with a host of its own and replays synthetic NVN work (textures,
uniform, storage, index and vertex buffers, and hand-encoded programs that read them) on the real Vulkan device: the
time per draw or dispatch, and with --census every vkCmd* recorded, counted and hashed by kind, and the picture.
tests/test_replay_bench.py builds and drives it (A/B of two renderers or a switch) and runs its self-test in run_all.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #3046 perf(vk): add O(1) generation-guarded dynamic state and vertex-stream bind skips (RX_VK_DRAW_DYN_LEAN) — Open per-draw renderer optimization this benchmark could measure
  • issue #1517 The renderer rewrite's frame-time gates need a noise floor per machine, and the test farm's gate has none — Noise-floor concern for renderer performance measurements
Possibly related, for context: - PR #3046 perf(vk): add O(1) generation-guarded dynamic state and vertex-stream bind skips (RX_VK_DRAW_DYN_LEAN) — Open per-draw renderer optimization this benchmark could measure - issue #1517 The renderer rewrite's frame-time gates need a noise floor per machine, and the test farm's gate has none — Noise-floor concern for renderer performance measurements
test(vk): the replay bench's census keeps each command buffer's order, folded in at its submit
Some checks failed
CI / What the change needs (pull_request) Successful in 7s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
0ae642a277
The census hashed every call into one stream as it was recorded: two threads recording parts at once would mix their
orders. Each command buffer now keeps its calls from vkBeginCommandBuffer, and vkQueueSubmit2 folds them into the
stream in submit order, so a path that records parts on a helper thread compares with the serial one, and the same
calls split into other buffers hash the same. Device-level descriptor updates stay in their kind's order-free sum.
The self-test records the last call first into a second buffer and expects the serial order back, and another order
from the buffers submitted the other way round.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The benchmark can report equivalent Vulkan commands when synchronization arguments differ, and its switch comparisons can silently compare the same configuration. Its threaded census and Windows path handling also need correction before the results are reliable.

Adds a game-free renderer replay benchmark, command census, self-test and usage guide. It gives developers a faster way to investigate per-draw work, but the comparison currently has blind spots that can mislead optimization work.

Blocking (3): must change before merging.

  1. L1 tests/replay_bench.cpp:267: The census drops the pointed-to arguments of barriers and rendering commands, yet reports their hashes as command equivalence. (more on the line) Do: Hash the relevant structures and nested arrays for commands the renderer records, including dependency and rendering information, and add a negative control that changes a barrier field.
  2. L2 tests/test_replay_bench.py:211: The two sides inherit renderer switches from the invoking environment, so an A/B switch comparison can silently run the same value on both sides. (more on the line) Do: Remove inherited renderer switches from each child environment before applying explicit side values, or require and report explicit values for both sides; test an inherited value that conflicts with the intended comparison.
  3. L3 tests/replay_bench.cpp:215: Handle IDs are assigned in recording order, before command buffers are folded in submission order. (more on the line) Do: Canonicalize handles in submitted command order, including handles nested in descriptor data, and extend the split-buffer self-test with distinct handles first encountered in reverse recording order.

Should fix (2): not blocking, but worth doing before merging.

  • L4 tests/replay_bench.cpp:1220: The Windows renderer path is passed to the ANSI LoadLibrary API. (more on the line) Do: Accept the Windows command line as Unicode and load the renderer with LoadLibraryW, preserving the full path.
  • L5 tests/test_replay_bench.py:61: The self-test compiles the C layout source with CXX and ignores the configured CC. (more on the line) Do: Pass run_all's cc into the test and use it for nvn_layout.c, retaining cxx for the C++ source and link.

@fix can do L1, L2, L3, L4 and L5.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven as a reliable comparison tool. The author reports Windows self-comparisons within 1.6% for draws and 2.4% for dispatches across four sets, plus a successful index-rebase negative control; the Linux GPU path remains untested.

Other systems: The game and renderer binaries are unchanged. The tool loads the real renderer on Windows and Linux; its census currently requires the Windows loader path. Recorder threads, Vulkan synchronization and developer environment switches affect the reliability of its results.

Switches: No game switch is added, changed or removed. The benchmark defaults RX_VK_ASYNC, RX_VK_RECORDER, RX_VK_PRECOMPILE and RX_VK_FRAMEGEN to 0 only when absent from the environment; inherited values can invalidate comparisons.

Reviewed: 0ae642a277 against 4007f6eae4: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, both commits, all three changed files and the relevant renderer, loader and test-runner code around their interfaces. Skimmed the reported runs. docs/review-checklist.md and ../Tooling/AGENTS.md are absent; no translations or generated files changed.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance.
  • No game data, generated output, renderer API changes or new game switches appear in the diff.
  • The self-test includes broken stream and missing index-buffer controls, and the author reports both failing as intended.
  • The Linux census explicitly refuses to report an empty capture.

Testing: No code was run, as requested. The author reports Windows GPU and Windows/Linux self-test runs; CI checks are still running.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The benchmark can report equivalent Vulkan commands when synchronization arguments differ, and its switch comparisons can silently compare the same configuration. Its threaded census and Windows path handling also need correction before the results are reliable. Adds a game-free renderer replay benchmark, command census, self-test and usage guide. It gives developers a faster way to investigate per-draw work, but the comparison currently has blind spots that can mislead optimization work. **Blocking (3)**: must change before merging. 1. **L1** `tests/replay_bench.cpp:267`: The census drops the pointed-to arguments of barriers and rendering commands, yet reports their hashes as command equivalence. (more on the line) **Do:** Hash the relevant structures and nested arrays for commands the renderer records, including dependency and rendering information, and add a negative control that changes a barrier field. 2. **L2** `tests/test_replay_bench.py:211`: The two sides inherit renderer switches from the invoking environment, so an A/B switch comparison can silently run the same value on both sides. (more on the line) **Do:** Remove inherited renderer switches from each child environment before applying explicit side values, or require and report explicit values for both sides; test an inherited value that conflicts with the intended comparison. 3. **L3** `tests/replay_bench.cpp:215`: Handle IDs are assigned in recording order, before command buffers are folded in submission order. (more on the line) **Do:** Canonicalize handles in submitted command order, including handles nested in descriptor data, and extend the split-buffer self-test with distinct handles first encountered in reverse recording order. **Should fix (2)**: not blocking, but worth doing before merging. - **L4** `tests/replay_bench.cpp:1220`: The Windows renderer path is passed to the ANSI LoadLibrary API. (more on the line) **Do:** Accept the Windows command line as Unicode and load the renderer with LoadLibraryW, preserving the full path. - **L5** `tests/test_replay_bench.py:61`: The self-test compiles the C layout source with CXX and ignores the configured CC. (more on the line) **Do:** Pass run_all's cc into the test and use it for nvn_layout.c, retaining cxx for the C++ source and link. `@fix` can do L1, L2, L3, L4 and L5. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven as a reliable comparison tool. The author reports Windows self-comparisons within 1.6% for draws and 2.4% for dispatches across four sets, plus a successful index-rebase negative control; the Linux GPU path remains untested. **Other systems:** The game and renderer binaries are unchanged. The tool loads the real renderer on Windows and Linux; its census currently requires the Windows loader path. Recorder threads, Vulkan synchronization and developer environment switches affect the reliability of its results. **Switches:** No game switch is added, changed or removed. The benchmark defaults RX_VK_ASYNC, RX_VK_RECORDER, RX_VK_PRECOMPILE and RX_VK_FRAMEGEN to 0 only when absent from the environment; inherited values can invalidate comparisons. **Reviewed:** 0ae642a277e0 against 4007f6eae45b: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, both commits, all three changed files and the relevant renderer, loader and test-runner code around their interfaces. Skimmed the reported runs. docs/review-checklist.md and ../Tooling/AGENTS.md are absent; no translations or generated files changed.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance. - No game data, generated output, renderer API changes or new game switches appear in the diff. - The self-test includes broken stream and missing index-buffer controls, and the author reports both failing as intended. - The Linux census explicitly refuses to report an empty capture. **Testing:** No code was run, as requested. The author reports Windows GPU and Windows/Linux self-test runs; CI checks are still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -0,0 +212,4 @@
for (size_t i = 0; i < n; i++) h = (h ^ b[i]) * kFnv;
}
inline void mix_u(uint64_t& h, uint64_t v) { mix(h, &v, sizeof v); }
uint64_t handle_id(const void* h) {
Member

L3 (blocking): Handle IDs are assigned in recording order, before command buffers are folded in submission order.

When: If a helper records the later buffer first and first encounters pipeline B there, B gets ID 1 and pipeline A in the earlier buffer gets ID 2. Serial recording assigns the opposite IDs, so identical submitted commands produce different hashes; the self-test uses only draws without handles and misses this.

Do: Canonicalize handles in submitted command order, including handles nested in descriptor data, and extend the split-buffer self-test with distinct handles first encountered in reverse recording order.

**L3** (blocking): Handle IDs are assigned in recording order, before command buffers are folded in submission order. *When:* If a helper records the later buffer first and first encounters pipeline B there, B gets ID 1 and pipeline A in the earlier buffer gets ID 2. Serial recording assigns the opposite IDs, so identical submitted commands produce different hashes; the self-test uses only draws without handles and misses this. **Do:** Canonicalize handles in submitted command order, including handles nested in descriptor data, and extend the split-buffer self-test with distinct handles first encountered in reverse recording order.
@ -0,0 +264,4 @@
I_COUNT
};
// what a kind carries by pointer, mixed in (the binds' and pushes' data; barriers and passes by their numbers alone)
Member

L1 (blocking): The census drops the pointed-to arguments of barriers and rendering commands, yet reports their hashes as command equivalence.

When: For example, host_read_barrier records vkCmdPipelineBarrier2 with its stage and access masks entirely inside VkDependencyInfo. Changing or removing the host-read access mask leaves both the call hash and stream hash unchanged, so A and B can be reported as recording the same commands even though their synchronization differs.

Do: Hash the relevant structures and nested arrays for commands the renderer records, including dependency and rendering information, and add a negative control that changes a barrier field.

**L1** (blocking): The census drops the pointed-to arguments of barriers and rendering commands, yet reports their hashes as command equivalence. *When:* For example, host_read_barrier records vkCmdPipelineBarrier2 with its stage and access masks entirely inside VkDependencyInfo. Changing or removing the host-read access mask leaves both the call hash and stream hash unchanged, so A and B can be reported as recording the same commands even though their synchronization differs. **Do:** Hash the relevant structures and nested arrays for commands the renderer records, including dependency and rendering information, and add a negative control that changes a barrier field.
@ -0,0 +1217,4 @@
host.vulkan_loader_proc = h_vulkan_loader_proc;
#ifdef _WIN32
HMODULE m = LoadLibraryA(o.dll.c_str());
Member

L4 (should fix): The Windows renderer path is passed to the ANSI LoadLibrary API.

When: A renderer stored under a path containing characters outside the Windows active code page cannot be loaded even though Python can resolve and pass that path.

Do: Accept the Windows command line as Unicode and load the renderer with LoadLibraryW, preserving the full path.

**L4** (should fix): The Windows renderer path is passed to the ANSI LoadLibrary API. *When:* A renderer stored under a path containing characters outside the Windows active code page cannot be loaded even though Python can resolve and pass that path. **Do:** Accept the Windows command line as Unicode and load the renderer with LoadLibraryW, preserving the full path.
@ -0,0 +58,4 @@
encoding="utf-8")
layout = out / "nvn_layout.o"
exe = out / ("replay_bench.exe" if WINDOWS else "replay_bench")
steps = [
Member

L5 (should fix): The self-test compiles the C layout source with CXX and ignores the configured CC.

When: A developer or CI setup that supplies a required C compiler through CC has host/nvn_layout.c compiled by the independently selected C++ driver instead, so the check does not exercise the requested C toolchain and can fail when that driver cannot compile C.

Do: Pass run_all's cc into the test and use it for nvn_layout.c, retaining cxx for the C++ source and link.

**L5** (should fix): The self-test compiles the C layout source with CXX and ignores the configured CC. *When:* A developer or CI setup that supplies a required C compiler through CC has host/nvn_layout.c compiled by the independently selected C++ driver instead, so the check does not exercise the requested C toolchain and can fail when that driver cannot compile C. **Do:** Pass run_all's cc into the test and use it for nvn_layout.c, retaining cxx for the C++ source and link.
@ -0,0 +208,4 @@
def run_bench(exe, dll, env_pairs, bench_args, timeout=600):
env = dict(os.environ)
Member

L2 (blocking): The two sides inherit renderer switches from the invoking environment, so an A/B switch comparison can silently run the same value on both sides.

When: With RX_VK_INDEX_REBASE=0 already exported, running the documented pattern with --env-b RX_VK_INDEX_REBASE=0 gives A and B the disabled value and reports a near-zero difference as though it compared the default against disabled.

Do: Remove inherited renderer switches from each child environment before applying explicit side values, or require and report explicit values for both sides; test an inherited value that conflicts with the intended comparison.

**L2** (blocking): The two sides inherit renderer switches from the invoking environment, so an A/B switch comparison can silently run the same value on both sides. *When:* With RX_VK_INDEX_REBASE=0 already exported, running the documented pattern with --env-b RX_VK_INDEX_REBASE=0 gives A and B the disabled value and reports a near-zero difference as though it compared the default against disabled. **Do:** Remove inherited renderer switches from each child environment before applying explicit side values, or require and report explicit values for both sides; test an inherited value that conflicts with the intended comparison.
test(vk): the replay bench's draws find their indices and vertices across 256 MB of mirrored pools, and it reports us a frame
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
100cec3f8e
The default scene drew eight meshes from one pool, so every index and vertex lookup found what it found before. A
cache of those lookups (RX_VK_GEOM_SPAN_FAST) hit 99.9 % of them there and measured faster, but hit 40 % in the game
and gained nothing. Now each draw's indices and each vertex buffer it binds sit at a place of their own across
256 MB (--geom-mb, default 256; 0 gives the eight meshes) of 64 MB pools that the host reports and the renderer
imports and mirrors on its own, as it does the game's. That cache hits 33 % of its lookups here and gains nothing,
as in the game.

The driver also prints us a frame beside us each (times the scene's draws and dispatches), to read against the
game's frame, and keeps each run's renderer log with --keep-logs DIR, for a switch's check mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(dev): the replay bench's mirrors are the device's: a buffer lookup change is also measured with whole ones
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
5b4e638fed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
test(vk): the replay bench's census hashes what commands point to and numbers handles as submitted
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
1576a1c83e
Review 3568 and a second review of the newer commits:
- The census hashes the data a command carries by pointer: barriers, passes' attachments (the clear value only when
  the pass clears, the resolve target only when it resolves), conditional rendering, copy, blit and resolve regions,
  clears, vkCmdUpdateBuffer's bytes, blend constants and the colour-blend arrays. Left out: pNext chains and
  vkCmdSetCheckpointNV's marker.
- A command's handles are numbered at its buffer's submit, as first submitted, and the command is counted there:
  a part recorded first on another thread hashes as the serial path. Descriptor sets' updates, made on the device,
  are counted and numbered as made. A submit the driver refuses folds nothing.
- Neither side inherits the shell's RX_, HOS_, LONGSHOT_ or OOT_ variables; the driver names those it leaves out.
- Windows loads --dll from the UTF-16 command line; host/nvn_layout.c is built with run_all's C compiler (--cc).
- Each draw's geometry place is 512 bytes at a multiple of 512 into its pool, so none crosses a pool's end
  (--draws 12 faulted); options whose draws would share places are refused.
- The self-test checks the places for any size and draws the options take, and over two pools the scene's own
  addresses and the pages' write marks; benches that draw from one place or leave the pages unmarked must fail it.
- --keep-logs keeps a run's log when it times out; the single-renderer report gives the medians' us a frame too;
  the guide says an integrated GPU mirrors nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks: all five fixed in 1576a1c83.

  • L1 (pointed-to data): the census now hashes what each kind the renderer records carries by pointer. Barriers: dependency flags, each barrier's stage and access masks, buffer barriers' queue families, buffer, offset and size, image barriers' layouts, queue families, image and subresource range. vkCmdBeginRendering: flags, area, layers, view mask, and each attachment's view, layout and resolve mode, the resolve target only when it resolves, load and store ops, the clear value only when it clears (16 bytes for colour, 8 for depth and stencil). Also conditional rendering, copy, blit and resolve regions, the clears, vkCmdUpdateBuffer's bytes, blend constants and the colour-blend arrays. Structs taken by their bytes have a static_assert on their size, so no padding gets in. Left out: pNext chains, and vkCmdSetCheckpointNV's marker (the renderer's own pointer). New self-test controls: a barrier whose dstAccessMask changes hashes differently, while the same barrier at another address hashes the same; changing an attachment's storeOp changes the hash, while its clear value does not when it loads.
  • L2 (inherited switches): each side's environment drops the shell's RX_, HOS_, LONGSHOT_ and OOT_ variables before applying its --env-a / --env-b pairs, and the driver prints what it dropped. check_child_env runs in run_all. With RX_VK_INDEX_REBASE=0 exported, main against itself now names the variable and the census stays equal.
  • L3 (record-time numbering): a command's handles are kept as places within the call and numbered at submit, in the order first submitted. Kinds are counted at submit too. In the new self-test, recording bind P2, draw 4 into a second buffer first and then bind P1, draw 3 into the first, submitted {first, second}, gives the serial stream and kind hashes; binding P1 twice gives other ones. Descriptor set updates happen on the device, so they are still counted and numbered as they are made (documented).
  • L4 (non-ANSI paths): on Windows, --dll loads from the UTF-16 command line (CommandLineToArgvW + LoadLibraryW); links shell32.
  • L5 (CC): RUN_ALL_ARGS passes --cc {cc}, and host/nvn_layout.c is built with it. The C++ compiler compiles it as C only when no --cc is given.

A second review of the newer commits found more problems, also fixed here:

  • Geometry places are now 512 bytes, at multiples of 512 into their pool, so none crosses a pool's end (--draws 12 faulted).
  • Options whose draws would share places are refused.
  • The self-test now checks the scene's own index and vertex addresses and the geometry pages' write marks over two pools. Two more broken variants (every draw from one place, the pages unmarked) must fail it.
  • A submit the driver refuses folds nothing.
  • --keep-logs keeps a run's log when it times out.
  • The single-renderer report gives the medians' us a frame too.
  • The guide says an integrated GPU mirrors nothing.

Verified on 1576a1c83 against main @ bd4586c2e's renderer (RX 9070 XT):

  • The self-test passes with llvm-mingw clang and in WSL with clang 21 and g++ 15, and all four broken variants fail it.
  • main against itself records the same census in each scene: commands with their pointed-to data, their order, the picture and the storage buffers.
  • RX_VK_INDEX_REBASE=0 against main names vkCmdBindIndexBuffer (28 calls vs 8000) and vkCmdDrawIndexed's arguments.
  • The two files compile against API 95's headers.
  • run_all --strict --changed (5 passed) and mise run lint pass.
Thanks: all five fixed in 1576a1c83. - **L1** (pointed-to data): the census now hashes what each kind the renderer records carries by pointer. Barriers: dependency flags, each barrier's stage and access masks, buffer barriers' queue families, buffer, offset and size, image barriers' layouts, queue families, image and subresource range. `vkCmdBeginRendering`: flags, area, layers, view mask, and each attachment's view, layout and resolve mode, the resolve target only when it resolves, load and store ops, the clear value only when it clears (16 bytes for colour, 8 for depth and stencil). Also conditional rendering, copy, blit and resolve regions, the clears, `vkCmdUpdateBuffer`'s bytes, blend constants and the colour-blend arrays. Structs taken by their bytes have a `static_assert` on their size, so no padding gets in. Left out: `pNext` chains, and `vkCmdSetCheckpointNV`'s marker (the renderer's own pointer). New self-test controls: a barrier whose `dstAccessMask` changes hashes differently, while the same barrier at another address hashes the same; changing an attachment's `storeOp` changes the hash, while its clear value does not when it loads. - **L2** (inherited switches): each side's environment drops the shell's `RX_`, `HOS_`, `LONGSHOT_` and `OOT_` variables before applying its `--env-a` / `--env-b` pairs, and the driver prints what it dropped. `check_child_env` runs in `run_all`. With `RX_VK_INDEX_REBASE=0` exported, `main` against itself now names the variable and the census stays equal. - **L3** (record-time numbering): a command's handles are kept as places within the call and numbered at submit, in the order first submitted. Kinds are counted at submit too. In the new self-test, recording `bind P2, draw 4` into a second buffer first and then `bind P1, draw 3` into the first, submitted {first, second}, gives the serial stream and kind hashes; binding P1 twice gives other ones. Descriptor set updates happen on the device, so they are still counted and numbered as they are made (documented). - **L4** (non-ANSI paths): on Windows, `--dll` loads from the UTF-16 command line (`CommandLineToArgvW` + `LoadLibraryW`); links `shell32`. - **L5** (CC): `RUN_ALL_ARGS` passes `--cc {cc}`, and `host/nvn_layout.c` is built with it. The C++ compiler compiles it as C only when no `--cc` is given. A second review of the newer commits found more problems, also fixed here: - Geometry places are now 512 bytes, at multiples of 512 into their pool, so none crosses a pool's end (`--draws 12` faulted). - Options whose draws would share places are refused. - The self-test now checks the scene's own index and vertex addresses and the geometry pages' write marks over two pools. Two more broken variants (every draw from one place, the pages unmarked) must fail it. - A submit the driver refuses folds nothing. - `--keep-logs` keeps a run's log when it times out. - The single-renderer report gives the medians' `us a frame` too. - The guide says an integrated GPU mirrors nothing. Verified on 1576a1c83 against `main` @ bd4586c2e's renderer (RX 9070 XT): - The self-test passes with llvm-mingw clang and in WSL with clang 21 and g++ 15, and all four broken variants fail it. - `main` against itself records the same census in each scene: commands with their pointed-to data, their order, the picture and the storage buffers. - `RX_VK_INDEX_REBASE=0` against `main` names `vkCmdBindIndexBuffer` (28 calls vs 8000) and `vkCmdDrawIndexed`'s arguments. - The two files compile against API 95's headers. - `run_all --strict --changed` (5 passed) and `mise run lint` pass.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The five ledger items are resolved, and the reported Windows runs show the bench working. The pull request remains WIP and its CI checks are still running. Nothing blocking is left. Recommend approval; not approved on the forge.

Adds a game-free renderer benchmark and command census for comparing replay paths, with documentation and self-tests. It gives renderer developers a faster comparison tool at the cost of maintaining the synthetic host and Vulkan census.

Since the last review (on 0ae642a277)
Resolved: L1 (The census drops the pointed-to arguments of barriers and rendering commands, yet reports…); L2 (The two sides inherit renderer switches from the invoking environment, so an A/B switch co…); L3 (Handle IDs are assigned in recording order, before command buffers are folded in submissio…); L4 (The Windows renderer path is passed to the ANSI LoadLibrary API.); L5 (The self-test compiles the C layout source with CXX and ignores the configured CC.)

Checks: Still running: 11 checks.

Also noticed (1; not asked for, not blocking)
  • The Linux GPU loading path still needs the run described in the pull request.
More: does it help, other systems, switches, what was read

Does it help: Not a game performance change. The author reports matching Windows A/A censuses and a negative control that identifies changed index-buffer commands; Linux GPU execution remains untested.

Other systems: The game and renderer are unchanged. The bench loads renderer builds on Windows and Linux; its Windows census has reported GPU coverage, while the Linux loading path has not yet run on a Vulkan GPU.

Switches: No game switches added, changed or removed. The benchmark adds --geom-mb, defaulting to 256 MB, and --keep-logs, disabled by default; the driver now removes inherited RX_, HOS_, LONGSHOT_ and OOT_ variables before applying each side's explicit environment.

Reviewed: 1576a1c83e against 4007f6eae4: Read AGENTS.md, CONTRIBUTING.md and the pull request template in full. Reviewed the changes since the ledger and the census and driver code relevant to its items; the full benchmark, developer guide and renderer callers were not read in full.; nothing run (a code review).

Checked and fine:

  • Failed queue submissions do not fold their commands into the census.
  • The environment self-test checks both removal and explicit replacement of inherited switches.

Testing: No commands from the pull request were run. The author reports Windows GPU and self-test coverage; CI is still running.

Overlaps and merge order: Not checked; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The five ledger items are resolved, and the reported Windows runs show the bench working. The pull request remains WIP and its CI checks are still running. Nothing blocking is left. Recommend approval; not approved on the forge. Adds a game-free renderer benchmark and command census for comparing replay paths, with documentation and self-tests. It gives renderer developers a faster comparison tool at the cost of maintaining the synthetic host and Vulkan census. **Since the last review** (on 0ae642a277e0) Resolved: L1 (The census drops the pointed-to arguments of barriers and rendering commands, yet reports…); L2 (The two sides inherit renderer switches from the invoking environment, so an A/B switch co…); L3 (Handle IDs are assigned in recording order, before command buffers are folded in submissio…); L4 (The Windows renderer path is passed to the ANSI LoadLibrary API.); L5 (The self-test compiles the C layout source with CXX and ignores the configured CC.) **Checks:** Still running: 11 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The Linux GPU loading path still needs the run described in the pull request. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Not a game performance change. The author reports matching Windows A/A censuses and a negative control that identifies changed index-buffer commands; Linux GPU execution remains untested. **Other systems:** The game and renderer are unchanged. The bench loads renderer builds on Windows and Linux; its Windows census has reported GPU coverage, while the Linux loading path has not yet run on a Vulkan GPU. **Switches:** No game switches added, changed or removed. The benchmark adds --geom-mb, defaulting to 256 MB, and --keep-logs, disabled by default; the driver now removes inherited RX_, HOS_, LONGSHOT_ and OOT_ variables before applying each side's explicit environment. **Reviewed:** 1576a1c83eb4 against 4007f6eae45b: Read AGENTS.md, CONTRIBUTING.md and the pull request template in full. Reviewed the changes since the ledger and the census and driver code relevant to its items; the full benchmark, developer guide and renderer callers were not read in full.; nothing run (a code review). **Checked and fine:** - Failed queue submissions do not fold their commands into the census. - The environment self-test checks both removal and explicit replacement of inherited switches. **Testing:** No commands from the pull request were run. The author reports Windows GPU and self-test coverage; CI is still running. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.</sub>
test(vk): the replay bench's census hashes a bound descriptor set as what was written to it
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2ee5ee1198
A review of 1576a1c83:
- A bound descriptor set is hashed as its writes since it was allocated (their handles numbered with the bind's
  command), not by its handle: which update a bind uses shows, and a set handle a pool reset gives out again does
  not. Descriptor writes, made on the device, number their handles by their places in the write.
- vkCmdUpdateBuffer's bytes are left out again: the guest page table's device addresses differ from run to run.
- Clears hash depth and stencil only where their aspect is cleared.
- The census is read after any submit still folding (RX_VK_ASYNC=1).
- --geom-mb shares its places out over the whole span however many draws (90000 in 72 MB stayed in one pool).
- Self-test: a clearing pass's clear value and a depth attachment's unread stencil value, a refused submit's counts,
  and bound sets in two orders and under other handles.
- A C compiler given with flags (CC="ccache clang") builds nvn_layout.c; the bench's output is read as UTF-8 with
  replacement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Pushed 2ee5ee119, from a second review of 1576a1c83:

  • A bound descriptor set is now hashed as what was written to it since its allocation, with its handles numbered alongside the bind's command. It is no longer hashed by its own handle, so which update a bind used now shows, and a set handle that a pool reset gives out again no longer changes the hash.
  • vkCmdUpdateBuffer's bytes are left out again: they carry the guest page table's device addresses, which differ from run to run.
  • Clears hash depth and stencil only for the aspects they clear.
  • The census is read only after any submit that is still being folded in (RX_VK_ASYNC=1).
  • --geom-mb now shares its places out over the whole span, however many draws.
  • New self-test checks cover each of these.

Verified on 2ee5ee119 against the same renderer, with the same set as before:

  • The self-tests pass on Windows and in WSL, and all four broken variants fail them.
  • main against itself records the same census in each scene.
  • The RX_VK_INDEX_REBASE=0 negative control still names vkCmdBindIndexBuffer, and an exported RX_VK_INDEX_REBASE=0 stays out of both sides.
  • The two files compile against API 95's headers.
  • run_all --strict --changed and lint pass.
Pushed 2ee5ee119, from a second review of 1576a1c83: - A bound descriptor set is now hashed as what was written to it since its allocation, with its handles numbered alongside the bind's command. It is no longer hashed by its own handle, so which update a bind used now shows, and a set handle that a pool reset gives out again no longer changes the hash. - `vkCmdUpdateBuffer`'s bytes are left out again: they carry the guest page table's device addresses, which differ from run to run. - Clears hash depth and stencil only for the aspects they clear. - The census is read only after any submit that is still being folded in (`RX_VK_ASYNC=1`). - `--geom-mb` now shares its places out over the whole span, however many draws. - New self-test checks cover each of these. Verified on 2ee5ee119 against the same renderer, with the same set as before: - The self-tests pass on Windows and in WSL, and all four broken variants fail them. - `main` against itself records the same census in each scene. - The `RX_VK_INDEX_REBASE=0` negative control still names `vkCmdBindIndexBuffer`, and an exported `RX_VK_INDEX_REBASE=0` stays out of both sides. - The two files compile against API 95's headers. - `run_all --strict --changed` and lint pass.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The bench has working Windows results and adds no code to the game. It remains WIP, and its Linux GPU run and CI checks are still outstanding. Nothing blocking is left. Recommend approval; not approved on the forge.

Adds a game-free replay benchmark and Vulkan command census for comparing renderer changes, plus a driver and developer guide. It makes renderer experiments easier to assess at the cost of maintaining a substantial test tool.

Since the last review (on 1576a1c83e)
Nothing changed in the ledger.

Checks: Still running: 11 checks.

Also noticed (2; not asked for, not blocking)
  • The census intentionally omits vkCmdUpdateBuffer payloads and pNext chains, as the guide explains.
  • The Linux renderer loading path still needs the GPU run listed in the PR.
More: does it help, other systems, switches, what was read

Does it help: Not a game performance change. Windows A/A runs reported census agreement and timing variation within 2.2% for draws and 2.4% for dispatches; the Linux GPU path has not yet been run.

Other systems: The tool loads the renderer on Windows and Linux; the census is available only where Vulkan is loaded through the host. It does not change game runtime code.

Switches: No game switches added or changed. The bench defaults RX_VK_ASYNC, RX_VK_RECORDER, RX_VK_PRECOMPILE and RX_VK_FRAMEGEN to 0 unless supplied explicitly; those defaults suit its synchronous timing purpose.

Reviewed: 2ee5ee1198 against 4007f6eae4: Read the changes since 1576a1c83, the developer-guide addition, repository instructions, contribution rules and PR template; inspected the benchmark and driver and the renderer descriptor and buffer-update paths. The full benchmark output was truncated during reading, so not every changed code file was verified in full.; nothing run (a code review).

Checked and fine:

  • The geometry placement calculation spreads distinct 512-byte slots across the requested span.
  • Descriptor-set contents are cleared when a set handle is allocated again.
  • The driver parses the C compiler command consistently with run_all and decodes child output as UTF-8.

Testing: No commands from the project were run. The author reports Windows and WSL self-tests and Windows GPU census runs; CI is still running.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The bench has working Windows results and adds no code to the game. It remains WIP, and its Linux GPU run and CI checks are still outstanding. Nothing blocking is left. Recommend approval; not approved on the forge. Adds a game-free replay benchmark and Vulkan command census for comparing renderer changes, plus a driver and developer guide. It makes renderer experiments easier to assess at the cost of maintaining a substantial test tool. **Since the last review** (on 1576a1c83eb4) Nothing changed in the ledger. **Checks:** Still running: 11 checks. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The census intentionally omits vkCmdUpdateBuffer payloads and pNext chains, as the guide explains. - The Linux renderer loading path still needs the GPU run listed in the PR. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Not a game performance change. Windows A/A runs reported census agreement and timing variation within 2.2% for draws and 2.4% for dispatches; the Linux GPU path has not yet been run. **Other systems:** The tool loads the renderer on Windows and Linux; the census is available only where Vulkan is loaded through the host. It does not change game runtime code. **Switches:** No game switches added or changed. The bench defaults RX_VK_ASYNC, RX_VK_RECORDER, RX_VK_PRECOMPILE and RX_VK_FRAMEGEN to 0 unless supplied explicitly; those defaults suit its synchronous timing purpose. **Reviewed:** 2ee5ee11985b against 4007f6eae45b: Read the changes since 1576a1c83, the developer-guide addition, repository instructions, contribution rules and PR template; inspected the benchmark and driver and the renderer descriptor and buffer-update paths. The full benchmark output was truncated during reading, so not every changed code file was verified in full.; nothing run (a code review). **Checked and fine:** - The geometry placement calculation spreads distinct 512-byte slots across the requested span. - Descriptor-set contents are cleared when a set handle is allocated again. - The driver parses the C compiler command consistently with run_all and decodes child output as UTF-8. **Testing:** No commands from the project were run. The author reports Windows and WSL self-tests and Windows GPU census runs; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by klimovich008. Nothing was run; a maintainer decides.</sub>
test(vk): the replay bench keeps descriptor sets written in the warm-up, and reads its census once it is over
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
CI / What the change needs (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
864a440d96
A review of 2ee5ee119:
- With --census, descriptor sets' writes are kept from the start, so a set written in the warm-up and bound in the
  measured frames hashes as what was written; they are counted only in the measured frames.
- Each census call reads census_on again under the census lock, so a submit or command that saw the census on
  before main ended it adds nothing while main reads.
- The renderer's log lines (its threads) take a lock that main holds for its last read and close.
- --geom-mb's first draw takes the span's first place and the last draw its last: 8 draws in 72 MB reach the
  second pool.
- Self-test: a depth attachment's depth value, a set given out again by an allocation, a set written before the
  measured frames.
- --runs below 1 is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
CI / What the change needs (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/replay-bench:klimovich008-perf/replay-bench'
git switch 'klimovich008-perf/replay-bench'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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!3268
No description provided.