mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[GH-ISSUE #476] Verified FidelityFX CAS PC replacements: 8 fp32 variants, bit-exact golden model (ffx-kit) #7
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#7
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?
Originally created by @Cobrall on GitHub (Nov 24, 2026).
Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/476
Title: Verified FidelityFX CAS PC replacements: 8 fp32 variants, bit-exact golden model (ffx-kit)
Hi! We built a small verification kit that may help with the FidelityFX side of the shader pipeline.
What it does:
APrxLoRcpF1 / APrxMedRcpF1 / APrxLoSqrtF1 bit tricks, the green-channel weight path,
and D3D saturate(NaN)=0 semantics.
Results (2026-11-24, RTX 4070 Ti, Vulkan, DXC 1.9.2609.5):
Why this may matter: a naive "mathematically correct" reference disagrees with AMD's
fast-math paths by up to ~8.5% of signal, so checking translated FidelityFX output against
exact math produces false failures. This kit reproduces the intended approximations.
Scope / honesty:
Repo: https://github.com/Cobrall/ffx-kit
Happy to adapt the harness to Leonida's pipeline or open PRs if useful.
@Cobrall commented on GitHub (Nov 24, 2026):
Hi team,
Following up on the shader pipeline: I've built and open-sourced a GPU-verified FidelityFX CAS harness: github.com/Cobrall/ffx-kit
What it does:
ffx_cas.hvia DXC to SPIR-V.APrxLoRcpF1,APrxMedRcpF1,APrxLoSqrtF1bit tricks, green-channel weighting, D3Dsaturaterules).Results:
4.77e-07(a few ULPs).manifest.jsonincludes SHA-256 hashes for every compiled.spv.Why this matters:
A naive "mathematically exact" CPU reference will disagree with AMD's intended output by up to ~8.5% of the signal due to these fast-math paths. This kit provides the correct reference to validate against, preventing false failures when porting.
Note on fp16: The repo includes the
CasFilterH(fp16 packed) HLSL and Python golden model. Automated fp16 GPU verification is noted as limited in the README due towgpuSPIR-VRelaxedPrecisionquirks on Windows, but the HLSL is ready for direct integration into a native C++/Vulkan runtime like Leonida's.Happy to help adapt this harness to Leonida's CI or answer any questions about the bit-exact golden model!