gpu: follow-up to #671/#682 — a lit, shadowed scene through the translated mesh and pixel stages #724
Open
opened 2026-11-22 23:25:34 +00:00 by roansystemlabs
·
13 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
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#724
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 roansystemlabs on 2026-11-22T23:25:34Z.
Problem
#682 (grahamster2, on the issue you defined in #671) runs the translated compute → mesh → pixel chain from the shim EXE's PE entry, and native Windows,
pe_mapand AOT agree on every published byte. Depth occlusion between two translated mesh draws is verified separately in #639 (descent81), and texture reuse across EXE-driven draws in #705 (RonLogic).What no fixture covers yet is lighting and shadowing with translated stages:
image_sample_c_lz→SampleCmpLevelZero, which is our open #718 (your review asked for a filter-boundary case; we're working on it).Proposal
A small next step after #682, not a new demo: a lit, shadowed scene built from translated stages. We'd like to take it, one small PR at a time, each opened only after the previous one is reviewed:
SampleCmpLevelZero. Controls: swapped LESS/GREATER comparison and a stale shadow map.X2W_SHIM_DRAW_CASEvalues on thedraw_request/draw_framecontract from #560/#682, with no signature or import-table change, compared across native,pe_mapand AOT, with a stale-input control likechain-stale.#721 remains our priority. We won't start step 1 until you reply here.
Alternatives
Verification
shim_chain_check.py. Every RGBA byte must match. Each negative control must produce a known, nonzero mismatch while the uncovered pixels still match.cpu_shim_chain_hardwarealready does.Questions
AI-assisted: yes
Checklist
pixel_aotand #670 for the SPIR-V bridge. #682 and #705 are merged, and RonLogic/Xbox2Windows#1 changesshim_draw_gpu.cppfor multi-frame draws, not lighting.)Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T23:55:21Z.
Please start with the standalone lit fixture once it fits around #721. An independent pixel reference and the inverted-light and ignored-normal controls are the right first slice. Keep the shadow pass dependent on #718, and wire the combined scene into the EXE only after the standalone comparisons pass. Reuse the current
draw_request/draw_frameABI and keep the three-runner output and stale-input checks at that stage. The swapchain can stay outside this work.Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T00:18:48Z.
Thanks. Starting the standalone lit fixture now (independent pixel reference, inverted-light and ignored-normal controls; no shadow pass, no EXE wiring yet). I'll link the PR here.
Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T00:47:45Z.
First slice is up: #749 (standalone lit fixture with an independent pixel reference; inverted-light, ignored-normal and missing-clamp controls). The shadow fixture comes next, now that #718 is in main.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T01:23:11Z.
The standalone lighting step merged in #749. It uses the existing indexed mesh path and checks the complete lit image against an independent reference, with inverted light, ignored normal and omitted clamp as mismatch controls. #718 is also merged, so the separate depth-comparison shadow slice can proceed. The issue stays open for the combined draw and EXE hookup.
Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-23T02:08:53Z.
Shadow slice is up: #773 (light-view depth pass with the translated mesh program, plane compared through SampleCmpLevelZero from #718, lit object from #749; independent reference; swapped-compare, stale-map, ignored-map, coverage-for-depth and missing-occluder controls). Wiring the scene into the EXE comes after it.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T02:26:00Z.
#773 merged as
03d4fbc. The standalone fixture now checks the translated light pass and SampleCmpLevelZero camera pass. RTX 3070 and WARP matched all 4,096 color pixels and 4,096 depth texels, and the stale-map and coverage-instead-of-depth controls produced different readbacks. The normal and /O2 Windows jobs and both Linux jobs passed. The remaining step here is to wire the same scene and readback into the EXE comparison.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T04:54:24Z.
@roansystemlabs I’m picking up the two-frame EXE integration requested by the maintainer. I’ll reuse your #773 renderer and oracle, keep the resources live across both frames, move the occluder for frame two, and use the previous depth map as the negative control. If you already have EXE integration commits, please link them here so I can build on them. I’ll compare both outputs, cleanup and exit status across Windows, pe_map and AOT on hardware and WARP.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T05:17:21Z.
The two-frame EXE integration merged in #797 at
16b433c. Thanks @roansystemlabs for the standalone renderer and reference in #773. On RTX 4060 Laptop and WARP, native Windows, pe_map and AOT matched both color and light-depth frames, four owned surface releases and exit 42. Moving the caster four pixels in frame two made the previous-map control differ at exactly 170 second-frame color pixels on each runner, with both depth readbacks correct.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T09:12:39Z.
I’m taking the next integration step using the existing source-built scene and oracle from #773 and #797. The EXE will call the device creation import itself, select the shadow-map binding for each frame, and submit and wait for each frame separately. The current two-frame fixture records both frames into one command list. The comparison will cover native Windows, pe_map and AOT on WARP and a physical adapter, including the stale-map and device rejection controls and a rejected second submission that preserves the first frame. The device entry retains the existing desktop IID and null parameter block scope from #799.
CPU/PE review of the import binding and GPU review of fence and resource lifetime are welcome once the candidate is up. For independent adapter work, #810 remains open for mesh pipeline retests.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T09:39:28Z.
#826 and #829 are on
main. Thanks to the #773 and #797 contributors for the scene and independent reference. The source-built EXE now calls the real device import and chooses the frame and shadow-map slot before each fixture submission.On the RTX 4060 Laptop GPU and WARP, native Windows,
pe_mapand AOT each produced the same 65,536 color and light-depth bytes with two submissions and fences 1 and 2. The stale binding changed 170 second-frame color pixels. The invalid second submission kept the first frame intact, released the four tracked surfaces and device, and exited 24. All four CI jobs for #829 passed.#830 is open for claiming the next integration test. It uses the independent archive reader to drive GPU upload and readback, with a truncated second record as the cleanup control.
Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-24T12:14:38Z.
Update, outside the steps above: a larger scene through the same translated stages, rendered locally on
mainat5bfafce2. It is a local harness outside the tree, not a project test; the details are here so you can judge whether any of it should become one.Full video, 1920×1080, 14 s: scene_1920x1080.mp4
What was drawn. A round platform with six solids (hexagonal column, cube, pyramid, icosahedron, low slab, small monolith), a perspective camera swinging ±24°, and a sun at 31° elevation making one full turn in 14 s. Two framings of the same scene, 420 frames each: landscape rendered at 3840×2160 and portrait at 2160×2700, both downsampled 2×2 in linear light (to 1920×1080 and 1080×1350), with a 4096×4096 shadow map. NVIDIA GeForce RTX 3070, driver 621.01, D3D12 debug layer on.
What goes through the translator. Three source-built gfx1013 programs, assembled with the LLVM 15 chain used by the binary checks and translated from machine code by
tools/mesh_entry_aot.pyandtools/pixel_aot.pyat5bfafce2. Each binary translates to the same HLSL as its source text, and dxc compiles that HLSL unedited.image_sample_c_lzlowered toSampleCmpLevelZerowith the bilinear comparison filter, hemisphere ambient and albedo, binary16 export as in #749 and #773.What does not. The CPU builds the world-space triangles, the per-face constants (normal, colour, plane coefficients) and the camera and light matrices of each frame. The host is my own D3D12 program, with the #773 root signature, no window or swapchain, and readback from GPU memory. It is not the EXE path, and no title code is involved. I did not measure performance.
Checks.
debug_errors=0 debug_warnings=0on all 840 frames. In the first frame of each video, the exported mesh positions of both passes match a CPU matrix × vertex product on 6,840 vertices, with a largest error of 3.1e-6 (|got - want| / max(1, |want|)). There is no pixel reference: per frame I checked mean luma (34 to 56 of 255 landscape, 41 to 64 portrait) and the mean absolute change between consecutive frames (at most 0.63 of 255 landscape, 0.74 portrait), and I looked at full-size frames of both videos for shadows falling away from the sun.Three translator limits this ran into (lines at
5bfafce2):v_interp_p1/p2_f32is accepted only forattr0.xandattr0.y, at entry or in whole-quad mode (pixel_aot.py#L3840-L3845), and whole-quad arithmetic on them is limited toadd,fmaandmul_legacyand must stay affine (#L4125-L4145). The light-space depth could not be interpolated, so the pixel program evaluates it from each face's plane (a·u + b·v + c, coefficients in b0). That is exact only because every face is flat.DispatchMeshper triangle: 1,032 in the shadow pass (casters only) and 1,248 in the camera pass.I found no existing issue for these.
Question. Which would be more useful to you, if either?
mesh_scene_draw_{hardware,warp}test: a few frames with fixed lights on a small target, point comparison filter, values kept off every boundary as in #773, an independent Python reference and negative controls.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-24T17:34:56Z.
Following up on limit 3 above, I'm taking it as a focused PR: let
tools/mesh_entry_aot.pytranslate mesh programs that write several vertices and triangles, within the counts declared in PSV0 (up to 256), instead of only(3, 1). Every exported vertex and primitive index must still be covered, and the compute fallback keeps its single-triangle rule with an explicit refusal.Verification: a source-built gfx1013 mesh program (LLVM 15 chain, as the existing mesh fixtures) drawing a two-triangle quad and a larger strip, compared per pixel against an independent CPU reference on WARP and an RTX 3070 with the debug layer on; negative controls for a swapped index, a missing primitive and a count mismatch. Limits 1 and 2 are not part of this PR (limit 2 is covered by #1702).
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-24T18:42:15Z.
Following up on limit 1 above, I'm taking it as a separate focused PR, independent of #1779 (limit 3): when a pixel program is translated with a sampler, let
tools/pixel_aot.pyacceptv_interp_p1/p2_f32forattr0.zandattr0.wat entry as plain interpolated values, with afloat4TEXCOORD0 as the no-sampler path already declares. Onlyattr0.x/yremain sample coordinates. Using z or w as a coordinate, whole-quad arithmetic on them, and attr1+ stay refused. The 16-bit high-word question in #711 is not touched.Verification: a source-built gfx1013 pixel program (LLVM 15 chain, as the existing pixel_aot fixtures) that samples a texture at attr0.xy and scales the result by attr0.z and attr0.w, with distinct per-vertex z/w values, compared per pixel against an independent CPU reference on WARP and an RTX 3070 with the debug layer on. Negative controls: swapped z/w (predicted first mismatch), z used as a sample coordinate (refused) and attr1 (refused).
AI-assisted.