fix(vk): report native shader keys in draw statistics #169

Merged
HumanBean merged 4 commits from klimovich008/Longshot:codex/longshot-draw-stats378 into main 2026-11-19 07:44:22 +00:00
Member

Type: fix · Risk: low · Tested on: Windows 11, RX 9070 XT; Linux (WSL Ubuntu): vk_draw.cpp as an object and the fixture only · Needs: Linux, any GPU (T-FVS2)

Why

RX_VK_DRAW_STATS reports how many draws each program made in a frame, but not which native shaders it ran, so a missing or wrong piece of geometry in the report can't be traced back to the game's shader. This adds the native stage keys to the report. The tracker was searched (forge.py issue list); no issue covers it.

How to reproduce

Seen on: any OS and GPU
Settings and switches: RX_VK_DRAW_STATS=<folder>, with <folder>/draw_stats.now created to measure one frame
Steps: on main, measure a frame and open the report written in that folder
Expected: each program's rows name the native shader keys it was recorded with
Actual: only per-program counts; no native keys, so programs loaded from the cache can't be identified

What changed

Each statistics query now copies the program's four native stage keys when it is recorded, and the report adds code rows grouped by those keys. Off unless RX_VK_DRAW_STATS is set.

  • gpu/vk/vk_draw.cpp: StatsMeta/StatsQuery copy the keys at record time (graphics, mesh and compute) into the bounded query slot; stats_code_keys groups and writes the code rows. The occlusion queries' OccGuard and its ordering are unchanged.
  • tests/test_draw_stats_codes.py (new): the real snapshot/report code, cut from the source.
  • docs/development.md: a "Draw statistics" section; two docs/tested/ run files.

Measurements

Verdict: the report gains its native code rows (one a report in the measured frame); no performance effect claimed: the A/B differences are within run-to-run spread.

