tests: reuse the compute pipeline across descriptor-format references #2607
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2615"
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 RavenCurseBurg on 2026-11-25T23:24:29Z.
Change
Refs #448. The descriptor-format readback fixture now makes 12 renderer launches instead of 32. Seven matching references and fourteen intentionally wrong references share one device, root signature and compute pipeline. Each case still creates fresh resources, fills the UAV with its sentinel, dispatches, waits for the fence and compares all 320 words. The eleven independently compiled shader mutations retain their individual renderer processes.
The new test-runner command is
offscreen_check <adapter> --compute-store-batch <shader.cso> <case.bin>.... It uses the existing batch loop to report a status and D3D12 debug messages for each input. A wrong word reportsmismatch. An invalid reference, debug-layer error or removed device reportserror. The Python check associates each result with its fixture label and checks the first wrong word. Fixture instructionsVerification
cmake --build --preset release --target offscreen_check, followed byctest --preset release --no-tests=error -V -R '^compute_store_aot_descriptor_load_format_warp$'. On Windows Server 2025 with the debug layer the six-worker baseline took 26.74, 26.70 and 26.70 s. This PR took 14.77, 14.75 and 14.77 s on the same runner, a 44.7% reduction in the median. All 11 Release CTests passed, including the capability table, pixel batch debug, removal and pairs controls, both compute root layouts, the normalized BVH root, and the image load, store and MSAA paths. Full commands and output at c0cd0bfe03c8d10ctook 22.736 → 14.859 s on WARP, 16.343 → 11.220 s on an RTX 4060 and 22.720 → 15.311 s on an Intel UHD 770. These are medians of three interleaved timed runs per side after a warm-up, using the same executable. A separate device-only experiment was slower on all three. Baselines, drivers, hosted timings and procedurepython -B tests/compute_load_format_check.py draw <dxc.exe> <offscreen_check.exe> hardwarewithXBOX2WINDOWS_ADAPTERset to the adapter name. On each of the three desktop adapters I compared the single-case and batch runs, including the 32 binary input files, 12 HLSL/DXIL pairs, individual statuses, mismatch counts and first-word diagnostics. The complete fixture reported seven matching dispatches, fourteen wrong references and eleven detected shader mutations.Evidence and follow-up
A one-byte reference between two valid cases gave
pass/error/passand exit 1 on all three adapters. The debug-layer control attributed an injected error to its own case. CallingID3D12Device5::RemoveDevicefailed that case and the following case. Debug-layer runThe fixture uses the existing source-generated compute shader and references. This PR changes no production code. AI-assisted with Codex (GPT-6.2 Astra, xhigh).
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:30:56Z.
Review: COMMENTED
Review of head
d4e9efa5(PR head after updating with main), against origin/main. Comment review.Checked:
tests/compute_check.cpp,tests/offscreen_check.cpp,tests/desktop_gpu.h,tests/compute_load_format_check.py, one doc note).create_compute_program/ComputeReadbackProgramhoist only root signature and pipeline creation. Each case still creates its own input, output and readback resources and fence, so cases stay independent. The other callers (check_compute_file, texture and sized-view paths) build one program per call, as before.read_store_referenceandread_compute_shaderare straight extractions; the validation order and error texts match the old inline code.read_texture_shaderis folded into the shared reader.ReadbackMismatchis a new base ofPixelMismatch, so the existing pixel batch still catches it; compute mismatches reportmismatch, other failures reporterror.--compute-store-batchreuses the existing batch loop; the program is created lazily on the first case, and a creation failure is reported aserrorfor that case.mismatch) and the 11 separately compiled shader mutations, so the negative controls are kept.Commands run locally on a worktree at the exact head:
python3 -I -m py_compile tests/compute_load_format_check.py: ok.python3 tests/docs_links_check.py: ok.python3 tests/bidi_controls_check.py: ok.git diff --check origin/main...HEAD: clean.Not verified in this review: the C++ build and the D3D12 run (needs Windows); the Windows run is done separately. The reported 44.7% speed-up is the author's own measurement.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:37:03Z.
Win2025 WARP receipt for head
d4e9efa5after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
d4e9efa560e322d928bd5e34bdd5f79af24e2895:--preset dev):cmake --build --preset dev --target cpu_placed_dxr_provider cpu_shim_draw d3d12x_compute_list_check d3d12x_desktop_gpu_obj d3d12x_graphics_list_check offscreen_check rcas_coordinate_readback startup_dump_fence_check startup_indirect_dispatch startup_indirect_draw_indexed startup_list_queries startup_nv12_draw startup_plane_refresh xmem_section_lease_check -- -j 2):3.75s(configure0.00s)ctest --preset dev -R '^(compute_store_aot|compute_(root|tables)|check_pixel|image_(load|store)|msaa)[a-z0-9_]*_warp$|^compute_(root|tables)$' --parallel 4 --no-tests=error --output-on-failure): 82/82 passed (46.69s:compute_store_aot_guard_read_warp7.70s,compute_store_aot_heap_view_load_warp9.64s,compute_store_aot_heap_view_store_warp11.23s,compute_store_aot_descriptor_load_format_warp11.67s,compute_store_aot_lds_qword_warp5.76s,compute_store_aot_lds_arithmetic_warp4.98s,compute_store_aot_mimg_mip_warp3.71s,compute_store_aot_mimg_load_warp3.78s,compute_store_aot_warp3.95s,compute_store_aot_mimg_packed_warp2.86s,compute_store_aot_lds_private_warp3.73s,compute_store_aot_lds_f32_warp3.53s,compute_store_aot_lds_replacement_warp2.62s,compute_store_aot_mimg_atomic_counter_warp2.01s,compute_store_aot_mubuf_reduction_x2_warp2.44s,compute_store_aot_lds_packed_warp2.60s,compute_store_aot_mtbuf_store_warp2.41s,compute_store_aot_mimg_store_packed_warp2.24s,compute_store_aot_mimg_store_warp2.20s,compute_store_aot_mubuf_reduction_warp2.38s,compute_store_aot_mubuf_d16_warp1.99s,compute_store_aot_lane_mask_warp2.31s,compute_store_aot_mubuf_store_format_warp2.04s,compute_store_aot_mtbuf_load_warp2.22s,compute_store_aot_mimg_atomic_float_warp1.97s,compute_store_aot_mimg_resinfo_warp1.91s,compute_store_aot_f32_warp1.92s,compute_store_aot_mubuf_store_subword_warp1.78s,compute_store_aot_descriptor_store_format_warp1.77s,compute_store_aot_lds_wide_replacement_warp1.82s,compute_store_aot_alu_lane_gaps_warp1.83s,compute_store_aot_gfx1013_image_atomics_warp2.01s,compute_store_aot_vcmp_select_warp2.24s,compute_store_aot_mubuf_subword_warp1.80s,compute_store_aot_scratch_base_warp1.64s,compute_store_aot_mimg_atomic_minmax_warp1.59s,compute_store_aot_mbcnt_warp1.49s,compute_store_aot_bcnt_exec_warp1.39s,compute_store_aot_ff1_scalar_warp1.48s,compute_store_aot_lds_strided_warp1.75s,compute_store_aot_sub_co_warp1.42s,compute_store_aot_cvt_u32_f32_warp1.40s,compute_store_aot_mimg_atomic_integer_warp1.70s,compute_store_aot_writelane_warp1.50s,compute_store_aot_add_co_warp1.33s,compute_store_aot_vadd_nc_i32_warp1.44s,compute_store_aot_mubuf_format_warp1.57s,compute_store_aot_mubuf_load_format_d16_warp1.63s,compute_store_aot_ff1_exec_warp1.28s,compute_store_aot_salu_i32_warp1.45s,compute_store_aot_alu_xor3_warp1.99s,compute_store_aot_dot_u_warp1.40s,compute_store_aot_alu_minmax3_warp1.89s,compute_store_aot_bfe_warp1.36s,compute_store_aot_readlane_warp1.13s,compute_store_aot_salu_absdiff_warp1.41s,compute_store_aot_mubuf_exchange_warp1.38s,compute_store_aot_alu_bcnt_warp2.03s,compute_store_aot_mubuf_csub_warp1.23s,compute_store_aot_alu_mad_i24_warp1.55s,compute_store_aot_alu_cvt_pk_u8_warp1.88s,compute_store_aot_mubuf_vector_warp1.39s,compute_store_aot_gfx1013_gather4_l_warp1.81s,compute_store_aot_mubuf_counter_warp1.17s,compute_store_aot_mac_f32_warp1.37s,compute_store_aot_ds_route_warp1.28s,compute_store_aot_alu_med3_warp1.55s,compute_store_aot_mimg_atomic_exchange_warp1.21s,compute_store_aot_dpp_warp1.07s,compute_store_aot_mubuf_store_format_xyz_warp1.21s,compute_store_aot_mimg_msaa_warp1.27s,compute_store_aot_gfx1013_image_store_warp1.08s,compute_store_aot_gfx1013_buffer_atomics_warp1.43s,compute_store_aot_gfx1013_image_store_d16_warp1.02s,compute_store_aot_desc_numeric_warp1.30s,compute_store_aot_gfx1013_image_uav_load_warp0.89s,compute_store_aot_gfx1013_image_store_layers_warp1.13s,compute_tables_warp0.06s,compute_root_warp0.06s,compute_store_aot_dpp_row_shr_warp1.11s,compute_store_aot_mubuf_float_warp2.16s,compute_store_aot_gfx1013_image_store_1d_warp1.04s)/O2(--preset release):cmake --build --preset release --target cpu_placed_dxr_provider cpu_shim_draw d3d12x_compute_list_check d3d12x_desktop_gpu_obj d3d12x_graphics_list_check offscreen_check rcas_coordinate_readback startup_dump_fence_check startup_indirect_dispatch startup_indirect_draw_indexed startup_list_queries startup_nv12_draw startup_plane_refresh xmem_section_lease_check -- -j 2):77.70s(configure0.00s)ctest --preset release -R '^(compute_store_aot|compute_(root|tables)|check_pixel|image_(load|store)|msaa)[a-z0-9_]*_warp$|^compute_(root|tables)$' --parallel 4 --no-tests=error --output-on-failure): 82/82 passed (42.93s:compute_store_aot_guard_read_warp5.53s,compute_store_aot_heap_view_load_warp7.27s,compute_store_aot_heap_view_store_warp8.41s,compute_store_aot_descriptor_load_format_warp9.42s,compute_store_aot_lds_qword_warp4.74s,compute_store_aot_lds_arithmetic_warp4.13s,compute_store_aot_lds_private_warp3.12s,compute_store_aot_mimg_mip_warp3.01s,compute_store_aot_mimg_load_warp2.98s,compute_store_aot_lds_f32_warp2.80s,compute_store_aot_warp3.24s,compute_store_aot_mimg_packed_warp2.40s,compute_store_aot_mimg_store_packed_warp1.79s,compute_store_aot_mubuf_reduction_x2_warp2.17s,compute_store_aot_mtbuf_load_warp2.10s,compute_store_aot_mimg_atomic_counter_warp1.94s,compute_store_aot_lds_replacement_warp2.38s,compute_store_aot_mubuf_reduction_warp2.02s,compute_store_aot_mubuf_subword_warp1.41s,compute_store_aot_mtbuf_store_warp1.79s,compute_store_aot_lds_packed_warp2.04s,compute_store_aot_salu_i32_warp1.12s,compute_store_aot_mimg_store_warp1.65s,compute_store_aot_mimg_atomic_float_warp1.49s,compute_store_aot_mubuf_store_format_warp1.59s,compute_store_aot_mimg_atomic_minmax_warp1.30s,compute_store_aot_mimg_resinfo_warp1.44s,compute_store_aot_mubuf_d16_warp1.53s,compute_store_aot_descriptor_store_format_warp1.41s,compute_store_aot_mimg_atomic_integer_warp1.35s,compute_store_aot_mbcnt_warp1.15s,compute_store_aot_cvt_u32_f32_warp1.10s,compute_store_aot_alu_minmax3_warp1.49s,compute_store_aot_bcnt_exec_warp1.03s,compute_store_aot_mubuf_store_subword_warp1.42s,compute_store_aot_f32_warp1.51s,compute_store_aot_lds_wide_replacement_warp1.45s,compute_store_aot_vadd_nc_i32_warp1.12s,compute_store_aot_lane_mask_warp1.99s,compute_store_aot_mubuf_load_format_d16_warp1.29s,compute_store_aot_alu_xor3_warp1.64s,compute_store_aot_lds_strided_warp1.33s,compute_store_aot_bfe_warp1.09s,compute_store_aot_scratch_base_warp1.31s,compute_store_aot_readlane_warp0.98s,compute_store_aot_mubuf_format_warp1.37s,compute_store_aot_alu_cvt_pk_u8_warp1.60s,compute_store_aot_ff1_scalar_warp1.20s,compute_store_aot_mubuf_exchange_warp1.13s,compute_store_aot_mubuf_csub_warp0.91s,compute_store_aot_dot_u_warp1.09s,compute_store_aot_writelane_warp1.16s,compute_store_aot_alu_bcnt_warp1.65s,compute_store_aot_ff1_exec_warp1.09s,compute_store_aot_mubuf_counter_warp1.15s,compute_store_aot_mubuf_vector_warp1.32s,compute_store_aot_add_co_warp1.19s,compute_store_aot_sub_co_warp1.26s,compute_store_aot_mimg_atomic_exchange_warp1.18s,compute_store_aot_mubuf_store_format_xyz_warp1.05s,compute_store_aot_dpp_warp1.26s,compute_store_aot_mimg_msaa_warp1.36s,compute_store_aot_ds_route_warp1.40s,compute_store_aot_alu_med3_warp1.64s,compute_store_aot_alu_mad_i24_warp1.46s,compute_store_aot_gfx1013_image_store_warp0.90s,compute_store_aot_salu_absdiff_warp1.22s,compute_store_aot_gfx1013_image_atomics_warp1.99s,compute_store_aot_mac_f32_warp2.61s,compute_store_aot_desc_numeric_warp5.14s,compute_store_aot_gfx1013_image_store_layers_warp3.01s,compute_store_aot_vcmp_select_warp6.02s,compute_store_aot_alu_lane_gaps_warp5.07s,compute_store_aot_gfx1013_image_store_d16_warp0.97s,compute_tables_warp0.05s,compute_root_warp0.04s,compute_store_aot_gfx1013_image_uav_load_warp1.07s,compute_store_aot_gfx1013_gather4_l_warp1.80s,compute_store_aot_gfx1013_buffer_atomics_warp1.42s,compute_store_aot_dpp_row_shr_warp1.18s,compute_store_aot_gfx1013_image_store_1d_warp0.83s,compute_store_aot_mubuf_float_warp1.62s)tests/compute_heap_view_check.pyok (0.5s),tests/compute_load_format_check.pyok (0.6s)sccache: 91/158 hits; wall130.6sAI-assisted; commands listed were executed locally.
upstream-sync referenced this pull request2026-11-26 05:02:29 +00:00