shader: lower mesh float median and base-2 exponent (Part of #3703) #3921
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3921"
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 timbot103 on 2026-12-03T10:38:50Z.
Part of #3703
A2 mesh median and exponent
The census reports 67 first refusals at
v_med3_f32and 23 atv_exp_f32. Source-built fixtures for both opcodes reproduced the standard unsupported mesh instruction diagnostic before this change. Private census coverage is pending.The mesh frontend routes VOP3
v_med3_f32and VOP1 or VOP3v_exp_f32through the existing direct float ALU. Median selects the folded FMin result when any operand is NaN. The exponent uses DXIL Exp, opcode 21, for a base-2 power. Valid source abs and neg use the shared sign-bit transformations. Clamp, omod, op_sel, SDWA, DPP and nonzero unused exponent fields stay refused.The fixture evaluates the DXIL feeding the position export. It covers ordinary medians, each NaN position, multiple NaNs, infinities and positive and negative exponents. GPU regression tests cover the existing mesh suite. Exact hardware floating-point parity was not measured.
Verification
Base
d2e6a4ed, patch326b56e8. Both builds passed, including the full Debug build and its C++17 shader frontend target.accepted=1 refused=0and passed its synchronized retry.accepted=1 refused=0, as on the clean Release baseline. All three passed withX2W_SYNC_MESH_REQUESTS=1.Windows 11 10.0.26200.9974, MSVC 19.44.35230, Windows SDK 10.0.26100, DXC 1.9.2602.17. WARP 10.0.26100.9818 and NVIDIA GeForce RTX 5080 with driver 32.0.16.2140. The D3D12 debug layer was unavailable.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-12-03T11:17:34Z.
Reviewed
326b56e8955cagainst maind2e6a4ed. Verdict: no MUST or SHOULD, two NITs.ctest --preset dev --no-tests=error -j 1 -R '^native_mesh_missing_position_warphas no closing quote, so pasted into PowerShell it waits for more input.python tests/docs_links_check.pyandgit diff --check origin/main...HEADare each listed twice.docs/experiments/native-mesh-vector-alu.md): there are now two blank lines before## Mesh median and base-2 exponentiation.Checked on Linux (clang-cl cross build, run under Wine): the new IR check passes at head (14 DXIL cases, 10 refusal controls); four source mutations each turned it red; docs links, bidi controls, form coverage and
git diff --checkpass; the branch merged cleanly with main atd31b66435. Not run: MSVC suites, WARP or hardware readbacks, census delta.Not a finding on the code: the question on #3703 about the A2 row still had no reply at review time.
AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T11:59:43Z.
Review: APPROVED
Approved
326b56e8. The mesh entry routes plain median and exponent through the existing float lowering, with checks for unsupported modifiers and the unused VOP3 exponent operands. Independent MSVC Debug with SDK DXC, Windows build 26300: native_mesh_med3_exp_ir and native_direct_mesh passed (2/2), including the emitted median NaN cases, exponent infinities and operand refusals. This checks the compiler output; I did not run a GPU draw. Optional follow-up: guard the CTest registration on the DXC executable and DLLs, like the other tool-dependent fixtures.