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

Draft
klimovich008 wants to merge 3 commits from klimovich008/Longshot:codex/longshot-draw-stats378 into main
Contributor

Why

Cached-program draw reports hide native shader keys, making suspect draws hard to identify.

What changed

  • gpu/vk/vk_draw.cpp: snapshot four keys; append grouped rows.
  • tests/test_draw_stats_codes.py: test production blocks with synthetic inputs.
  • docs/development.md: document keys and limits.

Flags and settings

RX_VK_DRAW_STATS remains off.

Measurements

Fixture main @ 0c74253d this PR @ 2b04e006
Native keys FAIL PASS

Fails on the old code, passes now.

Testing

python -I -B tests/test_draw_stats_codes.py --cxx clang++: Windows, MinGW.

Full suite: 483 passed, 5 failed, 35 skipped. All five also fail on unmodified main: test_nup_paths, test_check_third_party, test_display_pointer, test_texture_staging_publication, test_release.

Not tested: this build's gameplay, validation, Linux, NVIDIA/Intel.

Needs other testers: none requested while WIP.

Screenshots

None.

Risk and rollback

Adds 1 MiB of metadata. Revert this commit to remove it.

Issues

Ports https://github.com/NotRexed/Hookshot/pull/2896. No game data is included.

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported — gameplay pending.
  • 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.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Flags noted, and the switch reference updated (docs/development.md, the README).
  • 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.
  • Docs updated.
## Why Cached-program draw reports hide native shader keys, making suspect draws hard to identify. ## What changed - `gpu/vk/vk_draw.cpp`: snapshot four keys; append grouped rows. - `tests/test_draw_stats_codes.py`: test production blocks with synthetic inputs. - `docs/development.md`: document keys and limits. ## Flags and settings `RX_VK_DRAW_STATS` remains off. ## Measurements | Fixture | main @ 0c74253d | this PR @ 2b04e006 | |---|---|---| | Native keys | FAIL | PASS | Fails on the old code, passes now. ## Testing `python -I -B tests/test_draw_stats_codes.py --cxx clang++`: Windows, MinGW. Full suite: 483 passed, 5 failed, 35 skipped. All five also fail on unmodified main: `test_nup_paths`, `test_check_third_party`, `test_display_pointer`, `test_texture_staging_publication`, `test_release`. Not tested: this build's gameplay, validation, Linux, NVIDIA/Intel. Needs other testers: none requested while WIP. ## Screenshots None. ## Risk and rollback Adds 1 MiB of metadata. Revert this commit to remove it. ## Issues Ports https://github.com/NotRexed/Hookshot/pull/2896. No game data is included. ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [ ] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported — gameplay pending. - [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. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Flags noted, and the switch reference updated (docs/development.md, the README). - [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] Docs updated.
fix(vk): report native shader keys in draw statistics
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 6s
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
684333d38f
Cached programs skip translation-miss logs, so per-program draw counts cannot
identify their native stages. Snapshot the four existing stage keys in each
accepted query and report distinct tuples alongside the original count rows.

Port https://github.com/NotRexed/Hookshot/pull/2896 to Longshot. The game-free
C++ check fails on Longshot main without the keys and passes with this change.
A matched Longshot game run and the full source-check suite remain pending.

Assisted-by: OpenAI Codex
Assisted-by: GPT-6.1 Sol
Co-Authored-By: OpenAI Codex <[email protected]>
Co-Authored-By: GPT-6.1 Sol <[email protected]>
Author
Contributor

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.
Merge commit '839e85ff2b' into codex/longshot-draw-stats378
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
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 3s
914ca048fe
Author
Contributor

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.
chore: merge current main into native draw statistics
All checks were successful
PR description / Description follows the template (pull_request_target) Successful in 4s
2b04e0066f
Keep the build-time documentation and the draw-statistics section. Runtime diagnostic code is unchanged by this refresh.

Assisted-by: OpenAI Codex

Assisted-by: gpt-6.1-sol
Author
Contributor

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.
All checks were successful
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request has changes conflicting with the target branch.
  • gpu/vk/vk_draw.cpp
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'codex/longshot-draw-stats378:klimovich008-codex/longshot-draw-stats378'
git switch 'klimovich008-codex/longshot-draw-stats378'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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.