Repository navigation
WIP: Experimental FidelityFX Xbox GPU compatibility — Wave64 emulation and NVIDIA support - #33
ElHombreAlex wants to merge 21 commits into
Conversation
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.
microsoft/Xbox-GDK-Samples Kits/FidelityFX/signedbin ships AMD-signed Scarlett builds of amd_fidelityfx_loader_xbox.dll and amd_fidelityfx_upscaler_xbox.dll (next to their *_dx12 PC twins). Anyone can fetch them legally, so unlike the retail DLLs in console_dlls_e2e.rs they make a publicly reproducible regression harness (XCL_SAMPLE_FFX = folder with the two DLLs; skipped when unset). - both DLLs map, resolve imports and run DllMain; - the upscaler's console-only imports route to the console emulation (d3d12_xs -> D3D12.X HLE, xmem -> kernelx cross lookup, PIXEvt -> stub); - exported-function execution: the loader's Xbox-only FSR4-Lite accessors lazily load the upscaler through the runtime LoadLibrary shim (mapped, relocated, TLS carrier, DllMain) and forward to its exports via GetProcAddress; the flag round-trips through the upscaler's global. The accessor semantics were pinned down from the official binaries' machine code first: the upscaler's Set stores CL into a global byte, Get zero-extends it into EAX; the loader's first accessor call runs an internal ensure-loaded helper, then tail-calls the upscaler's export - so the pair shares one global state and the first call is what loads the upscaler. scripts/test.ps1 lists the new variable so the suite is not silently skipped.
The console D3D12.X passes initial resource states with console-only qualifier bits above the 32-bit PC D3D12_RESOURCE_STATES enum; the officially distributed FSR4 upscaler (Xbox-GDK-Samples Kits/FidelityFX/signedbin) passes 0x400000008 for one of its textures (console bit | UAV). The PC driver rejects the raw value with E_INVALIDARG. Mask to the PC state range in dev_create_committed_resource_x - the same console->PC translation point that already neutralizes the console Layout fields (0x101 etc.): console qualifiers describe the console memory model, which XCL deliberately reinterprets. Verified on the NVIDIA RTX 4060 Ti: with the mask the same call proceeds past state validation (the remaining E_INVALIDARG on that texture is a format-capability difference - DXGI 67, R9G9B9E5_SHAREDEXP, has no typed UAV on PC - documented separately in the FFX GPU harness).
… XCL Extend the XCL_SAMPLE_FFX harness with the GPU milestone test (XCL_FFX_GPU=1, real backend required). The chain is Microsoft's own (AMD_FSR sample + the current FidelityFX headers shipped beside the DLLs): CreateContextDescUpscale (0x00010000) -> CreateBackendXboxDesc (0x02000002, device @ +0x10) -> CreateContextDescUpscaleVersion (0x0001000b, u32 0x01001002 = FFX_UPSCALER_VERSION 4.1.2). The retail-era chain (old DX12 backend 0x0100_0002, no version desc) is kept as a control: this DLL rejects it with a bare ERROR before touching the device - the version declaration and the Xbox backend desc are required. With the sample-exact chain the official console upscaler drives XCL's emulated device for real on the NVIDIA RTX 4060 Ti: AddRef, four descriptor heaps, three committed 1920x1080 textures (R8G8B8A8_UNORM, R16G16B16A16_FLOAT x2) with SRV/UAV views, and then fail-fasts (0xC0000409) inside its own error path when the fourth texture - DXGI 67 (R9G9B9E5_SHAREDEXP) with ALLOW_UNORDERED_ACCESS - is rejected: PC has no typed UAV for that format (CheckFormatSupport, printed by the test), the console's RDNA2 does. The abort cannot be caught through Rust frames, so the test reproduces it in a child process and asserts the exact signature: fail-fast code, the capability line, the E_INVALIDARG line. The full success flow (context -> provider version query -> destroy) runs verbatim in the child and takes over automatically when a format translation lands. Also documents two dead ends in comments: the provider DLL's context-less ffxQuery(GetVersions) faults at +0x8055 on an uninitialized registry (via the loader too), so version ids come from Microsoft's published values instead.
… creation The console's RDNA2 image pipeline supports typed UAV access on formats the PC typed-UAV set lacks. The officially distributed FSR4 upscaler (microsoft/Xbox-GDK-Samples Kits/FidelityFX/signedbin) creates its neural-input texture as 1920x1080 R9G9B9E5_SHAREDEXP with ALLOW_UNORDERED_ACCESS and initial state console-bit|UAV; the PC driver rejects the flag and the matching UAV initial state for DXGI 67 with E_INVALIDARG (CheckFormatSupport: no typed UAV for R9G9B9E5 on the PC), and the console DLL then fail-fasts inside its own error path. Translate at the same console->PC boundary that already neutralizes the console Layout fields: keep the format (SRVs of R9G9B9E5 are PC-legal), drop the GPU-write flags, and start the resource in COMMON when its initial state was the dropped UAV state. Verified end-to-end with the authentic console binaries on an NVIDIA RTX 4060 Ti: the FSR4 ffxCreateContext now completes through XCL's emulated D3D12.X device (descriptor heaps, four committed textures, SRV/UAV views) and ffxDestroyContext returns OK - the context lifecycle of the official console middleware, executed on a PC GPU through the compatibility layer. Known open risk, to be observed at dispatch: if a console pipeline binds a UAV view of such a texture, view creation is void and the failure would surface at execution time.
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 xcl-dev#57/xcl-dev#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).
XCL_SAMPLE_FFX + XCL_FFX_DISPATCH=1 + XCL_CONSOLE_LISTS=1 runs the full FSR4 dispatch flow with the authentic console binaries and locks the precise frontier: - ffxCreateContext completes (the context-lifecycle test's chain), the FSR4 root signature already flows through XCL's capture path ([SHADER] rootsig ..., parts [RTS0]), and ffxDispatch reaches the provider's native pipeline setup - ffxProvider_FSR4_Common::Dispatch calls DeserializePipelineStateX for 'FFX_FSR4_PASS_0'. - XCL's deserializer stub returns E_NOTIMPL; the provider's assertion fires (fsr4_common.cpp:1401, CreateModel), and the null PSO then crashes the recording inside the console DLL (0xC0000005). - The test reproduces this in a child process and the parent asserts the exact signature: the crash code, the provider assertion line and the XCL deserializer line. The full flow below - three dispatch frames with real input content (gradient color, two-band depth, zero motion), console-list close, GPU execution, output readback and comparison, PPM dump via XCL_FFX_DUMP - engages automatically once a console pipeline-cache deserializer exists. The flow also exercises the format-capability translation end to end up to the pipeline: heaps, four committed textures (including the translated R9G9B9E5 one), views, the captured RTS0 root signature.
XCL_FFX_BLOB_DIR=<dir> makes DeserializePipelineStateX write every call's blob out in full: the header qwords, the sub-table object at qword[0], and every (ptr, size) section. The header is qword[0] = a runtime session object, then (ptr, size) pairs: a 0x1c-byte pipeline header, a 0x14-byte hash, the raw RDNA2 code (verified: s_code_end padding and s_endpgm, byte-identical to the console DLL's embedded FXCP pipeline blocks), and a metadata section. Replaces the one-shot hex logging from 8b12698. Findings recorded with it (see reports/verification-iter4.md): the official FSR4 upscaler deserialises block xcl-dev#200 of a 927-block FXCP bank embedded in the DLL; the code section is genuine RDNA2 whose prologue matches the retail FSR4 dispatch-pass ABI the XCL author measured (s4/s5 descriptor tables, root CBVs, s14/s15 = TGID x/y).
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.
The device creation takes the first high-performance adapter or WARP; nothing selects another GPU. XCL_ADAPTER=<substring> matches an adapter by name (case-insensitive substring of the DXGI description) before the normal selection, logging the match; no match falls through unchanged. Needed for the Track-4 matrix: the FSR4 deserializer march found the RTX 4060 Ti rejecting a 602 KB DXIL that the Radeon iGPU accepts (DXC output size is optimization-independent), while the iGPU rejects the descriptor-heap-indexed DXIL the RTX takes - each vendor blocks a different half of the pass set, so the same workload has to run on both. The bisect test (deserialized_fs_dxil_driver_acceptance, XCL_FFX_BISECT_ADAPTER) uses this to compare adapters directly.
DeserializePipelineStateX (device xcl-dev#57/xcl-dev#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 frontier-lock now pins the iteration-4 frontier in the child's output: the FSR4 pass set deserialises and translates, the first passes become real PC pipelines (counted), and a later pass's oversized DXIL is rejected by the driver - while still recognising the iteration-3 signature (the deserializer declining the blob) as a regression. The strict success path (execute, readback, verification, PPM dump) engages automatically when the march gets through. Every console Dispatch record's grid (the 0x4002_C400 records) is printed, for validating the pass geometry: grid * threads must cover the pass's work exactly (XCL_FFX_THREADS overrides the default). deserialized_fs_dxil_driver_acceptance (XCL_FFX_BISECT_DXIL=<file>, optional XCL_FFX_BISECT_ADAPTER=n, XCL_FFX_BISECT_DEBUG=1) creates a compute PSO from a DXIL file directly on a chosen adapter under XCL's ABI root signature. Measured with it on this machine: 320 KB accepted / 602 KB rejected on the RTX 4060 Ti, the same 602 KB accepted on the Radeon iGPU (21 s), and the iGPU rejecting the descriptor-heap-indexed DXILs the RTX takes - the vendor matrix of the FSR4 march.
NVIDIA's D3D12 wave range is 32..32 (measured WaveLaneCountMin/Max on the RTX 4060 Ti): [WaveSize(64)] compute shaders are rejected at PSO creation with E_INVALIDARG, silently, root signature or not (isolated with the harness's bisect test - WARP rejects them too, the Radeon iGPU's range is 64..64). The deserialised FSR4 pass set hits its first wave64 program at pass 14, which is what iteration 4 mistook for a "602 KB DXIL size wall": a 951 KB DXIL is accepted once the wave size is legal. A wave64 console program on such an adapter now translates to [WaveSize(32)] with the same [numthreads]: the console wave's two halves run as co-resident native waves and rendezvous per cross-lane operation through groupshared memory - ballot/rla become exchanges (ballot: the sibling's word via an atomic epoch publish and spin; rla: a 64-slot value exchange the same way). No barrier intrinsics: DXC lowers them to dx.op.barrier, which is only legal in group-uniform control flow, while the rendezvous runs after the per-lane publish branches - the seq_cst atomic publish orders the word store against the spin's read (verified by the GPU hanging without this change, and by the spin-verified run with it). Options.hw_wave = 32 (0 = native waves of either width), set once from the device's WaveLaneCountMax at device creation (pso::set_hw_wave). Passes 0-13 of the FSR4 set are wave32 programs and are unaffected. Test: wave64_compute_rendezvous_on_32_lane_waves - a synthetic console CS (assembled RDNA2, wrapped in an FSSM container through the same pipeline as retail shaders) whose readfirstlane crosses the halves (readers in the high half read lane 8's value) and whose exec words need the other half's ballot; runs on the RTX 4060 Ti and asserts the exact console semantics (mem[v0] = 8 exactly for v0 in 8..=40).
A wave64 program that also uses the emulated console LDS (the FSR4 pass at 4776 B of RDNA2) declares 32 KB of xcl_lds plus the exchange arrays - 33888 B of groupshared in total - and DXC rejects it: the D3D12 limit (32 KB) is absolute. The exchange now carries inside the LDS block's tail dwords when the program uses LDS: the per-native-wave counters and the lane-value slots live at the base 8192 - 3*NW - threads, the region the program's own accesses only reach when they wrap the emitter's `& 8191` mask (already unsupported), keeping the total at exactly 32 KB. Without LDS the exchange keeps its own arrays as before. Verified with the LDS variant of the synthetic rendezvous test (XCL_TEST_W64_RENDEZVOUS=lds): a program doing a ds_write/ds_read round-trip plus the cross-half readfirstlane and the ballot exchange runs on the RTX 4060 Ti and stores the exact console semantics (mem[v0] = v0 for the active lanes 8..=40).
The driver-acceptance bisect gained the controls that separated the pass-14 rejection from size: - a DBWIN listener (the OutputDebugString protocol) with a self-test line - the debug layer's rejection reasons are only visible to a debugger otherwise; the listener proved the NVIDIA rejection is silent; - the adapter's WaveLaneCountMin/Max printed per run - the measurement that identified the real root cause: the RTX 4060 Ti's range is 32..32 ([WaveSize(64)] is rejected outright, WARP's too; the Radeon iGPU's is 64..64 - inverting which translated shaders each adapter accepts); - XCL_FFX_BISECT_NO_RS=1 creates the PSO without any root signature, isolating shader-content rejection from root-signature interaction (the empty-shader control: an empty cs_6_6 with [WaveSize(64)] is rejected, without one it is accepted); - XCL_FFX_BISECT_EMPTY=1 runs the empty-shader control.
The real FSR4 wave64 pass (26 KB of RDNA2, dispatch 14 of the console frame, 507 thread groups) deadlocks the GPU: 0x887A0006 after the TDR timeout, while the synthetic rendezvous test passes. The exact desynchronisation was not reproduced in isolation; the heavy pass has 25 ballot and 9 cross-lane sites interleaved with 600 KB of shader. Every rendezvous spin is now bounded (2^28 atomic reads, well under the TDR budget). A timed-out pair still advances both halves' per- thread epoch counters once per call site, so the *next* rendezvous matches up again on its own: a console wave may compute one ballot from a stale word, but the shader always terminates - a watchdog reset takes the whole device and every later frame with it, a self-healed ballot costs at most one operation's worth of data. The dispatch-bisection tooling that isolated the hang is part of the console list replay (XCL_EXEC_FIRST_DISPATCHES=n: replay only the first n dispatches; each replayed dispatch logs its grid and pipeline wrapper address, which the deserializer's creation log also prints). Measured with it: dispatch 13 (24 groups) keeps the device alive, dispatch 14 (507 groups, the 26 KB wave64 pass) hangs it - the fault is in that pass's execution, not in the frame's setup, and the earlier full-frame run showed the same signature.
…cking The dispatch-bisection isolated the mid-frame device fault to dispatch 14 - the 26 KB wave64 pass, which image-stores the FSR4 neural-input texture. The console's t# descriptors are read-write, so the console DLL never creates a UAV view of that texture; the recompiler's image stores index the PC UAV slot at +1, and with the iteration-3 flag-drop translation that slot could never be created (the PC driver rejects both the ALLOW_UNORDERED_ACCESS flag and UAV views of DXGI 67) - the store went through an uninitialized descriptor and faulted the device. (Verified not-a-cause along the way: no console UAV view of any non-UAV resource is ever requested, and bounded rendezvous spins did not save the frame - the fault is immediate.) Translate the format instead of dropping the flags: - CreateCommittedResource (console) and CreatePlacedResourceX: DXGI 67 with GPU-write flags becomes R32_TYPELESS, keeping the flags and the console's UAV initial state. - The console's R9G9B9E5 views of such a texture become R32_UINT on the PC (a format-67 view of a typeless resource is invalid), while the console t# keeps format 132 so the recompiler takes over; and the SRV creation also creates the PC UAV at the slot's +1 (console code never asks for it, but the recompiler's stores index it). - The recompiler's format-132 image path: loads read the raw dword and decode 9-9-9-E5; stores pack the shader's float RGB. The pack and decode are each other's inverse with the format's own 9-bit quantisation - both the writer and the reader pass are translated by the same code, so the FSR4 pipeline stays self-consistent (the console HW does this packing natively).
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").
The 2^28-iteration rendezvous bound could not prevent the hang it was built for: one desynchronised site burns ~3 s of serialized groupshared atomics at 2^28 (NVIDIA atomics run at single-digit cycles each), so the ~2 s watchdog reset the device before the bound ever completed - dispatch 14 still ended in 0x887A0006 after the TDR (17.2 s vs 4.7 s for n=13, the reset-and-recovery overhead). 2^20 costs a few milliseconds per site (a healthy rendezvous of two waves of one CTA on one SM resolves in microseconds), so even a fully desynchronised pair finishes every one of the pass's 34 sites well under the watchdog. The self-healing semantics are unchanged: a timed-out pair advances both halves' per-thread epoch counters once per call site, so the next rendezvous matches up again - the pass produces degraded output instead of resetting the device.
|
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
No device removal or TDR. The rendezvous test fails on current Suggested fix: anchor on the signature only, and fail loudly if either hook doesn't apply: - b.replace("uint rla(uint v, uint l) {\n if (xcl_logical_wave64)", "uint rla(uint v, uint l) {\n if (xcl_xw64) return rla_x64(v, l);\n if (xcl_logical_wave64)")
+ let b = b.replace("uint rla(uint v, uint l) {\n", "uint rla(uint v, uint l) {\n if (xcl_xw64) return rla_x64(v, l);\n");
+ assert!(b.contains("if (xcl_xw64) return ballot_x64(b);") && b.contains("if (xcl_xw64) return rla_x64(v, l);"), "the wave64 rendezvous hooks no longer match PRELUDE");
+ bWith it, the test passes on the RTX 3080 in all three variants (default, Two smaller things in that test:
|
|
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 8e592ff as it is, because it conflicts with current
|
…ng wave32 halves NVIDIA's D3D12 wave range is 32..32, so a [WaveSize(64)] compute shader is rejected at PSO creation: wave64 compute programs were refused there (their dispatches skipped every frame), and mesh / ES+GS programs ran as two independent halves only when they had no cross-half operation. Now, when the device cannot run 64-lane waves (the same detection as before, `pso::wave32_only_for_device`), each console wave of a wave64 kernel, compute, mesh or ES+GS program runs as two hardware wave32s of the same thread group that exchange through groupshared memory wherever a value has to be the whole wave's: every mask (ballot), v_readlane / v_readfirstlane, ds_bpermute and GLC scalar loads. Both halves then hold the full 64-bit EXEC / VCC and identical SGPRs and take every branch the same way; DPP, ds_swizzle and v_permlane(x)16 stay inside a half and need nothing. One console wave per group meets at group barriers; several (mesh, compute > 64 threads) meet pairwise through double-buffered slots and arrival counters, bounded so that a desynchronised pair degrades instead of hanging the GPU. Hardware threads take console thread ids in the order their waves arrive: NVIDIA does not form waves from consecutive thread indices for 3-D groups (8 x 8 x 4). GPUs with 64-lane waves get byte-identical HLSL for every native translation the test suite makes. Design, hazards and measured cost: docs/wave64-on-wave32.md. The idea of a groupshared rendezvous kept in the LDS tail, and the finding that NVIDIA rejects [WaveSize(64)], come from PR #33 (ElHombreAlex); the protocol here is new (double-buffered slots, counted arrivals, barriers where they are legal). Tests: the instruction tests run on 32-lane GPUs too (`runner::options`), and the kernel runner fails when the two halves end with different SGPRs; new tests for cross-half masks, lane reads and scalar loads, for four diverging console waves per group in 1-D and 3-D groups, mesh form checks, and an ignored benchmark (`bench_split_wave64`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…runs on the GPU AMD's console upscaler (amd_fidelityfx_upscaler_xbox.dll) creates its 29 pipelines with CreateComputePipelineState on blobs that carry no DXIL: an ACCC part holding FSPX, the console driver's own container (numthreads, COMPUTE_PGM_RSRC1/2, the RDNA2 code). pso::fspx reads it and the program goes through the recompiler as a compute shader – all 29 translate and compile. The packed 8-bit dot products (v_dot4(c)_i32_i8, v_dot4_u32_u8) are SM 6.4's dot4add_i8packed / dot4add_u8packed instead of shifts and multiplies: FSR4's network passes are thousands of them, and the biggest went 1.55 -> 1.23 MB of DXIL and 604 -> 74 s in DXC; the AMD driver had refused it with E_OUTOFMEMORY. The FSR probe (XCL_CONSOLE_LISTS=1 XCL_PROBE_FSR=1 XCL_PROBE_FSR_DISPATCH=1, new XCL_PROBE_FSR_EXECUTE=1) uploads inputs (a grey gradient, depth 0.5, no motion), records a 1280x720 -> 1920x1080 frame (20 dispatches, all records recognised), runs it on the GPU and reads the output back: finite, and the gradient survives (RX 9070, ~11 ms). New ignored test fspx_containers_translate_and_compile (XCL_SAMPLE_FSPX). Based on PR #33's research, rebuilt on current main (the FSPX path carries the real thread geometry; #33 guessed it).
|
Thank you for this research – it is what got FSR4 going. Since
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 ( |
|
Thanks for the update and for building upon the research! I ran the requested NVIDIA validation against upstream 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 The upstream worktree was left unmodified throughout testing. 1. FSR4 probe — context initializationWith
D3D12 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:
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 creationWith 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:
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 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 resultsThe unmodified upstream The passing tests include:
This confirms that the upstream split-Wave64 implementation passes its applicable regression tests on real NVIDIA hardware. ConclusionConfirmed 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! |
PR xcl-dev#33 is closed (not merged); the reference in the Relation to earlier work section still said draft. Assisted-by: DeepAI Code (GLM 5.3 Flash)
Overview
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.