native: read formatted loads through a byte-address rewritten descriptor #3034
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3034"
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 JB2WIN on 2026-11-27T09:15:47Z.
Change
Target branch
cpp-migration. Refs #3023. Follow-up to #3025 (merged as1507f0e2); rebased ontocpp-migrationb8f49259, so this PR is the one formatted-load commit.formatted_byte_load(src/gfx1013_compute_mtbuf.inl) askedresource()forraw_vector_srveven when its descriptor was the byte-address rewrite (word 1 with the stride cleared). Atbuffer_load_format_*through such a window was therefore refused with "non-contiguous resource descriptor", both for a table descriptor and for a GPU-selected heap descriptor under theraw_buffercontract of #3025. It now picksbyte_window_srvby the same rule as the raw MUBUF load (buffer_load_dword*). The instruction's format still drives the in-shader conversion,getDimensionson the raw view still bounds the element, and the loads stayrawBufferLoad.src/gfx1013_compute_mtbuf.inl: the view-kind choice, plus the file comment.tests/native_store_replay.cpp: the replay harness binds abyte_window_srvinput as the same raw view and seed asraw_vector_srv.Why this step: on a local start-up capture (
compile_dxil --refusals, 2,689 slot 67 requests, counts only), with the raw heap contract forced and a typed heap load prototyped (both uncommitted, not reproducible from the repo), 861 requests stopped first at this refusal. With this change they move on to other, already-known refusals. No additional request compiles from this alone; typed heap loads (buffer_load_format_*) remain the next step of #3023 and need their own view contract.Verification
Environment: Windows 11 build 26200, NVIDIA GeForce RTX 3080 (driver 32.0.16.2124), MSVC 14.51.36231, Windows SDK 10.0.26100 DXC, D3D12 debug layer not enabled. Base
837728dd(#3025); rerun after the rebase onb8f49259: the four targeted tests pass again.native_global_srv_heap_replay_hardware: 94 assertions (84 before). A 32_UINTtbuffer_load_format_xthrough the heap window is recorded, compiled withcompile_dxil --requestsand replayed for selections 0 and 1 (output equals the slot's data); replaying selection 0 against slot 1 reports a mismatch; a loop around the heap load refuses it ("heap byte window loaded inside a loop"); an 8_8_8_8_UNORMtbuffer_load_format_xyzwthrough the window compiles.native_mtbuf_hardware: the existing 11-format value check also runs through a byte window of its table SRV and matches, including the element at the end of the view that reads 0.native_direct_container: compute table windows with 32_UINT and 8_8_8_8_UNORM compile; without the byte-count product they are refused ("non-contiguous resource descriptor"; an over-acceptance control only, the old code refuses it with the same text).compile_dxil,native_global_srv_heap_replayandnative_store_replaybuilt at837728ddfail: the heap check at thetwindow_loopshape (the earlier 74 assertions pass), the MTBUF check at the window run, the container check atcompute-tbuffer-byte-window, each with "non-contiguous resource descriptor".native_cvt_pk_u8_hardware, failing at the base as well), WARP skips; the same as before the change.compile_dxil --refusalson the local capture without a contract: identical output before and after.tests/docs_links_check.pyandtests/bidi_controls_check.pypass.Evidence and follow-up
clang -cc1as -triple amdgcn-amd-amdhsa -target-cpu gfx1013 -show-encoding); fixtures are source-built.docs/experiments/native-global-srv-heap-replay.md): the MTBUF element bound is the desktop raw view's size, so a runtime that binds a window must size the raw view to the guest window's byte count. The startup manifest route already does so for a table window (max(stride, 1) * num_records,indirect_table_buffer), but no fixture runs that route for a window. The descriptor's DST_SEL is not applied (identity only, unchecked).Checklist
AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T09:31:47Z.
Review: COMMENTED
I reviewed the six-file delta above #3025 and tested GitHub's integration tree
7eef58b7(this head oncpp-migration999e17cd) in Debug with/Z7and Release/O2.ctest --preset <dev|release> --no-tests=error -V -R '^(native_mtbuf_hardware|native_direct_container|native_global_srv_heap_replay_(hardware|warp))$'gave three passes and one capability skip in each configuration. On RTX 4060 Laptop GPU (NVIDIA 616.56, Windows 11 26200.9974, SDK 10.0.26100), capture and offline replay each matched 64 words for both slots and kept all eight guards intact. The wrong-slot control failed at word 0. A back edge spanning the formatted descriptor load refused and produced no bytecode. The table byte-window MTBUF test matched 54 result words and all guards. The heap replay does not enable the D3D12 debug layer. WARP reported 4–4 lanes and exited 77 in both configurations.#3025 is now on
cpp-migrationas1507f0e2. Please rebase the draft onto the updated target so the PR shows only the formatted-load change. The tests above cover the current synthetic capture and replay contract. The runtime checks for stride above one and exact view byte count remain tracked in #3023.Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-27T09:56:17Z.
Thanks for testing it on the RTX 4060 in both configurations.
Rebased onto
cpp-migrationb8f49259(which contains #3025 as1507f0e2). The PR is now the single commite67f1017and is marked ready. I rebuilt on the new base and rerannative_mtbuf_hardware,native_direct_container,compute_load_format_controlsandnative_global_srv_heap_replay_hardwareon the RTX 3080 (driver 32.0.16.2124): 4/4 passed, 94 assertions in the heap replay as before. The PR description is updated to match.Agreed on the remaining runtime checks; the stride, exact byte count and DST_SEL items are recorded in #3023.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T10:14:57Z.
Review: APPROVED
Reviewed the rebased six-file delta at
e67f1017, integration commite3dbf96foncpp-migrationb8f49259. I rebuiltcompile_dxil,native_store_replay,native_global_srv_heap_replayandoffscreen_check, then ranctest --preset <dev|release> --no-tests=error --output-on-failure -j 2 -R '^(native_mtbuf_hardware|native_direct_container|compute_load_format_controls|native_global_srv_heap_replay_(hardware|warp))$'. Each configuration produced four passes and one WARP 77 skip because the adapter has four-lane waves. RTX 4060 Laptop driver 32.0.16.1656, Windows 11 26200.9974, SDK 10.0.26100, WARP 10.0.26100.9818, heap replay debug layer off. Hosted Windows, Linux and gfx1013 passed. This covers the capture and offline compiler contract. Runtime stride, exact view length and DST_SEL remain in #3023.