shader: distinguish MinLod translation from adapter rounding #1310

Merged
Evan-Lowry merged 2 commits from upstream-pr/1317 into main 2026-11-24 08:09:46 +00:00
Evan-Lowry commented 2026-11-24 07:48:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Evan-Lowry on 2026-11-24T07:48:11Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6577122052 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1317). Originally posted by [Evan-Lowry](https://github.com/Evan-Lowry) on 2026-11-24T07:48:11Z. --- 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.
tedin7 commented 2026-11-24 08:01:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:55:58Z.

Review: COMMENTED


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6035546688 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1317#pullrequestreview-6035546688). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T07:55:58Z. **Review:** COMMENTED --- 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.
upstream-sync closed this pull request 2026-11-24 09:04:28 +00:00
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!1310
No description provided.