runtime: bind slot 86 heap window views only in the shader's read type (Part of #3545) #3599
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3599"
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 R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-11-30T12:29:03Z.
Part of #3545. Follow-up to #3593. Target
main.Problem
#3593 bound any typed buffer format in a heap-buffer window. A desktop stage that reads
Buffer<float4>could therefore be given anR32G32B32A32_UINTview, which D3D12 leaves undefined. @timbot103's prototype on #3545 refuses this wrong-format case.Change
Publisher (
mesh86_cache.py):annotateHandleproperties: F32, SNormF32 and UNormF32 count asf32, U32 asu32, I32 asi32.heap-buffer <first> <count> <type>.Runtime (
mesh86_cache.inl):ExecuteIndirect, a slot is bound as a typed null if its view format reads as a different type: FLOAT, UNORM and SNORM read asf32, UINT asu32, SINT asi32.R32G32B32A32format of the window's type.The profile 3 marker format changes. #3593 merged at 12:19Z today, and no published markers exist outside the fixtures.
Tests
startup_indirect_mesh_cache_heap_*:R32G32B32A32_UINTview of the same bytes in anf32window. It reads as null, red on the left half, and the log rowslot format does not match the window's read typeappears;runtime_mesh86_cache_cli_check: three new window cases (au32window, an F16 read refused, and a mixed f32/u32 window refused), on top of the seven from #3593.Windows 11 build 26300, MSVC 19.44, Release, debug layer enabled. On an RTX 3090 (driver 32.0.16.1664) and WARP 10.0.26100.9818, all 23 slot 86, cached mesh and mesh lease tests passed with no D3D12 errors.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-11-30T12:44:36Z.
Independent Release retest of
3f9af963bd1aon RTX 5080 and WARP. I adapted the source-built fixture to use this PR’s publisher and runtime. The publisher provedheap-buffer 4 2 f32for4 + min(group.x, 1u). The typed buffer load is in the mesh stage, and the draw runs through wrapped slot 86 andExecuteIndirect.Both adapters matched all eight pixels in each case. The two live views drew red and green. An explicit typed null, an
R32G32B32A32_UINTview in thef32window, and an empty slot each drew black on the left and green on the right. The wrong-type case loggedslot format does not match the window's read type. The indirect argument guards stayed intact. The pending-profile control left the target clear.Five CTest entries passed with the local fixture overlay, including both adapted mesh-stage cases, both existing heap-window cases, and the cache CLI check.
Windows 11 build 26200, RTX 5080 driver 32.0.16.2140, in-box WARP 10.0.26100.9818, MSVC 19.44.35230, and DXC from Windows SDK 10.0.26100.0. The D3D12 debug layer was unavailable.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T12:48:05Z.
Review: APPROVED
Reviewed
3f9af963by reading the diff; not built or run.Verdict: approve. The read type is proven once in the publisher, carried through the marker, and enforced per slot at bind time; every path that cannot be matched ends in a typed null of the window's type or a creation refusal. No MUST, no SHOULD.
ResourcePropertiesword is the DXIL component type. 9/13/14 →f32, 5 →u32, 4 →i32is correct, and F16/64-bit and mixed windows are refused (tools/startup/mesh86_cache.py:137,:206).mesh86_read_class(mesh86_cache.inl:14) covers every formattyped_buffer_format_bytesaccepts (memory_srv_buffer.h), so the wrong-type branch at:382is reached only after the format is known to be a typed buffer format. A recognised but unclassified format cannot occur.%3sintochar[4]plus the exactexpectedcompare at:307rejects trailing text and untyped windows.:420):Mesh86HeapEntry::operator==comparesFormat, and every null entry now carries the window's type. So au32window and anf32window with the samefirstcannot share a page, and the slots belowfirstkeep the right null type.mix read types). Per-slot types in the marker would cover that later.Tests: the
uint_seconddraw reaches:382and checks both the pixel and the log row. The untyped-marker loop reaches the:291refusal. The CLIuint/half/mixedcases reach the publisher's new branches. CI did not run them:runtime_mesh86_cache_cli_checkandstartup_indirect_mesh_cache_heap_*are outside theprpreset filter, and no workflow calls the Python checks. They ran locally: the author on RTX 3090 + WARP with the debug layer, and timbot103 on RTX 5080 + WARP at this head.Imported from R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-11-30T13:10:39Z.
Thanks @timbot103 for the independent retest on RTX 5080 and WARP (https://github.com/R0Y00/Xbox2Windows/pull/3599#issuecomment-7278860449). It covers the mesh-stage read path, which my pixel-stage fixture doesn't. Thanks @lukaslw-lab for the review.
On the nit: agreed. A window with both float and uint heap reads is refused as a whole for now. If a real title pass needs mixed types, the marker can carry one type per slot range. That would be its own PR, with a fixture that reads both types.
On CI coverage: good catch.
runtime_mesh86_cache_cli_checkandstartup_indirect_mesh_cache_heap_warpare not in theprpreset filter, so CI never runs them. I'll open a separate small PR that adds them, next to thestartup_indirect_mesh_lease_warp_dualentries already there, which use the same driver script and DXC. #3603 will add itsheap_wide_warptest the same way.Imported from R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-30T13:41:44Z.
Independent AMD RDNA2 + WARP retest of
3f9af963:10.0.26300.032.0.21045.29003) and Microsoft WARPdevpreset (MSVC Debug), D3D12 debug layer present (d3d12SDKLayers.dll), DXC10.0.26100.0ctest --preset dev --no-tests=error -j1 -R '^(startup_indirect_mesh_cache_heap_|runtime_mesh86_cache_cli_check$)' -Vruntime_mesh86_cache_cli_check,startup_indirect_mesh_cache_heap_warp, andstartup_indirect_mesh_cache_heap_hardwareall passed, including theslot format does not match the window's read typenull-binding path on AMD Radeon RX 6600.