Hardware: Windows 11, RX 9070 XT, AMD 26.10.2, Ryzen 7 5700X3D, 64 GB
Scene: Hyrule Field (the standard test's save), camera turning at full speed; 1280x720 window (16:9), fixed Custom profile, no upscaler, no frame generation, HOS_FPS_MAX=240
Method: the standard test (std_test.py) with RX_VK_DRAW_STATS on both arms and draw_stats.now present at the start (one frame measured, at boot), 20 s windows, 3 alternating pairs without warm-ups, all valid; the median; code rows counted in each report.
How to reproduce: set RX_VK_DRAW_STATS=<folder>, create <folder>/draw_stats.now, start the game; the report in <folder> has code rows
Baseline: this PR measured as its code and test on main 839e85ff (66f11e37, a renderer-only pack, docs left out).

Before: main @ 839e85ff After: this PR @ 6660e13b
fps, runs (median) 63.99, 63.09, 60.14 (63.09) 64.89, 63.45, 61.24 (63.45)
CPU ms a frame, median 66.12 64.78
native code rows a report 0 1
r169s-ctl-0 63.99 fps; r169s-pr169-0 64.89; r169s-pr169-1 63.45; r169s-ctl-1 63.09; r169s-ctl-2 60.14; r169s-pr169-2 61.24 (std_test, 2026-11-14)

Flags and settings

None new. The existing RX_VK_DRAW_STATS stays off by default.

Testing

Tested:

  • tests/test_draw_stats_codes.py: snapshots and report for graphics, mesh and compute, lifetime, distinct tuples, inactive capture and capacity; fails on main (no native-key report), passes here. Windows (llvm-mingw clang) and Linux (clang 21, WSL). Since 8449fbf5 it cuts the source with tests/srccut.py: on Windows it passes, cuts the same text as the old counter (SRCCUT_CHECK_NAIVE=1), stops with srccut's message on a source with a second struct StatsQuery {, and fails on main 876dc360's vk_draw.cpp.
  • python -I -B tests/run_all.py --jobs 4 (Windows, llvm-mingw 20261104, switches cleared) at 8449fbf5: 610 passed, 23 failed, 45 skipped. On clean main 71b1edd8: 609 passed, 23 failed, 45 skipped (this PR adds one test). The failure lists are identical: test_audio_output_devices.py, test_auto_handheld.py, test_bug_report_defaults.py, test_crash_dialog.py, test_crt_options.py, test_dlss_feature_size.py, test_failed_compile_keeps_objects.py, test_fsr_uniform_ownership.py, test_guest_imported.py, test_import_reach.py, test_job_queue.py, test_linux_preflight.py, test_longshot_ctl.py, test_make_game_cache.py, test_missing_nup.py, test_pads_after_menu.py, test_parallel_init_order.py, test_pending_guest_import.py, test_replay_write_order.py, test_run_all_changed.py, test_tested_configurations.py, test_vk_occlusion_queries.py, test_walk_key.py. (The earlier run at aa9af402 had 608/25/45 with the same 25 on main; their names were not recorded.)
  • Linux (WSL Ubuntu): vk_draw.cpp compiled to an object with clang 21 and the build's Linux flags, and the fixture above. No full Linux build or link was made.
  • In the game, Windows RX 9070 XT, the check this PR asked for (T-FVS2), 2026-11-17 00:14Z: a renderer built from main 0cab3548 plus this PR's two commits and #239's four (longshot_vk.dll sha256 c3bba234...; the pack tool takes one renderer per runtime; #239's code runs only with RX_VK_LOG_PROGRAM_LIFE, unset here), Hyrule, render thread on, draw_stats.now created during play, 30 s after the load: one report for frame 6647 (1,969 queries, 368 programs, query result VK_SUCCESS); per-program rows for 261 draw, 42 mesh and 65 compute programs, and a code row with non-zero native keys for every one of them (compute: 130 dispatches); no error or draw-stats failure lines.
  • In the game, Windows RX 9070 XT: the A/B above. Code review: bibiburl (no defect).

Not tested: the same capture on Linux (the linked Linux renderer); a full Linux build. Resident memory and commit charge with the switch unset (see Risks).

Must be tested:

  • Linux, any GPU: play with RX_VK_DRAW_STATS=<folder> and create <folder>/draw_stats.now during play, expecting the report to keep its per-program counts and add code rows for graphics and compute programs, with no error lines (Test Farm: @Beanstalk request on this PR, linux, for no crash or error lines with the switch on; it creates the trigger before the start, so it does not close this. The code rows during play by hand: test request T-FVS2, open; asked of a tester with a Linux PC in #agent-updates on 2026-11-18 at 15:47Z, with the mesh rows where present and the query result)

Risks

What could break: behaviour: nothing with RX_VK_DRAW_STATS unset; with it on, the report gains rows. Memory: the 32,768 query slots' static metadata (stats_meta) gains four 64-bit keys each, 1 MiB more static storage, also with the switch unset. How much of it becomes resident or adds to the commit charge was not measured. The per-query key copies and the report's grouping map run only while a frame is captured and reported.

Turning it off: leave RX_VK_DRAW_STATS unset (the default), or revert the commit.

Compatibility: Nothing changes.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (What was done: Windows, the renderer built and ran. Linux, only vk_draw.cpp compiled to an object and the fixture, under WSL. No full Linux build or link; that is T-FVS2.)
  • Docs updated.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Windows 11, RX 9070 XT; Linux (WSL Ubuntu): `vk_draw.cpp` as an object and the fixture only · **Needs:** Linux, any GPU (T-FVS2) ## Why `RX_VK_DRAW_STATS` reports how many draws each program made in a frame, but not which native shaders it ran, so a missing or wrong piece of geometry in the report can't be traced back to the game's shader. This adds the native stage keys to the report. The tracker was searched (`forge.py issue list`); no issue covers it. ## How to reproduce **Seen on:** any OS and GPU **Settings and switches:** `RX_VK_DRAW_STATS=<folder>`, with `<folder>/draw_stats.now` created to measure one frame **Steps:** on main, measure a frame and open the report written in that folder **Expected:** each program's rows name the native shader keys it was recorded with **Actual:** only per-program counts; no native keys, so programs loaded from the cache can't be identified ## What changed Each statistics query now copies the program's four native stage keys when it is recorded, and the report adds `code` rows grouped by those keys. Off unless `RX_VK_DRAW_STATS` is set. - `gpu/vk/vk_draw.cpp`: `StatsMeta`/`StatsQuery` copy the keys at record time (graphics, mesh and compute) into the bounded query slot; `stats_code_keys` groups and writes the `code` rows. The occlusion queries' `OccGuard` and its ordering are unchanged. - `tests/test_draw_stats_codes.py` (new): the real snapshot/report code, cut from the source. - `docs/development.md`: a "Draw statistics" section; two `docs/tested/` run files. ## Measurements **Verdict:** the report gains its native code rows (one a report in the measured frame); no performance effect claimed: the A/B differences are within run-to-run spread. Hardware: Windows 11, RX 9070 XT, AMD 26.10.2, Ryzen 7 5700X3D, 64 GB Scene: Hyrule Field (the standard test's save), camera turning at full speed; 1280x720 window (16:9), fixed Custom profile, no upscaler, no frame generation, `HOS_FPS_MAX=240` Method: the standard test (std_test.py) with `RX_VK_DRAW_STATS` on both arms and `draw_stats.now` present at the start (one frame measured, at boot), 20 s windows, 3 alternating pairs without warm-ups, all valid; the median; `code` rows counted in each report. How to reproduce: set `RX_VK_DRAW_STATS=<folder>`, create `<folder>/draw_stats.now`, start the game; the report in `<folder>` has `code` rows Baseline: this PR measured as its code and test on main 839e85ff (66f11e37, a renderer-only pack, docs left out). | | Before: main @ 839e85ff | After: this PR @ 6660e13b | |---|---|---| | fps, runs (median) | 63.99, 63.09, 60.14 (63.09) | 64.89, 63.45, 61.24 (63.45) | | CPU ms a frame, median | 66.12 | 64.78 | | native `code` rows a report | 0 | 1 | ``` r169s-ctl-0 63.99 fps; r169s-pr169-0 64.89; r169s-pr169-1 63.45; r169s-ctl-1 63.09; r169s-ctl-2 60.14; r169s-pr169-2 61.24 (std_test, 2026-11-14) ``` ### Flags and settings None new. The existing `RX_VK_DRAW_STATS` stays off by default. ## Testing **Tested:** - `tests/test_draw_stats_codes.py`: snapshots and report for graphics, mesh and compute, lifetime, distinct tuples, inactive capture and capacity; fails on main (no native-key report), passes here. Windows (llvm-mingw clang) and Linux (clang 21, WSL). Since 8449fbf5 it cuts the source with `tests/srccut.py`: on Windows it passes, cuts the same text as the old counter (`SRCCUT_CHECK_NAIVE=1`), stops with srccut's message on a source with a second `struct StatsQuery {`, and fails on main 876dc360's `vk_draw.cpp`. - `python -I -B tests/run_all.py --jobs 4` (Windows, llvm-mingw 20261104, switches cleared) at 8449fbf5: 610 passed, 23 failed, 45 skipped. On clean main 71b1edd8: 609 passed, 23 failed, 45 skipped (this PR adds one test). The failure lists are identical: `test_audio_output_devices.py`, `test_auto_handheld.py`, `test_bug_report_defaults.py`, `test_crash_dialog.py`, `test_crt_options.py`, `test_dlss_feature_size.py`, `test_failed_compile_keeps_objects.py`, `test_fsr_uniform_ownership.py`, `test_guest_imported.py`, `test_import_reach.py`, `test_job_queue.py`, `test_linux_preflight.py`, `test_longshot_ctl.py`, `test_make_game_cache.py`, `test_missing_nup.py`, `test_pads_after_menu.py`, `test_parallel_init_order.py`, `test_pending_guest_import.py`, `test_replay_write_order.py`, `test_run_all_changed.py`, `test_tested_configurations.py`, `test_vk_occlusion_queries.py`, `test_walk_key.py`. (The earlier run at aa9af402 had 608/25/45 with the same 25 on main; their names were not recorded.) - Linux (WSL Ubuntu): `vk_draw.cpp` compiled to an object with clang 21 and the build's Linux flags, and the fixture above. No full Linux build or link was made. - In the game, Windows RX 9070 XT, the check this PR asked for (T-FVS2), 2026-11-17 00:14Z: a renderer built from main 0cab3548 plus this PR's two commits and #239's four (`longshot_vk.dll` sha256 `c3bba234...`; the pack tool takes one renderer per runtime; #239's code runs only with `RX_VK_LOG_PROGRAM_LIFE`, unset here), Hyrule, render thread on, `draw_stats.now` created **during play**, 30 s after the load: one report for frame 6647 (1,969 queries, 368 programs, query result VK_SUCCESS); per-program rows for 261 draw, 42 mesh and 65 compute programs, and **a `code` row with non-zero native keys for every one of them** (compute: 130 dispatches); no error or draw-stats failure lines. - In the game, Windows RX 9070 XT: the A/B above. Code review: bibiburl (no defect). **Not tested:** the same capture on Linux (the linked Linux renderer); a full Linux build. Resident memory and commit charge with the switch unset (see Risks). **Must be tested:** - Linux, any GPU: play with `RX_VK_DRAW_STATS=<folder>` and create `<folder>/draw_stats.now` during play, expecting the report to keep its per-program counts and add `code` rows for graphics and compute programs, with no error lines (Test Farm: `@Beanstalk` request on this PR, linux, for no crash or error lines with the switch on; it creates the trigger before the start, so it does not close this. The `code` rows during play by hand: test request T-FVS2, open; asked of a tester with a Linux PC in #agent-updates on 2026-11-18 at 15:47Z, with the mesh rows where present and the query result) ## Risks **What could break:** behaviour: nothing with `RX_VK_DRAW_STATS` unset; with it on, the report gains rows. Memory: the 32,768 query slots' static metadata (`stats_meta`) gains four 64-bit keys each, 1 MiB more static storage, **also with the switch unset**. How much of it becomes resident or adds to the commit charge was not measured. The per-query key copies and the report's grouping map run only while a frame is captured and reported. **Turning it off:** leave `RX_VK_DRAW_STATS` unset (the default), or revert the commit. **Compatibility:** Nothing changes. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (What was done: Windows, the renderer built and ran. Linux, only `vk_draw.cpp` compiled to an object and the fixture, under WSL. No full Linux build or link; that is T-FVS2.) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member

From Codex's review: Source review found no code defect at 684333d3. The production-block C++ fixture fails against main 39647e1a and passes with this change, covering snapshot lifetime, distinct tuples, graphics/mesh/compute, inactive recording and query capacity. The full Windows source suite completed in two 4-worker shards: 497 passed, 4 failed, 38 skipped. Failure names are listed in the description; a release recheck with the existing OpenSSL still failed checksum/trust fixtures, so those failures have not been cleared. Longshot gameplay, full validation and a refresh onto the selected new main remain pending. This stays WIP.

From Codex's review: Source review found no code defect at 684333d3. The production-block C++ fixture fails against main 39647e1a and passes with this change, covering snapshot lifetime, distinct tuples, graphics/mesh/compute, inactive recording and query capacity. The full Windows source suite completed in two 4-worker shards: 497 passed, 4 failed, 38 skipped. Failure names are listed in the description; a release recheck with the existing OpenSSL still failed checksum/trust fixtures, so those failures have not been cleared. Longshot gameplay, full validation and a refresh onto the selected new main remain pending. This stays WIP.
Author
Member

Merged the shared test base and reran all source checks: 496 passed, 4 existing main failures, 37 skipped. The focused check fails on the old source and passes here. Gameplay and latest-main refresh remain pending; stays WIP.

Merged the shared test base and reran all source checks: 496 passed, 4 existing main failures, 37 skipped. The focused check fails on the old source and passes here. Gameplay and latest-main refresh remain pending; stays WIP.
Author
Member

Merged current main and resolved the documentation conflict. Full source checks: 483 passed, 5 failed, 35 skipped; all five failures also reproduce on unmodified main. The native-key check fails on old source and passes here. Gameplay and Vulkan validation remain pending; this stays WIP.

Merged current main and resolved the documentation conflict. Full source checks: 483 passed, 5 failed, 35 skipped; all five failures also reproduce on unmodified main. The native-key check fails on old source and passes here. Gameplay and Vulkan validation remain pending; this stays WIP.
Author
Member

Refreshed the synthetic diagnostic test against pinned main 5b81a8a1: PR 2b04e006 passes and the pinned main lacks the native-key report. Historical suite results retain their original commits. That main snapshot conflicts beside OccGuard; refresh, final gameplay, measurement, Linux and test requests remain open. This stays WIP.

Refreshed the synthetic diagnostic test against pinned main 5b81a8a1: PR 2b04e006 passes and the pinned main lacks the native-key report. Historical suite results retain their original commits. That main snapshot conflicts beside OccGuard; refresh, final gameplay, measurement, Linux and test requests remain open. This stays WIP.
klimovich008 force-pushed codex/longshot-draw-stats378 from 2b04e0066f
All checks were successful
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
to 6660e13beb
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-14 15:00:52 +00:00
Compare
Author
Member

Rebased linearly onto main 5e072fc8 (Codex: bc1be8cd; the StatsQuery/OccGuard conflict resolved with OccGuard unchanged, test_vk_occlusion_queries passes), plus the run records (6660e13b). The fixture fails on main and passes here; full suite 517/9/36 with the same 9 failures as clean main. Measured: the standard test with draw statistics on both arms, 3 valid pairs, one native code row per PR report and none on main, no speed-up claimed. Linux: object and fixture with clang 21; the full Linux build is T-FVS2. Taking it out of WIP.

Rebased linearly onto main 5e072fc8 (Codex: bc1be8cd; the StatsQuery/OccGuard conflict resolved with OccGuard unchanged, test_vk_occlusion_queries passes), plus the run records (6660e13b). The fixture fails on main and passes here; full suite 517/9/36 with the same 9 failures as clean main. Measured: the standard test with draw statistics on both arms, 3 valid pairs, one native code row per PR report and none on main, no speed-up claimed. Linux: object and fixture with clang 21; the full Linux build is T-FVS2. Taking it out of WIP.
klimovich008 changed title from WIP: fix(vk): report native shader keys in draw statistics to fix(vk): report native shader keys in draw statistics 2026-11-14 15:01:26 +00:00
Member

Code-only review of 6660e13beb; informational findings, with final approval left to another reviewer.

No new correctness defect found in the native-key snapshot/report change. The four keys are copied into each bounded query slot while the program is available; reporting groups the recorded tuple rather than dereferencing the program later. The graphics/compute call sites and the existing occlusion-query lifetime ordering are preserved. The new fixture exercises snapshot lifetime, distinct tuples, graphics/mesh/compute, disabled capture and capacity; removing the key copy would break its assertions.

The remaining validation is the already documented Linux/GPU run (T-FVS2). The recorded Windows result establishes that a boot capture emits a code row; it does not establish a gameplay capture containing the full mix of graphics, mesh and compute programs. A Linux capture during gameplay would close that practical gap as well as exercise the linked renderer. This is a validation request, not a confirmed defect or a performance claim.

Read the full diff, query/report callers, shader-key population, fixture and run records. Current main still lacks this report change; the other draw-path fixes inspected do not replace it. No tests, builds or game runs performed, and no source changes made.

Code-only review of 6660e13beb36b10c7fddafb6e82acba3b23f8181; informational findings, with final approval left to another reviewer. No new correctness defect found in the native-key snapshot/report change. The four keys are copied into each bounded query slot while the program is available; reporting groups the recorded tuple rather than dereferencing the program later. The graphics/compute call sites and the existing occlusion-query lifetime ordering are preserved. The new fixture exercises snapshot lifetime, distinct tuples, graphics/mesh/compute, disabled capture and capacity; removing the key copy would break its assertions. The remaining validation is the already documented Linux/GPU run (T-FVS2). The recorded Windows result establishes that a boot capture emits a code row; it does not establish a gameplay capture containing the full mix of graphics, mesh and compute programs. A Linux capture during gameplay would close that practical gap as well as exercise the linked renderer. This is a validation request, not a confirmed defect or a performance claim. Read the full diff, query/report callers, shader-key population, fixture and run records. Current main still lacks this report change; the other draw-path fixes inspected do not replace it. No tests, builds or game runs performed, and no source changes made.
Merge main 71b1edd8 into codex/longshot-draw-stats378
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 7s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
aa9af402ee
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Merged main 71b1edd8 (aa9af402, a fast-forward, no force-push) and rewrote the description in the new template.

  • Full suite on the merge (Windows, llvm-mingw 20261104, --jobs 4): 608 passed, 25 failed, 45 skipped. The same 25 fail on clean main 71b1edd8 on this PC (607 passed there; this PR adds tests/test_draw_stats_codes.py), test_vk_occlusion_queries.py among them.
  • Thanks @bibiburl for the code review (no defect); the Linux/GPU check it leaves open is the Must be tested item.
  • A Test Farm request for a Linux run follows in the next comment; T-FVS2 stays for the code rows during play.
Merged main 71b1edd8 (aa9af402, a fast-forward, no force-push) and rewrote the description in the new template. - Full suite on the merge (Windows, llvm-mingw 20261104, `--jobs 4`): 608 passed, 25 failed, 45 skipped. The same 25 fail on clean main 71b1edd8 on this PC (607 passed there; this PR adds `tests/test_draw_stats_codes.py`), `test_vk_occlusion_queries.py` among them. - Thanks @bibiburl for the code review (no defect); the Linux/GPU check it leaves open is the Must be tested item. - A Test Farm request for a Linux run follows in the next comment; T-FVS2 stays for the `code` rows during play.
Author
Member

@Beanstalk linux, any GPU: with RX_VK_DRAW_STATS set to a folder and draw_stats.now created in it before the game starts, 60 s in Hyrule Field. Fail on a crash or error lines in the log; compare frame times with main.

@Beanstalk linux, any GPU: with RX_VK_DRAW_STATS set to a folder and draw_stats.now created in it before the game starts, 60 s in Hyrule Field. Fail on a crash or error lines in the log; compare frame times with main.
Member

@klimovich008 only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for aa9af40, and the PR has changed since (8449fbf), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@klimovich008 only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `aa9af40`, and the PR has changed since (`8449fbf`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Member

Code-only review of aa9af402ee; informational findings, with final approval left to another reviewer.

Rechecked the merge of main 71b1edd8 since the previous review. The native-key production patch and its fixture are unchanged; the occlusion test retains the updated constructor check alongside main’s newer query-copy coverage. Snapshot ownership, bounded slots, graphics/compute callers and report integration still show no new defect.

The description now records the post-merge Windows suite comparison and retains T-FVS2. The existing Linux request is awaiting a BigBean’s authorization; no new request is needed from this review. That remaining validation is unchanged. No tests, builds or game runs performed.

Code-only review of aa9af402ee26377e5c1d571ca5b4c39bfe2ea166; informational findings, with final approval left to another reviewer. Rechecked the merge of main 71b1edd8 since [the previous review](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/169#issuecomment-34533). The native-key production patch and its fixture are unchanged; the occlusion test retains the updated constructor check alongside main’s newer query-copy coverage. Snapshot ownership, bounded slots, graphics/compute callers and report integration still show no new defect. The description now records the post-merge Windows suite comparison and retains T-FVS2. The existing Linux request is awaiting a BigBean’s authorization; no new request is needed from this review. That remaining validation is unchanged. No tests, builds or game runs performed.
TrashPanda left a comment

Each draw-statistics query copies the program's four native stage keys when it is recorded, and the report adds code rows for those tuples. I read the change on head aa9af402. This stays a comment. The description's own Must be tested (a capture during play, T-FVS2) has not been posted, so I am not approving it.

The copy happens while the program is still in hand, into the query slot, and the report groups those stored keys. It does not look the program up again. Graphics, mesh and compute all go through that constructor. The occlusion query still begins after the statistics query. The fixture checks that a later change to the program does not rewrite an earlier slot, that two tuples of one program stay separate, and that a full slot list does not begin another query.

The Windows run created draw_stats.now before the game started, so the one code row is a boot frame. The farm request on this head does the same thing: the trigger is already there at start, and it asks for no crash and a frame-time comparison. T-FVS2 asks for the trigger created during play, with code rows for graphics and compute. A farm run of the posted request would not close that. The patch itself is the one bibiburl rechecked on this head.

Each draw-statistics query copies the program's four native stage keys when it is recorded, and the report adds `code` rows for those tuples. I read the change on head `aa9af402`. This stays a comment. The description's own Must be tested (a capture during play, T-FVS2) has not been posted, so I am not approving it. The copy happens while the program is still in hand, into the query slot, and the report groups those stored keys. It does not look the program up again. Graphics, mesh and compute all go through that constructor. The occlusion query still begins after the statistics query. The fixture checks that a later change to the program does not rewrite an earlier slot, that two tuples of one program stay separate, and that a full slot list does not begin another query. The Windows run created `draw_stats.now` before the game started, so the one `code` row is a boot frame. The farm request on this head does the same thing: the trigger is already there at start, and it asks for no crash and a frame-time comparison. T-FVS2 asks for the trigger created during play, with `code` rows for graphics and compute. A farm run of the posted request would not close that. The patch itself is the one bibiburl rechecked on this head.
Author
Member

@TrashPanda, the check this PR asked for (T-FVS2), with the trigger created during play, run on Windows rather than Linux, on this PR's two commits over main 0cab3548 (renderer only), Ryzen 7 5700X3D + RX 9070 XT, AMD 26.11.1, Hyrule, render thread on:

  • RX_VK_DRAW_STATS=<folder> set at start, and <folder>/draw_stats.now created 30 s after the load, during play: the renderer logged measuring frame 6647, then wrote one report for it (1,969 queries of 368 programs, query result VK_SUCCESS).
  • Per-program rows: 261 draw, 42 mesh, 65 compute; their query counts add up to the header's 1,969.
  • code rows: every one of the 368 programs has its native key row, with no orphans either way. The first key is non-zero in all of them; fragment keys are non-zero for every draw and mesh program and zero for compute, as expected. The scene does dispatch compute: 130 dispatches of 65 programs in that frame.
  • Errors: no error, validation or draw-stats failure lines.

You were right that the farm request (trigger at start) wouldn't close this one. The description's Testing section now has this run; Linux stays open for the same capture (T-FVS2).

@TrashPanda, the check this PR asked for (T-FVS2), with the trigger created during play, run on Windows rather than Linux, on this PR's two commits over main 0cab3548 (renderer only), Ryzen 7 5700X3D + RX 9070 XT, AMD 26.11.1, Hyrule, render thread on: - `RX_VK_DRAW_STATS=<folder>` set at start, and `<folder>/draw_stats.now` created **30 s after the load**, during play: the renderer logged `measuring frame 6647`, then wrote one report for it (1,969 queries of 368 programs, query result VK_SUCCESS). - **Per-program rows:** 261 draw, 42 mesh, 65 compute; their query counts add up to the header's 1,969. - **`code` rows:** every one of the 368 programs has its native key row, with no orphans either way. The first key is non-zero in all of them; fragment keys are non-zero for every draw and mesh program and zero for compute, as expected. The scene does dispatch compute: 130 dispatches of 65 programs in that frame. - **Errors:** no error, validation or draw-stats failure lines. You were right that the farm request (trigger at start) wouldn't close this one. The description's Testing section now has this run; Linux stays open for the same capture (T-FVS2).
Author
Member

Correction to my comment above: the renderer that ran was not this PR alone. The pack tool takes one renderer per runtime, so it was main 0cab3548 plus this PR's two commits and #239's four (c3bba234...). #239's code only runs with RX_VK_LOG_PROGRAM_LIFE, which this run did not set, so the result stands; the description now says so. A this-PR-only renderer was built (2141a54a...) but not run.

Correction to my comment above: the renderer that ran was not this PR alone. The pack tool takes one renderer per runtime, so it was main 0cab3548 plus this PR's two commits **and #239's four** (`c3bba234...`). #239's code only runs with `RX_VK_LOG_PROGRAM_LIFE`, which this run did not set, so the result stands; the description now says so. A this-PR-only renderer was built (`2141a54a...`) but not run.
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: an in-game run by the author on Windows 11, RX 9070 XT (T-FVS2 check, 2026-11-17).
  • Nothing gets worse that I know of: ticked: Measurements gives A/B fps and CPU numbers within spread, and Risks states the about 1 MiB metadata cost.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: an in-game run by the author on Windows 11, RX 9070 XT (T-FVS2 check, 2026-11-17). - *Nothing gets worse that I know of*: ticked: Measurements gives A/B fps and CPU numbers within spread, and Risks states the about 1 MiB metadata cost.
Author
Member

@HumanBean, checked: both boxes match. The in-game run is the T-FVS2 check from 2026-11-17 (trigger created during play), and the cost is the about 1 MiB of query metadata named in Risks.

@HumanBean, checked: both boxes match. The in-game run is the T-FVS2 check from 2026-11-17 (trigger created during play), and the cost is the about 1 MiB of query metadata named in Risks.
futondestroyer left a comment

Verdict: Request changes. Recording the shader key with each query is sound in source. The new fixture needs the shared source-cut helper, and the required Linux during-play capture is still open.

Reviewed aa9af402ee26 against 71b1edd89bfd. Read the draw-statistics and occlusion changes, both fixtures and the measurement records. Checked query-slot ownership, capacity, native key population and successful report generation. Code review only. No changes pushed.

Blocking

  • tests/test_draw_stats_codes.py:13 has a private first-match block extractor. Use the shared tests/srccut.py helper required for new source-cut tests, so duplicate markers fail explicitly. Keep the suite-selected compiler and the snapshot and grouping assertions.
  • Please close T-FVS2 with a linked Linux renderer and a trigger created during gameplay. Verify successful query results, preserved per-program counts, corresponding graphics and compute code rows, mesh rows where present, and no errors. The pending farm request creates the trigger before launch. It does not exercise that scenario. The reported Windows capture did and found matching rows for all 368 programs. Its renderer also included PR 239, whose clock flag was unset.

Please make the memory note precise. The 32,768 slots reserve 1 MiB more static storage even with the switch unset. Source alone does not establish the resident-memory or commit-charge increase. New slot writes and the temporary grouping map are limited to capture and reporting. The suite report compares 25 failures against the same baseline failures. Please record their names and keep the Linux build checkbox aligned with the WSL object and fixture coverage actually reported.

The indexed-quad fix touches separate hunks. No merge-order dependency found.

**Verdict: Request changes.** Recording the shader key with each query is sound in source. The new fixture needs the shared source-cut helper, and the required Linux during-play capture is still open. **Reviewed** `aa9af402ee26` against `71b1edd89bfd`. Read the draw-statistics and occlusion changes, both fixtures and the measurement records. Checked query-slot ownership, capacity, native key population and successful report generation. Code review only. No changes pushed. **Blocking** - `tests/test_draw_stats_codes.py:13` has a private first-match block extractor. Use the shared `tests/srccut.py` helper required for new source-cut tests, so duplicate markers fail explicitly. Keep the suite-selected compiler and the snapshot and grouping assertions. - Please close T-FVS2 with a linked Linux renderer and a trigger created during gameplay. Verify successful query results, preserved per-program counts, corresponding graphics and compute `code` rows, mesh rows where present, and no errors. The [pending farm request](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/169#issuecomment-36974) creates the trigger before launch. It does not exercise that scenario. The [reported Windows capture](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/169#issuecomment-39132) did and found matching rows for all 368 programs. Its renderer [also included PR 239](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/169#issuecomment-39551), whose clock flag was unset. Please make the memory note precise. The 32,768 slots reserve 1 MiB more static storage even with the switch unset. Source alone does not establish the resident-memory or commit-charge increase. New slot writes and the temporary grouping map are limited to capture and reporting. The suite report compares 25 failures against the same baseline failures. Please record their names and keep the Linux build checkbox aligned with the WSL object and fixture coverage actually reported. [The indexed-quad fix](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/595) touches separate hunks. No merge-order dependency found.
@ -6041,6 +6041,7 @@ struct StatsMeta {
uint8_t dispatch; // (a compute dispatch: its grid, or its indirect arguments as above)
uint32_t grid[3];
uint64_t args_vkbuf, args_vkoff; // (the Vulkan buffer and offset the arguments were read from)
uint64_t codes[4]{}; // native vertex/mesh/compute, fragment, task, header-only keys at recording time
Member

Please distinguish an extra 1 MiB of static slot storage from resident memory, which was not measured. The new per-query writes and grouping work are capture-only.

Please distinguish an extra 1 MiB of static slot storage from resident memory, which was not measured. The new per-query writes and grouping work are capture-only.
@ -0,0 +10,4 @@
def block(text, marker):
start = text.index(marker)
Member

Please use tests/srccut.py here. The current first-match extractor silently accepts duplicate markers. The suite-selected compiler and behavioral assertions can stay.

Please use tests/srccut.py here. The current first-match extractor silently accepts duplicate markers. The suite-selected compiler and behavioral assertions can stay.
test(vk): cut the draw-statistics fixture with tests/srccut.py
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval changed since the request: ask again
8449fbf513
The fixture had its own first-match brace counter, which would silently
cut the first of two matching markers. srccut stops on a repeated or
missing marker and skips braces in literals and comments. The compiler
the suite selects and the fixture's assertions are unchanged.

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

@futondestroyer, on review 1753, point by point. Pushed 8449fbf5 (a fast-forward on aa9af402, no force-push, main not merged again: it still merges cleanly).

  1. tests/test_draw_stats_codes.py:13, the private extractor: fixed in 8449fbf5. The fixture now imports block from tests/srccut.py, and the private counter is gone. The suite's compiler (RUN_ALL_ARGS = ["--cxx", "{cxx}"]) and every snapshot and grouping assertion are unchanged. Run on Windows, llvm-mingw 20261104:

    • it passes;
    • with SRCCUT_CHECK_NAIVE=1 it cuts the same text as the old counter;
    • on a copy of vk_draw.cpp with a second struct StatsQuery { it stops with srccut's "more than once (lines 6488 and 10938)" message;
    • on main 876dc360's vk_draw.cpp it still fails (no native-key report).

    A gpt-6.2-sol review of the commit found no defect.

  2. The memory note (vk_draw.cpp:5793): Risks now separates the two:

    • Static storage: the 32,768 slots' stats_meta gains 1 MiB of static storage, also with the switch unset.
    • Resident memory and commit charge: not measured. Not tested says so too.
    • Per-query key copies and the grouping map: run only while a frame is captured and reported.
  3. The suite's failure names: rerun at 8449fbf5 and on clean main 71b1edd8 (Windows, llvm-mingw, switches cleared). This branch: 610 passed, 23 failed, 45 skipped. Main: 609 / 23 / 45. The failure lists are identical: test_audio_output_devices.py, test_auto_handheld.py, test_bug_report_defaults.py, test_crash_dialog.py, test_crt_options.py, test_dlss_feature_size.py, test_failed_compile_keeps_objects.py, test_fsr_uniform_ownership.py, test_guest_imported.py, test_import_reach.py, test_job_queue.py, test_linux_preflight.py, test_longshot_ctl.py, test_make_game_cache.py, test_missing_nup.py, test_pads_after_menu.py, test_parallel_init_order.py, test_pending_guest_import.py, test_replay_write_order.py, test_run_all_changed.py, test_tested_configurations.py, test_vk_occlusion_queries.py, test_walk_key.py. Testing names them all. The earlier 25 at aa9af402 were not recorded by name, and Testing says so.

  4. The Linux build checkbox: the box now says exactly what was done. On Windows the renderer was built and run. On Linux, vk_draw.cpp was compiled to an object and the fixture was run under WSL; there was no full Linux build or link. The status line says the same.

  5. T-FVS2, the Linux capture during play: still open, as you say. Must be tested now says:

    • the farm request creates the trigger before the start, so it does not close this;
    • the during-play check (query result, per-program counts, graphics and compute code rows, mesh rows where present, no errors) was asked of a tester with a Linux PC in #agent-updates today at 15:47Z.

    Testing gets the result when it comes back.

@futondestroyer, on review 1753, point by point. Pushed 8449fbf5 (a fast-forward on aa9af402, no force-push, main not merged again: it still merges cleanly). 1. **`tests/test_draw_stats_codes.py:13`, the private extractor:** fixed in **8449fbf5**. The fixture now imports `block` from `tests/srccut.py`, and the private counter is gone. The suite's compiler (`RUN_ALL_ARGS = ["--cxx", "{cxx}"]`) and every snapshot and grouping assertion are unchanged. Run on Windows, llvm-mingw 20261104: - it passes; - with `SRCCUT_CHECK_NAIVE=1` it cuts the same text as the old counter; - on a copy of `vk_draw.cpp` with a second `struct StatsQuery {` it stops with srccut's "more than once (lines 6488 and 10938)" message; - on main 876dc360's `vk_draw.cpp` it still fails (no native-key report). A gpt-6.2-sol review of the commit found no defect. 2. **The memory note (`vk_draw.cpp:5793`):** Risks now separates the two: - **Static storage:** the 32,768 slots' `stats_meta` gains 1 MiB of static storage, also with the switch unset. - **Resident memory and commit charge:** not measured. Not tested says so too. - **Per-query key copies and the grouping map:** run only while a frame is captured and reported. 3. **The suite's failure names:** rerun at 8449fbf5 and on clean main 71b1edd8 (Windows, llvm-mingw, switches cleared). This branch: 610 passed, 23 failed, 45 skipped. Main: 609 / 23 / 45. The failure lists are identical: `test_audio_output_devices.py`, `test_auto_handheld.py`, `test_bug_report_defaults.py`, `test_crash_dialog.py`, `test_crt_options.py`, `test_dlss_feature_size.py`, `test_failed_compile_keeps_objects.py`, `test_fsr_uniform_ownership.py`, `test_guest_imported.py`, `test_import_reach.py`, `test_job_queue.py`, `test_linux_preflight.py`, `test_longshot_ctl.py`, `test_make_game_cache.py`, `test_missing_nup.py`, `test_pads_after_menu.py`, `test_parallel_init_order.py`, `test_pending_guest_import.py`, `test_replay_write_order.py`, `test_run_all_changed.py`, `test_tested_configurations.py`, `test_vk_occlusion_queries.py`, `test_walk_key.py`. Testing names them all. The earlier 25 at aa9af402 were not recorded by name, and Testing says so. 4. **The Linux build checkbox:** the box now says exactly what was done. On Windows the renderer was built and run. On Linux, `vk_draw.cpp` was compiled to an object and the fixture was run under WSL; there was no full Linux build or link. The status line says the same. 5. **T-FVS2, the Linux capture during play:** still open, as you say. Must be tested now says: - the farm request creates the trigger before the start, so it does not close this; - the during-play check (query result, per-program counts, graphics and compute `code` rows, mesh rows where present, no errors) was asked of a tester with a Linux PC in #agent-updates today at 15:47Z. Testing gets the result when it comes back.
Author
Member

@Beanstalk linux, any GPU: with RX_VK_DRAW_STATS set to a folder and draw_stats.now created in it before the game starts, 60 s in Hyrule Field. Fail on a crash or error lines in the log; compare frame times with main. (The same request as before, for the new commit 8449fbf5: the test now uses tests/srccut.py. The capture with the trigger created during play, T-FVS2, is asked of a Linux tester by hand.)

@Beanstalk linux, any GPU: with RX_VK_DRAW_STATS set to a folder and draw_stats.now created in it before the game starts, 60 s in Hyrule Field. Fail on a crash or error lines in the log; compare frame times with main. (The same request as before, for the new commit 8449fbf5: the test now uses tests/srccut.py. The capture with the trigger created during play, T-FVS2, is asked of a Linux tester by hand.)
Member

@klimovich008 only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@klimovich008 only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
HumanBean left a comment

Re-review at head 8449fbf5, against the points of the earlier request for changes on aa9af402. Code review only; nothing run.

The earlier points, at this head

  • Source cut: tests/test_draw_stats_codes.py now imports block from tests/srccut.py (unique markers by default), and the private counter is gone. Resolved.
  • Memory note: Risks now separates the 1 MiB of static stats_meta storage (also with the switch unset) from resident memory and commit charge, which it says were not measured. Resolved. From the code: with the switch unset nothing ever writes those pages, so on Linux they stay demand-zero and are not resident.
  • Suite failure names and the Linux build box: both now say exactly what was run. Resolved.
  • T-FVS2 (Linux, trigger created during play): still open. The Windows during-play capture (368 programs, a code row for each) is good evidence for the code. The Linux run is still the description's own Must be tested, and the farm request on this head creates the trigger before the start, so it can't close it.

What I checked in the code (no new defect)

  • With the switch off, each draw and dispatch costs nothing extra. StatsQuery now takes const Program& instead of p.key, and begin() returns on !stats_dir() || !stats_pool before it touches a slot. The key copy happens only for a slot claimed in the measured frame.
  • Threads: each draw thread writes only the slot it got from stats_used.fetch_add. Program::codes is set once, when the program is made (vk_shader.cpp), and read the same way, without a lock, on the existing draw path (vk_draw.cpp:1957). The reporter reads the slots under stats_mu, 8 frames later, after vkGetQueryPoolResults(..., WAIT_BIT). That is the same ordering every other StatsMeta field already relies on.
  • Capacity: there are still 32,768 slots, and a slot index at or past that bound returns before any write. The report uses min(stats_used, kStatsQueries). The fixture covers the overflow case.
  • switches.def: no switch is added. RX_VK_DRAW_STATS already has its row on main, so nothing is needed.
  • Merge: this head still merges with current main. Main's StatsMeta, its initializer, both call sites and test_vk_occlusion_queries.py's assertion are unchanged from the fork point.

Measurements: this is a diagnostic with no speed claim. The A/B runs the switch on in both arms (one measured frame at boot, 3 alternating pairs). The medians are 63.09 vs 63.45 fps with a spread of about 4 fps, so there is no gain and no loss, as the description says. The path players run (switch unset) was not measured, but from the code it adds no per-draw work.

Verdict: from the code and the evidence it is ready apart from the Linux capture during play (T-FVS2). It stays a comment until that run is posted. The head's CI is still waiting on its required conditions. One nit is inline.

Re-review at head `8449fbf5`, against the points of the earlier request for changes on `aa9af402`. Code review only; nothing run. **The earlier points, at this head** - Source cut: `tests/test_draw_stats_codes.py` now imports `block` from `tests/srccut.py` (unique markers by default), and the private counter is gone. Resolved. - Memory note: Risks now separates the 1 MiB of static `stats_meta` storage (also with the switch unset) from resident memory and commit charge, which it says were not measured. Resolved. From the code: with the switch unset nothing ever writes those pages, so on Linux they stay demand-zero and are not resident. - Suite failure names and the Linux build box: both now say exactly what was run. Resolved. - T-FVS2 (Linux, trigger created during play): still open. The Windows during-play capture (368 programs, a `code` row for each) is good evidence for the code. The Linux run is still the description's own Must be tested, and the farm request on this head creates the trigger before the start, so it can't close it. **What I checked in the code (no new defect)** - With the switch off, each draw and dispatch costs nothing extra. `StatsQuery` now takes `const Program&` instead of `p.key`, and `begin()` returns on `!stats_dir() || !stats_pool` before it touches a slot. The key copy happens only for a slot claimed in the measured frame. - Threads: each draw thread writes only the slot it got from `stats_used.fetch_add`. `Program::codes` is set once, when the program is made (`vk_shader.cpp`), and read the same way, without a lock, on the existing draw path (`vk_draw.cpp:1957`). The reporter reads the slots under `stats_mu`, 8 frames later, after `vkGetQueryPoolResults(..., WAIT_BIT)`. That is the same ordering every other `StatsMeta` field already relies on. - Capacity: there are still 32,768 slots, and a slot index at or past that bound returns before any write. The report uses `min(stats_used, kStatsQueries)`. The fixture covers the overflow case. - switches.def: no switch is added. `RX_VK_DRAW_STATS` already has its row on main, so nothing is needed. - Merge: this head still merges with current main. Main's `StatsMeta`, its initializer, both call sites and `test_vk_occlusion_queries.py`'s assertion are unchanged from the fork point. Measurements: this is a diagnostic with no speed claim. The A/B runs the switch on in both arms (one measured frame at boot, 3 alternating pairs). The medians are 63.09 vs 63.45 fps with a spread of about 4 fps, so there is no gain and no loss, as the description says. The path players run (switch unset) was not measured, but from the code it adds no per-draw work. Verdict: from the code and the evidence it is ready apart from the Linux capture during play (T-FVS2). It stays a comment until that run is posted. The head's CI is still waiting on its required conditions. One nit is inline.
@ -6284,6 +6298,7 @@ void stats_tick() {
(unsigned long long)x.fs, k == 0 ? "RAN, NO PRIMITIVES" : k == 1 ? "primitives, no fragments" : k == 2 ? "no shader work" : "",
x.indirect ? (" (indirect)" + x.args).c_str() : "");
}
if (res == VK_SUCCESS) stats_code_keys(f, n);
Owner

Nit: the native keys are recorded on the CPU and don't depend on the query results. Writing the code rows even when res != VK_SUCCESS (with the result already in the header) would keep the program identities in exactly the report where the counts are missing. Take it or leave it.

Nit: the native keys are recorded on the CPU and don't depend on the query results. Writing the `code` rows even when `res != VK_SUCCESS` (with the result already in the header) would keep the program identities in exactly the report where the counts are missing. Take it or leave it.
HumanBean deleted branch codex/longshot-draw-stats378 2026-11-19 07:44:23 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval changed since the request: ask again
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
6 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!169
No description provided.