tests: cover ffx_recurrent generation and identity validation #3742

Manually merged
github merged 1 commit from github-bot/gh-3740 into main 2026-12-01 17:11:26 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 13:36 UTC · original
Ammmae0x:tests/ffx-recurrent-py → main · +886 −0 · 5 files · 1 commits · merged 2026-12-01 17:06 UTC

Refs #1149

Adds synthetic AMD64 PE32+ unit, boundary, error/refusal and 1:1 mutation tests for tools/ffx_recurrent.py (previously 0 Python unit tests), with zero edits to existing files (5 new files only, +886/-0).

tests/ffx_recurrent_py_check.py builds a minimal synthetic PE32+ image in memory (NOP-filled .text, the recurrent name and UUID in .rdata, the format/state/view jump tables; zero external binaries or DLLs) and covers generate_recurrent() end to end: deterministic C++ output structure, exact FSR4UPSCALER_Recurrent name at 0x4d928 and UUID 696442be-a72e-4059-bc79-5b5c98040fad at 0x48310, enum-switch jump table resolution (format_code = 10, state_code = 2, selector and state RVA lookups, relocated and indexed variants), all 16 bound call sites, all 3 builder and 20 backend exit blocks, and refusals pinned by exact exception type and message (wrong/empty name, zero/byte-swapped UUID, empty/non-PE/truncated images, out-of-range RVAs, mid-instruction and RET-less ranges, wrong view targets, unbound CALL KeyError and JMP). ffx_recurrent.py has no CLI of its own, so no CLI cases apply.

Linux verification (all on this host):

  • /tmp/pe-env/bin/python -B tests/ffx_recurrent_py_check.py: 130 cases, 5/5 mutations killed PASS
  • /tmp/pe-env/bin/python -B tests/ffx_recurrent_py_meta_check.py: PASS: 9 cases, 5/5 mutations killed (subprocess --mutate)
  • form_coverage_check.py: passed; docs_links_check.py: 208 files, 802 links; bidi_controls_check.py: 2826 files, no controls
  • run_checks_parallel.py (meta check): 1/1 passed; scratch CMake + CTest: 6/6 (ffx_recurrent_py + 5 WILL_FAIL TRUE _mut controls)
  • git diff --check clean; git status shows only the 5 new files; zero personal paths
  • No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.

AI-assisted.

Windows Verification (e517c1ce)

  • git merge-tree --write-tree upstream/main HEAD -> ad5f2010 (exit 0), git diff --check clean
  • Python checks: py_compile, ffx_recurrent_py_check.py, ffx_recurrent_py_meta_check.py, form_coverage_check.py, docs_links_check.py (209 files, 804 links), bidi_controls_check.py (2829 files) passed
  • Commands:
python -B tests/ffx_recurrent_py_meta_check.py
ctest --preset dev --no-tests=error -R "^ffx_recurrent_py" --output-on-failure
ctest --preset release --no-tests=error -R "^ffx_recurrent_py" --output-on-failure
  • Results: ffx_recurrent_py: 130 cases, 5/5 mutations killed PASS (9 meta cases, 5/5 --mutate killed); dev 6/6 passed (2.79s); release 6/6 passed (2.78s). AI-assisted.
**@⁠Ammmae0x** on GitHub · 2026-12-01 13:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3740) `Ammmae0x:tests/ffx-recurrent-py` → `main` · +886 −0 · 5 files · 1 commits · merged 2026-12-01 17:06 UTC Refs #1149 Adds synthetic AMD64 PE32+ unit, boundary, error/refusal and 1:1 mutation tests for tools/ffx_recurrent.py (previously 0 Python unit tests), with zero edits to existing files (5 new files only, +886/-0). tests/ffx_recurrent_py_check.py builds a minimal synthetic PE32+ image in memory (NOP-filled .text, the recurrent name and UUID in .rdata, the format/state/view jump tables; zero external binaries or DLLs) and covers generate_recurrent() end to end: deterministic C++ output structure, exact FSR4UPSCALER_Recurrent name at 0x4d928 and UUID 696442be-a72e-4059-bc79-5b5c98040fad at 0x48310, enum-switch jump table resolution (format_code = 10, state_code = 2, selector and state RVA lookups, relocated and indexed variants), all 16 bound call sites, all 3 builder and 20 backend exit blocks, and refusals pinned by exact exception type and message (wrong/empty name, zero/byte-swapped UUID, empty/non-PE/truncated images, out-of-range RVAs, mid-instruction and RET-less ranges, wrong view targets, unbound CALL KeyError and JMP). ffx_recurrent.py has no CLI of its own, so no CLI cases apply. Linux verification (all on this host): - /tmp/pe-env/bin/python -B tests/ffx_recurrent_py_check.py: 130 cases, 5/5 mutations killed PASS - /tmp/pe-env/bin/python -B tests/ffx_recurrent_py_meta_check.py: PASS: 9 cases, 5/5 mutations killed (subprocess --mutate) - form_coverage_check.py: passed; docs_links_check.py: 208 files, 802 links; bidi_controls_check.py: 2826 files, no controls - run_checks_parallel.py (meta check): 1/1 passed; scratch CMake + CTest: 6/6 (ffx_recurrent_py + 5 WILL_FAIL TRUE _mut controls) - git diff --check clean; git status shows only the 5 new files; zero personal paths - No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter. AI-assisted. <!-- WIN-VERIFY: passed | sha=e517c1ce2b565739aeaba2277e2f65fe762eb4eb | targets=none | ctest=^ffx_recurrent_py | release=true --> ### Windows Verification (`e517c1ce`) - `git merge-tree --write-tree upstream/main HEAD` -> `ad5f2010` (exit 0), `git diff --check` clean - Python checks: `py_compile`, `ffx_recurrent_py_check.py`, `ffx_recurrent_py_meta_check.py`, `form_coverage_check.py`, `docs_links_check.py` (209 files, 804 links), `bidi_controls_check.py` (2829 files) passed - Commands: ```text python -B tests/ffx_recurrent_py_meta_check.py ctest --preset dev --no-tests=error -R "^ffx_recurrent_py" --output-on-failure ctest --preset release --no-tests=error -R "^ffx_recurrent_py" --output-on-failure ``` - Results: `ffx_recurrent_py`: `130 cases, 5/5 mutations killed PASS` (`9` meta cases, `5/5` `--mutate` killed); `dev` 6/6 passed (2.79s); `release` 6/6 passed (2.78s). AI-assisted.
Refs #1149

Add synthetic AMD64 PE32+ unit, boundary, error/refusal and 1:1
mutation tests for tools/ffx_recurrent.py (previously 0 Python unit
tests), with zero edits to existing files (5 new files only).
AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:37:35 +00:00
github manually merged commit c417532743 into main 2026-12-01 17:11:26 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.