Skip to content

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

Draft
Aforno wants to merge 3 commits into
trustno1-coder:mainfrom
Aforno:codex/meshlet-descriptor-bounds
Draft

Aforno wants to merge 3 commits into
trustno1-coder:mainfrom
Aforno:codex/meshlet-descriptor-bounds

Conversation

@Aforno

@Aforno Aforno commented Nov 29, 2026 •

Copy link
Copy Markdown

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: chore(ci): fix workspace clippy -D warnings, diagnostics build, and stale tests on main #3385.

Related work

@github-actions github-actions Bot added the pr-fix Pull request: fixes a bug label Nov 29, 2026
@github-actions github-actions Bot changed the title [pr-fix] Fix descriptor type and bounds checks in meshlet buffer loads Fix descriptor type and bounds checks in meshlet buffer loads Nov 29, 2026
moritz-eckhard-nickel added a commit to moritz-eckhard-nickel/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
… checks in meshlet buffer loads

trustno1-coder#3408 by Aforno, head 08041a5.
Conflicts: emit/mod.rs exports (kept both), host.rs (device is unwrapped earlier here; kept the diagnostics-only gbv::configure).
@dyshay

dyshay commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-fix Pull request: fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants