compute: read the buffer load V# from a run-time heap view record (Part of #2022) #2166
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2174"
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 tedin7 on 2026-11-25T02:52:20Z.
Part of #2022
What this unblocks: slice 2 of item A. Formatted buffer loads in
compute_store_aot.pycan take base, stride,num_recordsand the format from a V# view record chosen at run time, with range and lifetime controls, on top of the #2150 decoder.Scope, stated plainly:
--heap-view SLOT_WORD TABLE_OFFSET COUNT BUFFER_BYTESreads a 32-byte record per view (V# words 0 to 3 plus a live state word) from a side table inside t0.num_records, opcode wider than the stride, element leaving the buffer.ResourceDescriptorHeap[index](SM 6.6). That needs a heap-indexed root signature and stays open under #2022 and #1143. This is not application coverage.Tests:
tests/compute_heap_view_check.py(controls, LLVM 15 round trip, WARP/hardware draw with 11-slot tables for the xy and xyzw opcodes, wrong references and mutated sources that must fail). Registered in CMake, the workflow and AGENTS.md; docs indocs/experiments.md#heap-view-buffer-loads.Verification:
python3 -B tests/compute_heap_view_check.py controls,compute_load_format_check.py,compute_entry_layout_check.py,compute_alu_bcnt64_check.py,compute_alu_cmp_ne_check.py,docs_links_check.py,bidi_controls_check.py,run_checks_parallel_check.py,git diff --check: all pass.python3 x2w_pipe.py win2025 2174 --wait 3600at headab3bf742. Debug (--preset dev) PASS and Release/O2(--preset release) PASS, ctest 63/63 passed includingcompute_heap_view_controlsandcompute_store_aot_heap_view_load_warp.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T03:39:12Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
ab3bf7425fℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T03:31:45Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
ab3bf74ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T03:39:13Z.
Code review location:
tools/compute_store_aot.py; line 633For a dispatch reaching index 262144, this fixed ceiling makes valid elements read zero. For example, a live two-channel view with base 0, stride 16,
num_records=300000andBUFFER_BYTES=4800000contains the requested bytes at address 4194304, but this predicate setsinRangeto false and the invocation stores zeros.lower()accepts a group size of eight, so a legal dispatch of 32769 groups reaches this case. Use an overflow-safe bound derived from the buffer length and stride rather than treating every index at or above 2^18 as out of range.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T03:39:13Z.
Code review location:
tools/compute_store_aot.py; line 632For a live view with an unaligned base or stride, these guards allow
load_descriptor_format()to receive an address that violates itsinputData.Load4(addr)DWORD-alignment requirement. A supportedR16_UINT/buffer_load_format_xview with base 2, stride 4 and eight records passes every range check and loads at address 2; base 0 and stride 6 similarly produces address 6 for index 1. The static path enforces aligned strides, but heap views explicitly exclude that validation without replacing it at runtime. Reject misaligned records or implement unaligned word extraction before decoding to avoid undefined or incorrect readback.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:46:38Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:46:40Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T04:54:12Z.
While preparing the adjacent store fixture for #2022 B, I noticed that
XYZW_VIEWSlabels itsindex past num_recordsrow32_32_32_32_UINTbut passes format 77. I checked both names with LLVM 15.0.7 targeting gfx1013. With otherwise identicaltbuffer_load_format_xyzwoperands, UINT assembled to40d05bea00054203(format 75) and FLOAT to40d06bea00054203(77). The tree'stools/disasm_rdna2.pytable agrees. The raw four-dword readback can pass for either. If this row is intended as UINT coverage, could you switch the code to 75? If it is intended as FLOAT, the label can say FLOAT. Our store fixture will use 75.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:46:38Z.
Code review location:
tools/compute_store_aot.py; line 633Fixed in
dfc6c2c0(fix5bf90a9f). The fixed 2^18 ceiling is gone; the bound is now index <= (buffer length - base) / stride, which cannot wrap. Note: the fixture buffer is 1280 bytes, so a dispatch cannot reach index 2^18; the controls assert the new bound on the generated source and two mutations (index bound, buffer end) fail on WARP.Verification: python3 -B tests/compute_heap_view_check.py controls, compute_load_format_check.py, docs_links_check.py on Linux; x2w_pipe.py win2025 2174 --force: dev 63/63 and release 63/63 passed, no skips.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:46:40Z.
Code review location:
tools/compute_store_aot.py; line 632Fixed in
dfc6c2c0(fix5bf90a9f). A live view whose base, stride or instruction offset is not a multiple of 4 is now refused (valid=false, stores suppressed) before the DWORD load. New fixture views: unaligned base and unaligned stride, on xy and xyzw, plus two mutations that fail on WARP.Verification: python3 -B tests/compute_heap_view_check.py controls, compute_load_format_check.py, docs_links_check.py on Linux; x2w_pipe.py win2025 2174 --force: dev 63/63 and release 63/63 passed, no skips.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T05:42:18Z.
Review: APPROVED
Verified head
5ba80892on Windows x64 (devpreset, MSVC19.44.35228.0, SDK/DXC10.0.26100.0):cmake --build --preset dev --target offscreen_check-> succeededctest --preset dev --no-tests=error -R '^(compute_heap_view_controls|compute_store_aot_heap_view_load_)' -V-> 3/3 passed (compute_heap_view_controls,compute_store_aot_heap_view_load_hardware,compute_store_aot_heap_view_load_warp)heap_view_load: 56 dispatches, 6 wrong references and 14 mutated sources checked (debug_layer=enabled,debug_errors=0 debug_warnings=0).AMD Radeon RX 7900 XTX(vendor=1002 device=744c, driver32.0.32029.2010)Microsoft Basic Render Driver(vendor=1414 device=008c, driver10.0.26100.9818)Verdict: Approved at
5ba80892.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:05:26Z.
Thank you @RavenCurseBurg, good catch and a clear write-up.
Fixed in
5ba80892: the32_32_32_32_UINT, index past num_recordsrow inXYZW_VIEWS(tests/compute_heap_view_check.py) now passes format 75, matching its label and thetools/disasm_rdna2.pytable.Verification:
python3 -I tests/compute_heap_view_check.py: self-test passedpython3 -I tests/docs_links_check.py: 18 Markdown files, 404 links OKcompute_heap_view_controls,compute_store_aot_heap_view_load_warp)AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T05:40:54Z.
I checked out
5ba8089240c09b81c7e16c1ab355bccf533f4e8ein a clean worktree and ranpython -B tests/compute_heap_view_check.py draw <dxc> <offscreen_check> warp, then the same command withhardwareon Windows x64. Both runs passed all 56 dispatches and detected all six wrong references and fourteen mutated shaders, including the corrected UINT4 case. I used DXC v1.9.2609 and the source-builtoffscreen_checkfromab9a020c. This independently checks the load-side record layout used by the item B store fixture.Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T05:58:12Z.
Ran head
5ba80892. Windows 11 build 26100, debug layer unavailable. Adapters: WARP 10.0.26100.8972, NVIDIA Quadro M1000M 32.0.15.7371, Intel HD Graphics 530 31.0.101.2111, the hardware ones selected withXBOX2WINDOWS_ADAPTER.compute_heap_view_controlscompute_store_aot_heap_view_load_{warp,hardware}mismatches=0(21 s)AI-assisted.