startup: bind compute outputs named by a buffer UAV view token #2961
Open
Miffedrandir wants to merge 3 commits from
upstream-pr/2961 into main
pull from: upstream-pr/2961
merge into: R0Y00:main
R0Y00:main
R0Y00:codex/indirect-large-backed-views
R0Y00:codex/word3-preflight-check
R0Y00:codex/vertex-table-two-records
R0Y00:codex/live-index-alias
R0Y00:codex/copied-vertex-buffer-srv
R0Y00:codex/windows-stage-test-output
R0Y00:codex/preserve-live-srv-retirement
R0Y00:codex/share-render-target-tracking
R0Y00:codex/sgd5-negative-offset-fixture
R0Y00:coverage-dashboard
R0Y00:codex/mesh-loose-root
R0Y00:codex/mesh86-cache-padding
R0Y00:codex/xmem-scatter-preflight
R0Y00:codex/mesh-depth-ps
R0Y00:codex/indirect-dispatch-refresh
R0Y00:codex/compute-container-index
R0Y00:codex/startup-compute-formatted-load
R0Y00:codex/compute-indirect-producer
R0Y00:codex/compute-atomic-soffset
R0Y00:codex/mesh-dual-handoff
R0Y00:codex/startup-run-sh-watcher-control
R0Y00:codex/queue31-page-alias
R0Y00:codex/indexed-indirect-compute-root
R0Y00:codex/typed-buffer-view-metadata
R0Y00:codex/translated-indexed-address-alias
R0Y00:codex/fixed-mesh-create-result
R0Y00:codex/xmem-section-lease
R0Y00:codex/startup-slot86-mesh-cache
R0Y00:codex/restore-mesh-barrier-iteration
R0Y00:codex/translated-indirect-upload-index
R0Y00:codex/xapu-completion-opt-in
R0Y00:codex/translated-indexed-rect
R0Y00:codex/translated-indexed-indirect
R0Y00:codex/startup-mesh-lds-integration
R0Y00:codex/startup-console-ms24
R0Y00:codex/startup-slot57-mesh-request
R0Y00:codex/indirect-copy-provenance
R0Y00:codex/present-color-producer-trace
R0Y00:codex/compute-dispatch-binding-trace
R0Y00:codex/translated-indirect-table-buffers
R0Y00:codex/indirect-copy-provenance-base
R0Y00:codex/mix-half-literal-source
R0Y00:codex/translated-indirect-draw
R0Y00:codex/xmem-scatter-diagnostics
R0Y00:codex/slot148-recording-upload
R0Y00:codex/slot70-loading-art-verified
R0Y00:codex/command-list-upload-arena
R0Y00:codex/recover-failed-command-list
R0Y00:codex/startup-heap-timing-notes
R0Y00:codex/align-audio-input-timeline
R0Y00:codex/synthetic-depth-export-control
R0Y00:codex/startup-texture1d-on-windows
R0Y00:codex/1629-packed-position-fixture
R0Y00:codex/cpu-srv-refresh
R0Y00:codex/stream-root-srv-draw
R0Y00:codex/audio-mixer-timer
R0Y00:codex/startup-reload-published-shader
R0Y00:codex/priority-integrate-1284
R0Y00:codex/guest-sixteen-page-record
R0Y00:codex/aot-placed-dxr-batch
R0Y00:codex/guest-directory-selection
R0Y00:codex/gamesave-enumerate-read
R0Y00:codex/readme-archive-to-pixels
R0Y00:codex/pe-placed-view-draw
R0Y00:codex/archive-directory-gpu
R0Y00:codex/slot133-dxr-build
R0Y00:codex/materialize-placed-vertex-view
R0Y00:codex/dstorage-directory-offsets
R0Y00:codex/xg-nine-bc-copy
R0Y00:codex/xg-slot10-bc64-arrays
R0Y00:codex/dxr-guest-address-readback
R0Y00:codex/gpu-va-high-bits
R0Y00:codex/clarify-diagnostic-startup-scope
R0Y00:codex/xg-six-levels
R0Y00:codex/typed-derived-blend
R0Y00:codex/english-legal-text-progress
R0Y00:codex/address-bc-4ks
R0Y00:codex/dstorage-bounded-file-read
R0Y00:codex/wide-srv-offsets-menu
R0Y00:codex/startup-memory-srv
R0Y00:codex/bound-view-tail
R0Y00:codex/language-selector-readback
R0Y00:codex/setup-menu-progress
R0Y00:codex/cpu-plane-refresh
R0Y00:codex/startup-ubyte-vertex
R0Y00:codex/presenter-window-selection
R0Y00:codex/startup-uniform-buffer-lane
R0Y00:codex/intro-loop-timing
R0Y00:codex/static-clzero-loops
R0Y00:codex/document-rtx-intro
R0Y00:codex/startup-insertq
R0Y00:codex/nv12-startup-texture
R0Y00:codex/stream-stage-draw
R0Y00:codex/startup-null-uav-format
R0Y00:codex/startup-draw-capture
R0Y00:codex/shorten-windows-checks
R0Y00:codex/dstorage-rfc1950
R0Y00:codex/startup-dump-fence
R0Y00:codex/pr1135-review-base
R0Y00:codex/startup-stream-requests
R0Y00:codex/startup-chroma-view
R0Y00:codex/readme-graphics-pipeline-streams
R0Y00:codex/static-crt-free-tls
R0Y00:codex/arc-140t-rtx-5080-laptop-gpu-reports
R0Y00:codex/main-startup-progress-entry
R0Y00:codex/signed-dxil-catalogue
R0Y00:codex/reloc-free-preferred-base
R0Y00:codex/quad-dpp-bit-mask
R0Y00:codex/raw-srv-bounds
R0Y00:codex/rx9070-31044-hardware-report
R0Y00:codex/gpu-page-source-provenance
R0Y00:codex/runtime-placeholder-interior
R0Y00:codex/gpu-copy-queue-tile-order
R0Y00:codex/pe-pin-external-providers
R0Y00:codex/xmem-placeholder-reservations
R0Y00:codex/xmem-shared-physical-pages
R0Y00:codex/pe-package-startup
R0Y00:codex/xmem-tools-memory-query
R0Y00:codex/cpu-stack-output-import
R0Y00:codex/pe-load-security-cookie
R0Y00:codex/record-three-bvh-retests
R0Y00:codex/cpu-rbp-frame-anchor
R0Y00:codex/xmem-default-startup
R0Y00:codex/record-rtx-3050-ti-9597
R0Y00:codex/docs-readme-start-here
R0Y00:codex/check-compute-mad24-truncation
R0Y00:codex/docs-discord-community
R0Y00:codex/bound-rcx-branch-mutants
R0Y00:codex/rtx5060ti-bvh-62114
R0Y00:codex/837-neutral-readme-disclaimer
R0Y00:codex/record-rtx-3070-ti
R0Y00:codex/title-neutral-public-wording
R0Y00:codex/exe-shadow-frame-submissions
R0Y00:codex/exe-shadow-runtime-chain
R0Y00:codex/readme-polish
R0Y00:codex/gpu-coverage-nov23
R0Y00:codex/spirv-minlod
R0Y00:codex/shadow-shim-device
R0Y00:codex/exe-two-shadow-frames
R0Y00:codex/shim-dispatch-cleanup
R0Y00:codex/fix-spirv-cache-probe
R0Y00:codex/sampler-use
R0Y00:codex/ballot-bit-extract
R0Y00:codex/packed-fma-release
R0Y00:codex/cpu-packed-fma-o2
R0Y00:codex/publish-coverage-dashboard
R0Y00:codex/mesh-cbv-binding-order
R0Y00:codex/spirv-window-fixture
R0Y00:codex/ps-e32-float-uint
R0Y00:codex/ps-cbuffer-reads
R0Y00:codex/fixed-profile-rescan
R0Y00:codex/shim-compute-integration
R0Y00:codex/readme-visible-coverage
R0Y00:codex/readme-research-navigation
R0Y00:codex/integrate-pr-256
R0Y00:codex/indexed-mesh
R0Y00:codex/sampled-coverage
R0Y00:codex/first-ms
R0Y00:codex/dual-ps
R0Y00:codex/ps-attribute
R0Y00:codex/compute-first
R0Y00:codex/ps-export
R0Y00:codex/readme-research-status
R0Y00:codex/ps-layout
R0Y00:codex/blast-window
R0Y00:codex/chart-caption
R0Y00:codex/reviewer-roles
R0Y00:codex/blast-aot
R0Y00:codex/archive-program
R0Y00:codex/crc-stream-program
R0Y00:codex/exe-image-data-chain
R0Y00:codex/local-cpu-fixture-coverage
R0Y00:codex/exe-bound-frame-chain
R0Y00:codex/exe-mapped-comparison
R0Y00:codex/contribution-dependencies
R0Y00:codex/exe-entry-aot
R0Y00:codex/bink-frame-heap-integration
R0Y00:docs/hardware-seven-reports
R0Y00:codex/bink-custom-heap
R0Y00:codex/bink-heap-callers
R0Y00:codex/discussions-entry-points
R0Y00:codex/gpu-community-batch-64
R0Y00:codex/ffx-scratch-writers
R0Y00:codex/generic-project-documentation
R0Y00:codex/ffx-dispatch-rcas
R0Y00:codex/four-windows-gpu-reports
R0Y00:codex/title-neutral-project-wording
R0Y00:codex/community-coverage-provenance
R0Y00:codex/rcas-packed-texels
R0Y00:codex/community-gpu-retests
R0Y00:codex/community-build-and-gpu-reports
R0Y00:codex/ffx-provider-loop
R0Y00:codex/ffx-recurrent-views
R0Y00:codex/ffx-recurrent-resource
R0Y00:codex/amd-wave64-reports
R0Y00:codex/ffx-backend-slots
R0Y00:codex/upscaler-device-init
R0Y00:codex/ffx-context-lifecycle
R0Y00:codex/ffx-version-query
R0Y00:codex/ffx-provider-contract
R0Y00:codex/typed-object-callback
R0Y00:codex/cpu-ordinal-import
R0Y00:codex/chained-cpu-ranges
R0Y00:codex/cpu-import-call
R0Y00:codex/cpu-direct-call
R0Y00:codex/cpu-leaf-aot
R0Y00:codex/community-project-status
R0Y00:codex/script-state-path-replay
R0Y00:codex/script-state-evidence
R0Y00:codex/bc7-resident-tail
R0Y00:codex/bcpack-mip-tail
R0Y00:codex/bc7-texture-draw
R0Y00:codex/asset-ranges
R0Y00:codex/pixel-constants
R0Y00:codex/pixel-aot
R0Y00:codex/pre-exe-workloads
R0Y00:codex/root-signature-device-coverage
R0Y00:engineering/packed-bvh-leaves
R0Y00:engineering/bvh-build-and-update
R0Y00:engineering/intake-root-roundtrip
R0Y00:community/gpu-check-release
R0Y00:community/english-contributor-entry
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows!2961
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2961"
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 Miffedrandir on 2026-11-26T23:39:47Z.
Part of #870
Problem
A translated Dispatch refuses any output whose table entry holds the token of a buffer view the title created (device slot 19). The refusal reads "an output is not an aliased placed buffer range with unordered access". The code calls this out as a shortcut: "view tokens and copied placements are refused, add them with their first user". Inputs already take tokens (slot 18).
To measure it, I split that one refusal reason into its separate conditions locally and ran a 10-minute title run. Counts only:
Change
src/startup_stubs/d3d12_compute_dispatch.inl: an output named by a token is now bound in that view's desktop resource, over the view's own range. Raw, structured and typed views are accepted; a typed view's range is sized by its format, as typed input tokens already are.These are still refused, one reason each:
Outputs named by an address are unchanged.
Tests
startup_compute_dispatchgains four cases. In each, the output descriptor is replaced by the token of a buffer view of the output buffer:dispatch-output-token: a raw view;dispatch-output-token-typed: an R32_UINT view;dispatch-output-token-structured: a structured view with stride 8, 160 elements;dispatch-output-token-typed8: an R16G16B16A16_FLOAT view, 160 elements.The last two were added after review: they describe the same 1280 bytes with 8-byte elements, so they catch an element size taken as 4.
In all four, all 320 output words must match the expected values and nothing may be refused.
Windows 11 26200, MSVC 19.44, release preset, RTX 5070 Laptop and WARP:
ctest: 100% of 27 passed, with
main429f11d5merged in (startup_compute_dispatch_native_warpreports itself skipped).Control: the new cases against
main'sd3d12_compute_dispatch.inlfail on both adapters withdispatch-output-token: 288 words differ, because the output is refused. With the element size fixed at 4 instead,dispatch-output-token-structuredfails on both adapters with 128 words differ.Title run, counts only
10 minutes each, same settings, translated compute dispatches:
No device removal or debug-layer error was logged. The largest remaining token refusals are the entry-value case (18 programs) and one program whose view range fails the size check.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Sir6Mr49SZWax95VApRPvz
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-27T00:16:42Z.
Independent AMD RDNA 4 and WARP result on
ca96748f: neither case this PR adds can tell the element size from a constant 4Not a code change; measurements only.
Environment
10.0.26200.9974, MSVC 19.44.35230 (VCToolsVersion 14.44.35207), Windows SDK 10.0.26100dxc.exe1.9.2602.17,fxc.exe10.0.26100.94571002:7550), driver 32.0.32029.2010 (2026-11-18); WARP (1414:008c), driver 10.0.26100.9818devpreset, worktree atca96748f,git status --porcelain --untracked-files=noempty before the local edits below and after reverting them. The D3D12 debug layer is not installed on this machine (debug layer: unavailable), so nothing below is a validation-layer result.Commands
Observed on the unmodified head
16 of 16 entries pass, ctest exit 0, no skip. Across them 15 lines read
adapter=AMD Radeon RX 9070 XT driver=32.0.32029.2010and 15 readadapter=Microsoft Basic Render Driver driver=10.0.26100.9818. The two entries that carry the new cases (#1272 and #1282):What the two added cases cannot separate
Both describe 320 elements of 4 bytes, i.e. 1280 bytes — the exact size of case A's output buffer. In both, the derivation already yields
element = 4(raw → 4; typedR32_UINT→typed_buffer_format_bytes→ 4), so neither can tell the derivation apart from a hard-coded 4. What they do catch is a wrongful refusal, not a wrong size.Mutation,
src/startup_stubs/d3d12_compute_dispatch.inl:365-366:File sha256
9941c248f60a7602e0a4b9d0294a0b16467eb15ded7294713a522712b5377aebat the head,96dac53607486eb2720cd64153caeb566650c5e7db56c773f9697cba42420b91with the mutation, and9941c248…7aebagain aftergit checkout --.Under that mutation both entries this PR adds still pass, on both adapters, and so does the whole compute family:
Those two only needed their targets. Built and re-run under the same mutation:
100% tests passed out of 2. So every one of the 151 entries passes with the element size fixed at 4 — 149 in one run, the last two once their executables existed.The mutation is not an equivalent program: it also turns some refusals into acceptances, because the range checks downstream use the same
element(with stride 8 and 200 elements over a 1280-byte resource, the head computes 1600 bytes and refuses, the mutation computes 800 and accepts). That is arithmetic on the two expressions, not a run. It is a probe of "is this size derived", not a second implementation.Two descriptions that do separate it
Same 1280 bytes with 8-byte elements, so the expected table is unchanged (the fixture hard-codes case A):
dispatch-output-token-structured:Format UNKNOWN,Flags NONE,StructureByteStride 8,NumElements 160dispatch-output-token-typed8:Format R16G16B16A16_FLOAT,Flags NONE,NumElements 160Head, both adapters:
Same build under the mutation, both adapters:
128 and not 160 because the last 32 words of the expected table are the sentinel itself (
WORDS=320 EXPECTED_NON_SENTINEL=288): with a 640-byte range the writes stop at word 160. 288 of the 320 words can distinguish "written" from "not written", not 320.Base control: this fixture on the old translator
main'sd3d12_compute_dispatch.inlat6ee878d8(still carryingshortcut: view tokens and copied placements are refused), with the consumer and the two modes from this head, same probe, both adapters:The same 288 words as your own control against
main, reached independently. Adispatchbaseline on that build still matches (differ=0), so the probe is sensitive to the change itself and not only to my mutation.What the branch binds
The title's description never becomes a descriptor: for a buffer output,
d3d12_compute_dispatch.inl:479-487always creates a rawR32_TYPELESSUAV overFirstElement = offset / 4,NumElements = bytes / 4. The format and the stride of the title's view therefore only decide the byte range, and both extra modes exercise the same raw binding as the two cases in the PR.Refusal reasons (reading, not measured)
No case in
tests/startup_compute_dispatch_check.pyreaches the token branch with a refused view: all six refusal cases name the output by an address. The five reasons that branch can log (not a buffer UAV of a desktop resource,no element size,range is empty, unaligned or outside its resource,an entry value reads the descriptor,also an input) are therefore untested there. I did not sweep the whole suite for an entry that would.Limits
StructureByteStrideand of a typed format's byte width, not on this run.FirstElementis 0 in every case here, so the alignment check, theresource.Width - offsetterm and the 16 MiB cap are not exercised;ALLOW_UNORDERED_ACCESSis always set; only three descriptions are covered (rawR32_TYPELESS,R32_UINT,R16G16B16A16_FLOAT).If the two extra modes are worth having, I can push them as a patch on top of this branch.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T04:29:52Z.
Review: COMMENTED
PR #2961 fills the gap: compute outputs now accept buffer UAV view tokens (slot 19), not just address-based naming.
What works
and typed (typed buffer, element size from typed_buffer_format_bytes). Each correctly rejects mismatched flags.
while the map grows during a title run.
ranges, ranges over 16 MiB or outside the resource, and entry-value outputs.
output words match with zero refusals.
Issues
the title run. Since it is a std::vector, concurrent access from multiple dispatch threads could cause issues.
The AcquireSRWLockShared helps with reader concurrency but vector pushes (from the view creation path, slot 19)
need an exclusive writer. Verify that the slot 19 path uses AcquireSRWLockExclusive when appending.
typed UAVs. Ensure this function covers all formats that compute outputs use; missing formats would fall through
to element=0 and get refused. A comment listing supported formats would help.
rarely use typed formats (they use UNKNOWN). The conversion may be unnecessary for structured views.
Worth keeping but verify it does not mis-convert UINT formats during the typed path.
through a view token would be refused. Consistent with address-based naming but limits applicability.
Recommendations
Overall: clean, correct. Fills a real gap and adds good test coverage.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T04:41:55Z.
Review: COMMENTED
The independent fixed-stride mutation passes the current raw and R32_UINT cases, so those fixtures cannot distinguish the new element-size calculation from a constant 4. Please bring in the tested 8-byte structured and typed cases from the review, and add a refused token-range case with untouched sentinels. An out-of-bounds range using the 8-byte stride would exercise the validation that the existing address-based controls miss.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T05:36:13Z.
Review: COMMENTED
What works
the same
view_records()lookup, the sharedAcquireSRWLockShared/ReleaseSRWLockSharedpattern, anddesktop_format()-- consistent and safe.R32_TYPELESSwithRAWflag) andtyped (
R32_UINT) buffer views, matching the input side's narrowness.validation in the same harness.
Issues
record_transferred_dispatchrefuses tokens outright for copies;this PR only touches dispatch. The refusal TODO
(
view tokens and copied placements are refused, add them with their first user) should be addressed in a follow-up PR.view_records()read but not theas_wrapper()call. Ifview_records()can grow between the sizecheck and the
as_wrapper()lookup, recompute the index under thelock.
no
Buffer.Flags).Recommendations
as_wrapper()to avoid aracy lookup as view_records grows.
Overall
Solid change that aligns output binding with input handling already in
the codebase. Approvable with the lock scope adjustment noted above.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T09:36:18Z.
This PR now conflicts with
main. Conflicting files:src/startup_stubs/d3d12_compute_dispatch.inltests/startup_compute_dispatch_check.pytests/startup_stream_consumer.cppCould you merge
maininto your branch (a merge commit, no force push needed) and resolve these? Thank you.AI-assisted; commands listed were executed locally. (
git merge-tree origin/main <head>)Imported from R0Y00/Xbox2Windows. Originally posted by Miffedrandir on 2026-11-27T18:37:00Z.
@tedin7 Merged
main(429f11d5) in as66b03bf0. Only the header comment ofd3d12_compute_dispatch.inlneeded hand resolution. In the two test files, main's root SRV and table cases stay and the token cases come after them.Sorry about the force pushes. I first rebased instead of merging, which dropped
ca96748f, the commit thepatrickworld reviewed. I've pushed once more to put it back:That push was a force push, the last one; any further updates will be normal pushes. The tree at
66b03bf0is identical to the rebased one that was tested.@thepatrickworld Thanks, you're right: raw and R32_UINT both give 4-byte elements, so neither case could tell a derived size from a fixed 4.
383ffaebadds your two descriptions asdispatch-output-token-structured(stride 8, 160 elements) anddispatch-output-token-typed8(R16G16B16A16_FLOAT, 160 elements). Same 1280 bytes, so the expected table is unchanged.Windows 11 26200, MSVC 19.44, release preset, RTX 5070 Laptop and WARP:
startup_compute_dispatch_native_warpreports itself skipped). All four token cases match all 320 words on both adapters.const UINT element = (raw || structured || typed) ? 4 : 0;):startup_compute_dispatchfails on both adapters withdispatch-output-token-structured: 128 words differ from the CPU reference, the same 128 you measured.You're also right that the five refusal reasons in the token branch aren't covered yet, and that
FirstElementis always 0 here. I've left them out of this PR to keep it to one behavior, and can follow up if wanted.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-27T19:18:42Z.
Independent AMD RDNA 4 run on
383ffaeb: the four token cases pass, and three one-line mutants of the same block pass with themNot a code change; measurements only.
Environment
dev,debug layer: unavailable383ffaeb0a65dd37b873f83a4de3ce91a76b65c4,git status --porcelain --untracked-files=noemptyCommands
Run from the repository root:
d3d12_xs.dllin your command block is not a build target here (ninja: error: unknown target 'd3d12_xs');startup_stream_consumerlinksd3d12_xs_shim, so the shim is built as a dependency.Observed
Mutations of the token block
One line each, built and run against the same entry;
git checkout --between runs, and the file hashes back to481cc91c…(sha256of the head blob with CRLF, verified equal).element = (raw || structured || typed) ? 4 : 0(yours) → fails atdispatch-output-token-structured: 128 words differ. The fixture asserts per mode inside the loop, so it stops there and-typed8never runs.structured ? 4→ fails at the same case; with the entry's mode tuple narrowed to-typed8alone, the same build passes. The typed8 case does not see the structured branch.typed ? 4→-token,-typedand-structuredpass,-typed8fails with 128 words. The structured case does not see the typed branch.So each 8-byte case catches a mutant of its own branch and is blind to the other's, and your mutant (1) cannot stand in for (3).
Three mutants of the same block that all four cases still pass:
structured ? 8instead ofdesc.Buffer.StructureByteStride→ the only structured case is stride 8, so the field's value is never read. A case at stride 16 with 80 elements describes the same 1280 bytes, keeps the expected table, and dies here.bytes = resource.Width - offsetinstead ofu64{NumElements} * element→ every case covers the whole buffer at offset 0, so the element count is never read. A view covering half the buffer (stride 8, 80 elements) separates it; its expectation is not the plain table, the second half must stay at the sentinel.if (desc.Format) desc.Format = desktop_format(desc.Format);from the token block → none of the four formats is in the range that function rewrites (116..120,src/startup_stubs/d3d12_xs_device.cpp:765). A token whose format maps, e.g. 116 →R10G10B10A2_UNORMwith 4-byte elements, would see it.(4) and (5) are the ones the two new cases look like they cover and do not; each is one line, and each is killed by a case that keeps the 1280-byte span.
Regression
^startup_compute_dispatch: 19 passed / 1 skipped (native_warp) / 0 failed. CTest prints100% tests passed out of 20because the skipped entry stays in the percentage.Conclusion
On this adapter the four token cases bind the view's own range and the readback matches all 320 words; each 8-byte case pins one of the two non-raw branches of the element derivation. What none of them pins is the stride value, the element count, and the desktop-format mapping.
Limits
expected('A'), last written index 287), so a 160-word bound range differs on 128.FirstElementare not exercised, as you said.AI-assisted; runs executed on the machine above.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T07:33:32Z.
Thanks for adding the 8-byte structured and typed cases. The branch is now 135 commits behind
main(c3204a9c) and has conflicts. Three things that landed onmainsince then interact with the token branch, and a plain conflict resolution won't catch them. Could you look at these when you merge?git merge-tree --write-tree --name-only c3204a9c 383ffaebexits 1 withCONFLICT (content)insrc/startup_stubs/d3d12_compute_dispatch.inlandtests/startup_compute_dispatch_check.py. Both sides add docstring item 8, so yours could become item 9.main,tests/startup_compute_dispatch_output_check.pyexpects('dispatch-output-texture-token', None, 'an output buffer descriptor is a view token'). In the trial-merged tree (git show <tree>:src/startup_stubs/d3d12_compute_dispatch.inl | grep -n 'view token'), the new branch comes first and refuses a texture token withan output view token is not a buffer UAV of a desktop resource. Reason 1 is never reached.docs/experiments/compute-output-buffer-reasons.mdalready says "with it, reason 1 is not reached". Could you repoint that control at the new reason, drop the dead reason-1 line and update the doc?desc_bytesuses the desktop size.git grep -n desc_bytes 383ffaeb -- src/startup_stubs/d3d12_compute_dispatch.inlshowsrecord.desc_bytes >= sizeof(desc)and< sizeof(desc)onD3D12_UNORDERED_ACCESS_VIEW_DESC. #3223 replaced that comparison withViewRecord::uav_desc_bytes(40). The reason is indocs/experiments/agility-compute-views.md: the Agility SDK 1.620.2 header "reports 40 for an SRV and 48 for a" UAV. With Agility headers, every output token would be refused as "not a buffer UAV". UsingViewRecord::uav_desc_bytes, asmain's texture branch does, would fix it.uav <i> bufhalf ...outputs (slot.half_buffer_bytes), which bind a typed UAV withviews[i].described = true. The token branch runs before that and setsviews[i] = {buffer, offset, bytes, true}, sodescribedstays false. The binder then creates aDXGI_FORMAT_R32_TYPELESS/D3D12_BUFFER_UAV_FLAG_RAWview for a typed half store. Todaymainrefuses this case at reason 1. Refusinghalf_bytesin the token branch, or describing the view, would keep that behavior.bytes = resource.Width - offsetmutant from the RDNA 4 run on383ffaeb.Items 2–4 come from reading the trial-merged blobs. Nothing was built or run for this comment.
This comment was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-28T12:09:58Z.
@Miffedrandir I reproduced a separate compiler-side gap on
052abe6fwith a source-built one-componentbuffer_store_format_x. The native compiler validates the DXIL (u0, one 4-byte element), then reportsunsupported startup runtime manifest bindings: UAV kind typed_buffer_uav. There is no published manifest for the runtime to consume.The natural follow-up is one native published
R32_UINTUAV with a nonzeroFirstElement, a shifted-window control, and unchanged guards on wrong-format or out-of-range refusals. I'd like to use your slot-19 token path for that fixture once the interface lands. Are you planning to cover this native case in #2961, or should I keep it for a dependent follow-up? I can also run the refreshed token tests on RTX 4070 and WARP.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T06:14:59Z.
Review: COMMENTED
383ffaebagainstmain(212d4b5f), by reading both sides; nothing built or run.mainalready binds outputs named by a slot-19 buffer view token.71844ba0addedcompute_token_output(nowsrc/startup_stubs/d3d12_compute_dispatch.inl:471-563, called at:828), with the same raw/structured/typed element sizes as this PR (:520-526) and the same entry-value and output-also-input refusals (:849-853).89b1a3a2gave each refused interval its own reason (:532-537).mainis stricter than this PR: the view must be materialized and counterless (:506), and its backing must uniquely alias the guest byte interval or sit on the default heap (:538-557). Tokens this PR would bind outside those conditions stay refused onmain.main:dispatch-uav-token-{raw,structured,typed}bound and{wrong-slot,copied}refused intests/native_compute_pack_check.py:77-91(structured: stride 8, FirstElement 2, half the elements); three refused intervals with an untouched output intests/startup_compute_token_interval_check.py.git merge-tree --write-tree origin/main 383ffaebexits 1 with conflicts insrc/startup_stubs/d3d12_compute_dispatch.inlandtests/startup_compute_dispatch_check.py.main's branch at:828ends incontinuefor every token, so a second token branch has nothing left to handle.main: a bound typed view with elements wider than 4 bytes. Its typed cases are R32_UINT bound (tests/startup_stream_consumer.cpp:425-428) and a one-element R16_UINT refused.dispatch-output-token-typed8(R16G16B16A16_FLOAT) would add it as adispatch-uav-token-*mode.Superseded by
71844ba0. Suggest closing, or reducing this to the 8-byte typed case on top ofmain's token modes.Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:40:49Z.
Update to my 11-28 comment on
383ffaeb. I checked againstmain77d1ba4d.I agree with the 06:14 review:
mainalready binds token-named outputs.compute_token_outputis called atreason = compute_token_output(self, words, token);inrecord_translated_dispatch, from71844ba0(git merge-base --is-ancestor 71844ba0 origin/main→ true). Its branch covers raw, structured and typed element sizes, and it usesViewRecord::uav_desc_bytes. So items 2–4 of my earlier comment (thedispatch-output-texture-tokencontrol, thesizeof(desc)comparison and the half-buffer raw view) no longer need work here. Please disregard them.MUST
git merge-tree --write-tree --name-only origin/main 383ffaebexits 1 insrc/startup_stubs/d3d12_compute_dispatch.inlandtests/startup_compute_dispatch_check.py, and the second token branch would never be reached. The new part is the bound 8-byte typed case (dispatch-output-token-typed8, R16G16B16A16_FLOAT). Please reduce the PR to that case as adispatch-uav-token-*mode onmain's path, or close it.AI-assisted.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.