tooling: report an unrecognized loader hash in dependency_paths #212

Manually merged
github merged 1 commit from gh-pr/212/head into gh-pr/212/base 2026-11-26 21:34:42 +00:00
Owner

@⁠raulmoracode on GitHub · 2026-11-21 18:26 UTC · original
raulmoracode:tooling/unverified-loader-hash → main · +69 −1 · 6 files · 1 commits · merged 2026-11-21 18:42 UTC

Change

tools/dependency_paths.py applied the conditional FidelityFX routes only when the loader image matched the pinned hash, and said nothing otherwise. A different loader build produced no conditional edges and exit code 0, which is indistinguishable from a loader that has no conditional routes.

A reachable image whose basename is amd_fidelityfx_loader_xbox.dll and whose SHA-256 differs now adds a finding:

{"problem": "unverified_loader_hash", "dll": "amd_fidelityfx_loader_xbox.dll",
 "sha256": "<observed>", "expected": "<pinned>"}

The conditional edges remain absent, so the graph is not widened; the report now states that it is incomplete for that image.

tests/dependency_paths_check.py runs both cases from a synthetic inventory and is registered as dependency_paths_controls and in the Linux Python job.

Fixes #211

Verification

Commit 55d4af7, Python 3.12.10.

python -B tests/dependency_paths_check.py

Result:

dependency_paths: the pinned hash reaches the conditional target; a different hash reports unverified_loader_hash and no conditional edge

Negative control: replacing the new branch with elif False: makes the same test fail with

AssertionError: expected one unverified loader finding: []

Evidence and follow-up

The inventory is built in memory: two images (pkg/amd_fidelityfx_loader_xbox.dll and pkg/amd_fidelityfx_upscaler_xbox.dll) and no imports. The pinned case uses FFX_LOADER from the module; the changed case uses 64 1 characters. The upscaler lists every name in FFX_EXPORTS, so the pinned case exercises the full conditional route rather than a partial one.

dependency_paths_controls is registered in the Python gate in CMakeLists.txt and added to the Linux job's command list. It needs no Windows-specific module.

The existing conditional_import_paths control (tests/intake/paths_check.py) asserted that an unknown loader hash produced no findings. That assertion encoded the silent-success behaviour this change removes. It now asserts the unverified_loader_hash finding with both hashes and that the conditional route stays absent.

All eight pure-Python checks from the Linux job pass locally: script_state_check, bcpack_check, resource_ranges_check, dxcontainer_part_offsets_check, layout_chunks_check, intake/paths_check, dependency_paths_check and shader_probe_check.

Not covered: a loader image that is reachable only through a forwarder, and a second loader build that has a different basename. Both are outside this change.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

**@⁠raulmoracode** on GitHub · 2026-11-21 18:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/212) `raulmoracode:tooling/unverified-loader-hash` → `main` · +69 −1 · 6 files · 1 commits · merged 2026-11-21 18:42 UTC ## Change `tools/dependency_paths.py` applied the conditional FidelityFX routes only when the loader image matched the pinned hash, and said nothing otherwise. A different loader build produced no conditional edges and exit code 0, which is indistinguishable from a loader that has no conditional routes. A reachable image whose basename is `amd_fidelityfx_loader_xbox.dll` and whose SHA-256 differs now adds a finding: ```json {"problem": "unverified_loader_hash", "dll": "amd_fidelityfx_loader_xbox.dll", "sha256": "<observed>", "expected": "<pinned>"} ``` The conditional edges remain absent, so the graph is not widened; the report now states that it is incomplete for that image. `tests/dependency_paths_check.py` runs both cases from a synthetic inventory and is registered as `dependency_paths_controls` and in the Linux Python job. Fixes #211 ## Verification Commit `55d4af7`, Python 3.12.10. ```powershell python -B tests/dependency_paths_check.py ``` Result: ```text dependency_paths: the pinned hash reaches the conditional target; a different hash reports unverified_loader_hash and no conditional edge ``` Negative control: replacing the new branch with `elif False:` makes the same test fail with ```text AssertionError: expected one unverified loader finding: [] ``` ## Evidence and follow-up The inventory is built in memory: two images (`pkg/amd_fidelityfx_loader_xbox.dll` and `pkg/amd_fidelityfx_upscaler_xbox.dll`) and no imports. The pinned case uses `FFX_LOADER` from the module; the changed case uses 64 `1` characters. The upscaler lists every name in `FFX_EXPORTS`, so the pinned case exercises the full conditional route rather than a partial one. `dependency_paths_controls` is registered in the Python gate in `CMakeLists.txt` and added to the Linux job's command list. It needs no Windows-specific module. The existing `conditional_import_paths` control (`tests/intake/paths_check.py`) asserted that an unknown loader hash produced no findings. That assertion encoded the silent-success behaviour this change removes. It now asserts the `unverified_loader_hash` finding with both hashes and that the conditional route stays absent. All eight pure-Python checks from the Linux job pass locally: `script_state_check`, `bcpack_check`, `resource_ranges_check`, `dxcontainer_part_offsets_check`, `layout_chunks_check`, `intake/paths_check`, `dependency_paths_check` and `shader_probe_check`. Not covered: a loader image that is reachable only through a forwarder, and a second loader build that has a different basename. Both are outside this change. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. _AI-assisted._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:34:40 +00:00
github manually merged commit 3941e9ef24 into gh-pr/212/base 2026-11-26 21:34:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.