startup: accept the structured-to-raw descriptor conversion for compute buffer stores (Part of #2274) #2538
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2546"
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 Leyukaka on 2026-11-25T20:27:13Z.
Part of #2274, the composite form of "buffer store through a modified descriptor" (claim, building on #2320).
Captured compute programs convert a structured buffer descriptor to a raw one before a
buffer_store_dword*. Shape of the sequence (register numbers illustrative):This accepts exactly that conversion of the four words of one table descriptor, in any order the symbols allow, and translates the store as #2320 translates the stride-cleared store. The field positions are the ones in
docs/pixel_mubuf_contract.md. Everything else stays refused withbuffer store through a modified descriptor:OOB_SELECT;NUM_RECORDSnot scaled, or scaled by a constant or by another descriptor's stride;s_bfe_u32;Descriptor identity: the pointer symbol records neither an addend on the low word nor a rewritten high word, so this also tells compute loads apart when the pointer may differ. A load through an untouched root pointer pair keeps the plain symbol, a load through an untouched 32-bit table pointer with a known constant high word is tagged with that constant, and any other load with its own offset. So a second load through the same pointer names the same words, while a load after
s_add_u32on the pointer, after a new high word, or at another table offset cannot supply a word of the conversion. Equal loads on both arms of a branch are still kept at the join.Limits. The fixture binds a root UAV and reads no descriptor, so the GPU run checks the translation, not the converted range. The manifest is the same as for the plain store, so sizing the view to
NUM_RECORDS * strideis left to the runtime, as for the stride-only case of #2320.Tests (Windows 11, Python 3.14, DXC from the Windows SDK 10.0.26100), on main
780f3c0plus the two commits of this PR:python -B tests/startup_gfx2hlsl_compute_check.py: ok. New caseI-rawgives the same HLSL and manifest as the plain store. The clamped form is accepted. The refusals above are each checked.... dispatch <dxc> <offscreen_check> warpandhardware: ok, includingI-raw. WARP: Microsoft Basic Render Driver. Hardware: NVIDIA GeForce RTX 5080, driver 32.0.16.2101.startup_gfx2hlsl_join_symbols_check,startup_compute_translate_check,startup_compute_request_offline_check,compute_load_format_check,compute_heap_store_check,compute_desc_numeric_check,startup_translator_check,startup_compute_image_store_d16_check,startup_gfx2hlsl_loop_constants_check,startup_gfx2hlsl_refusals_check,startup_gfx2hlsl_sload_const_offset_check,startup_gfx2hlsl_smem_offset_checkandcompute_heap_view_check.Mutation checks, run by hand. The controls fail on each:
OOB_SELECT2 accepted;descnum;s_bfe_u32with any field;Measured on a local capture (counts only, inputs private; requests re-keyed with
shader_cache_rekey.pyfor the current revision): at main396e7e2, 22 compute requests hadbuffer store through a modified descriptoras their first refusal. With this change, 16 of them translate and compile. The other 6 stop at unrelated refusals:buffer store without the offen address form(2), a 64-bit source, a descriptor used for both a load and a store (2), and an unprovenv_readfirstlane_b32source.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:35:10Z.
Review: COMMENTED
Review of head
eee2169a(comment only, code and fixture tests).Code: the recognizer
raw_descriptor_aluaccepts only the listed word expressions (stride bfe 0xe0010, optional max with 1, OOB clear 0xcfffffff, NUM_RECORDS times stride, OOB set 0x30000000, stride clear 0xc000ffff) on words of one table descriptor, andstore_descriptorrequires the exact four-word shape. Everything else still lands onbuffer store through a modified descriptor. Field positions matchdocs/pixel_mubuf_contract.md. The stricternames_one_valuecheck keeps a derived word from being treated as a loaded value. I found no sibling table that needs the same change.Tests: the new
I-rawcase checks HLSL and manifest against the plain store and the refusal list. The PR also reports a WARP and hardware dispatch run of the same test.Commands run locally (Linux, 6 commits behind main, own diff unaffected):
python3 -B tests/startup_gfx2hlsl_compute_check.pypassedpython3 tests/docs_links_check.pyandpython3 tests/bidi_controls_check.pypassedgit diff --check origin/main...HEADcleans_max_u32clamp accepts any constant: the test fails (accepted, expected a refusal).Not verified by me: I did not run the D3D12 dispatch step, and the "16 of 22 translate" count comes from a private capture that I cannot reproduce. The PR is tied to startup progress under #2274, so the merge decision and any check on the real game stay with MasterDomino or @R0Y00.
AI-assisted; commands listed were executed locally.