test: use an invalid handle in the existing-heap check (TEST-D3D12-EXISTING-HEAP-INVALID-HANDLE) #2515
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2515"
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 TheGeogeo on 2026-11-27T23:46:06Z.
Claimed in the coordination issue as: TEST-D3D12-EXISTING-HEAP-INVALID-HANDLE
What and why
d3d12_existing_heap_testpasses0x1234toOpenExistingHeapFromFileMappingand expectsE_INVALIDARG. Windows can assign that value to a live handle, so the Vulkan shim returnsE_NOTIMPLand the test fails.Use
-0x10000as the invalid-handle sentinel and check it withGetHandleInformationbefore asserting the HRESULT.Tested
main(d44285197), a temporary control retained a synthetic event at0x1234. The test returnedE_NOTIMPLwhere it expectedE_INVALIDARG. The same control passed with the fix.RelWithDebInfo. All five targeted CTest cases passed:d3d12_existing_heap,d3d12_host_prefix,d3d12_mapped_plane_async, and both existing-heap write-watch variants.git diff --checkandscripts/check_no_game_data.pyon the changed file passed.GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 build 26300.
AI-assisted: yes (Codex).
Checklist
main.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T23:59:17Z.
Review of
6e5e82e40, asked for in the French Discord group. I read the diff and the shim, and built and ran the test. No game files were used.Read in code. The fix matches what the shim checks.
OpenExistingHeapFromFileMapping(runtime/shims/d3d12_vulkan_device.cpp:19820-19827on maind44285197) returnsE_INVALIDARGonly whenGetHandleInformationfails. With a valid handle it returnsE_NOTIMPL. So a live handle at0x1234produces exactly the failure described here. The newEXPECT(!GetHandleInformation(...))asserts that same precondition before the HRESULT check.-0x10000is outside the small negative pseudo-handle range, and a user-mode process never gets a real handle with that value.Tested. Windows 11, MSVC Build Tools 2022, RelWithDebInfo, RTX 4070 Laptop 8 GB with NVIDIA 621.40. I built
d3d12_existing_heap_teston maind44285197and again with this file. Both exit 0, and the run ends with "vulkan vs host WARP: 8 OpenExistingHeapFromAddress cases match".0x1234wasn't live in my main run, so I couldn't reproduce the collision. Your forced-collision control covers that case.Looks good to me.
AI-assisted (Claude Code, Claude Opus 5.5), for OreoFR.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T09:52:18Z.
#2515 | head
6e5e82e400(merged cleanly with main3ca0707dde) |ctest --test-dir runtime/build -C RelWithDebInfo -R "^d3d12_existing_heap" --output-on-failure| red on main: whenHANDLE(0x1234)collides with a live kernel handle in the process (reproduced deterministically by opening kernel events until0x1234is live),OpenExistingHeapFromFileMapping(HANDLE(0x1234), ...)returnsE_NOTIMPLinstead ofE_INVALIDARGand failsd3d12_existing_heap_test| green on PR+main:3/3CTests pass on RTX 3090 (d3d12_existing_heapin9.15s,d3d12_existing_heap_no_write_watchin6.96s,d3d12_existing_heap_write_watchin9.08s, verifying!GetHandleInformation(HANDLE(-0x10000), ...)before checkingE_INVALIDARG);check_no_game_data.py0violations | Windows 11, RTX 3090 (610.88), Vulkan SDK 1.4.363.1 | AI-assisted: yesImported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:12:09Z.
Red/green: with a live handle forced at 0x1234, main fails at line 91 with E_NOTIMPL instead of E_INVALIDARG, and the PR passes under the same control (d3d12_existing_heap_test built alone, 5 ctest cases pass).
Full local suite (python standalone, pytest, semantic, node) with the PR merged on main
1a441d336: no new failure; merge-tree clean on main745aa4398.AI-assisted (Claude Code, Claude Opus 5.5)