Repository navigation
retire_tickets: coalesce pending_through per semaphore and guard completed_ monotonicity - #935
Conversation
…leted_ monotonicity
KernelSmoker
left a comment
There was a problem hiding this comment.
Verified on head 9392bbd9e03b88fd4746f51e2fb1e7cd7b0e5b86. The CPU-only regression binary builds with GCC 16 using -std=c++20 -Wall -Wextra -Werror -pedantic and passes; check_no_game_data.py and git diff --check are clean. The per-semaphore maximum is appropriate for the caller: each queue progress timeline is monotonic and global tickets are recorded in order, while idle entries are excluded after successful queue-idle.
ASan/UBSan could not be independently run here: linking fails because this environment lacks /usr/lib64/libasan.so.8.0.0. I therefore make no sanitizer claim. Hosted GitHub checks were still pending when I reviewed.
SweatierKey
left a comment
There was a problem hiding this comment.
Independent verification on Windows 11 against origin/main@a28927849:
- Built
retire_tickets_test.exe(clang-cl+ xwin SDK 10.0.26100) and ran natively on Windows 11:out-of-order queue completion kept the retirement prefix safe(rc=0), exercising per-semaphore max-value coalescing inpending_through()(skipping idle queues and post-cutoff tickets) and monotoniccompleted_clamping.
python3 -I scripts/check_no_game_data.py: clean.
Clean, minimal fix preventing duplicate VkSemaphore entries in vkWaitSemaphores and backward retirement regression.
AI-assisted: yes
|
Reviewed The checked-in The differential suite reproduced the duplicate-semaphore issue on baseline and passed on HEAD. Also verified per-semaphore maximum-value coalescing, out-of-order completion, monotonic retirement, semaphore isolation, and recording new tickets after Full Vulkan |
Testing resultsIndependently tested PR #935 against the baseline on Tested revisions
Test environments
Test configuration
All selected build targets compiled successfully CTest results
All 12 CTest invocations completed with exit code 0. Retire ticketsThe retirement prefix remained safe during The test passed consistently across all repetitions, No retirement-ordering failures were observed. Queue and query synchronizationThe following scenarios completed successfully:
The fault-injection results were consistent across
The reported execution failures and device-loss D3D12 queue waitsBoth Wait-before-Signal scenarios completed
No test failures, hangs or timeouts were observed. Two-queue handoverThe test used a caller-owned Vulkan device with The reported queue availability was 3/3/3 for Results per invocation:
These results were consistent across all repetitions The never-signaled fence scenario also completed
The diagnostic reporting two held operations that Both upload heap configurations were covered:
Vulkan synchronization validationThe synchronization validation self-test produced
The reported Synchronization validation was confirmed to be The validation layers also reported configuration These diagnostics were consistent between BASE No unexpected validation errors or new validation Limitations
ConclusionAll selected tests passed consistently on both The retirement prefix remained safe during No functional regressions, unexpected validation Result: PASS — no regressions detected. AI-assisted log analysis and report preparation. |
Merging. **Why merged:** D3D-CLEAR-DEPTH-RANGE: enables VK_EXT_depth_range_unrestricted where the device has it, so depth clears outside [0,1] (and NaN) behave like D3D12 instead of being clamped. Without the extension it keeps clamping, and NaN becomes 0. Four independent passes; on AMD (660M, 7900 XTX), d3d12_clear still fails only on the NaN rows, which is the driver issue tracked in #307, not this PR. **Why it's good:** On the 4070 SUPER with validation on, main's d3d12_clear_test exits 1 with 4x VUID-VkClearDepthStencilValue-depth-00022. With this PR it exits 0 with no VUIDs, and the 1.5 / -0.5 / NaN clears match WARP. The new d3d12_clear_restricted_depth passes, and so do d3d12_clear and d3d12_clear_formats. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Merging. **Why merged:** VK-SAMPLER-UNNORM-BIAS: an unnormalized-coordinates sampler gets mipLodBias 0, which VUID-VkSamplerCreateInfo-unnormalizedCoordinates-01074 requires. kawaii-shakal ran it under ASan/UBSan and showed the new check fails on main. **Why it's good:** gfx10_descriptors and d3d12_descriptor pass both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
…opy-clear-stage Merging. **Why merged:** OLD-10048: SYNC_COPY maps to COPY|CLEAR, so WriteBufferImmediate (vkCmdUpdateBuffer) and the query zero-fill are ordered before later copies. moffington reproduced the read-after-write hazard on the base, and Timon360SB and SweatierKey checked it independently. Part K of vk_command_replay_test covers it. **Why it's good:** vk_command_replay, d3d12_state_map and replay_query_edges pass both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
|
Merging. Why merged: RT-RETIRE-TICKETS-DEDUP-WAIT: pending_through() merges entries per semaphore to the highest value, and completed_ can no longer move backwards. moffington (ASan/UBSan, with a differential test that fails on the base), Timon360SB, KernelSmoker and SweatierKey checked it independently. Why it's good: retire_tickets passes both plain and under validation. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 3295055, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative: #516, #535, #751, #935 and #662 merged onto main 955d9be. There the repo-consistency set gives 571 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 307/309. The 2 failures are the same pre-existing ones as main (d3d12_execute_indirect_validation, d3d12_depth_resolve), with the same 11 skips. git merge-tree against current main 71f99e2: no conflicts, and none of these touch the files #891/#882 changed. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5). |
Summary
RetireTickets::pending_through(ticket)inruntime/src/retire_tickets.hso multiple pending submissions on the same timeline semaphore collapse to a single(semaphore, max_value)entry instead of passing duplicateVkSemaphorehandles tovkWaitSemaphoresinwait_retire_ticket().completed_inRetireTickets::completed()so a non-monotonic ticket can never move the completed retirement prefix backward.runtime/test/retire_tickets_test.cppwith regression checks for per-semaphore coalescing, idle queue exclusion, cutoff filtering, and monotoniccompleted_.Verification
g++ -std=c++20 -Wall -Wextra -Werror -pedantic -fsanitize=address,undefined -O1 -g runtime/test/retire_tickets_test.cpp -o /tmp/retire_tickets_test && /tmp/retire_tickets_test— pass.main: fails with exit code 5 before the patch and passes cleanly after.python3 -I scripts/check_no_game_data.py runtime/src/retire_tickets.h runtime/test/retire_tickets_test.cpp— clean.Claimed in the coordination issue as: RT-RETIRE-TICKETS-DEDUP-WAIT
AI-assisted: yes (Gemini)