Fix descriptor type and bounds checks in meshlet buffer loads #3408

Closed
github-bot wants to merge 3 commits from github-bot/gh-3408 into main AGit
Owner

@⁠Aforno on GitHub · 2026-11-29 22:52 UTC · original
Aforno:codex/meshlet-descriptor-bounds → main · +282 −90 · 10 files · 3 commits · closed without merging

What changed

A meshlet compute dispatch could read a descriptor through the wrong D3D12 buffer class. On the tested RTX 5060, guest-computed indices also reached the host's temporary table slots. DRED placed the interrupted command at ExecuteIndirect with meshlet culling enabled.

The host now records constant buffers, unordered buffer views, and private slots in its per-slot metadata. The translator uses that information for guest-selected scalar and untyped vector buffer reads. Byte and halfword reads use the same type check for both dwords of a straddling load. Raw multi-dword reads honor the existing WIDE optimization switch.

A separate diagnostics commit adds VICTORY_D3D12_GBV_SHADER=<shader hash>. With the D3D12 debug layer and GPU-based validation enabled, this instruments pipelines that use the selected shader. The first commit cherry-picks the diagnostics build prerequisite from #3086 with the original author's attribution. It can be dropped once that fix lands upstream.

Test evidence

  • On the RTX 5060, GPU-based validation reported a descriptor type mismatch on the meshlet shader, and a subsequent instrumented run caught an invalid resource in a host-private slot. After the descriptor fix, the same targeted run recorded zero validation errors for that shader over 1,628 frames after its first bind. Separate D3D12 resource-state warnings remained.
  • The release gameplay capture used the same scripted Series S stretch, 540p profile, DLSS Performance selected, frame generation off, relay copy on, and a 500 ms pipeline wait. It rendered for 13 minutes from the first heavy scene without a display-driver reset. The matched opening averaged 25.50 FPS against 26.00 FPS before. The longest frame across the run was 529 ms. These gameplay measurements preceded the byte/halfword and WIDE refinements in this draft.
  • On the proposed source, a synthetic wave32 shader verified unsigned byte and signed cross-dword halfword readbacks on the hardware adapter and WARP, including zero results for host-private and empty slots. A second test verifies that enabling WIDE changes the emitted code for a heap-selected scalar load. The existing scalar buffer boundary test also passed with WIDE off and on.
  • The complete shader suite passed (464 passed, 9 ignored). The diagnostics executable built successfully, and the GPU descriptor slot reuse test passed with diagnostics enabled.
  • The complete GPU unit suite reported 911 passed, 4 failed, and 60 ignored. The shared scratch test and both texture readback/pool tests passed when rerun individually. The shader cache key test still failed in isolation on the stale VICTORY_SCALAR_SPLITS expectation and also failed on upstream main. The clean upstream GPU suite likewise recorded four failures, three shared with this run.
  • The staged asset-policy check passed for both new commits.
  • Both workspace Clippy gates stopped on existing loader/shader diagnostics. The full workspace test command stopped on three BCPack oracle parity failures. All three test failures and both sets of Clippy errors reproduced on untouched upstream main at 716a0c99. Related CI repair: #3385.
  • Searched open PRs for this dispatch, meshlet culling, descriptor types, and GPU-based validation. #3380 also touches shader descriptor lowering, for descriptors constructed by shader code. #3086 covers the build prerequisite.
**@⁠Aforno** on GitHub · 2026-11-29 22:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3408) `Aforno:codex/meshlet-descriptor-bounds` → `main` · +282 −90 · 10 files · 3 commits · closed without merging ## What changed A meshlet compute dispatch could read a descriptor through the wrong D3D12 buffer class. On the tested RTX 5060, guest-computed indices also reached the host's temporary table slots. DRED placed the interrupted command at `ExecuteIndirect` with meshlet culling enabled. The host now records constant buffers, unordered buffer views, and private slots in its per-slot metadata. The translator uses that information for guest-selected scalar and untyped vector buffer reads. Byte and halfword reads use the same type check for both dwords of a straddling load. Raw multi-dword reads honor the existing `WIDE` optimization switch. A separate diagnostics commit adds `VICTORY_D3D12_GBV_SHADER=<shader hash>`. With the D3D12 debug layer and GPU-based validation enabled, this instruments pipelines that use the selected shader. The first commit cherry-picks the diagnostics build prerequisite from #3086 with the original author's attribution. It can be dropped once that fix lands upstream. ## Test evidence - On the RTX 5060, GPU-based validation reported a descriptor type mismatch on the meshlet shader, and a subsequent instrumented run caught an invalid resource in a host-private slot. After the descriptor fix, the same targeted run recorded zero validation errors for that shader over 1,628 frames after its first bind. Separate D3D12 resource-state warnings remained. - The release gameplay capture used the same scripted Series S stretch, 540p profile, DLSS Performance selected, frame generation off, relay copy on, and a 500 ms pipeline wait. It rendered for 13 minutes from the first heavy scene without a display-driver reset. The matched opening averaged 25.50 FPS against 26.00 FPS before. The longest frame across the run was 529 ms. These gameplay measurements preceded the byte/halfword and `WIDE` refinements in this draft. - On the proposed source, a synthetic wave32 shader verified unsigned byte and signed cross-dword halfword readbacks on the hardware adapter and WARP, including zero results for host-private and empty slots. A second test verifies that enabling `WIDE` changes the emitted code for a heap-selected scalar load. The existing scalar buffer boundary test also passed with `WIDE` off and on. - The complete shader suite passed (464 passed, 9 ignored). The diagnostics executable built successfully, and the GPU descriptor slot reuse test passed with diagnostics enabled. - The complete GPU unit suite reported 911 passed, 4 failed, and 60 ignored. The shared scratch test and both texture readback/pool tests passed when rerun individually. The shader cache key test still failed in isolation on the stale `VICTORY_SCALAR_SPLITS` expectation and also failed on upstream main. The clean upstream GPU suite likewise recorded four failures, three shared with this run. - The staged asset-policy check passed for both new commits. - Both workspace Clippy gates stopped on existing loader/shader diagnostics. The full workspace test command stopped on three BCPack oracle parity failures. All three test failures and both sets of Clippy errors reproduced on untouched upstream main at `716a0c99`. Related CI repair: #3385. ## Related work - [x] Searched open PRs for this dispatch, meshlet culling, descriptor types, and GPU-based validation. #3380 also touches shader descriptor lowering, for descriptors constructed by shader code. #3086 covers the build prerequisite.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 22:57:54 +00:00
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 03:12 UTC · original

Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.

**@⁠dyshay** on GitHub · 2026-11-30 03:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3408#issuecomment-7267678462) Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.
github-bot closed this pull request 2026-12-01 18:58:44 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!3408
No description provided.