gpu: replace offscreen_check dispatch chain with capability table #679
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/685"
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 Ammmae0x on 2026-11-22T19:59:18Z.
Change
Fixes #166. Merged
upstream/main(787ace7) cleanly intogpu/offscreen-capability-table, integrating--spirv-compare-sampler(kGateSm66CompareSampler) and updating--spirv-sampler-viewstokGateSm60SamplerViews(SM 6.0) to matchupstream/main.Replaces the ad-hoc
if/elseoperation dispatch chain and implicitbool -> 77skip convention intests/offscreen_check.cppwith a declarative operation capability table and explicit outcome types:AdapterCaps/query_adapter_caps): Queries D3D12 shader model (up to 6.6),Int64ShaderOps,WaveOps, and native wave lane range once per device while preserving existingshader_model_capped_at_6_0,shader_model_capped_at_6_5, andnative_lane_range=... shader_model_capped_at_6_6=...stdout diagnostics.OutcomeKind/OperationResult): Separatespass,skip, andfailso handlers cannot implicitly turn arbitrary failures into exit77. Only the runner (run_operation_spec) maps unmet gates orOutcomeKind::skipto exit77,OutcomeKind::pass(with zero D3D12 debug errors) to exit0, andOutcomeKind::failor thrown exceptions to exit1.OperationSpec/kOperations/resolve_cli): Declares argument arity bounds, optional flag predicates (--check-pixel,--mesh-entry,--mesh-entry-table,--compute-mesh-texture), and staticCapabilityGateprerequisites for all 56--*operations, plus positionaldraw(argc == 3 || argc == 5). Invalid commands, argument counts, and flags fail with exit2(Unknown GPU operation or invalid arguments: ...) before creating a D3D12 device or output image.offscreen_capability_table_self_test(offscreen_check --self-test) inCMakeLists.txtverifying CLI validation (exit2, including--spirv-sampler-viewsand--spirv-compare-samplerarity bounds), unmetCapabilityGateskipping with named reason and without invoking the handler (exit77), and handlerOutcomeKind::fail/ thrown exception exiting1(never77).tests/offscreen_invalid_operation.cmakewith invalid--check-pixelflag and invalid positionaldrawarity checks (confirming exit2and no output image created).Verification
9c05e76f0bcf8221ca84ae4af48b0ec5bebd750b(mergedupstream/mainat787ace7)26100.7623), MSVC (tools/dev.ps1),debug_layer=unavailableIntel(R) UHD Graphics(vendor=8086 device=a7a8), driver32.0.101.6314, native lane range16..16,dxr_tier=0Microsoft Basic Render Driver(vendor=1414 device=008c), driver10.0.26100.7309, native lane range4..4,dxr_tier=11Commands run:
Observed results:
dev(Debug) andrelease(/O2)offscreen_checkbuilds completed with 0 errors and 0 compiler warnings.devCTest (6.24s): 53 passed, 9 skipped (exit 77), 1 failed out of 63 (ffx_immediate_float_to_int_warp,ffx_float_to_int_warp,ffx_pass26_lds_warp, andoffscreen_capability_table_self_testincluded).releaseCTest (4.92s): 53 passed, 9 skipped (exit 77), 1 failed out of 63 (same pass/skip/fail breakdown).dxr_query_hardware,dxr_pipeline_hardware,dxr_update_hardware,dxr_facing_hardware,dxr_opacity_hardware,bvh_differential_hardware(dxr_tier=0onIntel(R) UHD Graphics),bvh_wave64_hardware(16-lane adapter),bvh_wave64_warp, andwave_shuffle_warp(4-lane WARP adapter).gpu_alias_lookup_writes_hardwareexited1onIntel(R) UHD Graphics(array_atomics threads=256 buffers=4 expected=64 actual=256,192,128,64:InterlockedAddthrough a per-thread index into a UAV array is not applied once per thread on this Intel driver;gpu_alias_lookup_writes_warppassed). Confirming this exits1rather than being swallowed as exit77validates theOutcomeKind::failseparation.tools/gpu-check/Run-GpuCheck.ps1against releaseoffscreen_check.exe:-Backend warp: 10 PASS, 1 SKIP (bvh_wave64_warp), 0 FAIL (exit0).-Backend hardware(Intel(R) UHD Graphics): 7 PASS, 4 SKIP (bvh_wave64_hardware,bvh_differential_hardware,dxr_pipeline_hardware,dxr_update_hardware), 0 FAIL (exit0).tests/bidi_controls_check.py: passed (Checked 604 tracked source, script and build/CI files: no bidirectional controls.).spirv_*CTests (spirv_sampler_views_*,spirv_compare_sampler_*,spirv_address_window_*,spirv_ballot_extract_*) were not configured becauseSPIRV_WINDOW_AS/SPIRV_WINDOW_VAL/SPIRV_WINDOW_CROSS(spirv-as,spirv-val,spirv-cross) are not installed;--spirv-sampler-viewsand--spirv-compare-samplerCLI validation were verified inoffscreen_capability_table_self_test.Evidence and follow-up
tests/offscreen_check.cppplus test-only self-test and negative-control additions inCMakeLists.txtandtests/offscreen_invalid_operation.cmake; no new external fixtures, no public capability or build requirement changes.Checklist
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-22T22:16:19Z.
Coordination note for #166: @lambirou claimed this issue on 2026-11-21 and proposed a table/handler split, which raulmoracode agreed with. The maintainer had asked for a lead design decision first. I found no open or merged PR from that claim. It may be worth confirming that no parallel branch exists, and whether this PR follows the agreed split: the table owns argument shapes and unconditional prerequisites, and handlers own scenario-dependent checks.
I'll run the before/after skip and pass comparison on a Quadro M1000M, an Intel HD 530 and WARP once a build finishes. The change moves where exit 77 is decided, so adapters without DXR or wave64 are a useful check.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-22T22:20:32Z.
Before/after comparison as announced:
mainat6f48648vs this PR at2401185. Each was built with thedevpreset on Windows 11 26100.9168, MSVC 19.52.37029, with the debug layer not installed. For each adapter I ranctest --preset dev --no-tests=error -R '^(bvh_|dxr_|wave_|offscreen_|compute_root|compute_tables|dual_uav|texture_mips)'withXBOX2WINDOWS_ADAPTERset.mainoffscreen_capability_table_self_test(passed)offscreen_capability_table_self_test(passed)Every one of the 44 existing tests keeps the same outcome on both adapters: no pass became a skip or failure, and no skip became a pass. On these capability-limited adapters, moving the exit-77 decision into the table preserves the current skips.
Skipped with this PR on the Quadro:
42 - dxr_query_hardware (Skipped) 43 - dxr_pipeline_hardware (Skipped) 44 - dxr_update_hardware (Skipped) 45 - dxr_facing_hardware (Skipped) 46 - dxr_opacity_hardware (Skipped) 55 - bvh_wave64_hardware (Skipped) 57 - bvh_differential_hardware (Skipped) 81 - bvh_wave64_warp (Skipped) 87 - wave_shuffle_warp (Skipped) bvh_differential_hardware bvh_wave64_hardware bvh_wave64_warp dxr_facing_hardware dxr_opacity_hardware dxr_pipeline_hardware dxr_query_hardware dxr_update_hardware wave_shuffle_warpSkipped with this PR on the Intel adapter:
42 - dxr_query_hardware (Skipped) 43 - dxr_pipeline_hardware (Skipped) 44 - dxr_update_hardware (Skipped) 45 - dxr_facing_hardware (Skipped) 46 - dxr_opacity_hardware (Skipped) 55 - bvh_wave64_hardware (Skipped) 57 - bvh_differential_hardware (Skipped) 61 - wave_shuffle_hardware (Skipped) 81 - bvh_wave64_warp (Skipped) 87 - wave_shuffle_warp (Skipped) bvh_differential_hardware bvh_wave64_hardware bvh_wave64_warp dxr_facing_hardware dxr_opacity_hardware dxr_pipeline_hardware dxr_query_hardware dxr_update_hardware wave_shuffle_hardware wave_shuffle_warpAI-assisted: run and compared with Claude Code; outputs from the local ctest logs.
Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-22T22:59:44Z.
Thanks @legacy-code-archaeologist for the coordination note and for running the before/after comparison on the Quadro M1000M and Intel HD Graphics 530!
kOperations(OperationSpec),resolve_cli, andevaluate_gateown static argument shapes/flag validation (exit2before device creation) and unconditional adapter prerequisites viaCapabilityGate(exit77without invoking the handler).E_NOTIMPL, and forced wave width support) and return explicitOperationResult(pass,skip,fail) so onlyOutcomeKind::skipmaps to exit77, while failures and thrown exceptions always exit1.upstream/main(9c05e76): Mergedupstream/main(787ace7) cleanly, integrating--spirv-compare-sampler(kGateSm66CompareSampler) and updating--spirv-sampler-viewstokGateSm60SamplerViews(SM 6.0) in the 56-operationkOperationstable and--self-testchecks.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T23:24:38Z.
Before/after check on a DXR-capable RTX, using the merged base
787ace7c2c692dcc766e150d2d8011c6752ad756and PR head9c05e76f0bcf8221ca84ae4af48b0ec5bebd750b. Windows 10 22H2 build19045.6466, MSVC19.44.35230, Windows SDK10.0.26100.0, DXC1.8.2502.11, Debug with/MTd. The D3D12 debug layer was unavailable.I compared JUnit outcomes by test name. All 19 shared tests kept their outcomes (10 passes, 9 capability skips, zero failures). The PR’s new
offscreen_capability_table_self_testalso passed.10de:2414), driver621.24(32.0.16.2124via DXGI). The five DXR tests andbvh_differential_hardwarepassed on both commits (dxr_tier=20).bvh_wave64_hardwareskipped on both (native lanes32..32). The alias-write test matched all 147,456 words on both.1414:008c), driver10.0.19041.5794. Offscreen rendering passed on both. Its five DXR, two differential BVH and wave64 tests kept their capability skips (dxr_tier=0, lanes4..4). The invalid-operation CTest passed on both.AI-assisted. All reported tests ran locally.