tests: batch heap-view store references by compute shader #2646

Merged
RavenCurseBurg merged 2 commits from upstream-pr/2654 into main 2026-11-26 00:45:29 +00:00
RavenCurseBurg commented 2026-11-26 00:37:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T00:37:52Z.


Change

compute_store_aot_heap_view_store_{warp,hardware} used to start a renderer for every reference, even when several references shared one compiled compute shader. This change uses the existing --compute-store-batch path once per shader. Every reference still uploads its own data, dispatches and compares 320 words after the fence.

The five batches contain 12 UINT4, 12 D16 XYZW, 16 D16 X, 17 D16 XY and 17 D16 XYZ references. The 52 shader mutations each compile and run separately, including their first-mismatched-word checks. A batch error identifies the mode and the individual slot, payload or format. The fixture retains its hardware-unavailable exit 77.

Verification

I compared main 8ecaa8ec and the candidate on Windows 11 using the same compiled renderer and DXC 1.9.2609. On WARP, an RTX 4060 and an Intel UHD Graphics 770, each side performed 126 independent 320-word readbacks per backend. Each candidate matched the baseline for all 57 HLSL/DXIL compilation pairs, shader and case-file fingerprints, mismatch counts, and first differing word (index, expected and actual). Each backend had 74 matching references and 52 detected mutations. Renderer invocations fell from 126 to 57.

I timed the uninstrumented fixture with a warm-up on each revision and three alternating measured pairs. On desktop WARP the median went from 33.094 s to 23.520 s (28.9% lower). The raw baseline runs were 27.804, 33.094 and 35.023 s. The candidate runs were 21.301, 23.520 and 25.616 s.

python -B tests/compute_heap_store_check.py controls
python -B tests/compute_heap_store_check.py binary $mc $objcopy $llvm
python -B tests/compute_heap_store_check.py draw $dxc $renderer warp
python -B tests/compute_heap_store_check.py draw $dxc $renderer hardware
python -B tests/docs_links_check.py

The translation controls passed, all five synthetic LLVM programs assembled and matched the CLI translation, and 507 documentation links passed. Five injected renderer results also checked the return path: only the opted-in hardware exit 77 became a skip, and WARP 77 and hardware errors remained failures.

Evidence and follow-up

The same three-pair benchmark on the RTX 4060 went from a median of 70.141 s to 44.492 s (36.6% lower). On Intel UHD Graphics 770 it went from 82.438 s to 51.410 s (37.6% lower). All 24 timed invocations across the three backends exited 0.

I also flipped reference word 319 in the middle of each of the five WARP batches. Each run named the failing slot, reported word 319 with its expected and actual values, and still reported a pass for the final case.

This is the heap-view store fixture requested in the #448 follow-up. The shader programs, heap records, payloads and mutations come from the existing public fixture.

Refs #448.

AI-assisted contribution using Codex (GPT-6.2 Astra, xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6616790678 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2654). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T00:37:52Z. --- ## Change `compute_store_aot_heap_view_store_{warp,hardware}` used to start a renderer for every reference, even when several references shared one compiled compute shader. This change uses the existing `--compute-store-batch` path once per shader. Every reference still uploads its own data, dispatches and compares 320 words after the fence. The five batches contain 12 UINT4, 12 D16 XYZW, 16 D16 X, 17 D16 XY and 17 D16 XYZ references. The 52 shader mutations each compile and run separately, including their first-mismatched-word checks. A batch error identifies the mode and the individual slot, payload or format. The fixture retains its hardware-unavailable exit 77. ## Verification I compared main `8ecaa8ec` and the candidate on Windows 11 using the same compiled renderer and DXC 1.9.2609. On WARP, an RTX 4060 and an Intel UHD Graphics 770, each side performed **126 independent 320-word readbacks** per backend. Each candidate matched the baseline for all 57 HLSL/DXIL compilation pairs, shader and case-file fingerprints, mismatch counts, and first differing word (index, expected and actual). Each backend had 74 matching references and 52 detected mutations. Renderer invocations fell from **126 to 57**. I timed the uninstrumented fixture with a warm-up on each revision and three alternating measured pairs. On desktop WARP the median went from **33.094 s to 23.520 s** (28.9% lower). The raw baseline runs were 27.804, 33.094 and 35.023 s. The candidate runs were 21.301, 23.520 and 25.616 s. ```powershell python -B tests/compute_heap_store_check.py controls python -B tests/compute_heap_store_check.py binary $mc $objcopy $llvm python -B tests/compute_heap_store_check.py draw $dxc $renderer warp python -B tests/compute_heap_store_check.py draw $dxc $renderer hardware python -B tests/docs_links_check.py ``` The translation controls passed, all five synthetic LLVM programs assembled and matched the CLI translation, and 507 documentation links passed. Five injected renderer results also checked the return path: only the opted-in hardware exit 77 became a skip, and WARP 77 and hardware errors remained failures. ## Evidence and follow-up The same three-pair benchmark on the RTX 4060 went from a median of 70.141 s to 44.492 s (36.6% lower). On Intel UHD Graphics 770 it went from 82.438 s to 51.410 s (37.6% lower). All 24 timed invocations across the three backends exited 0. I also flipped reference word 319 in the middle of each of the five WARP batches. Each run named the failing slot, reported word 319 with its expected and actual values, and still reported a pass for the final case. This is the heap-view **store** fixture requested in [the #448 follow-up](https://github.com/R0Y00/Xbox2Windows/issues/448#issuecomment-7178665540). The shader programs, heap records, payloads and mutations come from the existing public fixture. Refs #448. AI-assisted contribution using Codex (GPT-6.2 Astra, xhigh).
upstream-sync closed this pull request 2026-11-26 01:02:06 +00:00
tedin7 commented 2026-11-26 01:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:41:00Z.

