shader: lower finite-normal raw buffer floating-point min and max atomics #2503

Merged
chadhyatt merged 2 commits from upstream-pr/2511 into main 2026-11-25 19:34:43 +00:00
chadhyatt commented 2026-11-25 19:05:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chadhyatt on 2026-11-25T19:05:36Z.


AI-assisted backport patch from x2w-microlift.

Refs #1545. Admit fixed-address gfx1030 32-bit raw MUBUF float min/max only under the explicit finite-normal domain. Reuse the image float ordering with the raw buffer CAS method; preserve the existing integer atomics and refusals. Four source-built cases exercise single-value and contended reductions, seeded output, parser controls and arithmetic mutations.

Exact tested head: b688fabb3e, base 394f24f833. macOS ARM64, LLVM 23: all four new assembly/disassembly/lowering/CLI cases and domain/refusal controls passed (using mubuf_float_controls() and gfx1030_binary for mubuf_float_cases from tests/compute_store_check.py). python3 -B tests/docs_links_check.py and python3 -B tests/bidi_controls_check.py passed. Full binary suite and DXC/WARP/hardware execution were not run on this host.

Windows verification: cmake --build --preset dev --target offscreen_check, then ctest --preset dev --no-tests=error -R "^compute_store_aot_mubuf_float_" -V.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6611675086 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2511). Originally posted by [chadhyatt](https://github.com/chadhyatt) on 2026-11-25T19:05:36Z. --- AI-assisted backport patch from x2w-microlift. Refs #1545. Admit fixed-address gfx1030 32-bit raw MUBUF float min/max only under the explicit finite-normal domain. Reuse the image float ordering with the raw buffer CAS method; preserve the existing integer atomics and refusals. Four source-built cases exercise single-value and contended reductions, seeded output, parser controls and arithmetic mutations. Exact tested head: b688fabb3e6f2c568c2444c0c62308ed95daa7cd, base 394f24f8330c3f85bdfc9b6d9a268086e3c44fd2. macOS ARM64, LLVM 23: all four new assembly/disassembly/lowering/CLI cases and domain/refusal controls passed (using `mubuf_float_controls()` and `gfx1030_binary` for `mubuf_float_cases` from tests/compute_store_check.py). `python3 -B tests/docs_links_check.py` and `python3 -B tests/bidi_controls_check.py` passed. Full binary suite and DXC/WARP/hardware execution were not run on this host. Windows verification: `cmake --build --preset dev --target offscreen_check`, then `ctest --preset dev --no-tests=error -R "^compute_store_aot_mubuf_float_" -V`.
upstream-sync closed this pull request 2026-11-25 20:04:33 +00:00
tedin7 commented 2026-11-25 20:04:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:24:20Z.

Review: COMMENTED


Review of head b688fabb (comment only, no approval).

What I checked

  • The fmin/fmax CAS loop is now one shared helper used by the image path and the new raw buffer path. The image output text is unchanged.
  • The raw buffer path is admitted only with an explicit finite-normal domain, a single 32-bit operand, no glc, and the existing fixed-address descriptor/offset guards. Missing, misspelled and unused domain values are refused.
  • Integer atomics and the other refusals are untouched. No other open or merged PR covers raw buffer float min/max (searched all states).
  • The new compute_store_aot_mubuf_float_<adapter> CTest is wired next to the sibling mubuf_csub test. The test compares D3D12 readback with a CPU reference for single and contended reductions and has seeded output.

Commands run (Linux, worktree at the exact head, 11 behind main)

  • python3 -B tests/docs_links_check.py: passed
  • python3 -B tests/bidi_controls_check.py: passed
  • git diff --check origin/main...HEAD: clean
  • mubuf_float_controls() plus aot.lower on all four cases: passed
  • Mutation 1: removed the domain/width/glc guard on fmin/fmax. The controls fail ("Expected rejection").
  • Mutation 2: removed the fmin/fmax entries from MUBUF_ATOMIC_METHODS. The controls fail ("Unsupported compute instruction").

Not covered here: the WARP readback run. It will be run on Windows next.

No finding. Does not claim any startup progress, so no game verification is needed.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063660969 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2511#pullrequestreview-6063660969). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T19:24:20Z. **Review:** COMMENTED --- Review of head b688fabb (comment only, no approval). What I checked - The fmin/fmax CAS loop is now one shared helper used by the image path and the new raw buffer path. The image output text is unchanged. - The raw buffer path is admitted only with an explicit finite-normal domain, a single 32-bit operand, no glc, and the existing fixed-address descriptor/offset guards. Missing, misspelled and unused domain values are refused. - Integer atomics and the other refusals are untouched. No other open or merged PR covers raw buffer float min/max (searched all states). - The new `compute_store_aot_mubuf_float_<adapter>` CTest is wired next to the sibling `mubuf_csub` test. The test compares D3D12 readback with a CPU reference for single and contended reductions and has seeded output. Commands run (Linux, worktree at the exact head, 11 behind main) - `python3 -B tests/docs_links_check.py`: passed - `python3 -B tests/bidi_controls_check.py`: passed - `git diff --check origin/main...HEAD`: clean - `mubuf_float_controls()` plus `aot.lower` on all four cases: passed - Mutation 1: removed the domain/width/glc guard on fmin/fmax. The controls fail ("Expected rejection"). - Mutation 2: removed the fmin/fmax entries from MUBUF_ATOMIC_METHODS. The controls fail ("Unsupported compute instruction"). Not covered here: the WARP readback run. It will be run on Windows next. No finding. Does not claim any startup progress, so no game verification is needed. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 20:04:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T19:34:32Z.


Win2025 WARP receipt for head 9cf0e840 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 9cf0e84099d661ec2d601ffc77f4017c8341720a:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target offscreen_check -- -j 2): 84.88s (configure 5.89s)
    • Test (ctest --preset dev -R 'compute_store_aot_mubuf_' --parallel 2 --no-tests=error --output-on-failure): 32/32 passed (112.29s: compute_store_aot_mubuf_store_subword_warp 4.64s, compute_store_aot_mubuf_reduction_warp 5.83s, compute_store_aot_mubuf_reduction_x2_warp 3.68s, compute_store_aot_mubuf_store_format_warp 3.46s, compute_store_aot_mubuf_counter-x2_warp 2.28s, compute_store_aot_mubuf_d16_warp 4.69s, compute_store_aot_mubuf_exchange-x2_warp 4.19s, compute_store_aot_mubuf_subword_warp 5.84s, compute_store_aot_mubuf_exchange_warp 2.75s, compute_store_aot_mubuf_format_warp 3.43s, compute_store_aot_mubuf_store_format_xyz_warp 1.66s, compute_store_aot_mubuf_load_format_d16_warp 3.07s, compute_store_aot_mubuf_counter_warp 2.08s, compute_store_aot_mubuf_vector_warp 1.98s, compute_store_aot_mubuf_csub_warp 1.77s, compute_store_aot_mubuf_reduction_x2_hardware 10.64s, compute_store_aot_mubuf_reduction_hardware 15.96s, compute_store_aot_mubuf_store_format_hardware 32.41s, compute_store_aot_mubuf_d16_hardware 34.67s, compute_store_aot_mubuf_store_subword_hardware 12.12s, compute_store_aot_mubuf_subword_hardware 6.53s, compute_store_aot_mubuf_format_hardware 5.82s, compute_store_aot_mubuf_load_format_d16_hardware 9.34s, compute_store_aot_mubuf_vector_hardware 7.70s, compute_store_aot_mubuf_exchange_hardware 7.60s, compute_store_aot_mubuf_exchange-x2_hardware 6.74s, compute_store_aot_mubuf_counter_hardware 3.37s, compute_store_aot_mubuf_counter-x2_hardware 3.54s, compute_store_aot_mubuf_csub_hardware 2.27s, compute_store_aot_mubuf_store_format_xyz_hardware 2.46s, compute_store_aot_mubuf_float_warp 5.35s, compute_store_aot_mubuf_float_hardware 5.67s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target offscreen_check -- -j 2): 214.43s (configure 3.33s)
    • Test (ctest --preset release -R 'compute_store_aot_mubuf_' --parallel 2 --no-tests=error --output-on-failure): 32/32 passed (36.00s: compute_store_aot_mubuf_reduction_warp 3.08s, compute_store_aot_mubuf_reduction_x2_warp 3.10s, compute_store_aot_mubuf_d16_warp 2.46s, compute_store_aot_mubuf_store_format_warp 2.58s, compute_store_aot_mubuf_load_format_d16_warp 1.95s, compute_store_aot_mubuf_subword_warp 2.17s, compute_store_aot_mubuf_format_warp 2.19s, compute_store_aot_mubuf_counter_warp 1.86s, compute_store_aot_mubuf_exchange-x2_warp 1.58s, compute_store_aot_mubuf_store_subword_warp 2.41s, compute_store_aot_mubuf_exchange_warp 1.66s, compute_store_aot_mubuf_counter-x2_warp 1.49s, compute_store_aot_mubuf_vector_warp 1.67s, compute_store_aot_mubuf_csub_warp 1.33s, compute_store_aot_mubuf_store_format_xyz_warp 1.33s, compute_store_aot_mubuf_subword_hardware 2.11s, compute_store_aot_mubuf_reduction_hardware 3.11s, compute_store_aot_mubuf_reduction_x2_hardware 3.26s, compute_store_aot_mubuf_exchange_hardware 1.79s, compute_store_aot_mubuf_exchange-x2_hardware 1.73s, compute_store_aot_mubuf_counter_hardware 1.58s, compute_store_aot_mubuf_counter-x2_hardware 1.91s, compute_store_aot_mubuf_csub_hardware 1.60s, compute_store_aot_mubuf_vector_hardware 1.90s, compute_store_aot_mubuf_float_hardware 2.59s, compute_store_aot_mubuf_load_format_d16_hardware 2.43s, compute_store_aot_mubuf_d16_hardware 3.56s, compute_store_aot_mubuf_format_hardware 2.18s, compute_store_aot_mubuf_store_format_xyz_hardware 1.67s, compute_store_aot_mubuf_store_format_hardware 3.54s, compute_store_aot_mubuf_store_subword_hardware 2.62s, compute_store_aot_mubuf_float_warp 2.77s)
  • Windows Python checks: tests/compute_alu_bcnt64_check.py ok (0.7s), tests/compute_alu_cmp_ne_check.py ok (0.7s), tests/compute_alu_lane_gaps_check.py ok (0.7s), tests/compute_desc_numeric_check.py ok (0.6s), tests/compute_entry_layout_check.py ok (0.2s), tests/compute_heap_store_check.py ok (0.6s), tests/compute_heap_view_check.py ok (1.0s), tests/compute_load_format_check.py ok (1.3s), tests/pso_readiness_check.py ok (2.4s)
  • sccache: 6/426 hits; wall 365.4s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172485993 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2511#issuecomment-7172485993). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T19:34:32Z. --- Win2025 WARP receipt for head 9cf0e840 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `9cf0e84099d661ec2d601ffc77f4017c8341720a`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target offscreen_check -- -j 2`): `84.88s` (configure `5.89s`) - Test (`ctest --preset dev -R 'compute_store_aot_mubuf_' --parallel 2 --no-tests=error --output-on-failure`): **32/32 passed** (`112.29s`: `compute_store_aot_mubuf_store_subword_warp` `4.64s`, `compute_store_aot_mubuf_reduction_warp` `5.83s`, `compute_store_aot_mubuf_reduction_x2_warp` `3.68s`, `compute_store_aot_mubuf_store_format_warp` `3.46s`, `compute_store_aot_mubuf_counter-x2_warp` `2.28s`, `compute_store_aot_mubuf_d16_warp` `4.69s`, `compute_store_aot_mubuf_exchange-x2_warp` `4.19s`, `compute_store_aot_mubuf_subword_warp` `5.84s`, `compute_store_aot_mubuf_exchange_warp` `2.75s`, `compute_store_aot_mubuf_format_warp` `3.43s`, `compute_store_aot_mubuf_store_format_xyz_warp` `1.66s`, `compute_store_aot_mubuf_load_format_d16_warp` `3.07s`, `compute_store_aot_mubuf_counter_warp` `2.08s`, `compute_store_aot_mubuf_vector_warp` `1.98s`, `compute_store_aot_mubuf_csub_warp` `1.77s`, `compute_store_aot_mubuf_reduction_x2_hardware` `10.64s`, `compute_store_aot_mubuf_reduction_hardware` `15.96s`, `compute_store_aot_mubuf_store_format_hardware` `32.41s`, `compute_store_aot_mubuf_d16_hardware` `34.67s`, `compute_store_aot_mubuf_store_subword_hardware` `12.12s`, `compute_store_aot_mubuf_subword_hardware` `6.53s`, `compute_store_aot_mubuf_format_hardware` `5.82s`, `compute_store_aot_mubuf_load_format_d16_hardware` `9.34s`, `compute_store_aot_mubuf_vector_hardware` `7.70s`, `compute_store_aot_mubuf_exchange_hardware` `7.60s`, `compute_store_aot_mubuf_exchange-x2_hardware` `6.74s`, `compute_store_aot_mubuf_counter_hardware` `3.37s`, `compute_store_aot_mubuf_counter-x2_hardware` `3.54s`, `compute_store_aot_mubuf_csub_hardware` `2.27s`, `compute_store_aot_mubuf_store_format_xyz_hardware` `2.46s`, `compute_store_aot_mubuf_float_warp` `5.35s`, `compute_store_aot_mubuf_float_hardware` `5.67s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target offscreen_check -- -j 2`): `214.43s` (configure `3.33s`) - Test (`ctest --preset release -R 'compute_store_aot_mubuf_' --parallel 2 --no-tests=error --output-on-failure`): **32/32 passed** (`36.00s`: `compute_store_aot_mubuf_reduction_warp` `3.08s`, `compute_store_aot_mubuf_reduction_x2_warp` `3.10s`, `compute_store_aot_mubuf_d16_warp` `2.46s`, `compute_store_aot_mubuf_store_format_warp` `2.58s`, `compute_store_aot_mubuf_load_format_d16_warp` `1.95s`, `compute_store_aot_mubuf_subword_warp` `2.17s`, `compute_store_aot_mubuf_format_warp` `2.19s`, `compute_store_aot_mubuf_counter_warp` `1.86s`, `compute_store_aot_mubuf_exchange-x2_warp` `1.58s`, `compute_store_aot_mubuf_store_subword_warp` `2.41s`, `compute_store_aot_mubuf_exchange_warp` `1.66s`, `compute_store_aot_mubuf_counter-x2_warp` `1.49s`, `compute_store_aot_mubuf_vector_warp` `1.67s`, `compute_store_aot_mubuf_csub_warp` `1.33s`, `compute_store_aot_mubuf_store_format_xyz_warp` `1.33s`, `compute_store_aot_mubuf_subword_hardware` `2.11s`, `compute_store_aot_mubuf_reduction_hardware` `3.11s`, `compute_store_aot_mubuf_reduction_x2_hardware` `3.26s`, `compute_store_aot_mubuf_exchange_hardware` `1.79s`, `compute_store_aot_mubuf_exchange-x2_hardware` `1.73s`, `compute_store_aot_mubuf_counter_hardware` `1.58s`, `compute_store_aot_mubuf_counter-x2_hardware` `1.91s`, `compute_store_aot_mubuf_csub_hardware` `1.60s`, `compute_store_aot_mubuf_vector_hardware` `1.90s`, `compute_store_aot_mubuf_float_hardware` `2.59s`, `compute_store_aot_mubuf_load_format_d16_hardware` `2.43s`, `compute_store_aot_mubuf_d16_hardware` `3.56s`, `compute_store_aot_mubuf_format_hardware` `2.18s`, `compute_store_aot_mubuf_store_format_xyz_hardware` `1.67s`, `compute_store_aot_mubuf_store_format_hardware` `3.54s`, `compute_store_aot_mubuf_store_subword_hardware` `2.62s`, `compute_store_aot_mubuf_float_warp` `2.77s`) - **Windows Python checks**: `tests/compute_alu_bcnt64_check.py` ok (`0.7s`), `tests/compute_alu_cmp_ne_check.py` ok (`0.7s`), `tests/compute_alu_lane_gaps_check.py` ok (`0.7s`), `tests/compute_desc_numeric_check.py` ok (`0.6s`), `tests/compute_entry_layout_check.py` ok (`0.2s`), `tests/compute_heap_store_check.py` ok (`0.6s`), `tests/compute_heap_view_check.py` ok (`1.0s`), `tests/compute_load_format_check.py` ok (`1.3s`), `tests/pso_readiness_check.py` ok (`2.4s`) - `sccache`: 6/426 hits; wall `365.4s` AI-assisted; commands listed were executed locally.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2503
No description provided.