Skip to content

Test runtime-stride reads through a range-preserving buffer view - #3

Draft
MichaelSmithAI wants to merge 2 commits into
test/structured-srv-baselinefrom
test/structured-srv-readback
Draft

MichaelSmithAI wants to merge 2 commits into
test/structured-srv-baselinefrom
test/structured-srv-readback

Conversation

@MichaelSmithAI

@MichaelSmithAI MichaelSmithAI commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

On NVIDIA hardware, reviewers found that the raw reads emitted by VIctory Marvisak#193 returned zero when bound to a structured buffer. A subsequent title-side measurement identifies the four instance-culling shaders’ access as a structured SRV selected by a GPU-loaded index. All four emitted and passed Windows SDK validation on the reporter’s Marvisak#193 + lane-mask-fix stack at wave size 32. The static-slot path in this draft does not cover that dynamic selection. Original PR and hardware discussion · Instance-culling report

This fork-local draft is for native readback before proposing changes to Marvisak#193. Baseline 0484af4 contains Marvisak#193 plus the upstream test-module rename. For a read from an exact, static SRV table entry, the candidate binds a separate raw view of the original buffer range and records its index, stride, extent and count in command-list memory. This lets two recorded dispatches reuse the guest slot for different views and still read the intended data. Failed binds return the unused descriptor leases.

The experiment narrows Marvisak#193's runtime-stride fallback. It handles representable structured SRV ranges and raw stride-four inputs. Unknown-stride UAV operations, typed views, and dynamically selected descriptors remain unsupported. These differences make an offline comparison of newly accepted and newly refused shaders important before integrating it.

Run the native readback on Windows with a D3D12 adapter:

cargo test --locked -p victory-gpu --lib runtime_stride_reads_the_exact_structured_srv_window -- --nocapture --test-threads=1

The expected destination words are 0 for the skipped dispatch, 109 and 105 for two structured views, and 102 for a raw input. The fixture also checks that the guest's structured descriptor survives the alias bind and that a refused bind returns its lease. Look for Structured SRV generation and raw SRV readbacks passed in the output. If D3D12 is unavailable, the test prints a skip message.

The Linux shader library suite passed 57 tests, the synthetic shader passed Microsoft DXIL validation, and the Windows targets type-checked from Linux. On an RTX 4090 under Wine 11.22 with vkd3d-proton 3.1, the published test at 02710a0 failed guest-memory readback. Applying only VIctory #322 at b58d198 let the unmodified test complete with the expected 0, 109, 105 and 102 and the lease assertions passed. A separate control changed only the test destination to ordinary committed memory and also passed. Windows-native readback remains pending. This fixture remains a static-slot control. The four reported culling shaders need a separate dynamic-slot binding test that verifies the selected view, stride and record bounds before measuring their output or G-buffer occupancy.

AI assistance was used for implementation and review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant