shader: distinguish MinLod translation from adapter rounding #1317

Manually merged
github merged 2 commits from gh-pr/1317/head into gh-pr/1317/base 2026-11-26 22:57:35 +00:00
Owner

@⁠Evan-Lowry on GitHub · 2026-11-24 07:48 UTC · original
Evan-Lowry:tests/minlod-adapter-reference → main · +48 −36 · 3 files · 2 commits · merged 2026-11-24 08:09 UTC

The fractional MinLod fixture can fail when both the translated shader and the direct HLSL reference read mip 1 at a clamp of 1.5625, as reported in #809. Compare exact readbacks on the same adapter and require both shaders to choose the same accepted mip. Check mip 0 as the negative reference and retain opt-in --strict-rounding for checking nearest-mip behavior away from the tie.

Verified exact, fractional, and strict fractional checks on an AMD adapter and WARP. A synthetic control that selected the lower mip in both shaders passed in normal mode and failed in strict mode. Changing only the translated shader still failed with the expected disagreement. python -B tests/docs_links_check.py passed.

Refs #809. AI-assisted with Codex.

**@⁠Evan-Lowry** on GitHub · 2026-11-24 07:48 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1317) `Evan-Lowry:tests/minlod-adapter-reference` → `main` · +48 −36 · 3 files · 2 commits · merged 2026-11-24 08:09 UTC The fractional MinLod fixture can fail when both the translated shader and the direct HLSL reference read mip 1 at a clamp of 1.5625, as reported in #809. Compare exact readbacks on the same adapter and require both shaders to choose the same accepted mip. Check mip 0 as the negative reference and retain opt-in `--strict-rounding` for checking nearest-mip behavior away from the tie. Verified exact, fractional, and strict fractional checks on an AMD adapter and WARP. A synthetic control that selected the lower mip in both shaders passed in normal mode and failed in strict mode. Changing only the translated shader still failed with the expected disagreement. `python -B tests/docs_links_check.py` passed. Refs #809. AI-assisted with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:57:33 +00:00
github manually merged commit d6b54dfc90 into gh-pr/1317/base 2026-11-26 22:57:35 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 07:55 UTC · original · reviewed

Peer review at commit d6b54dfc90a705deacfbd9ce79eaf94ff48e748e:

Checks

  • Linux:
    • git diff --check origin/main...HEAD: passed
    • tests/docs_links_check.py: passed (16 Markdown files, 289 links)
    • tests/bidi_controls_check.py: passed (1086 tracked files)
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target offscreen_check -- -j 6 (3.61s), ctest --preset dev -R '^(spirv_minlod_fractional_warp|spirv_minlod_levels_warp)$' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (spirv_minlod_fractional_warp 0.97s, spirv_minlod_levels_warp 2.52s)
    • Release /O2 (--preset release): cmake --build --preset release --target offscreen_check -- -j 6 (0.97s), ctest --preset release -R '^(spirv_minlod_fractional_warp|spirv_minlod_levels_warp)$' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (spirv_minlod_fractional_warp 0.94s, spirv_minlod_levels_warp 2.42s)

Review Notes

  • tests/spirv_window/minlod_levels.py, tests/spirv_window/minlod_fractional.py, docs/experiments.md:
    • point_mip cleanly separates adapter rounding behavior (mip 1 vs mip 2 at 1.5 and 1.5625) from translation fidelity by requiring exact readback and translated-vs-HLSL-control agreement on the same adapter, while retaining --strict-rounding for nearest-mip testing away from the 1.5 tie.
    • WRONG_FRACTIONAL = ("1.5625", 0) is a valid negative control under both rounding rules.
    • No issues found.
**@⁠tedin7** on GitHub · 2026-11-24 07:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1317#pullrequestreview-6035546688) · **reviewed** Peer review at commit `d6b54dfc90a705deacfbd9ce79eaf94ff48e748e`: ### Checks - **Linux**: - `git diff --check origin/main...HEAD`: passed - `tests/docs_links_check.py`: passed (16 Markdown files, 289 links) - `tests/bidi_controls_check.py`: passed (1086 tracked files) - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: `cmake --build --preset dev --target offscreen_check -- -j 6` (`3.61s`), `ctest --preset dev -R '^(spirv_minlod_fractional_warp|spirv_minlod_levels_warp)$' --parallel 4 --no-tests=error --output-on-failure`: **2/2 passed** (`spirv_minlod_fractional_warp` `0.97s`, `spirv_minlod_levels_warp` `2.52s`) - **Release `/O2` (`--preset release`)**: `cmake --build --preset release --target offscreen_check -- -j 6` (`0.97s`), `ctest --preset release -R '^(spirv_minlod_fractional_warp|spirv_minlod_levels_warp)$' --parallel 4 --no-tests=error --output-on-failure`: **2/2 passed** (`spirv_minlod_fractional_warp` `0.94s`, `spirv_minlod_levels_warp` `2.42s`) ### Review Notes - `tests/spirv_window/minlod_levels.py`, `tests/spirv_window/minlod_fractional.py`, `docs/experiments.md`: - `point_mip` cleanly separates adapter rounding behavior (mip 1 vs mip 2 at `1.5` and `1.5625`) from translation fidelity by requiring exact readback and translated-vs-HLSL-control agreement on the same adapter, while retaining `--strict-rounding` for nearest-mip testing away from the `1.5` tie. - `WRONG_FRACTIONAL = ("1.5625", 0)` is a valid negative control under both rounding rules. - No issues found.
This discussion has been locked. Commenting is limited to contributors.
No description provided.