runtime: cap slot-19 output UAV intervals at the D3D12 element limit #3471
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3471"
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 JB2WIN on 2026-11-29T16:25:50Z.
Refs #3224. Takes the cap part of the output-interval refusal (agreed with @Not-Saii on #3224).
A slot-19 output token's buffer is bound in place as a UAV, with no copy. The 16 MiB cap in
compute_token_outputcame from the snapshot copies and has no reason on this path. #2477 made the same change for raw input views. The interval check now refuses only when the title's view has more than 2^27 elements, or the R32 raw UAV made from it (bytes / 4elements) does. The new reason isan output UAV interval exceeds the D3D12 buffer view element limit.The limit is counted in elements, not bytes, so a typed view with 2-byte elements cannot pass more than 2^27 elements (found in review).
Census target:
an output UAV interval is over 16 MiB(1 shader, 592,749 dispatches in Leyukaka's 600 s run). By default this probably will not move the dispatch count yet. @Not-Saii expects this shader's view to cover a whole 24 MiBcopied_bufferplacement, which then stops atan output token's backing does not uniquely alias its guest byte intervalunlessX2W_COPIED_OBJECT_UAVis on. I have not run the title on this branch, so that is untested.Tests (RTX 3080 and WARP):
startup_compute_token_interval_{warp,hardware}: the former 16 MiB + 16 bytes refusal control is now a bound case (offset=0 bytes=16777232 result=bound, no refusal). The two other interval controls still refuse by name. The fixture does not read back the large buffer, so it shows the binding, not the written values.src/change reverted, both token interval tests fail.startup_compute_dispatch_{input,output,native}_*andstartup_compute_indexed_atomic_uav_*(which use the same large-buffer mode) pass.native_warpandindexed_atomic_uav_warpskip as onmain.AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T17:27:00Z.
Review: APPROVED
Diff reading only at
54e661b6; nothing built or run.Checked: the token output is bound in place (
views[i] = {token.resource, token.offset, token.bytes, true}, then a raw R32 UAV ofbytes / 4elements or the described view), so no copy is sized by the interval and the 16 MiB snapshot limit does not apply here. The new bound, 2^27 elements (D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP), is D3D12's own buffer view limit, so nothing D3D12 would accept is refused. The other checks and their order are unchanged.NIT
tests/startup_compute_token_interval_check.py:77-81: the large case shows the 16 MiB cap is gone, but nothing reaches the new branch; removing the newifleaves the test green. The docstring gives the reason (D3D12 rejects such a view at creation), so this is fine as is.