Review: COMMENTED


Review of head 01a6501f (comment only, test-only change).

What I checked:

  • compute_heap_store_check.py now builds one case file per reference and sends them through the existing check_references batch path (--compute-store-batch), one renderer per shader. Case contents match the old per-call cases: same slots, payloads, wrong-format tables. The "wrong FLOAT4 format" case still expects an all-sentinel result (written_offsets=()), same as before.
  • Shader mutations still run one by one with the first-mismatch word check, so they still guard the lowering.
  • check_references gets an opt-in allow_hardware_skip, so the hardware exit 77 is kept. The other caller ignores the new return value, so it is unaffected.
  • docs/experiments.md text matches the code. No other open or merged PR covers this slice (#2615 and #2635 are the sibling batching changes it follows).

Commands run (Linux):

  • git diff --check origin/main...HEAD: clean
  • python3 tests/docs_links_check.py: pass
  • python3 tests/bidi_controls_check.py: pass
  • python3 -m py_compile on both touched tests: ok

No findings. The Windows WARP run is still to come (no renderer on Linux).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6066997405 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2654#pullrequestreview-6066997405). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:41:00Z. **Review:** COMMENTED --- Review of head 01a6501f (comment only, test-only change). What I checked: - `compute_heap_store_check.py` now builds one case file per reference and sends them through the existing `check_references` batch path (`--compute-store-batch`), one renderer per shader. Case contents match the old per-call cases: same slots, payloads, wrong-format tables. The "wrong FLOAT4 format" case still expects an all-sentinel result (`written_offsets=()`), same as before. - Shader mutations still run one by one with the first-mismatch word check, so they still guard the lowering. - `check_references` gets an opt-in `allow_hardware_skip`, so the hardware exit 77 is kept. The other caller ignores the new return value, so it is unaffected. - `docs/experiments.md` text matches the code. No other open or merged PR covers this slice (#2615 and #2635 are the sibling batching changes it follows). Commands run (Linux): - `git diff --check origin/main...HEAD`: clean - `python3 tests/docs_links_check.py`: pass - `python3 tests/bidi_controls_check.py`: pass - `python3 -m py_compile` on both touched tests: ok No findings. The Windows WARP run is still to come (no renderer on Linux). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 01:02:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:44:54Z.


Win2025 WARP receipt for head 799a37cc after updating with main.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 799a37cccba40b644647b2bf977ecfac68a6538a:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev -- -j 2): 0.00s (configure 0.00s)
    • Test (ctest --preset dev -R '^compute_(heap_store|store_aot_heap_view_store|load_format|store_aot_load_format)' --parallel 6 --no-tests=error --output-on-failure): 4/4 passed (3.93s: compute_heap_store_controls 0.52s, compute_load_format_controls 0.53s, compute_store_aot_heap_view_store_hardware 3.78s, compute_store_aot_heap_view_store_warp 3.81s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release -- -j 2): 0.00s (configure 0.00s)
    • Test (ctest --preset release -R '^compute_(heap_store|store_aot_heap_view_store|load_format|store_aot_load_format)' --parallel 6 --no-tests=error --output-on-failure): 4/4 passed (3.86s: compute_heap_store_controls 0.51s, compute_load_format_controls 0.53s, compute_store_aot_heap_view_store_warp 3.72s, compute_store_aot_heap_view_store_hardware 3.74s)
  • Windows Python checks: tests/compute_heap_store_check.py ok (0.5s), tests/compute_heap_view_check.py ok (0.5s), tests/compute_load_format_check.py ok (0.5s)
  • Wall: 13.3s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179073800 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2654#issuecomment-7179073800). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:44:54Z. --- Win2025 WARP receipt for head 799a37cc after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `799a37cccba40b644647b2bf977ecfac68a6538a`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev -- -j 2`): `0.00s` (configure `0.00s`) - Test (`ctest --preset dev -R '^compute_(heap_store|store_aot_heap_view_store|load_format|store_aot_load_format)' --parallel 6 --no-tests=error --output-on-failure`): **4/4 passed** (`3.93s`: `compute_heap_store_controls` `0.52s`, `compute_load_format_controls` `0.53s`, `compute_store_aot_heap_view_store_hardware` `3.78s`, `compute_store_aot_heap_view_store_warp` `3.81s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release -- -j 2`): `0.00s` (configure `0.00s`) - Test (`ctest --preset release -R '^compute_(heap_store|store_aot_heap_view_store|load_format|store_aot_load_format)' --parallel 6 --no-tests=error --output-on-failure`): **4/4 passed** (`3.86s`: `compute_heap_store_controls` `0.51s`, `compute_load_format_controls` `0.53s`, `compute_store_aot_heap_view_store_warp` `3.72s`, `compute_store_aot_heap_view_store_hardware` `3.74s`) - **Windows Python checks**: `tests/compute_heap_store_check.py` ok (`0.5s`), `tests/compute_heap_view_check.py` ok (`0.5s`), `tests/compute_load_format_check.py` ok (`0.5s`) - Wall: `13.3s` 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!2646
No description provided.