d3d12_xs: support buffer memory SRVs on slot 70 #1449
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1456"
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-24T11:52:00Z.
Summary
Support buffer memory SRVs on device slot 70 (
src/startup_stubs/d3d12_memory_srv.inl), with pure validation and offset helpers insrc/startup_stubs/memory_srv_buffer.h:R32_TYPELESS), structured (Format == UNKNOWN, stride a multiple of 4, at most 2048), and typed buffer SRV descriptions, plus element bounds and alignment.[address, address + (FirstElement + NumElements) * element_bytes), adjustsFirstElementby(address - base) / element_bytes, and forwards toview_slot<18, 2>.#1420's refusal telemetry and all existing texture memory-SRV behavior untouched.docs/startup-runtime.mdanddocs/experiments.md.Verification
git diff --check,tests/docs_links_check.py,tests/bidi_controls_check.py, pipelinepreflight./O2viax2w_pipe.py win2025): see the PR comment.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:58:28Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
4ec5dae113bdb0ad9efecc29011396973ba3bece:--preset dev):cmake --build --preset dev --target d3d12_xs_shim startup_stream_consumer startup_memory_srv_report_check startup_memory_srv_buffer_check -- -j 6):4.05s(configure1.68s)ctest --preset dev -R '^(startup_memory_srv_(report|buffer)|startup_address_(srv|buffer_srv|bc_view)_warp|startup_placed_vertex_warp)$' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (4.20s:startup_memory_srv_buffer0.01s,startup_memory_srv_report0.01s,startup_placed_vertex_warp0.95s,startup_address_buffer_srv_warp0.96s,startup_address_srv_warp1.01s,startup_address_bc_view_warp4.13s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_shim startup_stream_consumer startup_memory_srv_report_check startup_memory_srv_buffer_check -- -j 6):36.63s(configure1.71s)ctest --preset release -R '^(startup_memory_srv_(report|buffer)|startup_address_(srv|buffer_srv|bc_view)_warp|startup_placed_vertex_warp)$' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (4.22s:startup_memory_srv_report0.02s,startup_memory_srv_buffer0.02s,startup_placed_vertex_warp1.02s,startup_address_srv_warp1.07s,startup_address_buffer_srv_warp1.25s,startup_address_bc_view_warp4.15s)sccache: 7/11 hits; wall58.2sImported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:58:42Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
4ec5daeℹ️ 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.
[PR #1456] d3d12_xs: support buffer and RT-AS memory SRVs on slot 70to [PR #1456] d3d12_xs: support buffer memory SRVs on slot 70Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
4ec5dae113ℹ️ 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 tedin7 on 2026-11-24T12:15:50Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:54Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:58Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T12:17:34Z.
Review: CHANGES_REQUESTED
Please split the validated buffer-view path from the acceleration-structure path, or add an independent AS use test. The RT-AS branch verifies an address range and adapter tier but currently accepts an ordinary owned buffer with no AS role/lifecycle check before publishing the descriptor. Reuse the placed AS boundary from the existing DXR fixtures. Test that an actual built AS can be consumed through slot 70 and an aligned ordinary buffer leaves the previous descriptor intact. For structured views also enforce the desktop stride constraints before creating the view.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T12:46:24Z.
Review: APPROVED
Rebuilt the source-built consumer and shim on
adf1d255. Both RTX and WARP verified the placed buffer readbacks and preserved the previous descriptor after refusing the acceleration-structure view. Six Release checks passed, zero skips. Keeping the AS behavior for an independent PR resolves the earlier scope concern.Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T12:19:22Z.
Built and run here; two mutations show the new device-free check is the only guard
Independent reviewer, not the author. Reviewed
4ec5dae1; nothing pushed to the branch. Mutations below were madelocally, rebuilt, reverted; working tree is clean.
Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, DXC 1.8.2502.11, debug layer enabled;
Intel Arc 140T (32.0.101.8132) for the
_hardwarevariants.Unmodified branch — 5 of 5 pass:
startup_memory_srv_buffer0.17 s,startup_address_buffer_srv_warp1.59 s,startup_address_buffer_srv_hardware2.45 s,startup_stream_draw_warp5.08 s,startup_stream_draw_hardware12.55 s. So the new slot-70 path does not disturb the stream draw on this adapter.
Mutation A — element bounds accepted unconditionally
Mutation B —
offset % elem_bytesalignment check dropped fromresolve_buffer_srv_descWhat the second result means
Both mutations are caught, which is what a new check should do. The part worth recording is that the GPU-side
startup_address_buffer_srv_*test passes under both — it exercises the resolve path with valid addresses, so amissing rejection only shows up in the device-free check. That is an argument for keeping
startup_memory_srv_bufferin every job rather than next to the GPU ones, and it is cheap to do because it is device-free.
If you want, one sentence in
docs/startup-runtime.mdsaying which check owns the validation and which owns the resolvepath would stop a future reader from assuming the GPU test covers the rejections. I am not touching your branch.
Verdict
Reviewed
4ec5dae1. Build clean, 5 of 5 pass including both new tests on WARP and on a physical Intel adapter, and thetwo injected faults are both caught. No objection from me.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:27:50Z.
@R0Y00 @ChazY11 Fixed in
adf1d255(with7ed364a1): split the acceleration-structure path out of this PR.#1456now covers only the buffer-view path. The RT-AS branch,resolve_rt_as_srv_descand its tests are removed. Slot 70 refuses an acceleration-structure view (unsupported_description) and leaves the previous descriptor intact. Title, body,docs/startup-runtime.mdanddocs/experiments.mdare updated. A proper AS path needs a built structure through the placed AS boundary and will be a separate change.startup_address_srv.cppnow issues an AS view between the structured publish and its draw. The draw still samples the structured descriptor, and the refusal line is matched instartup_address_buffer_srv_check.py.docs/startup-runtime.mdnow states thatstartup_memory_srv_buffer(device-free) owns every rejection and thatstartup_address_buffer_srv_*only exercises the resolve path with valid addresses.Windows Server 2025,
x2w_pipe.py win2025, Debug and Release/O2, tested headadf1d255:startup_memory_srv_report,startup_memory_srv_buffer,startup_address_srv_warp,startup_address_buffer_srv_warp,startup_address_bc_view_warpandstartup_placed_vertex_warppass in both configurations (6 of 6, 100%).Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.
Code review location:
src/startup_stubs/d3d12_memory_srv.inl; line 255For an
R32G32B32A32_FLOATSRV withaddress = base + 16,FirstElement = 1, andNumElements = 4, the new resolver correctly publishesFirstElement = 2. However, the translated-draw consumer insrc/startup_stubs/d3d12_draw.inl:941-944treats every zero-structure-stride view as four-byte elements. It therefore bindsbase + 8instead ofbase + 32and copies 16 bytes instead of 64; indexed loads also receive stride zero. Newly accepted typed views consequently read incorrect data despite passing the helper tests. Update the translated token consumer to derive typed element sizes and strides from the format, or refuse these views until that consumer supports them.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.
Code review location:
docs/startup-runtime.md; line 708AGENTS.mdrequires public capability changes to update the README ordocs/experiments.md, but this new section leavesdocs/experiments.md:9612-9615explicitly claiming that buffer and acceleration-structure views are always refused withunsupported_descriptionand implement no semantics. That now contradicts both the implementation and the changed existing SRV test. Update the existing experiment section and its reproduction commands with the supported profile and new refusal reasons rather than leaving conflicting capability descriptions.AGENTS.md reference: AGENTS.md:L190-L191
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.
Code review location:
src/startup_stubs/memory_srv_buffer.h; line 38A slot-70 call for a live buffer using
DXGI_FORMAT_R8G8B8A8_UNORM_SRGBnow passes validation because this whitelist returns four bytes, andview_slot<18, 2>forwards the format unchanged. However, sRGB formats do not support desktop buffer SRVs, so this issues an invalidCreateShaderResourceViewcall instead of refusing the update and preserving the previous descriptor; invalid view calls can remove the desktop device, as the existing forwarding code documents. Remove unsupported formats from this whitelist or verifyD3D12_FORMAT_SUPPORT1_BUFFERand shader-load support before publishing the view.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:50Z.
Code review location:
src/startup_stubs/d3d12_memory_srv.inl; line 255Fixed in
7d019d80: the translated draw consumer now derives typed element size and stride from the format (16 bytes for R32G32B32A32_FLOAT), with tests.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:54Z.
Code review location:
docs/startup-runtime.md; line 708Fixed in
7d019d80: the slot-70 section in docs/experiments.md now describes the supported buffer and acceleration-structure profile and the refusal reasons; docs/startup-runtime.md matches.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:58Z.
Code review location:
src/startup_stubs/memory_srv_buffer.h; line 38Fixed in
7d019d80: sRGB, BGRA and other formats that cannot back a typed buffer SRV are removed from the whitelist and refused, with regression tests for sRGB, BC, depth and typeless.