shader: compile the log2 pixel fixtures with -denorm any #845
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/851"
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 alvaroolt on 2026-11-23T13:05:45Z.
Change
pixel_aot_e64_approx_hardwareandpixel_aot_sdwa_unary_hardwarefail on an NVIDIA GeForce RTX 5080 because the driver refusesCreateGraphicsPipelineState(E_OUTOFMEMORY) for any pixel shader that useslog2under-denorm preserve(#828). As agreed in the issue, this switches the denormal mode per fixture, only for the approximate programs that containlog2.tests/pixel_aot_check.py:log2_denorm_mode()returnsanywhen the translated HLSL containslog2(andpreserve(F32_DENORM_MODE) otherwise. Before returningany, it asserts that no value the fixture depends on is a binary32 subnormal: the inputs, the intermediate results (the unrounded exp, log and rcp results and their+ 0.5, the rounded-A * |B|product andD * Dsquare of the mac channels, the accumulator), the expected values and every wrong reference.e64_approxandsdwa_unary_exp.sdwa_unary_rootandsdwa_unary_exactkeeppreserve, and an assertion pins that onlysdwa_unary_expswitches.docs/experiments.md: the denormal-mode paragraph records the exception next to the existingcurveone, with the measured adapters.The minimal
preservereproduction stays in #828 for a later driver retest.Fixes #828
This change was AI-assisted (Claude Code); I reviewed the diff and the test results.
Verification
Commit
c0f4d9c(rebased one97090a),devpreset, DXC 1.9.2602.17 (Windows SDK 10.0.26100).Both modes on the same adapter and driver, one batch per program (10 cases each: 2 right references and 8 wrong references):
e64_approx,sdwa_unary_expunderpreserveanystatus=error,Translated pixel pipeline failed (HRESULT 0x8007000e)pass, 8mismatchfor each programpass, 8mismatchfor each programpass, 8mismatchfor each programOn the RTX 5080 under the new code,
sdwa_unary_root(2pass, 8mismatch) andsdwa_unary_exact(2pass, 10mismatch) still compile withpreserveand pass.Focused tests:
c3db335, the previousmain):pixel_aot_e64_approx_hardwareandpixel_aot_sdwa_unary_hardwarefail withcase=N status=erroron every case; both_warptests pass.82 of 82 passed on
c0f4d9c.Negative control for the new assertion:
log2_denorm_mode()with the least subnormal0x00000001among the values, ande64_approxwith that value in place of C in a row, both raiseAssertionErrorbefore any compile. A program withoutlog2returnspreserveregardless of the values.Other checks:
.github/workflows/windows.yml: all exit 0 onc0f4d9c.tests/pixel_aot_check.py binarywith LLVM 15llvm-mc(gfx1013): exit 0 onc0f4d9c.c3db335):ctest --preset dev --no-tests=error -j 4andctest --preset release --no-tests=error -j 4each give 415 passed, 0 failed of 422.bvh_wave64_hardware,bvh_wave64_warp,wave_shuffle_warp,spirv_minlod_hardware,spirv_minlod_levels_hardware,spirv_minlod_warp,spirv_minlod_levels_warp.Environment: Windows 11 build 26300.9974, VS Build Tools 2026 18.12 (MSVC 14.52.37025), Windows SDK 10.0.26100. The debug layer is unavailable (Graphics Tools not installed).
Evidence and follow-up
No new fixture. The fixtures' inputs and references are unchanged; only the recorded denormal mode of two programs changes.
Assumption: with no binary32 subnormal among the inputs, intermediates and expected values,
anyandpreserveproduce the same exported bits for these programs. The assertions check that for every value the fixtures use; they do not measure the shader's internal precision.Not established: whether older NVIDIA architectures or a later driver accept these pipelines under
preserve, and what the console computes. The AMD Radeon integrated GPU that acceptspreserve(#828) was not rerun with this change.Checklist