Repository navigation
native: read formatted loads through a byte-address rewritten descriptor - #3034
Conversation
R0Y00
left a comment
There was a problem hiding this comment.
I reviewed the six-file delta above #3025 and tested GitHub's integration tree 7eef58b7 (this head on cpp-migration 999e17cd) in Debug with /Z7 and 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-migration as 1507f0e2. 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.
formatted_byte_load asked resource() for raw_vector_srv even when the descriptor was the byte-address rewrite (stride cleared in word 1), so a tbuffer_load_format_* through such a window was refused with "non-contiguous resource descriptor", for a table descriptor and for a GPU-selected heap descriptor under the raw_buffer contract. It now picks byte_window_srv by the same rule as the raw MUBUF load. Conversion, the getDimensions element bound and the raw loads are unchanged. Tests: - native_global_srv_heap_replay_check.py: a 32_UINT tbuffer load through the heap window is recorded, compiled and replayed for selections 0 and 1, with the cross-slot mismatch control; the loop guard refuses it; an 8_8_8_8_UNORM load through the window compiles. - native_mtbuf_check.py: the 11-format value check also runs through a byte window of its table SRV (native_store_replay accepts the window binding as the same raw view). - native_direct_container_check.py: compute table windows with both formats compile; without the byte-count product they are refused. Refs R0Y00#3023 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b11de4d to
e67f101
Compare
|
Thanks for testing it on the RTX 4060 in both configurations. Rebased onto Agreed on the remaining runtime checks; the stride, exact byte count and DST_SEL items are recorded in #3023. AI-assisted. |
R0Y00
left a comment
There was a problem hiding this comment.
Reviewed the rebased six-file delta at e67f1017, integration commit e3dbf96f on cpp-migration b8f49259. I rebuilt compile_dxil, native_store_replay, native_global_srv_heap_replay and offscreen_check, then ran ctest --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.
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