startup: bind the resource-heap image record of a translated pixel draw #2755
Closed
tedin7 wants to merge 9 commits from
upstream-pr/2763 into main
pull from: upstream-pr/2763
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!2755
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2763"
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-26T06:40:52Z.
Part of #1723
What this unblocks: a translated pixel draw can now bind the image record a root constant indexes in the title's resource heap (the manifest line from #2761), so the heap-loaded image path works end to end instead of stopping at the manifest. Stacked on #2761 (translator and manifest); the diff shows only the runtime half once that merges.
Source: AMD "RDNA 2" Instruction Set Architecture reference guide, SMEM instruction S_LOAD_DWORDX8 (image resource descriptor load); Microsoft D3D12 documentation, descriptor heaps and
CreateShaderResourceView.What changed (
src/startup_stubs/d3d12_draw.inl):srv N tex* heap rootconst P Wandheap word table T B at A [rootconst P W times S [mask M]]. Any otherheapline, a non-texture kind, or a heap SRV next to a writable texture refuses the translation by name (the old reader silently skipped lines it could not parse).heap_srvs_readyruns before the draw changes any state. It reads the index from the draw's root constants, or from the word the title wrote in the recording's upload memory (same bounds rules as the compute dispatch), takes the 32-byte record atindex << 5of the list's view heap, and requires it to be a shader-resource view the title created. Anything else refuses the whole draw with a logged reason; no texture is guessed. Indirect draws are refused.Tests:
startup_pixel_heap_srv(host controls, fixture words checked against assembly, and WARP/hardware draws with fxc and dxc). The draw uses a two-entry heap with two different textures, swaps them between two passes, and draws keys 0..3: keys 0 and 1 must show the texture at their record (so an index that is ignored or not re-read fails), keys 2 and 3 name records the heap does not hold and must be refused by name and leave the cleared target.Verification (Linux only; no Win2025 run yet):
python3 -B tests/startup_pixel_heap_srv_check.py: host controls PASSpython3 -B tests/startup_pixel_heap_srv_check.py binary llvm-mc-19: fixture words matchstartup_gfx2hlsl_pixel_heap_image,startup_gfx2hlsl_heap_record,startup_gfx2hlsl_heap_word: PASSDraft until an independent review and a Win2025 WARP run of the draw tests.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T07:09:57Z.
Independent Windows Release review of
78cf80fffound two fixture issues. The four draw CTests originally returned 77. Their versioned serializer accepts only root CBV/SRV, while this fixture passes a descriptor table and a 32-bit root constant. Copy the table ranges and Constants into the 1.1 payload, and report serialization errors as fixture failures. Once the draw actually runs, WARP samples the second texture for key 2. On WARP the second native slot is at byte 64, which the fixture also presents as record 2 after memmove copies its token to the packed record at byte 32. Clear the bytes after the two packed records in the heap fixture after each move. The other joined-table test can keep its current bytes.I made both fixture corrections in an isolated checkout. All four FXC/DXC × WARP/RTX 4060 Laptop draws pass, following the swapped first two records and refusing all four invalid draws across the two passes. All 10 CTests in ^(startup_pixel_heap_srv_.|startup_gfx2hlsl_(heap_record|heap_word|pixel_heap_image)|startup_root_cbv_.)$ pass, zero skips, Windows 11 build 26200. This is the source-built root-constant path. A source-built draw through the separate table-buffer word path is still needed to establish that runtime binding.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:49:33Z.
Thank you, both findings are right and are fixed in the next push.
serialize_root(tests/startup_stream_setup.cpp) now copies descriptor-table ranges and 32-bit constants into the 1.1 payload. A serializer failure now returns a fixture failure (6), not a capability skip.Still open, as you noted: a source-built draw through the table-buffer word form (
heap word table ... at ...). The runtime path for it is written but has no draw proof yet; I will add that case next and say here when it is pushed. This stays a Draft until then.Verification: Linux host controls (
startup_pixel_heap_srv_cpu,startup_gfx2hlsl_heap_record,startup_gfx2hlsl_heap_word,startup_gfx2hlsl_pixel_heap_image) rerun after the change. The two edits are C++ fixture code; I rely on your Windows run for them and will rerun after pushing.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T08:51:22Z.
Pushed the table-buffer word draw case the review asked for (head
5989abe7).tests/startup_address_srv.cpp(X2W_TEST_HEAP_SRV=word): the heap index is a word of a buffer in the recording's upload memory, whose hardware descriptor sits at table byte 64. Keys 0 and 1 name records 1 and 0 (so a draw that ignored the word, or read the root constant as the index, shows the wrong texture); keys 2 and 3 name records 5 and 7, past the heap, and must be refused. The manifest line issrv 1 tex2d heap word table 0 64 at 0 rootconst 1 0 times 4.heap wordsource (%dof the stringword). Fixed intools/startup/gfx2hlsl.py.startup_pixel_heap_srv_word_{fxc,dxc}_{warp,hardware}.Verification (self-check, not the independent run):
bash runpod_test.sh 2763 --regex startup_pixel_heap_srvon the pod, 9 of 9 passed (cpu, plus root-constant and word cases for fxc and dxc on WARP and on the GPU), tested on RTX 3090 through vkd3d-proton (Linux). Host controls andstartup_gfx2hlsl_{heap_record,heap_word,pixel_heap_image}pass; 173 translation shapes unchanged againstorigin/main.Still a Draft until the independent Windows run of this head.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T09:16:04Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
5989abe792ℹ️ 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-26T09:04:56Z.
Independent Stage-2 review of head
5989abe792: PASS (round 2; the first round failed because all four draw tests skipped).Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
5989abe792454b9f896deb061ce1cffecb84446b:Debug (
--preset dev):cmake --build --preset dev --target startup_stream_consumer d3d12_xs_shim -- -j 2):23.37s(configure1.90s)ctest --preset dev -R '^(startup_pixel_heap_srv|startup_gfx2hlsl_pixel_heap_image|startup_gfx2hlsl_heap_record|startup_gfx2hlsl_heap_word|startup_address_srv|startup_stream|startup_shader_cache)' --parallel 3 --no-tests=error --output-on-failure): 34/34 passed (12.24s:startup_stream_draw_warp2.82s,startup_stream_depth_warp3.69s,startup_stream_depth_hardware3.69s,startup_stream_fetch_hardware1.12s,startup_stream_fetch_warp1.30s,startup_stream_draw_hardware2.75s,startup_stream_request_warp0.84s,startup_stream_viewport_warp0.76s,startup_shader_cache_key0.48s,startup_address_srv_warp0.60s,startup_stream_viewport_hardware0.84s,startup_stream_interface_warp0.65s,startup_stream_rasterizer_hardware0.77s,startup_stream_interface_hardware0.63s,startup_stream_rasterizer_warp0.75s, `startup_stRelease
/O2(--preset release):cmake --build --preset release --target startup_stream_consumer d3d12_xs_shim -- -j 2):38.49s(configure1.91s)ctest --preset release -R '^(startup_pixel_heap_srv|startup_gfx2hlsl_pixel_heap_image|startup_gfx2hlsl_heap_record|startup_gfx2hlsl_heap_word|startup_address_srv|startup_stream|startup_shader_cache)' --parallel 3 --no-tests=error --output-on-failure): 34/34 passed (10.89s:startup_stream_draw_warp2.41s,startup_stream_depth_hardware3.04s,startup_stream_depth_warp3.09s,startup_stream_request_warp0.80s,startup_stream_fetch_warp1.05s,startup_stream_viewport_warp0.64s,startup_stream_fetch_hardware1.01s,startup_stream_draw_hardware2.46s,startup_stream_interface_warp0.56s,startup_address_srv_warp0.58s,startup_stream_viewport_hardware0.73s,startup_shader_cache_key0.47s,startup_stream_rasterizer_warp0.71s,startup_stream_rasterizer_hardware0.72s,startup_stream_rasterizer_ignore_hardware0.65s,sccache: 0/8 hits; wall183.2sThe PR's own tests all ran and passed (no skips):
startup_pixel_heap_srv_cpuand the eight drawsstartup_pixel_heap_srv_{fxc,dxc}_{warp,hardware}andstartup_pixel_heap_srv_word_{fxc,dxc}_{warp,hardware}; the author reports RTX 3090 through vkd3d-proton 9/9.Linux:
python3 -B tests/startup_pixel_heap_srv_check.py(+binary llvm-mc-19),startup_gfx2hlsl_pixel_heap_image,heap_record,heap_word: pass; 173 existing translation shapes unchanged againstorigin/main; the workflow's Python check list shows only the failuresorigin/mainhas in the same environment.Not blocking: the word path reads the index word when the draw is recorded, like the compute dispatch, so a title that writes the upload word after recording but before submit would be read stale; worth one sentence in the body.
Marked Ready. @MasterDomino
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T09:05:06Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
5989abeℹ️ 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-26T09:16:04Z.
Code review location:
tools/startup/gfx2hlsl.py; line 5336For a pixel shader that masks a root constant and then applies
s_addk_i32ors_mulk_i32to that SGPR, this new mark makesheap_word_offset()return five values, butscalar_accumulate()still unpacks exactly four at line 5437. A synthetic binary containings_and_b32 s28, s9, -16followed bys_addk_i32 s28, 0x10translates on the parent commit but raisesValueError: too many values to unpack (expected 4)here; the multiply form fails identically. Tracking runs on every pixel shader, so this also breaks previously supported shaders without heap indexing enabled. Update the SOPK consumer to handle the new masked shape.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T09:16:05Z.
Code review location:
src/startup_stubs/d3d12_draw.inl; line 1653When a table-word offset wraps 32-bit arithmetic, this 64-bit reconstruction disagrees with the translated shader. The added word fixture computes
s28 = ud1 * 4u: withud1 == 0x40000000, the guest and HLSL read byte zero of the buffer, butheap_srvs_ready()computes an offset of 4 GiB and refuses the valid draw. The compute resolver already usesstd::uint32_t atfor the same manifest form. Apply DWORD wraparound before checking the upload and buffer bounds; likewise, the laterindex > (0xffffffffu >> 5)guard rejects valid wrapped record addresses whose high bits the shader'sindex << 5discards.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T10:04:12Z.
Independent AMD RDNA 4 result on
80a17a3d: both heap-record draw forms pass on a real GPU, with fxc and dxcNot a code change; measurements only. The
wordcase arrived at5989abe7; the independent Windows review in this thread is on78cf80ff, before it, and the author's own run of it is the RunPod one. This adds one more independent run of the current head, on an AMD adapter instead of the RTX 4060.Environment
Captured on the machine at run time:
git rev-parse HEADprinted80a17a3d289e2df8f6ca7482c935d6a6328fe4fa.git status --porcelainprinted nothing: it is the first thing the run log and the neighbour log record, and it is empty again in the environment capture taken after the runs.dev.ctest --preset dev -NreportsTotal Tests: 2405, andctest --preset dev -N -R startup_pixel_heap_srvlists the nine entries (Total Tests: 9for that filter), so they were built rather than dropped for a missing interpreter.pick_stream_adapter, intests/startup_stream_setup.cpp, code this pull request does not touch): by GPU preference, software-flagged adapters skipped, then the name filter and a D3D12 device at feature level 12_0. The draw's own printed line below says which adapter won.Test-Path C:\Windows\System32\d3d12SDKLayers.dllisFalse(d3d12.dllis 10.0.26100.9818) andX2W_TEST_DEBUG_LAYERwas not set, so no validation-layer output was captured and none is claimed.Commands
For whoever repeats this: the build directory was configured earlier with
-DINTAKE_PYTHON=C:/Users/walde/Downloads/x2w-pr641/out/pe-env/Scripts/python.exe, a virtual environment in another checkout of this repository (without it no Python entry is registered); and the tree isx2w-2741, a worktree directory of this repository, so the sha its log prints is what identifies it.Observed
100% tests passed out of 9,Total Test time (real) = 7.61 sec, no***Skipped, no stop at 77:The fixture captures the consumer's stdout, so a green
ctestlog carries no adapter line. I ran the samedraw()from the same file in a probe that prints what it captures; the recording call (no backend argument) and the drawing call print different devices, and only the second is the card:Readback is 128 bytes per case; the four 32-byte rows are equal (
rows differis not raised) and the eight columns are, root constant case, identical with fxc and with dxc:100000ffand902000ffare the two textures at records 0 and 1 (red 0x10 / 0x90, green = key x 32);0000ffffis the cleared target the refused keys leave. On the second pass the two views are swapped and the same keys show the other texture (900000ff,102000ff).Word case, same shape:
Keys 0 and 1 name records 1 and 0 (the index buffer holds
{1, 0, 5, 7}), key 2 names record 5 and is refused, and key 3's0x40000001root constant gives a byte offset of 4 after the 32-bit wrap, so it reads word 1 and is drawn with record 0 (green 255).The refused indices differ between the two cases, from the draw's stderr:
Two per pass in the root constant case (indices 2 and 3), one per pass in the word case (index 5); index 7 is never requested. The fixture asserts the total,
4or2, not which index each key named.Negative control on the fixture
The docstring says a shim that ignored the index would fail one of these cases. Measured on the same tree, by changing the record the runtime resolves in
heap_srvs_ready:Rebuild
d3d12_xs_shim, thenctest --preset dev --no-tests=error -R "^startup_pixel_heap_srv_(fxc|dxc)_hardware$" -V:ctestexits 8. The first divergence is key 1 of pass 0:102000ff, where the record-1 texture902000ffis expected. Thengit checkout --of the file, rebuild, same regex:100% tests passed out of 2, exit 0,git status --porcelainempty and no marker left in the file.Scope: the two root constant hardware entries only, and the mutant is not single-variable — once every key resolves to record 0, keys 2 and 3 are drawn instead of refused, so it removes the refusal as well as the index read.
Regression
^startup_gfx2hlsl_(heap_record|heap_word|pixel_heap_image)$— 3/3, with their own controls (19 refused controls,10 refused controls,x4 and compute refusals, mask marks).^(startup_stream_|startup_address_srv|startup_joined_table_pointer|startup_root_cbv)— 27/27, 58.31 s, no skip. The first attempt failed five of these inFileNotFoundErrorbecausestartup_stream_rasterizer.exeandstartup_stream_depth.exehad not been built; those are harness binaries, not a result, and the same regex is 27/27 once they exist.Conclusion
On this adapter, with both compilers, the shim draws the record the draw's index names (two different textures for keys 0 and 1), re-resolves it on the second pass when the views are swapped, and refuses a draw whose index is outside the heap — 2 and 3 in the root constant case, 5 in the word case — leaving the cleared target. A shim that always bound record 0 fails both root constant hardware entries at key 1.
Limits
devpreset only. No validation-layer output, so nothing here is API-layer validation.tex2donly: a heap record naming a buffer SRV or a 1D/3D/array texture, and theheap word table ... mask Mmanifest form, are parsed but never drawn here.record is outside the list's view heap. Not exercised:record is not a shader-resource view(record.slot != 18),index word is outside its table buffer,root constant out of range,table out of range,table buffer descriptor is not bound, the unsupported/invalid manifest-line refusals, the heap SRV beside a writable texture refusal, the indirect-draw refusal, and theserialize_rootchange (a serialization error returning 6 instead of 77).Notes (non-blocking)
tests/startup_pixel_heap_srv_check.py:13: the inserted(Word case: ...)parenthetical splits the sentence ("A draw that ... ignored the index").tests/startup_address_srv.cpp: the comment "keys 2 and 3 name records the two-entry heap does not hold" is exact for the root constant case; inwordmode the index buffer holds{1, 0, 5, 7}, key 2 names record 5 and is refused, and key 3 wraps to word 1 — record 7 is never requested.first_calls(refused, 8)), so a case producing more refusals would stop logging rather than fail; and the stderr line already names the refused record, so asserting the set of refused indices would pin the per-key mapping that the count alone leaves open.AI-assisted; runs executed on the machine above.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:12:45Z.
Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T10:13:51Z.
Both automated-review findings are fixed in head
80a17a3d(pushed).scalar_accumulatenow accepts the five-value masked mark.s_addk_i32keeps the mask;s_mulk_i32of a masked word is not named.startup_gfx2hlsl_pixel_heap_image_check.pyhas controls for both forms, and putting the old four-value unpack back makes it fail withValueError: too many values to unpack.heap_srvs_readynow does the offset arithmetic in 32 bits ((word & mask) * times,at, andindex << 5), checks the bounds on the wrapped value, and no longer rejects an index whose high bits the shader'sindex << 5discards. The word-case draw fixture's key 3 is root constant0x40000001, whose byte offset x 4 wraps to 4, so it must be drawn with record 0 (the old 64-bit code would have refused it).Verification: Linux host controls,
startup_gfx2hlsl_{heap_record,heap_word,pixel_heap_image}, binary mode and the 173 shape comparison pass on80a17a3d. The C++ wraparound case has not been run yet: my pod run picked up the previous head, so it needs the independent Windows run.AI-assisted; commands listed were executed locally.
Pull request closed