startup: run native shader compilation and compute dispatch through the runtime #2934
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#2934
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?
@sydney-0o on GitHub · 2026-11-26 22:00 UTC · original
Target branch:
cpp-migrationProblem
At
7f951fd3,x2w_shader_compileris linked intocompile_dxiland test executables. The startup runtime has no caller forShaderDxilCompiler::runtime_worker,NativeRecording, orNativeDispatchStates. The Windows startup launcher still starts the Pythongfx2hlsl.py --watchprocess when shader translation is enabled. The native compiler and recording fixtures therefore do not yet demonstrate execution through the startup runtime.Compiler build targets · Native recording fixture · Startup launcher
Done when
If the runtime route uses the on-disk shader cache, it depends on #2933.
@Not-Saii on GitHub · 2026-11-26 22:35 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: route a source-built compute workload through the stand-in's normal slot 67 and Dispatch path with native translation enabled and an empty cache. It compiles in-process with the pieces the issue names (ShaderDxilCompiler::runtime_worker,NativeRecording,NativeDispatchStates) and records the dispatch, with nogfx2hlsl.py --watchprocess. The Windows check compares the fenced readback with a CPU reference. Its negative control is an unsupported workload that is refused while the output buffer keeps its sentinel. Hardware run on the RTX 4090; the WARP package smoke test stays, with the wave-width skip reported separately.Shared interfaces I expect to touch: the compute dispatch path in
src/startup_stubs/d3d12_compute_dispatch.inl, the stand-in's link againstx2w_shader_compiler, and the translation switch intools/startup/run.ps1. I plan to compile in-process, so I do not expect to depend on the on-disk cache work in #2933. I will say here if tracing shows otherwise.AI-assisted (Claude Code).
@Not-Saii on GitHub · 2026-11-26 23:29 UTC · original
Update to my claim, after tracing and a first run on the RTX 4090.
The route does not use
NativeRecordingorNativeDispatchStates. The stand-in's dispatch path (record_translated_dispatch) already resolves raw table buffers, tracks their states and refuses what it cannot bind. So on the first Dispatch of a slot 67 pipeline the stand-in translates the request in-process (x2w::read_compute_request,x2w::translate_compute, thenShaderDxilCompiler::runtime_worker) and fills the sameComputeTranslationa published<key>.txtfills. The two helpers stay unused until a binder handles textures and typed views.What it accepts so far is what the fixture runs: root constants, a raw table buffer loaded per lane and a raw table buffer stored to. Everything else, a scalar buffer load included, is refused by name and left to a published translation.
Two things the runs showed:
startup_gfx2hlsl_compute_check.py(unaligned descriptor table entry): that program takes its second buffer descriptor from table byte 16, and the frontend reads a table as 32-byte records. The fixture uses the same program with the descriptors at bytes 0 and 32, and case A as the refused workload._hardwarevariant.It reads the request files the stand-in itself wrote, through the reader that #2939 moved to revision 28, so it needs nothing else from #2933. PR to follow.
AI-assisted (Claude Code).
@MasterDomino on GitHub · 2026-11-27 00:08 UTC · original
Closed by #2958 (@Not-Saii), merged into
cpp-migrationasb260984f. WithX2W_NATIVE_SHADERS(run.ps1 -NativeShaders), the stand-in translates a slot 67 compute request in-process on its first Dispatch, with no Python watcher.startup_compute_dispatch_native_hardwarepasses on an RTX 4090 and an RX 9070 XT, and the WARP smoke test still passes. In a 300 s start-up run with the switch, the run was stable; all logged attempts were refused, as the narrow scope intends. AI-assisted.