tests: route the XG linear-fallback control through addrlib #989

Merged
rasptum merged 2 commits from upstream-pr/996 into main 2026-11-23 21:13:03 +00:00
rasptum commented 2026-11-23 20:27:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-23T20:27:43Z.


Refs #979
Refs #870

Follow-up to #979 for the two points Leyukaka raised in review.

1. The linear-fallback control now goes through addrlib and the same comparison.

  • Before: the control compared the constant ADDR_SW_LINEAR with the table's constants, so it could fail only if the table was edited.
  • Now: linear_fallback_provider sends each request to addrlib with only the linear block allowed. It is checked by the same table_mismatches() comparison as the provider under test, which rejects it on 9 of 10 rows. The 8 tiled colour rows get SW_LINEAR and the depth target is refused with ADDR_INVALIDPARAMS. It agrees only on the 4096x1 SW_LINEAR row.
  • New mutation test: CTest xg_swizzle_select_mutation runs xg_swizzle_select_check --mutate-linear-fallback, which substitutes that provider for the provider under test. It is registered WILL_FAIL. Observed: 9 row checks fail and so does "matches every reference row", so the run exits 1 and CTest reports a pass.

2. tools/fetch_addrlib.py now restores the pinned tree.

  • It runs git checkout --force --detach <pin> and then git clean -ffdx, both only inside the out/deps/mesa checkout.
  • It then fails closed if git status --porcelain --ignored reports anything.
  • Checked: I appended a line to src/core/coord.cpp and added a stray file. Before the re-run, git status showed both. After it, the edit was reverted, the stray file was gone and status was empty.

Tested. Commit 907058e on dae1ca2, Windows 10 Pro 10.0.19045.6466, MSVC 19.44.35207.1 x64. No GPU is involved.

  • dev and release full builds with addrlib (Mesa 5c142e46) passed on b3311bf.
  • On that base, ctest --preset <p> --no-tests=error -R '^xg_swizzle_select|desktop_root_signature|era_heap_allocation|offscreen_warp' passed 5/5 in each preset.
  • After rebasing onto dae1ca2 (main only added unrelated CMake entries), I rebuilt the target. ctest --preset <p> --no-tests=error -R '^xg_swizzle_select' passed 2/2 in dev and release.
  • In a build directory configured with -DXBOX2WINDOWS_ADDRLIB_DIR=, both xg_swizzle_select and xg_swizzle_select_mutation report Skipped (77).
  • tests/docs_links_check.py, tests/bidi_controls_check.py and tests/hardware_reports_check.py passed.
  • pr_overlap_check.py --auto found no overlap. main_function_diff.py flags only fetch_addrlib.py::main, which is the intended change.

The results are still AddrLib observations on the PC gfx10.3 reference profile, not console values.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6568167731 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/996). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-23T20:27:43Z. --- Refs #979 Refs #870 Follow-up to #979 for the two points Leyukaka raised in review. **1. The linear-fallback control now goes through addrlib and the same comparison.** - **Before:** the control compared the constant `ADDR_SW_LINEAR` with the table's constants, so it could fail only if the table was edited. - **Now:** `linear_fallback_provider` sends each request to addrlib with only the linear block allowed. It is checked by the same `table_mismatches()` comparison as the provider under test, which rejects it on 9 of 10 rows. The 8 tiled colour rows get `SW_LINEAR` and the depth target is refused with `ADDR_INVALIDPARAMS`. It agrees only on the 4096x1 `SW_LINEAR` row. - **New mutation test:** CTest `xg_swizzle_select_mutation` runs `xg_swizzle_select_check --mutate-linear-fallback`, which substitutes that provider for the provider under test. It is registered `WILL_FAIL`. Observed: 9 row checks fail and so does "matches every reference row", so the run exits 1 and CTest reports a pass. **2. `tools/fetch_addrlib.py` now restores the pinned tree.** - It runs `git checkout --force --detach <pin>` and then `git clean -ffdx`, both only inside the `out/deps/mesa` checkout. - It then fails closed if `git status --porcelain --ignored` reports anything. - **Checked:** I appended a line to `src/core/coord.cpp` and added a stray file. Before the re-run, `git status` showed both. After it, the edit was reverted, the stray file was gone and status was empty. **Tested.** Commit `907058e` on `dae1ca2`, Windows 10 Pro 10.0.19045.6466, MSVC 19.44.35207.1 x64. No GPU is involved. - `dev` and `release` full builds with addrlib (Mesa `5c142e46`) passed on `b3311bf`. - On that base, `ctest --preset <p> --no-tests=error -R '^xg_swizzle_select|desktop_root_signature|era_heap_allocation|offscreen_warp'` passed 5/5 in each preset. - After rebasing onto `dae1ca2` (main only added unrelated CMake entries), I rebuilt the target. `ctest --preset <p> --no-tests=error -R '^xg_swizzle_select'` passed 2/2 in `dev` and `release`. - In a build directory configured with `-DXBOX2WINDOWS_ADDRLIB_DIR=`, both `xg_swizzle_select` and `xg_swizzle_select_mutation` report Skipped (77). - `tests/docs_links_check.py`, `tests/bidi_controls_check.py` and `tests/hardware_reports_check.py` passed. - `pr_overlap_check.py --auto` found no overlap. `main_function_diff.py` flags only `fetch_addrlib.py::main`, which is the intended change. The results are still AddrLib observations on the PC gfx10.3 reference profile, not console values. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 06:45:46 +00:00
R0Y00 commented 2026-11-24 06:49:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:35:26Z.


I pushed 54b0a66 so the mutation succeeds only when the comparison sees nine mismatches and still matches the linear row. Setup errors now fail that CTest. The fetch script also checks the origin and preserves local work by refusing a dirty checkout before it runs Git updates. Both Release XG CTests passed against pinned Mesa AddrLib. A separate local bare-input smoke test verified first and repeated fetches, preservation of modified and untracked files, and refusal of unrelated or non-empty destinations.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7113278532 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/996#issuecomment-7113278532). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T20:35:26Z. --- I pushed `54b0a66` so the mutation succeeds only when the comparison sees nine mismatches and still matches the linear row. Setup errors now fail that CTest. The fetch script also checks the origin and preserves local work by refusing a dirty checkout before it runs Git updates. Both Release XG CTests passed against pinned Mesa AddrLib. A separate local bare-input smoke test verified first and repeated fetches, preservation of modified and untracked files, and refusal of unrelated or non-empty destinations.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!989
No description provided.