WIP: Experimental FidelityFX Xbox GPU compatibility — Wave64 emulation and NVIDIA support #33
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!33
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/33/head"
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?
@ElHombreAlex on GitHub · 2026-11-22 12:02 UTC · original
ElHombreAlex:experimental/ffx-functional→main· +3244 −28 · 21 files · 21 commits · closed without mergingOverview
This experimental branch documents five iterations of Xbox Series GPU compatibility research, focused on running the authentic Xbox FidelityFX upscaler through XCL on an NVIDIA RTX 4060 Ti.
The work builds upon XCL's existing infrastructure and explores proprietary Xbox pipeline deserialization, RDNA2 shader recompilation, Wave64 compatibility, and GPU resource translation.
Key achievements
ffxDispatchrecording of 26 console compute dispatches.Verification
reports/.Known limitations
This is experimental work, not a complete or verified FSR4 implementation.
The full GPU workload does not yet complete successfully.
Execution currently fails at compute dispatch 14, where a suspected structural Wave64 rendezvous desynchronization leads to degraded execution and eventual GPU device failure.
The next investigation should identify the first divergent rendezvous site and validate cross-half data movement, particularly DPP operations.
No final output frame has been verified.
Project status
This PR is intended to share research and implementation progress, not to request immediate merging.
The branch requires further validation, cleanup, conflict resolution, and review before it can be considered production-ready.
No game binaries or proprietary Xbox DLLs are intended to be included.
Thanks to the original XCL author for the substantial foundation that made this investigation possible.
PIXEvt.dll is a console OS component: it always exists there, so a runtime LoadLibrary("PIXEvt.dll") from title code must not fail. Route it to stubs and answer GetProcAddress on the stub handle with a db-backed stub (a DLL routed to stubs has all of its exports; unknown DLLs still get NULL so optional-API probing keeps working). The stub default is 0, not E_NOTIMPL: the PIX event functions return block pointers / BOOLs, so E_NOTIMPL would be a bogus non-null pointer; 0 is the "not capturing" value instrumented code expects. Evidence: the officially distributed console FidelityFX upscaler (microsoft/Xbox-GDK-Samples Kits/FidelityFX/signedbin) statically imports PIXEventsReplaceBlock; the retail game DLLs this project tests against do not, so the gap was invisible until the official binaries were used.The strict success path now runs and passes with XCL_SAMPLE_FFX + XCL_FFX_GPU=1: ffxCreateContext via the loader with the sample-exact chain (BACKEND_XBOX 0x02000002 + UpscaleVersion 0x0001000b/0x01001002) returns OK, the context object structure is dumped (the loader's wrapper {name, provider-ctx} and the provider's C++ object with its vtable), and ffxDestroyContext returns OK through the provider - the complete context lifecycle of the authentic, officially distributed console FSR4 binaries on a PC GPU. Two findings are documented in the test, replacing the old frontier-lock assumptions: - the loader's context-bound dispatch (ffxQuery/ffxDestroyContext walk the wrapper) faults at loader+0x16a6 under XCL, and the provider's own context-bound query faults at upscaler+0x1b9a on a .data slot holding -1 (the same uninitialised-registry family as the context-less GetVersions crash); the query is therefore gated behind XCL_FFX_QUERY=1 to reproduce, and the destroy goes through the provider with the inner context, which works and is asserted. - the accessor test's "the loader has not loaded the upscaler yet" pre-assertion was order-dependent under parallel test execution and flaked; the post-lazy-load semantics (mapped, DllMain run, shared flag state through both modules' exports) are asserted instead, which hold in any order.The officially distributed FSR4 upscaler deserialises its native pipelines through device #57/#67 DeserializePipelineStateX ('FFX_FSR4_PASS_0'...). The stub logged only E_NOTIMPL; now it also dumps the serialisation: the header qwords, the (ptr, size) segments it contains - payloads in both host heap and title memory (console GPU VAs; XCL's UMA windows resolve them directly, console address = CPU address) - so the console driver-cache format can be identified. Evidence from the official DLL (FFX GPU harness, dispatch run): the header is a sub-table pointer plus (ptr, size) pairs; the 0xec0-byte segment at the title-memory GPU VA 0x402300000 is the shader payload - raw console-compiler output with no XBCH/XDAT/FSSM container structure, i.e. the console driver's private pipeline-cache serialisation (the class the FSR4 author note calls ACO-cooked). The provider's own assertion names the call site: fsr4_common.cpp:1401, ffxProvider_FSR4_Common::Dispatch -> CreateModel(internal_context, correctPreset, model).The default title configuration mounts a drive letter to the game folder ("D:" = "{game}", upstream's new default mount). A workspace on that drive has its own real paths there and under the XCL data folder - the host's game exe, the TLS carriers, the shader cache - and every hooked file operation on them was mount-translated to doubled, nonexistent paths: the e2e title could not even be read (os error 3), and after the exe read was fixed the TLS carrier's LoadLibrary failed (error 126). Mount translation now skips paths already under a host root: the mount target itself (the game folder - console paths never include the host-side game folder path, the game folder IS the drive root for them) and the XCL data folder. Regression test included (a mount on the temp dir's own drive). Verified: the e2e title loads and runs to completion again ("xcl_testtitle: done"); the remaining check failure in the e2e suite is the new upstream DMA-copy check, which fails identically without this branch's changes (none of them touch lists, queues or placed resources) - recorded as a known upstream issue on this NVIDIA environment.DeserializePipelineStateX (device #57/#67) reconstructs a compute pipeline from the console driver's serialised state - the form the officially distributed FSR4 upscaler uses to create its native passes ('FFX_FSR4_PASS_0'...), which blocked the dispatch at the provider's CreateModel assertion (fsr4_common.cpp:1401) since iteration 3. The blob the console code passes: qword[0] a runtime session object, then (ptr, size) pairs of four sections - a 0x1c-byte pipeline header, a 0x14-byte hash, the raw RDNA2 code and a metadata section (header [0x403, meta size - 0x14, code size in dwords]; validated, as is the code's s_code_end-padded tail). The code is byte-identical to the FXCP blocks the console DLL embeds (927 blocks); the driver appends s_code_end padding, which is trimmed to the final s_endpgm. The translated pipeline runs under XCL's ABI root signature like the normal console-compute path, and the console root arguments map onto it at dispatch (upstream's bind). The compute interface comes from the FSR4 pass ABI the retail probe measured (14 user SGPRs: s4 = UAV table, s5 = SRV table, root CBVs, then TGID x/y at s14/s15, one thread-id VGPR) - confirmed in the code's prologue (v_lshl_or_b32 v6, s14, 4, ..). numthreads is not in the serialised state (it is compiled into the code's lane algebra); the default is (256,1,1) from the PC twin's 1778-kernel PSV0 corpus (distribution: 256/32/8x8/64), XCL_FFX_THREADS=x,y,z overrides it for validation against the console's dispatch records. XCL_FFX_HLSL=path dumps the translated source. Verified with the authentic console binaries on the RTX 4060 Ti: fourteen FSR4 passes deserialise, translate completely, compile and are accepted by the driver as PC compute pipelines (up to 320 KB of DXIL; e.g. PASS_0's 3544 B of RDNA2 -> 33 KB DXIL). The fifteenth (26 KB RDNA2 -> 602 KB DXIL, 3.5x the PC FSR4's biggest shader) is rejected by the NVIDIA driver with E_INVALIDARG - isolated by the harness's bisect test, which also shows the same DXIL accepted by the Radeon iGPU. The dispatch frontier-lock test pins this new frontier.The dispatch test's child-process lock now pins three march states, each with its own signature: 1. iteration 3 - the deserializer declines the blob (the console DLL crashes at its CreateModel assertion); 2. iteration 4 - a deserialized pipeline is rejected at PSO creation (a wave64 pass, [WaveSize(64)] on the adapter's 32..32 wave range); 3. iteration 5 - the full pass set is accepted, ffxDispatch returns OK, the recorded console commands execute on the GPU and the frame faults the device mid-execution (the child fails its own device-removal assert - a test exit code, not the console crash). The lock run with the iteration-5 state passes: the parent prints the verified-frontier summary with the created-pipeline count and the executed dispatch count, and a child that completes the whole dispatch/execute/readback flow takes over automatically ("the blocker is gone").@grahamster2 on GitHub · 2026-11-22 20:56 UTC · original
Tested on an RTX 3080 (D3D12 wave range 32..32, driver 610.88) and a Radeon RDNA2 iGPU (wave 32..64, no mesh shaders), with this branch merged onto current
mainplus #41 for adapter selection. The merge conflicts inreal.rs/device_x.rswere only the adapter selection and the R9G9B9E5 additions, and I kept both sides.cargo test --workspace --release --no-fail-fast,XCL_SAMPLE_RPFset to a retailshaders.rpf:wave64_compute_rendezvous_on_32_lane_wavesretail_mesh_pipelines_through_the_hookmain; the rendezvous coversMode::Computeonly)main)No device removal or TDR.
The rendezvous test fails on current
mainbecauserlaisn't hooked any more. It fails withmem[32]: 40, expected 8. The generated HLSL showsballotdispatching toballot_x64, butrladoesn't dispatch torla_x64. The hook is aPRELUDE.replace("uint rla(uint v, uint l) {\n if (xcl_logical_wave64)", ..)(emit.rs,split_w64prelude), andmainchangedrlain507c441(uint w;first, plus the pixel-mode quad reads), so the pattern silently stops matching.v_readfirstlanein the high native wave then doesWaveReadLaneAt(v, 8)within its own 32 lanes and reads lane 40, which is exactly the 40 above. On your branch's base the pattern still matches, which is why it passes there.Suggested fix: anchor on the signature only, and fail loudly if either hook doesn't apply:
With it, the test passes on the RTX 3080 in all three variants (default,
XCL_TEST_W64_RENDEZVOUS=first,=lds). Pointed at the iGPU, its native[WaveSize(64)]run matches the rendezvous form. Note that theldsvariant passes even without the fix: the stored value there is the LDS round-trip, so it doesn't observereadfirstlane. Given the "suspected structural rendezvous desynchronization" at dispatch 14, it may be worth checking that the FSR4 runs were made with both hooks in place.Two smaller things in that test:
EnumAdapterByGpuPreference(0, ..)whilenative_okcomes fromrunner::wave64_supported(). On a machine whose first adapter has no wave64 (like this one), the native comparison never runs, and withXCL_ADAPTERthe two can be different GPUs. Taking the device from the runner (orgpu::adapterfrom #41) would fix both. That also overlaps withb8881cf: this branch and #41 both addXCL_ADAPTER, #41 with the number / name-substring forms and the test bench wiring. I'm happy to adapt #41 to whatever you need.C:\Users\alexa\AppData\Local\Temp\fsr4_bisect\(the error is ignored, but an env var orstd::env::temp_dir()would be safer).@Foniass on GitHub · 2026-11-22 22:47 UTC · original
Tested on RTX 5070 Ti only (Blackwell, driver 32.0.16.2114, D3D12 wave range 32..32, mesh tier 1). The RDNA2 iGPU on this machine is disabled, so it wasn't tested. I ran the PR head
8e592ffas it is, because it conflicts with currentmaininreal.rs/device_x.rs, and compared it with its basee511b94.cargo test --workspace --release --no-fail-fast -- --test-threads=4, noXCL_SAMPLE_*set. Hardware details are in #42.e511b94(base)8e592ffwave64_compute_rendezvous_on_32_lane_wavesreally runs on Blackwell and is not skipped:rendezvous form: 4 console waves (8 native), active 8..=40, all stores = 8: OK. The native cross-check is skipped, since there is no wave64 adapter here.gpu_ready()(no wave64) on the base and on the PR.ffx_official_console_dlls.rsneedXCL_SAMPLE_FFX. Without it they return immediately (0.00 s), so their pass says nothing on this machine.rlahook (emit.rs:3498) still expectsuint rla(uint v, uint l) {\n if (xcl_logical_wave64). Currentmain'srlastarts withuint w;, so after a rebase the hook won't apply, as described above. That part I checked in the source, not on the GPU.deserialized_fs_dxil_driver_acceptancewithXCL_FFX_BISECT_EMPTY=1reads a hard-codedC:\Users\alexa\...\fsr4_bisect\empty.cso(ffx_official_console_dlls.rs:863).@ivall on GitHub · 2026-11-23 13:57 UTC · original
Thank you for this research – it is what got FSR4 going. Since
mainmoved a lot (#67 brought the wave64 form on 32-lane GPUs, #41 adapter selection, the VFS drive fix), I rebuilt the FSR part on currentmaininstead of merging the branch:fdeacf0.DeserializeComputePipelineStateXstaysE_NOTIMPL, and FSR4 then callsCreateComputePipelineStatewith theACCC/FSPXblob, which carries the real thread geometry andCOMPUTE_PGM_RSRC2(entry 0) next to the RDNA2 code (entry 6) – so no(256,1,1)guess is needed. All 29 pipelines translate and compile.v_dot4*were shift-and-multiply emulations; as SM 6.4dot4add_i8packed/dot4add_u8packedthe biggest went 1.55 → 1.23 MB DXIL, DXC 604 → 74 s, and the AMD driver accepts it.fsr4_console_upscaler_creates_a_context_probewithXCL_PROBE_FSR_EXECUTE=1).Closing this PR as superseded – the reports in it are referenced in HANDOFF. If you can, a run of that probe on your RTX 4060 Ti (
XCL_CONSOLE_LISTS=1 XCL_PROBE_FSR=1 XCL_PROBE_FSR_DISPATCH=1 XCL_PROBE_FSR_EXECUTE=1,XCL_SAMPLE_DLLS= the game's DLLs) would tell whether the 32-lane path now gets through dispatch 14.@ElHombreAlex on GitHub · 2026-11-23 15:19 UTC · original
<html>Thanks for the update and for building upon the research! I ran the requested NVIDIA validation against upstream
mainat484dd57.Hardware: RTX 4060 Ti, NVIDIA driver 610.88, D3D12 wave-lane range 32..32. XCL's preflight correctly detects the GPU and selects the split-Wave64 path. The adapter was explicitly selected using
XCL_ADAPTER.The upstream worktree was left unmodified throughout testing.
1. FSR4 probe — context initialization
With
XCL_SAMPLE_DLLSpointing to the officially distributed GDK-Samples 4.1.2 FidelityFX DLLs, the upstream probe returns:ffxCreateContext: code 0x1D3D12 tracing confirms that no device methods are called before this failure, so this occurs before GPU initialization.
The available kit DLLs expect a different descriptor chain from the one used by the upstream probe:
CreateBackendXboxDesc:0x02000002CreateContextDescUpscaleVersion:0x0001000BRequested FSR version:
0x01001002(4.1.2)Using this descriptor chain through the loader allows initialization to progress.
This appears to be a difference between the kit DLLs available locally and the game-pack DLLs used for your successful RX 9070 validation.
2. FSR4 probe — resource creation
With the corrected descriptor chain, the DLL proceeds to create GPU resources through XCL, including four console descriptor heaps.
Initialization then fails while creating its fourth internal texture:
Dimensions: 1920 × 1080
Format:
R9G9B9E5_SHAREDEXP(DXGI 67)Flags:
ALLOW_UNORDERED_ACCESS(0x4)Relevant log output:
This matches the RGBE UAV resource-creation limitation identified during the earlier PR #33 investigation.
The experimental branch includes a workaround using
R32_TYPELESSstorage,R32_UINTviews and complementary shader-side 9-9-9-E5 packing/unpacking. That workaround was validated through resource initialization, but not through a successfully completed FSR4 frame.The underlying typed-UAV format limitation is not NVIDIA-specific. I have not independently tested these kit DLLs on AMD hardware.
3. NVIDIA GPU regression results
The unmodified upstream
Result | Count -- | -- Total | 271 Passed | 253 Failed | 0 Ignored | 18 Duration | 11.55 sgpu::test suite completed successfully on the RTX 4060 Ti:The passing tests include:
Split-Wave64 cross-half operations and lane-local masks.
Cross-half synchronization under divergent wave execution.
Inactive-lane zeroing for
ds_swizzleandds_bpermute.Mesh split-wave execution.
Upper-lane handling and Wave64 pixel-shader reductions.
This confirms that the upstream split-Wave64 implementation passes its applicable regression tests on real NVIDIA hardware.
Conclusion
Confirmed on the RTX 4060 Ti: D3D12 device initialization, correct split-Wave64 selection and successful execution of the upstream GPU regression suite.
Not yet verified: the complete FSR4 workload (29 pipelines, 20 dispatches and output readback). The available kit DLLs fail during context/resource initialization before reaching that stage.
Therefore, I cannot yet confirm whether the previous dispatch-14 failure is resolved by the new upstream implementation.
Thanks again for the work on XCL and for incorporating the earlier research. I'm happy to help with further NVIDIA hardware testing or validation if needed!
</html>Pull request closed