Skip to content

shader: lower mesh float median and base-2 exponent (Part of #3703) - #3921

Open
timbot103 wants to merge 1 commit into
R0Y00:mainfrom
timbot103:shader/mesh-med3-exp
Open

timbot103 wants to merge 1 commit into
R0Y00:mainfrom
timbot103:shader/mesh-med3-exp

Conversation

@timbot103

Copy link
Copy Markdown
Contributor

Part of #3703

A2 mesh median and exponent

The census reports 67 first refusals at v_med3_f32 and 23 at v_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_f32 and VOP1 or VOP3 v_exp_f32 through 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, patch 326b56e8. Both builds passed, including the full Debug build and its C++17 shader frontend target.

  • Debug mesh suite passed 22/23. The missing-position WARP case reported accepted=1 refused=0 and passed its synchronized retry.
  • Release mesh suite passed 20/23. The three known asynchronous WARP failures were guarded allocation, empty allocation and missing position. Each reported accepted=1 refused=0, as on the clean Release baseline. All three passed with X2W_SYNC_MESH_REQUESTS=1.
  • All five RTX 5080 mesh cases passed in both configurations. The PR preset passed 1/1, covering 14 source-built DXIL cases and 10 refusal controls. No test skipped. The bidi, documentation link and diff checks passed.

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.

cmake --build out/build/dev -- -j 6
cmake --build out/build/release --target compile_dxil offscreen_check d3d12_xs_shim startup_indirect_draw_indexed -- -j 6
ctest --preset dev --no-tests=error -j 1 -R 'native_direct_mesh|native_direct_container|native_mesh_'
ctest --preset release --no-tests=error -j 1 -R 'native_direct_mesh|native_direct_container|native_mesh_'
ctest --preset pr --no-tests=error -j 1 -R '^native_mesh_med3_exp_ir$'
$env:X2W_SYNC_MESH_REQUESTS = '1'
ctest --preset release --no-tests=error -j 1 -R '^native_mesh_((guarded|empty)_allocation|missing_position)_warp$'
ctest --preset dev --no-tests=error -j 1 -R '^native_mesh_missing_position_warp
python tests/docs_links_check.py
git diff --check origin/main...HEAD
python tests/bidi_controls_check.py
python tests/docs_links_check.py
git diff --check origin/main...HEAD

🤖 Generated with Claude Code

@JohnConnorNPC

Copy link
Copy Markdown
Collaborator

Reviewed 326b56e8955c against main d2e6a4ed. Verdict: no MUST or SHOULD, two NITs.

  1. NIT (PR body): in the reproduction block, ctest --preset dev --no-tests=error -j 1 -R '^native_mesh_missing_position_warp has no closing quote, so pasted into PowerShell it waits for more input. python tests/docs_links_check.py and git diff --check origin/main...HEAD are each listed twice.
  2. NIT (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 --check pass; the branch merged cleanly with main at d31b66435. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants