Repository navigation
Test structured root-buffer operations against the host view size - #4
Draft
MichaelSmithAI wants to merge 3 commits into
Draft
MichaelSmithAI wants to merge 3 commits into
MichaelSmithAI wants to merge 3 commits into
Conversation
A root SRV or CBV has no bounds on the host: a shader access past the memory the host mapped there is a GPU page fault. The console's buffer views of the same memory have record counts, and the offsets come from title data the host may not have mirrored (zeros, stale memory), so such accesses happen. Some hosts' GPUs stall on the fault until the driver resets the device as hung: a mesh dispatch of a program that reads its vertex streams through a root view with a formatted load hangs an RTX 5090 and the device is removed. The host now passes each root view's byte size in the user-data dword of its address (which the shader never reads, the view being bound as a root argument), and every raw, formatted and constant access through a root view checks the bytes it touches against it: reads past it give 0, writes are dropped, as for a console view past its records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # crates/victory-gpu/src/draw.rs # crates/victory-shader/src/emit/lower.rs # crates/victory-shader/src/emit/valu_tests.rs
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This tester branch combines the structured root SRV/UAV lowering from #709 with the host-side view sizes from #650. The base is the published structured-root comparison at
879ecc8. The production changes are pinned at66ac451; the additional commit on this PR is test-only. Both include the same spill-table and root-UAV prerequisites.A matched offline report on four world compute programs found that the spill-aware translator reaches the root-UAV/typed-view refusal. The five opening-cutscene pipelines reported in Marvisak#709 were measured on a different stack. We have no per-program evidence that these populations overlap.
The synthetic GPU test allocates eight dwords and uses a structured root UAV with stride eight. With a 24-byte logical view it stores, atomically updates, and loads the expected values. At 20 bytes the atomic update remains visible. At 16 bytes all eight dwords remain zero. Each case checks the entire physical allocation. The low-level shader harness supplies the logical size directly. A second test exercises the ordinary State::dispatch path with the root address eight bytes into a registered buffer. The runtime computes the remaining 24, 20, or 16 bytes. All three guest readbacks matched, including prefix sentinels and a check that the backing padding was untouched. Two independent controls deliberately report the wrong start or the wrong size within the allocated storage. The test caught both errors.
To run the fixture on a supported Windows device:
The fixture passed on an RTX 4090 under Wine 11.22 and vkd3d-proton 3.1, including an independent replay. DXVK routed the WARP request to the same adapter. A fresh Linux build passed 69 shader tests, the Windows diagnostics CLI and GPU/shader test targets type-checked, and the asset policy passed. Title dispatch results, depth/lighting changes, and visible world rendering remain unmeasured.
The source histories retain the original authors of Marvisak#294, Marvisak#650, and Marvisak#709. Integration and validation were AI-assisted.