Repository navigation
Description
Running the xtp-gpu tests on WARP with the D3D12 debug layer (XTP_TEST_ADAPTER=warp XTP_D3D12_DEBUG=1 cargo test -p xtp-gpu --features diagnostics --locked -- --test-threads=1, as the CI step from #33 does) shows three kinds of errors in XTP's own recording and submission. They are invalid D3D12 usage, which the issue behind #33 notes can hang an NVIDIA GPU. The tests below pass their functional checks and tolerate only these message ids through testgpu::known_layer_errors, pointing here. Remove each allowance once its cause is fixed.
1. Root signature set before a sampler (or view) heap is bound (message id 1419)
SetDescriptorHeaps must be called to bind a sampler descriptor before setting a root signature with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED flag.
Pipelines' root signatures carry SAMPLER_HEAP_DIRECTLY_INDEXED, but when the title binds no sampler heap, draw::State::wanted_heaps / set_host_heaps bind only a view heap (or none), then bind sets the root signature. The same happens with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED when no view heap is bound. A fix could keep an XTP-owned sampler heap, like descriptor::OWN_VIEW_HEAP, and bind it whenever the root signature indexes heaps the title has not bound. Some test helpers that set a root signature after binding only a view heap need the same.
Tests: descriptor::host::tests::a_translated_program_reads_and_writes_through_the_heaps_table, draw::tests::copied_root_srvs_see_what_the_list_wrote_before, draw::tests::lists_without_a_view_heap_use_xtps_own, draw::tests::root_cbvs_read_inside_memory_the_list_holds, draw::tests::root_srv_tables_read_their_range, pipeline::host::tests::r8_uint_pipeline_writes_the_pixel_shader_value_unblended, pipeline::host::tests::wave64_compute_for_a_forced_32_lane_target.
2. A buffer copied from while in COPY_DEST (message id 538)
CopyBufferRegion: Resource state (D3D12_RESOURCE_STATE_COPY_DEST) of resource (subresource: 0) is invalid for use as a source buffer. Expected State Bits (all): D3D12_RESOURCE_STATE_COPY_SOURCE
Test: list::tests::gpu::resource_and_memory_copies_run_on_the_gpu. Find whether the missing transition is in the title-copy translation in list.rs or only in the test's setup.
3. One command list executed twice before its first execution finished (message id 553)
ID3D12CommandQueue1::ExecuteCommandLists: Failed to execute a command list because the command queue fence has not advanced past previous executions of the command list.
Test: texture::tests::a_list_named_twice_in_a_submission_copies passes the same host list twice to Host::execute. A title may name one list twice in a submission; D3D12 does not allow it. XTP's submission should split such a submission at the repeat, or record a copy of the list, and the test should then raise no error.
No game files are needed for any of these.
Activity
ci, gpu, docs: run the WARP GPU tests under the D3D12 debug layer
ci, gpu, docs: run the WARP GPU tests under the D3D12 debug layer
ci, gpu, docs: run the WARP GPU tests under the D3D12 debug layer
fogydes commentedon Nov 25, 2026
I'm taking this, one PR per error: first 1419 (root signature set before a sampler or view heap is bound), then 553 and 538. The fixes stack on #46, which brings the debug-layer harness that checks them and drops their allowances.
ci, gpu, docs: run the WARP GPU tests under the D3D12 debug layer
gpu: debug-layer guard takes errors when panicking, wider scan
fogydes commentedon Nov 25, 2026
All three fixes are up, each stacked on #46: #49 (1419, both heaps bound before a directly indexed root signature), #50 (538, copies within one buffer go through staging) and #51 (553, a list named again in a submission runs after its first run). Together they leave no #45 allowance under the layer.
gpu: copies within one buffer go through staging (message 538)
gpu: bind both heaps before a directly indexed root signature
gpu: run a list named again in a submission after its first run
gpu: run a list named again in a submission after its first run
gpu: bind both heaps before a directly indexed root signature
gpu: bind both heaps before a directly indexed root signature
gpu, docs: run repeated lists after their previous execution