tests: check fractional MinLod one step below both observed mip transitions #2404
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2412"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T15:45:21Z.
Refs #809. The four fractional point-filter inputs were all exact multiples of 1/128. A translated shader could round every clamp to the nearest 1/128 and still pass the existing fixture on Intel, NVIDIA and WARP.
I swept a synthetic four-mip texture across [1, 2] with the translated SPIR-V shader and its direct HLSL control, first in steps of 1/16, then in steps of 1/256 around each observed transition. Both shaders matched the selected mip over all 64 pixels at every sampled clamp. Runnable measurement.
The regression fixture adds the two lower endpoints and the exact clamp 2. For the two fractional cases it requires complete, identical mip readbacks from the translated shader and direct control; the existing optional strict mode checks nearest-mip selection. The normal test succeeded on all three adapters. Rounding only the translated constant to 1/128 before assembling the shader made the new fixture fail at 1.99609375 on Intel and 1.49609375 on WARP and RTX. In each case the translated shader read mip 2 while the control read mip 1. The original four-input fixture passed that same mutation on all three devices.
Local runs used Windows 11 24H2 build 26100.9711, DXC 1.9.2609.5 (
-T ps_6_6 -E main), project-pinned SPIRV-Tools and patched SPIRV-Cross. The local debug layer was unavailable. The exact and mip-linear entry also passed on all three adapters. Strict fractional rounding passed on RTX/WARP and reproduced the documented 1.5625 failure on Intel. The wrong-mip-0 control failed at pixel (0, 0), channel 0, on each adapter. Documentation links and the bidirectional-control check passed.Hosted Windows Server 2025 WARP used the debug layer, WARP 10.0.26100.33648 and DXC 1.9.2602.17. The stock draw passed, the previous fixture accepted the rounded shader, and the new fixture rejected it at 1.49609375.
AI assistance: Codex + GPT-6.2 Astra (xhigh).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:08:07Z.
Review: COMMENTED
Review of head
3d1b95c3(test-only:tests/spirv_window/minlod_levels.py,docs/experiments.md).What I checked:
FRACTIONALhas one consumer (minlod_levels.py:68); the added clamps (1.49609375, 1.99609375, 2) are covered by the same loop, and the wrong-mip control is unchanged.No blocking findings. Next: update with main, CI, Win2025 WARP dev+release.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-25T16:06:09Z.
APPROVED. Tests fractional MinLod below mip transitions.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:16:14Z.
Win2025 WARP receipt for head
3d1b95c3after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
3d1b95c315c3a0941065ed9493d7147b6910e691:--preset dev):cmake --build --preset dev -- -j 2):158.52s(configure1.65s)ctest --preset dev -R 'spirv_minlod_(fractional|levels)_warp' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (2.62s:spirv_minlod_fractional_warp1.49s,spirv_minlod_levels_warp2.52s)/O2(--preset release):cmake --build --preset release -- -j 2):175.49s(configure1.67s)ctest --preset release -R 'spirv_minlod_(fractional|levels)_warp' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (2.23s:spirv_minlod_fractional_warp1.18s,spirv_minlod_levels_warp2.14s)sccache: 1234/1310 hits; wall346.9sAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T16:21:54Z.
@tedin7 I checked the reviewed head
3d1b95c3against upstreammainat7092683a. It contains that main commit, and all three upstream CI jobs passed.I rebuilt
offscreen_checkfrom this exact head using the stock dev (Debug) and release presets on Windows Server 2025. The fractional WARP fixture passed in both builds with the D3D12 debug layer enabled. The translated and direct HLSL draws selected mip 1 at 1.49609375, mip 2 at 1.99609375, and mip 2 at 2. Both wrong-mip-0 controls failed at pixel (0,0) as expected.Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T17:24:22Z.
Review: APPROVED
Approved at head
3d1b95c3. The change is test-only:tests/spirv_window/minlod_levels.pyanddocs/experiments.md. This adds an AMD adapter and a local run of the 1/128-rounding mutant to @tedin7's review and WARP receipt.Environment
--preset dev,offscreen_checkbuilt at3d1b95c3.tools/setup-spirv-tools.ps1, and DXC from SDK 10.0.26100.Normal run
spirv_minlod,_exact,_levelsand_fractional, each onhardware(AMD Radeon RX 9070 XT, 1002:7550, driver 32.0.32029.2010) and onwarp. There were no skips.1.4375→1,1.49609375→1,1.5→2,1.5625→2,1.99609375→2,2→2and3.75→3. So the RX 9070 XT switches at 1.5, like the RTX 4060 and WARP in the description's table, and unlike the UHD 770.Negative control (the description's mutant)
I rounded only the translated SPIR-V constant to 1/128 (
%clamp = OpConstant %float {round(float(clamp) * 128) / 128}) and left the HLSL control unchanged:spirv_minlod_fractional_hardware(RX 9070 XT) and_warpboth fail withClamp 1.49609375 read mip 2 translated, mip 1 in the HLSL control.main's clamp list the mutant is a no-op, because 1.4375, 1.5, 1.5625 and 3.75 are exact multiples of 1/128. That is the gap this PR closes.Merge checks: the branch merges cleanly with current
main. Required CI passed at this head. The/O2and coverage skips come from explicit workflow conditions. There are no review threads.AI-assisted; commands listed were executed locally.