Skip to content

Recompiler: route FSPX compute containers through direct DXIL - #3750

Open
Decodere wants to merge 1 commit into
xcl-dev:mainfrom
Decodere:perf-dxil-direct-fspx-compute
Open

Decodere wants to merge 1 commit into
xcl-dev:mainfrom
Decodere:perf-dxil-direct-fspx-compute

Conversation

@Decodere

@Decodere Decodere commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Driver (FSPX) compute containers – the console driver's own container (an ACCC part holding FSPX) that the FidelityFX upscaler builds its passes from – only went through the HLSL path: pso::direct_compute refused them. They now go through the direct DXIL translator like FSSM compute shaders, with the same interface the HLSL path already derives for them (CsInterface::from_rsrc2(threads, rsrc2), wave64 from the code, no constant data in the code region). When the direct translator refuses a program, the HLSL path stays the fallback, as for every other compute shader. TRANSLATOR_VERSION goes 12 → 13 because these programs' containers change; their cached DXIL is rebuilt once.

What is in it

  • crates/xcl/src/gpu/recomp/pso.rs: direct_compute accepts an FSPX blob (fspx(blob)), the shared body moves to direct_compute_program. New test fspx_compute_routes_through_direct_compute: synthetic wave32 and split-wave64 FSPX containers translate through direct_compute and validate; with DXC present the wave32 one disassembles with the direct DXIL producer and numthreads(32, 1, 1).
  • crates/xcl/src/gpu/dxil/kernel.rs: TRANSLATOR_VERSION 13.

Tested

  • NVIDIA GeForce RTX 4060 8 GB (driver 621.40, wave32), Intel Core i5-11400F, 32 GB, Windows 11 build 26200, release build
  • cargo test -p xcl --lib gpu::recomp::pso (including fspx_compute_routes_through_direct_compute): 43 passed, 0 failed, 1 ignored (baseline main 078358a0 full workspace: 3006 passed, 0 failed, 52 ignored, 28 SKIPPED)
  • title 29640639, 60 s smoke via scripts/smoke.ps1 (clean worktree at 2936f61e90786790b716326c90cc0fb9c80fa9c7 vs main 078358a058f7ba5d16690dba8dc4e55d2c88ae0a)

Regression run

main (078358a0):

xcl-smoke v1
commit: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1635 (PresentX 1635)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 16151 MB

PR (2936f61e):

xcl-smoke v1
commit: 2936f61e90786790b716326c90cc0fb9c80fa9c7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1617 (PresentX 1617)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15924 MB

Not tested

  • AMD (wave64) GPUs: the split-wave64 FSPX case is covered only by the synthetic test.
  • FSPX programs of other titles or other upscaler versions.

AI use

  • Antigravity (Gemini 4 Neon) wrote the code and tests; the description was drafted and the diff reviewed in Antigravity (Claude Opus 5.5 and Gemini 4 Neon). All tests and xcl-smoke v1 runs were executed directly on local hardware.

Route FSPX/ACCC compute containers directly through direct_compute when the direct DXIL backend is active instead of falling through to the HLSL translator.

When direct DXIL translation returns an error for an FSPX container, fall back automatically to the existing HLSL compilation path so unsupported opcodes or layouts keep working.

AI-assisted: Antigravity (Gemini 4 Neon)
@Foniass

Foniass commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Review of 2936f61e (code reading only, not a merge-check) · 1 medium, 2 nits

In short: The PR sends FSPX (driver) compute containers, the ones FSR4 builds its passes from, through the direct DXIL translator. It uses the interface the HLSL path derives for them, and the HLSL path stays the fallback. The code matches the HLSL path's handling, and the new test fails without the change. Nothing blocks it, but nothing shows a real FSR4 pipeline going through the new default route.

Medium

  1. No real FSPX program shown on the new default route.

    • Direct DXIL is the default (gpu::dxil::kernel::enabled()), so with this PR all 29 FSR4 pipelines move from the HLSL path to the direct translator by default, and README lists that upscaling as working.
    • The only evidence is the synthetic test in pso.rs (~3255) and a smoke run of title 29640639. Nothing shows that title creates an FSPX pipeline, and HANDOFF.md (~943, ~1295) notes the titles run so far do not ship FSR4.

    Fix: run fspx_containers_translate_and_compile (XCL_SAMPLE_FSPX, recomp/tests.rs ~12395) on dumped FSR4 pipelines, or the fsr4_console_upscaler_creates_a_context_probe, and report how many translate directly and how many fall back. If neither can be run, say under Not tested that the smoke title does not reach this code.

Nit

  1. The description understates the cache cost. "Their cached DXIL is rebuilt once" covers only part of it. TRANSLATOR_VERSION feeds identity_from_source (pso.rs ~371) for every stage under the default routing, so the bump makes the whole translated cache miss once.
  2. XCL_DIRECT_DXIL=0 behaviour also changes. The huge-program route (huge_direct_min, pso.rs ~809) and the enormous route (~838) call direct_compute too. Large FSPX passes, such as FSR4's 1.2 MB one, now take direct DXIL even with XCL_DIRECT_DXIL=0. That matches FSSM programs, but the description should say so.
Checked and fine
  • The FSPX branch in direct_compute builds the same interface as console_translation_with: CsInterface::from_rsrc2(f.threads, f.rsrc2), detect_wave64(f.code), no rodata.
  • The direct_compute_program extraction is unchanged for FSSM apart from passing references.
  • An Err from direct_compute still reaches direct_fallback and the HLSL path. Cached-only probes still defer through defer_direct_compute.
  • Old HLSL-fallback FSPX entries are not reused after the bump. The HLSL-only identity is unchanged.
  • xcl shaders measure already accepted FSPX, and now measures the direct container instead of failing.
  • The synthetic FSPX layout matches what fspx() parses, and the test fails without the change ("not a console shader container").
  • 74+/5- in 2 files, both smoke blocks present. Recompiler: direct compute LDS is the block the program declares #3478 touches direct LDS sizing, not this.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

@github-actions github-actions Bot added area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants