cpp-migration: compile a VS/PS pair on first draw through the ordinary graphics runtime #2978
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#2978
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?
@R0Y00 on GitHub · 2026-11-27 01:50 UTC · original
Target branch
main. Refs #2935. #2958 wired the first native compute dispatch. This issue covers the first native graphics draw through the stand-in. #2914 and #2946 provide stage-level regression fixtures.Status. @Not-Saii claimed the first-draw work. #2981 is now on main at
c827d8baad, after independent review of3440edff. The source-built triangle draws 16 red and 16 clear pixels with cold and warm caches on both WARP and RTX. The published disk pair retains precedence and stays byte-identical. After an unsupported native manifest is rejected, the later draw recovers when the disk pair becomes available in the same process. The exact main tree passed 3 focused tests in Debug and Release /O2, with one expected inbox WARP wave32 Compute capability skip per build. Independent review.Remaining main acceptance. PSO creation failure is a later step than manifest rejection. #3141 passed that negative control on the #3094 runtime stack. This issue stays open until the applicable PSO failure control is also verified on main. WARP and RTX results above refer to the source-built fixture.
Scope. Wire the existing C++ graphics pair compiler and binding information into the ordinary graphics pipeline/draw path for one supported VS/PS pair, with the native route enabled. Reuse the existing request identity, PSO creation and cache logic. Start with one render target, a known format and a simple source-built triangle. Keep mesh and additional RTV variants in separate work.
Reproduction and acceptance
The deliverable is one reproducible end-to-end graphics path on this branch. The older CLI/cache work is tracked in #2933 and the compute work in #2934.
@Not-Saii on GitHub · 2026-11-27 01:55 UTC · original
Claiming this.
Environment: Windows 11 build 26300, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), Windows SDK 10.0.26100, plus WARP.
Part I will do, on
cpp-migration: on the first draw of a graphics pipeline withX2W_NATIVE_SHADERSset and no<key>.txtin the cache, the stand-in reads its ownreq_<key>.*files and compiles the pair in-process with the existing pieces (read_graphics_request,prepare_direct_graphics,format_graphics_runtime_manifest,ShaderDxilCompiler::runtime_worker). It then publishes<key>.vs.cso,<key>.ps.csoand<key>.txt(in that order) and loads them through the existingload_translationand PSO path. A fresh process with that cache loads the entry without recompiling. A refusal is logged with its stage and reason, and no<key>.txtis written.The fixture is a source-built constant-colour triangle, one RTV with a known format, drawn through the stand-in. It compares one interior pixel and one exterior pixel against a clear-colour control and a skipped-draw control, does a second-process cache-hit run, and has an unsupported-pair case. Hardware run on the RTX 4090, WARP reported separately.
Shared interfaces I expect to touch:
cached_translationinsrc/startup_stubs/d3d12_draw.inl, and the graphics request job intools/startup/compile_dxil.cpp, which I plan to move into a shared function so the tool and the runtime run the same code. Mesh and RTV variants stay out of scope. I will say here if tracing shows otherwise.AI-assisted (Claude Code).
@R0Y00 on GitHub · 2026-11-28 01:26 UTC · original
The remaining PSO failure control has now passed independently on #3141 at
dbca1851, on top of #3094. The source-built fixture enters the native compiler, injects a PSO creation failure, publishes a valid disk pair before fallback, and then reads back 16 red and 16 clear pixels. Native-only and missing-pair controls refuse, and the ordinary delayed RTV manifest still recovers. All six selected tests passed in both Debug and Release /O2 on inbox WARP and RTX 4060 Laptop with the D3D12 debug layer enabled.Not-Saii's original #2981 remains linked and has green Windows CI at
850aba86; the new head is awaiting independent review. #3094 and #3141 are still stacked. This issue stays open until the first-draw path and its applicable controls are verified on main.@R0Y00 on GitHub · 2026-11-28 04:23 UTC · original
Not-Saii’s #2981 is now on
mainatc827d8baa. The independent review of3440edffreproduced the ordinary cold and warm draw on WARP and an RX 9060 XT. With an invalid generated manifest, the first target stayed clear. Publishing the valid disk pair let a later draw in the same process read back 16 red and 16 clear pixels, with all three cache files byte-identical. The early missing-DXC refusal was tested separately.The later PSO-creation failure control is still tracked in #3141 on top of #3094. A local combined candidate passed that control, and the refreshed candidate
d86ea977passed seven focused Release regressions, including the WARP and hardware draw fixtures. This remains open for verification of the PSO recovery onmain. All of these results are from source-built fixtures.@R0Y00 on GitHub · 2026-12-02 12:39 UTC · original
Current-main check at
5770f14e: #3094 has merged tomain, but #3141 merged into the former integration branch. Thestartup_native_graphics_drawfixture onmainstill injects only missing DXC, manifest failure and root-signature failure. I traced the translated draw on this revision: a null result from graphics PSO creation goes topipeline_state_unavailableand exits the draw without reloading the published pair. This is a source inspection, not a new GPU result.The remaining acceptance is a main-targeted change carrying over the late PSO recovery and its fixture from #3141. Inject failure only for the native candidate, publish a valid disk pair, and verify in the same process that the first target stays clear and the retry reads back 16 red and 16 clear pixels after the fence, with all three cache files byte-identical. Keep the native-only and missing-pair refusals, and record WARP and hardware separately.
@R0Y00 on GitHub · 2026-12-02 18:40 UTC · original
@Ammmae0x @Leyukaka Thanks for bringing #3141 forward. #3873 and #3874 change the same PSO recovery path. Please coordinate on one PR to carry @lambirou’s original work and both timing cases. #3873 shows that a just-published pair can be hidden by the stale absent cache. #3874 also exercises publication after the first draw has already failed. The common fixture should cover both cases, keep the native-only and invalid-pair controls, and check the fenced pixels and cache files. Please link the chosen PR here so we can run one independent Windows review for #2978 and #3136.
@R0Y00 on GitHub · 2026-12-03 05:15 UTC · original
I independently tested #3876 (
05eff611) in a local trial merge with main9dfe168a. The source-built fixture matched the cold and warm draw on WARP and RTX 4060 Laptop. When native PSO creation was faulted, the first target stayed clear and the retry in the same process after disk publication read back 16 red and 16 clear pixels after the fence. The existing cache byte/mtime assertions passed. The fixed-entry draw and slot 67 regressions also passed on both adapters. Trial detailsThe remote PR still has merge conflicts. The just-published timing from #3875 and the command signature lifetime review remain open before this can land on main.
@R0Y00 on GitHub · 2026-12-03 05:34 UTC · original
The remaining main acceptance passed at
8a2f84d1b9bfc8815e224255a46c38d62d8bc39b(#3876). I checked out and rebuilt that exact main commit with MSVC Debug:cmake --build --preset dev --target compile_dxil d3d12_xs_shim startup_stream_consumer, thenctest --preset dev --no-tests=error -j 1 -V -R '^startup_native_graphics_(draw|fixed_entry)_(warp|hardware)$'. All four tests passed with no skips on Windows 11 build 26300, inbox WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, with the D3D12 debug layer enabled.On each adapter the source-built triangle read back 16 red and 16 clear pixels on both the cold and warm native draws. The native-candidate PSO fault left all 32 pixels clear on the first draw. Publishing the disk pair let a later draw in that same process read back 16 red and 16 clear pixels after the fence, with its three cache files' bytes and mtimes unchanged. Native-only and missing-pair controls each left all 32 pixels clear. This completes the source-built first-draw acceptance started in #2981.