Repository navigation
d3d12_vulkan_device_test: 0.6 ULP tolerance for placed SRGB-cast clears (D3D-221) - #1752
Conversation
…rs (D3D-221) Against another adapter or WARP, a placed clear byte may differ from the host when both sides are within 0.6 ULP of the ideal value, the tolerance D3D11.3 spec 3.2.3.6 (FLOAT -> UNORM) and 3.2.3.8 (FLOAT -> SRGB) allow. The plain tie rule already did this for 0.5 * 255; the SRGB-cast clear's 0.5 encodes to 187.516, where Intel's Vulkan driver (UHD 770, 101.7092) writes 187 and WARP 188. The layer's own adapter stays exact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested What I ran, from the PR head in its own worktree:
Reproducing the Intel case without Intel hardware — I changed only the layer's SRGB clear colour inside
That last row is the one I most wanted: the rule is not a blanket one-byte allowance. Exhaustively over all byte pairs, the predicate accepts only Spec check: 3.2.3.8 gives the ideal as One non-blocking thing. The accept side of the new SRGB rule is only reached when the host rounds differently, i.e. on Intel: here and on your 4070 the bytes agree, both this PR and unchanged I did not run the full |
The accept side of the SRGB-cast rule only runs where the host rounds differently (Intel), so a change to it would stay green on NVIDIA and AMD. ideal_srgb and within_06_ulp move to file scope, and the test checks the predicate directly: (187, 188) at 187.516 and (127, 128) at 127.5 are accepted; (186, 188), (126, 128), (224, 225) at 224.61, (136, 137) at 136.97 and (254, 255) at 255 are not. Raising the tolerance to 1.6 fails the test on an RTX 4070 SUPER. Suggested in review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review and for reproducing the Intel case without Intel hardware. I've pushed the pin:
As a mutation check, raising the tolerance to 1.6 makes the test fail at the pinned line on an RTX 4070 SUPER. Re-run after the change: exit 0 on the 4070 SUPER against its own adapter and against WARP, and on the UHD 770 (16 SRGB-cast bytes within tolerance). |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51). This fixes |
|
Tested ceb244b on Intel(R) UHD Graphics (Tiger Lake (Xe-LP) iGPU 0x9a78, subgroup 8..32, no mesh), driver 32.0.101.7088, Windows 11, MSVC 14.44: pass
AI-assisted (GLM, operated by the account owner). |
Claimed in the coordination issue as: D3D-221 (claim, from #1725)
What and why
On
main(89b047cd),d3d12_vulkan_devicestill fails on an Intel UHD 770 (101.7092), but differently from #1725. The cross-adapter tie rule from cb43923 now accepts the plain clear. On this machine the Intel D3D12 adapter is not used as the host, so the test falls back to WARP. The remaining failure is the SRGB-cast clear:The ideal encoding of linear 0.5 is 1.055 * 0.5^(1/2.4) - 0.055 = 0.73536, which scales to 187.516. Intel's Vulkan driver writes 187 and WARP writes 188; NVIDIA's Vulkan driver also writes 188. D3D11.3 spec 3.2.3.8 (FLOAT -> SRGB) permits "a tolerance of 0.6f ULP (on the integer side)", the same as 3.2.3.6 (FLOAT -> UNORM), so both codes are valid.
The change generalises the existing tie rule instead of adding a second special case. Against another adapter or WARP, a byte may differ from the host when both sides are within 0.6 ULP of the ideal value:
The layer's own adapter (same LUID) is still compared exactly. The summary line now reports plain and SRGB-cast bytes separately.
Tested
Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0:
LEONIDA_VK_DEVICE)LEONIDA_HOST_ADAPTER=warp)line 4943Full
ctest:d3d12_draw("bundle blend pixel (0, 0): got 255,0,0,255, expected red 64"). It also fails on unchangedmainand is not touched here, see the note below.d3d12_draw(same as above) andd3d12_descriptor/d3d12_copy_xfmt(D3D-219 and D3D-220, unchanged).Note:
d3d12_drawfails on89b047cdon both GPUs at the bundle blend check added by #1660.Checklist
docs/design.md, with how it was confirmed. (No translator change.)AI-assisted (Claude).
🤖 Generated with Claude Code