Skip to content

Report FSPX translation coverage against the unpacked inventory - #5688

Open
kacper-serewis wants to merge 2 commits into
ItsNotRexed:mainfrom
kacper-serewis:feat/fspx-coverage-report
Open

kacper-serewis wants to merge 2 commits into
ItsNotRexed:mainfrom
kacper-serewis:feat/fspx-coverage-report

Conversation

@kacper-serewis

Copy link
Copy Markdown
Contributor

Claimed in the second implementation item on #5581. Independent of #5563 and #2323. No open PR dependencies.

Adds a count-only report for matching FSPX unpack and translation outputs. The FSPX build records named Unsupported outcomes locally. The report checks listings, the published index and modules, and reports missing or conflicting evidence separately. Older output directories remain usable.

Tested on Windows, Python 3.13.15, CPU only. GPU and driver were unused. On all 29 privately cached programs, base 561b65a and this branch both translated 18 and passed spirv-val for all 18. The new refusal record accounts for the remaining 11. The same report against the base output counts those 11 as unaccounted. No raw package was required.

Passed the standalone fspx_coverage, fspx_shaders_stage, rdna2spirv_cli and text_write_line_endings test files (50 tests), plus compileall. Synthetic cases cover missing listings, explicit refusals, incomplete and conflicting outputs, and stale refusal records.

AI-assisted implementation and testing.

@Kev-Ball

Copy link
Copy Markdown

Checked the coverage report on four fresh extractions/translations of the FidelityFX DLL from Xbox 1.0.2.1, at 606d99b0 on CachyOS. The disassembler version changes the retail count:

llvm-mc Wave64 mode Eligible Translated and spirv-val valid Explicit refusals Unaccounted
21.1.8 native and emulated, each 29 18 11 0
23.1.5 native and emulated, each 29 21 8 0

For each run I checked the CLI totals against the actual module index and refusal set and ran external spirv-val --target-env vulkan1.3 on every published module. In both wave64 modes, LLVM 23 retained all 18 programs that translated with LLVM 21 and added the same three to the count. Of the 18 shared programs, 17 binaries were byte-identical between toolchains in each mode. These counts distinguish a change in translation coverage from missing report evidence. CPU only. AI-assisted.

@lunarminus

Copy link
Copy Markdown

Tested 606d99b0 merged onto main d0835dd9 on an AMD Radeon 760M (RDNA3 iGPU, gfx1103, subgroup 32..64), RADV Mesa 26.3.1, CachyOS Linux: pass

  • Tree tested: the branch already contains d0835dd9 (its parent is 561b65a8), so the merge was a fast-forward and the tree is exactly 606d99b0. I built runtime/ in that tree (RelWithDebInfo, --parallel 2) with no errors.
  • The test files named in the description (python -I):
    • test_fspx_coverage: 1 OK
    • test_fspx_shaders_stage: 14 OK
    • test_rdna2spirv_cli: 32 OK, 1 skipped (a Windows-only drive-root case)
    • test_text_write_line_endings: 3 OK
    • That is 50 tests, as in the description. compileall is clean.
  • FSPX semantic tests: python -m unittest discover -s tests/semantic -p 'test_fspx*' ran 16 tests, all OK.
  • CLI check: rdna2spirv.py --record-refusals together with --shard 0/2 or with --merge exits 2 with "--record-refusals requires an unsharded run".
  • scripts/run_gpu_tests.py, native wave64 and LEONIDA_W64_EMULATE=1: 216/232 passed, 16 skipped, 0 failed in each mode.
  • Per test against main without the PR:
    • Against 561b65a8, run on this machine: no differences in either mode.
    • Against d0835dd9: 22 differences in each mode. All 22 are tests that d0835dd9 does not have: 20 pass and 2 skip (ps_live_width, ps_m2_literal). The list is identical to 561b65a8 against d0835dd9, so the 22 come from main, not this PR.
  • The PR adds no GPU fixtures and names no AMD-specific command. I did not re-measure the retail FSPX coverage counts here, because that needs the game's programs.

AI-assisted (Claude Code).

@larpinguser larpinguser left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds tools/fspx_coverage.py, which counts per-program FSPX outcomes (eligible, translated, refused, unaccounted with reasons) from unpacked and translated directories without reading shader contents. rdna2spirv.py gains --record-refusals (unsharded only) writing refusals.json; make_game.py passes the flag and clears the file on rebuild. Documents the workflow in docs/fspx.md and adds coverage, stage, and CLI tests.

Why merge

Turns FSPX translation status into an auditable report and prevents stale refusals from surviving a rebuild.

Verdict: Approve

@larpinguser

Copy link
Copy Markdown

Summary

Adds tools/fspx_coverage.py, which counts per-program FSPX outcomes (eligible, translated, refused, unaccounted with reasons) from unpacked and translated directories without reading shader contents. rdna2spirv.py gains --record-refusals (unsharded only) writing refusals.json; make_game.py passes the flag and clears the file on rebuild. Documents the workflow in docs/fspx.md and adds coverage, stage, and CLI tests.

Why merge

Turns FSPX translation status into an auditable report and prevents stale refusals from surviving a rebuild.

Verdict: Approve

Windows CPU: 29 cached listings, 18 pass spirv-val, 11 explicit refusals. Older output has 11 missing results. All 50 focused tests passed. The repository newline scan flags the unchanged upstream f64_omod_probe.py:268. AI-assisted.
kacper-serewis added a commit to kacper-serewis/Leonida that referenced this pull request Nov 23, 2026
Depends on: ItsNotRexed#5688 at 31ba693. Windows CPU: both focused tests and compileall passed. Re-ran both ItsNotRexed#2323 input paths at 6dcbcbd with local refusal recording on all 29 cached programs. spirv-val confirmed 18 retained and 11 newly validated identities, with no missing identities or regressions. The legacy run had 11 missing results, all explicit refusals in the updated listing run. No raw package or GPU. AI-assisted.
@morodirule

Copy link
Copy Markdown

Tested 31ba693 on Arch Linux, Python 3.14.10, CPU only: pass.

  • python3 -I tests/test_fspx_coverage.py — 1 test OK (this head has coverage only; the renamed/shuffled compare test arrives with Compare validated FSPX translation runs by code identity #6062)
  • python3 -I tests/test_fspx_shaders_stage.py — 14 tests OK
  • python3 -I tests/test_rdna2spirv_cli.py — 35 tests OK, 1 skipped
  • compileall on fspx_coverage.py/rdna2spirv.py/make_game.py OK; git diff --check clean
  • Negative control: tools/fspx_coverage.py is new in this stack (absent on origin/main), so there is nothing to run against on main.

No game files, no GPU. AI-assisted.

@thiefyzheng

Copy link
Copy Markdown

checked: #5688 @ 31ba693 — CPU only, no GPU: python3 -I tests/test_fspx_coverage.py → exit 0, "Ran 1 test in 0.002s / OK" (test_partial_and_legacy_outputs asserts the full counter dict); tests/test_fspx_shaders_stage.py "Ran 14 tests in 0.352s / OK"; tests/test_rdna2spirv_cli.py "Ran 35 tests in 8.275s / OK (skipped=1)". AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants