shader: specify raw MUBUF binding contract #711
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/717"
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 lambirou on 2026-11-22T22:19:48Z.
Change
Refs #319.
Document a bounded first contract for lowering one raw buffer_load_dword with
offen in pixel_aot. The proposal keeps the pixel path on ps_6_0 and adds a
visible, bounded space1 descriptor table for the title range table and alias
buffers.
It records the four SGPR words that form a gfx1013 V# with separate masks.
DW0 carries address[31:0], DW1[15:0] carries address[47:32], DW1[29:16] is
the 14-bit byte stride and DW1[31:30] holds the cache-swizzle flags. The
address uses DW0 and DW1[15:0] only, with the descriptor layout cited from the
AMD RDNA 2 instruction-set reference. The first case remains stride zero, no
idxen, zero scalar offset and OOB_SELECT=3. The proposed whole-DWORD bound is:
The document includes first-word, last-word, complete out-of-range and aligned
partial-tail draws. The aligned partial tail uses NUM_RECORDS = 14 at offset 12
and stays separate from the rejected non-aligned offsets 13 to 15. A guest
bound miss returns zero. A title address inside the guest bound but outside
every published range must surface as a separately observable host binding
failure, not as a successful zero read. An address-extraction control varies
the DW1 stride or flag bits without changing DW1[15:0], so the two descriptors
must produce the same 48-bit base.
Negative controls cover dropped guest bounds, byte/DWORD scaling, the two base
words, a wholesale DW1 shift, the wrong bounds mode, a host mapping miss counted
as zero, an unaligned partial tail, range crossing and unproven descriptor
provenance.
Issue #319 remains open. Its single reply is a contributor preference, not a
maintainer decision. This patch deliberately adds no vector-memory lowering.
Verification
The local commit is
5bf70ce310, rebased ontoorigin/main
6f48648e. GitHub still reports the branch as mergeable after mainadvanced to
787ace7.Both checks passed. docs_links_check.py checked 11 Markdown files and 135
links. The bidirectional-control scan checked 601 tracked files.
The Leonida reference at 4eb6155d reports a 732-case hardware measurement on
gfx1036. It includes soffset in mode-3 raw bounds, but does not establish the
gfx1013 rule.
Evidence and follow-up
The proposal asks the maintainer to confirm four points:
It must be distinct from a guest bound miss and must not count zero as data;
AI-assisted: yes.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T23:02:22Z.
Review: COMMENTED
Re-reviewed
5bf70ceas a design-only document. The three requested changes are present.V_BASE_HI_MASK=0x0000ffffnow keeps DW1[29:16] stride and DW1[31:30] flags out of the address, with a same-address/different-descriptor-bits control. The test plan requires a separately observable host range failure even when the guest V# bound passes. NUM_RECORDS=14 at aligned offset 12 is a separate partial-tail case, and offsets 13–15 are excluded as unaligned. The proposal explicitly leaves hardware validation on gfx1013 and the final binding decisions open. Both Windows and Linux checks passed at this SHA. My docs-review requests are satisfied.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T22:36:08Z.
Please fix an ambiguity in the proposed V# layout before this serves as an implementation contract. Word 1 cannot be copied wholesale into the high half of a 64-bit address while bits [29:16] of that word also carry stride. Name the address and flag masks separately, cite the encoding, and give a control that changes descriptor bits without changing the address. Keep a guest bounds miss distinct from a missing host title-range mapping. The latter should produce a separately observable binding failure in the fixture rather than count a zero result as a successful read. Please also separate aligned partial-bound controls (for example, an aligned offset with fewer than four bytes left in NUM_RECORDS) from rejected non-aligned inputs. The gfx1036 measurements help select the tests, while the gfx1013 behavior remains an open question.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-22T22:53:13Z.
I rewrote the V# section and the test plan.
names DW1[29:16] as the 14-bit stride and DW1[31:30] as cache-swizzle flags,
cites the RDNA 2 Buffer Resource Descriptor layout, and adds a control that
varies those bits without changing the 48-bit base.
published range is now specified as a separately observable host binding
failure, not a successful zero read.
NUM_RECORDS = 14, offset 12) is a distinct casefrom the rejected unaligned offsets 13 to 15.
gfx1013 rule is still called out as open.
The branch is at
5bf70ce31045e6ca0e1208099ee894edf8054cf8and remainsmergeable against current main.
docs_links_check.pyandbidi_controls_check.pypass.