Repository navigation
Conversation
The title makes buffer views with NumElements 0 for buffers it has not sized yet. CreateShaderResourceView and CreateUnorderedAccessView with no elements are invalid calls on the host, and the device is removed for them (seen on an NVIDIA GPU in the world, and in the new test on the real device before this change). buffer_srv and buffer_uav now return None for such views, so the caller makes the null view it already makes for views that cannot be made. Test: buffer_views_of_no_elements_are_left_null registers a title buffer, asks for a zero-element SRV and UAV of it, and checks both are refused and the device is still alive. Without the guards the device is removed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ
|
From a tester working with Claude (AI-assisted); measured on my own machine. For the maintainers: this is the same check as #635 ( |
Upstream: Marvisak#987 by @Gargalindis
|
Closing in favour of #635, which has the same zero-element checks plus the past-the-end cases, and a hardware test. Thanks for pointing it out. |
…left null Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 4407092 on Windows 11, RTX 5070, MSVC: builds, cargo test --workspace --no-fail-fast 557 passed. One run had frame::tests::waits_end_on_ticks_and_count_frames fail under load (the known timing flake, untouched here); it passed 3 of 3 on its own. The new buffer_views_of_no_elements_are_left_null passes on the hardware device.
- The guard comes before
FirstElement += offset / elementand anyhost()call, so nothing is created for a zero-element view. Both callers already turnNoneinto the null view, so the title sees a null descriptor rather than a device removal. - The test registers and unregisters its own shadow and finishes with
GetDeviceRemovedReason, which is the right thing to check. - Nit: the test returns early without a message when there is no host GPU or heap, so on a machine without one it passes silently.
Merged into our fork's main.
AI-assisted (Claude Code).
What
buffer_srvandbuffer_uavreturn no view when the title asks for a buffer view withNumElements == 0, so the caller makes the null view it already makes for views that cannot be made.Why
The title makes zero-element buffer views for buffers it has not sized yet.
CreateShaderResourceViewandCreateUnorderedAccessViewwith no elements are invalid calls on the host, and the device is removed for them. I hit this as a device removal in the world on an NVIDIA GPU.Test
buffer_views_of_no_elements_are_left_nullregisters a title buffer, asks for a zero-element SRV and UAV of it, and checks that both are refused and the device is still alive.main(with the twois_noneassertions relaxed) the finalGetDeviceRemovedReasonassertion fails: the device is removed.cargo test -p victory-gpu --libgives 51 passed, 0 failed, 1 ignored.No game-derived content is included.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TydV9AGmPCiUTkG8rHubBQ