runtime: guard null out pointers, add inspection helpers and unit tests for PlacedDepthTextures (RT-XS-PLACED-DEPTH-GUARDS-AND-TESTS) #2046
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2046"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T18:56:49Z.
Claimed in the coordination issue as: RT-XS-PLACED-DEPTH-GUARDS-AND-TESTS (claim)
What and why
runtime/shims/d3d12_xs_placed_depth.hmanages GPU backing for slot-133 depth/UAV textures keyed by Xbox placement ranges.Null out pointer guards:
PlacedDepthTextures::create: Ifoutis null, returnsE_POINTERimmediately before attempting any allocations or lookups.outis non-null, sets*out = nullptrat entry so failures (E_INVALIDARG,E_NOTIMPL, or backing creation failures) guarantee callers receive null.Inspection and cleanup helpers:
clear(),size(), andempty()toPlacedDepthTextures(markingmutex_mutable for const query methods).Portability:
ID3D12Resource::GetDescinPlacedDepthTexture.Unit test suite (
runtime/test/d3d12_xs_placed_depth_test.cpp):outpointer returningE_POINTER.address == 0,Alignment == 0, unaligned address,SizeInBytes == 0, address+size overflow) setting*out = nullptrand returningE_INVALIDARG.create_backingfailure propagation and clearing*out.texture_backingresolution.QueryInterfaceforwarding (kVulkanResourceTagdelegating to backing,ID3D12Resourcereturning wrapper).E_NOTIMPL).E_NOTIMPL).std::erase_if) when all aliases are released.clear()andempty().OptimizedClearmismatch refusal.Registers
d3d12_xs_placed_depth_testand CTest inruntime/CMakeLists.txt.Tested
46/46 checks passed(0 failures).python -I tests/test_ci_registration.py: 16/16 pass.python -I tests/test_text_write_line_endings.py: 3/3 pass.python -I scripts/check_no_game_data.py: clean (0 violations, no game data).AI-assisted (Claude Code)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T02:48:51Z.
Hi @abnalstlll-byte, thanks for this pull request. It currently conflicts with
main(conflicting file(s):runtime/CMakeLists.txt), so it carries theneeds rebaselabel. CONTRIBUTING.md asks authors to rebase their branch onmain; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T11:36:38Z.
TAKEN by OreoFR (Windows, RTX 4070 8 GB)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T12:38:20Z.
Verified by OreoFR — READY
8fb974878+ this PR (head0233a9ec7) merged with --no-ff (still no conflict with maincc0f662a7; theruntime/CMakeLists.txtconflict in the needs-rebase note is gone)clear()/size()/empty()accessors so the test compiles, without the null-out guards):d3d12_xs_placed_depthfails 9 of 46 checks. A nulloutstill registers a range ("pool remains empty on null out"), and*outis not cleared on the 8 refusal paths.LEONIDA_CARGO=OFF,LEONIDA_XMA2_DECODER_LIBempty); imports unchanged vs main (25 DLLs, no WS2_32)proxy_create_placed_resource_slot133) already checksout, so the E_POINTER path changes nothing in game. The new accessors and the__MINGW32__GetDesc branch are additive.AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
Ready to merge per the maintainers' plan (green, no conflict, tested).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T14:09:20Z.
I could not run the Linux build locally, so this is only what I found from the CI log and the current workflow.
linux-gpu-toolsrun (2026-11-26, head0233a9e) failed at Build withvk_null_descriptor_test.cpp:97: error: 'LEONIDA_TEST_NULL_DESCRIPTORS_SPV' was not declared in this scope. That file is not touched by this PR; the PR only changesruntime/CMakeLists.txt,d3d12_xs_placed_depth.hand its test.vk_null_descriptor_test.cppwraps that code in#ifdef LEONIDA_TEST_NULL_DESCRIPTORS_SPV, so the error from that run should not reproduce after a rebase.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:19:16Z.
Merged at head
0233a9e. Tested by OreoFR on this head (Windows, RTX 4070): READY, new test red on main and green with the PR. Its red CI steps of 26/11 (linux Build, windows CPU runtime tests) were red on main the same day; Thib traced the Build one to vk_null_descriptor_test.cpp, which this PR does not touch. AI-assisted: yes.