Repository navigation
Conversation
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> (cherry picked from commit e67f101)
Conflicts resolved: - indirect_table_buffer: main added `alignment` as the sixth parameter, so the compute input call now passes D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT before `true, slot.requires_identity_dst_sel` and keeps main's scalar-window fallback. - formatted_byte_load: a byte window the caller already bound (main's graphics path) is used as is; otherwise the zero-stride rewrite selects byte_window_srv. - native_mtbuf_check.py: main's scalar operand 137 with the byte-window prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R0Y00#3042) Accept the one-channel typed heap-view contract in the direct compute compiler and offline replay. Exercise typed slot selection, cache reuse, and malformed metadata refusals with source-built fixtures. Refs R0Y00#3023. (cherry picked from commit a0f6773)
The typed heap load reads the idxen element index only. offen, an immediate
offset and a nonzero soffset are already refused by the decoder ("formatted
load requires zero or a single linear index"); three negative cases pin that.
The doc now lists the typed_dword contract and the current assertion count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hardware test on the Windows test PC (RTX 4070 Ti, Windows 11) at head
The 4 failures are AI-Assisted |
Leyukaka
left a comment
There was a problem hiding this comment.
Request changes at d4d9af41. Read from the diff only, not built here.
Blocking: the in-process path drops the DST_SEL check. translate_compute_natively (src/startup_stubs/d3d12_compute_dispatch.inl, slot loop) accepts byte_window_srv through accepts_cbv_window and pushes the slot without copying view.requires_identity_dst_sel, so record_translated_dispatch calls indirect_table_buffer(..., false). That path is tried before the published manifest. On main this program was refused at translation. With this PR and X2W_NATIVE_SHADERS set, a V# with swapped DST_SEL, a slot 18 SRV with a non-default mapping or a slot 17 CBV token binds without a check (the three checks in d3d12_draw.inl are all gated on that flag). The same drop applies when the pack returns a prepared program, not only on live translation. I could not find what the doc line "The in-process path falls through to that manifest for a byte window" refers to. startup_compute_mtbuf_window_check.py removes X2W_NATIVE_SHADERS, so this path is not tested. Suggested fix: set slots.back().requires_identity_dst_sel = view.requires_identity_dst_sel; and run the swapped case once with the variable set.
One-line mutations the tests do not catch:
src/startup_stubs/native_global_srv.h,global_srv_contract:view.dword_channels != 1->!view.dword_channels. There is nodword 3 2case.- Same line: removing
view.stride != 4 ||or!view.bytes || view.bytes % 4 ||. No stride or size negative exists. src/startup_stubs/d3d12_draw.inl:(words[3] & 0xfffu) != 0xfacu->(words[3] & 0x3fu) != 0x2cu. Only an X/Y swap is tested, and the test load is_xy.
Checked and correct: 0xfac is identity DST_SEL. The decoder refuses typed heap loads with op > 3 (so no d16), offen, an immediate offset or a nonzero soffset. heap_typed_srv is appended last and the cache decode bound covers it. compute_heap_binding includes it, so the pipeline treats it as heap-indexed. The revision hash covers direct_compute_cache.cpp, so cached bindings in the old format do not decode under the new layout. git merge-tree against main 212d4b5f is clean.
Scope: the startup runtime still passes HeapViewContract::none (translate_compute hardcodes it at gfx1013_compute_native.cpp:2048; compile_dxil line 858 for runtime requests). So "direct resource-heap load requires the selected GPU slot and its view type" still refuses every runtime request. typed_dword applies only to compile_dxil with a .views file. In the runtime, the only change is that compute MTBUF loads through a table byte window are no longer refused with "non-contiguous resource descriptor".
The only build file is tests/cmake/startup_compute_mtbuf_window.cmake (add_test only). It is picked up by the existing glob, and CMakeLists.txt is unchanged.
…he contract checks Review of R0Y00#3409 (Leyukaka): - translate_compute_natively pushed a byte-window slot without requires_identity_dst_sel, so with X2W_NATIVE_SHADERS a swapped DST_SEL, a non-default slot 18 mapping or a slot 17 CBV token bound without the check. The slot now carries the flag. startup_compute_mtbuf_window runs the identity and swapped cases on the in-process route too; without the fix the swapped case writes the output. - A Z/W swap with identity X/Y is refused too (catches a check of the low DST_SEL fields only). - global_srv_contract: a two-channel dword line, stride 8, an odd byte count and a zero byte count each refuse on their own. - Doc: the in-process sentence now says what the code does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, all addressed in
AI-assisted. |
Brings the two
cpp-migrationfeatures tomain: #3034 (formatted loads through a byte-address rewritten descriptor, as RonLogic's #3232) and #3042 (one-channel typed loads through a GPU-selected heap slot). Takes over #3232 under the 2-hour rule (no activity since 12:39 UTC, see the comment there). RonLogic's commits are kept as they are.This is the first step toward #3063 on
main. Its bucket, "direct resource-heap load requires the selected GPU slot and its view type", is the largest in #3224 (330 shaders, 4.67 M dispatches in Leyukaka's 900 s run).Changes on top of #3232
main8ecd30f.indirect_table_buffergainedalignmentas its sixth parameter onmain, so the compute input call passesD3D12_RAW_UAV_SRV_BYTE_ALIGNMENTbeforetrue, slot.requires_identity_dst_sel(Leyukaka's point 1 on Carry formatted buffer loads through byte-address windows to main #3232). Every other caller was checked against the new signature.formatted_byte_loaduses a byte window the caller already bound (main's graphics path) and otherwise selectsbyte_window_srvfrom the zero-stride rewrite.heap_typed_srvgoes afterindexed_raw_srv(kinds are serialized by value, so appending keeps existing caches valid). Thetyped_dwordcache identity sits inmain'scached_compute_ir. Test section 12 sits next tomain's sections 10 and 11.offen, an immediate offset or a nonzerosoffsetis refused by the decoder ("formatted load requires zero or a single linear index"). Doc updated (typed_dwordcontract, 160 assertions).Leyukaka's point 2 on #3232 (the pixel-shader MTBUF path has no test) is not covered here.
Tests
Windows 11 26200, RTX 3080 (32.0.16.2124), WARP, dev preset,
-j1:^(native_.*|startup_compute_.*|compute_manifest.*|direct_compute.*)$: all pass exceptstartup_compute_dispatch_output_{warp,hardware}andstartup_compute_half_buffer_uav_{controls,hardware}. Those four fail the same way onmainwithout this PR (see shader: lower direct MTBUF packed half stores #3353). WARP wave32 cases skip with 77.native_global_srv_heap_replay_hardware: 160 assertions pass. With thesrc/,tools/and fixture changes of the native: read one-channel typed loads through a GPU-selected heap descriptor #3042 commit reverted, it fails at "record typed select 3".startup_compute_mtbuf_window_{controls,hardware}(identity and swapped X/Y, writable alias, CBV token) pass after the merge.Refs #3232, #3042, #3034, #3023, #3224.
AI-assisted.
🤖 Generated with Claude Code