Without pipelineStatisticsQuery the test never records or closes its two
statistics lists, but it handed them to execute(), which returns list_open.
The lists are now left out there. --no-statistics runs the test as such a
device does, and the new ctest entry vk_overlapping_occlusion_no_statistics
uses it, so the path is run on devices that have the feature.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A queue's ExecuteCommandLists is replayed against one LayoutTracker in call order, so a batch that waits (cross-queue) for a Signal submitted later was
recorded against layouts from before the work it waits for. Track, per fence, the highest Signal value submitted (CPU Signal and the creation value
count); a queue holds a batch, and what follows it, while a Wait names a higher value, and the thread that submits the satisfying Signal releases the
held work in dependency order on its own VkQueue. Reports a queue destroyed with held work and a fence released under a waiter; nothing blocks.
Adds d3d12_queue_handover_test (27 queue-type assignments x 6 submission orders, two producers, CPU Signal cases, never-signaled and released fences,
byte-exact against the host runtime) and updates docs section 4.4 and the M4 row. Two existing tests that used an unsignaled Wait as a GPU gate or
expected a synchronous submit failure under a pending Wait now declare the Signal first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D3D12 only forbids beginning the same query element twice while it runs, so a
command list may overlap two pipeline-statistics queries, or an ordinary
occlusion query and a binary one, on different slots of one heap. The replay
refused all of those with ReplayResult::unsupported. The overlapping-ordinary
occlusion machinery already virtualizes concurrent queries as non-overlapping
physical segments whose results are summed; this extends it to the remaining
cases:
- Binary occlusion joins the ordinary kind in the same physical pool (both are
VK_QUERY_TYPE_OCCLUSION, so one physical query is open at a time and the
shared intersection interval is counted by both logical queries). A binary
resolve of a multi-segment query sums its segments and normalizes the total
to 0/1 (OcclusionResolve::sum_binary; run flag needs_sum_binary).
- Overlapping pipeline-statistics queries split into the statistics pool with
the same one-slot-per-event layout (plan_overlapping_statistics_segments);
every non-timestamp resolve while a query runs closes and reopens the open
segment for D3D-162's helper-dispatch exclusion. The single-list replay()
helper still has no segment pool and refuses such lists outright instead of
running two Vulkan queries of one type whole.
The device test's old pin of the occlusion+binary refusal now expects a
replay; vk_overlapping_occlusion adds crossing statistics queries checked
word-by-word against three unsplit references and an ordinary query around a
binary one; replay_query_predication pins the segment layouts, the composite
binary resolve and the helper's refusal without a GPU. docs/d3d12_vulkan.md
4.6 moves the case out of "Not implemented yet".
AI-assisted: yes
main took db421e6f (the bisect mode) and D3D-162's statistics segments, which
conflicted with this branch in vulkan_replay.h, d3d12_vulkan.md and the test.
The 8060S retest on driver 26.11.2 (#1540) failed 7690b647 3/3: the earlier
c8ea00e4 passes were not reproducible, and a TDR also breaks unrelated tests
until the GPU recovers. With no evidence that the pause helps, vulkan_replay.h
and d3d12_vulkan.md are main's, and the branch keeps only the diagnostics:
--no-draw, --no-resolve, the active phase, the single-query resolve case, and
a lost-device check that now reads is_device_lost() and the gate semaphore
(main removed VulkanContext::retire_timeline). The draw schedule follows main's
statistics lists, then replace and the single case.
After upgrading the Radeon 8060S from AMD driver 26.10.1 to 26.11.2 (#1540),
vk_overlapping_occlusion still times out on main, and c8ea00e4 with the pause
passes every run (--bisect, --gated, the full test, and under validation) in
about 0.1 s. The earlier "every phase hangs" retest was a broader occlusion
bug in 26.10.1 that 26.11.2 fixed, so the revert in 3784aacc is undone.
The comment and docs now cite the 26.11.2 measurement. --no-draw and
--no-resolve stay; the crossing and single schedules match the split again.
The 8060S retest of c8ea00e4 (#1540) loses the device in every phase that runs
a hardware occlusion query, including nested and binary, which never resolve
inside an active query, and active with the pause applied. Only unwritten, with
no hardware query, passes. So the resolve-while-active rule did not fix it;
vulkan_replay.h and docs/d3d12_vulkan.md go back to main.
Every hanging phase both draws inside a query (an attachmentless rendering
scope inside a query begun outside rendering) and resolves through the copy
and compute helpers. --no-draw leaves every query empty and --no-resolve never
copies or sums results, so the four combinations tell the two apart. The
bisect run prints which switches are on.
The resolve inside one active query stays in the default run and as the
"active" phase; the crossing schedule is back to three segment ends.
The Radeon 8060S on AMD's Windows driver times out (TDR) on the crossing
pattern of vk_overlapping_occlusion: a resolve recorded while an ordinary
occlusion query is active, so vkCmdCopyQueryPoolResults with WAIT_BIT and the
summing dispatch run while a query of the same pool is active (#1540, found
with --bisect). Validation reports nothing before the hang.
A resolve while a physical segment is active now ends that segment before the
resolve and begins the next one after it; the logical query's range spans one
more segment, so results are unchanged. A list that resolves inside a single
active query takes the segment path too when the device can sum.
The test adds a resolve inside one active query (default run and the new
"active" bisect phase), gives the crossing schedule the extra segment end, and
--bisect now detects a lost device by the queue timeline reading UINT64_MAX,
since vkQueueWaitIdle succeeds after the reset on that driver.
The test hangs the GPU (TDR) on an AMD Radeon 8060S on Windows (#1540) and
passes everywhere else. --bisect runs its seven query patterns (crossing,
nested, unwritten, binary, predicated, chunked, replace) one per submission
and waits for each, printing the phase before it runs, so the last line before
a hang or a lost device names the pattern. --gated queues them all behind one
CPU-signalled semaphore as the full test does; named phases run only those.
Without --bisect the test is unchanged.
Replay refused binary occlusion resolves, and ordinary resolves that need a sum, while a pipeline-statistics
query was active: their compute helper would count in the application's CSInvocations.
A statistics query that contains a resolve (other than a timestamp copy) is now split. Its counters go to
physical PIPELINE_STATISTICS segments in a pool of the submission's own (flags 0x7ff, as the device creates
the heap). A segment ends before each such resolve and the next begins after it, so no helper dispatch runs
inside the application's query. The query's result is the sum of its segments: a new 11-counter compute shader
(statistics_sum.comp, encoded in statistics_sum_spirv.h like the occlusion helpers) adds them on the
occlusion-resolve scratch buffer. That sum is a helper dispatch too, and is kept out of any statistics query
still running by the same split. Whether a resolve dispatches is only known when the list is planned against
the heaps, so every such resolve splits the query.
The single-list replay() has no segment pool. It keeps refusing a resolve that dispatches inside statistics,
and now allows a binary resolve that only writes zeros. SetPredication and predicated copies are still refused
while statistics are active.
Tests, all with the Khronos validation layer on:
- vk_binary_occlusion: a binary resolve inside one statistics query, then the statistics sum of that query
inside a second one. Every counter of both is 0. With the split disabled, CSInvocations reads 64.
- vk_overlapping_occlusion: a 261-segment occlusion sum inside a statistics query, with a native draw in each
segment. The split query, and a second one split around the statistics sum, equal two unsplit queries with the
same draws on every counter, and CSInvocations is 0.
- replay_query_predication (CPU): the exact begin/end/dispatch order of a split query, and the refusal without a
segment pool.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verify compute and transfer readback-stage collection, descriptor cleanup after failed submits and gated/reused batches. Extend binary and overlapping occlusion fixtures with independent destinations to check skipped-copy preservation and copying after predicate reset. Document the command-slot lifetime and queue integration.
Local RX 5700 XT validation: 180 exact WARP comparisons, 64 gated/reused copy submissions, both occlusion controls, 192 predicate captures, replay A-G and 1663 existing WARP readbacks passed. CTest: 59/60 active tests passed; the six stencil CopyResource mismatch reports exactly match the tested #856 baseline. Shader source and embedded SPIR-V match after Vulkan 1.2 validation.