d3d12_xs: no GPU timestamp on a COPY list; depth bounds survive a list cut (RT-XS-LIST-VALUES-COPY-TIMESTAMP-AND-DEPTH-BOUNDS) #2500
Closed
github-bot
wants to merge 1 commit from
github-bot/gh-2500 into main
AGit
pull from: github-bot/gh-2500
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2500
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2500"
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?
@Tyrannys on GitHub · 2026-11-27 19:43 UTC · original
Tyrannys:rt-xs-list-values-copy-timestamp-depth-bounds→main· +115 −1 · 3 files · 1 commits · closed without mergingClaimed in the coordination issue as: RT-XS-LIST-VALUES-COPY-TIMESTAMP-AND-DEPTH-BOUNDS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7226663134)
What and why
Item 3 of @kevincommits' finding in #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7226076494). Thanks for the audit.
COPY-list timestamps.
take_timestamp(d3d12_xs_device.cpp) recordedEndQueryandResolveQueryDataon the device'sD3D12_QUERY_HEAP_TYPE_TIMESTAMPheap for every list that tracks values, and COPY lists track them too. A COPY list needs aCOPY_QUEUE_TIMESTAMPheap: the layer'sCommandQueue::timestamps_fit()refuses the whole COPY submission (invalid_query), and Windows' D3D12 validation flags it. A timestamp write (write64 flag 1 or 2) on a COPY list now takes the CPU's clock when it lands, the fallback the code already has for a device without the heap. DIRECT and COMPUTE lists keep the GPU's timestamp.A separate
COPY_QUEUE_TIMESTAMPheap per device would keep GPU timing on copy lists. That is left for later: it needs a second heap and readback, and the copy queue's clock calibration.Depth bounds across a list cut.
OMSetDepthBoundsX(console slot 70, PC slot 62) was forwarded to the real list but not kept inlist_values::ListState. Any draw after a list cut (a wait after work), and any list afterExecuteBundleof a bundle that set them, went back to D3D12's default[0, 1].ListStatenow records the bounds once the real list has taken them, clears them on Reset like the rest, inherits a bundle's, and replays them after a cut (through slot 62 of the new real list, which is the same kind of list).Overlap: #2484 (
RT-XS-LATE-RELAY, list values) touches the same three files on other lines;git merge-treefinds no conflict. The new test sits besidecheck_list_values, not in it, and runs between it andcheck_list_values_more, while the list-values threads are up. No conflict with #2498 either (the descriptor-mirror item, same files).Tested
Windows 11, MSVC (VS 18), RelWithDebInfo, on
main43a9d562d. CPU only.The mock list now answers
GetType(slot 8) with the type it was created with, and records slot 62's float arguments.xs_proxy_mock_testgainscheck_list_values_copy_and_depth_bounds:EndQueryorResolveQueryData, while a DIRECT list still records both, with the TIMESTAMP query type.OMSetDepthBounds(0.25, 0.75)again;(0.125, 0.5)executed in the list is replayed after its cut.With
main's shims the test fails at the COPY check. With only theListStaterecording line removed, it fails at the first replay check. With the fix it passes.ctest -R "^(xs_proxy_mock.*|device_proxy)$": 10/10 pass.scripts/check_no_game_data.py: clean.GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11 (CPU tests only)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
@lixonik on GitHub · 2026-11-27 21:36 UTC · original · approved these changes
Reviewed the diff and tested locally on Windows 11 (MSVC 19.44, Ninja Release).
take_timestamp()returning early forD3D12_COMMAND_LIST_TYPE_COPYavoids recordingEndQuery/ResolveQueryDataagainst aD3D12_QUERY_HEAP_TYPE_TIMESTAMPheap on a copy list and cleanly uses the existing CPU-clock fallback.list_om_set_depth_bounds()recordsdepth_bounds(min, max)intoListStateonly after passing thekPcOMSetDepthBounds < self->pc_slot_countguard and forwarding toself->real;ListStatemerges depth bounds from bundles, clears them onReset(set_ = 0), and replays PC slot 62 (OMSetDepthBounds) onto cut spare lists.xs_proxy_mock_testand ranctest --output-on-failure -V -R xs_proxy_mock: 9/9 tests passed (includingcheck_list_values_copy_and_depth_bounds).AI-assisted (Antigravity, Gemini).
@timbot103 on GitHub · 2026-11-28 02:02 UTC · original
Reviewed at head
7aa6520bbon Windows 11 (MSVC 202219.44).Verification
xs_proxy_mock_test.xs_proxy_mock_test: passed.Notes
COPYlists for both timestamp flags while preserving calibrated queue-tick / QPC pending writes (d3d12_xs_device.cpp:3395-3444,d3d12_xs_list_values.h:915-940) and forwarding/tracking depth bounds across list cuts, bundles,Reset, andClearState(d3d12_xs_device.cpp:3340-3362,3647-3695,3861-3880,d3d12_xs_list_values.h:1274-1285,1358-1367) all look clean and consistent with the D3D12 specs.Approve.
AI-assisted review + local MSVC verification.
@zmasi on GitHub · 2026-11-28 10:22 UTC · original
#2500 | head
7aa6520bbb(merged cleanly with main33db04a701) |ctest --test-dir runtime/build -C RelWithDebInfo -R "^(xs_proxy_mock.*|d3d12_mesh)$" --output-on-failure(LEONIDA_VK_VALIDATION=1) | red on main:xs_proxy_mock_testfails (xs_proxy_mock_test.cpp:4045: copy_real->calls[53] == 0 && copy_real->calls[54] == 0:take_timestamprecorded aTIMESTAMPquery on aCOPYlist) | green on PR+main:10/10CTests pass (9/9xs_proxy_mock*variants incl.COPY-list timestamp fallback andOMSetDepthBoundsXreplay across list cuts, bundles, andReset, plusd3d12_meshon RTX 3090 in1.04swithLEONIDA_VK_VALIDATION=1and0Khronos validation errors);check_no_game_data.py0violations | Windows 11, RTX 3090 (610.88), Vulkan SDK 1.4.363.1 | AI-assisted: yes@timbot103 on GitHub · 2026-11-29 01:07 UTC · original · reviewed
Static audit of
7aa6520bbonly. I ran no builds, tests, or GPU workloads.The early COPY check in
runtime/shims/d3d12_xs_device.cppskips query allocation and recording for both timestamp flags while keeping the fence-driven write. Flag 1 uses calibrated queue ticks when available and QPC otherwise. Flag 2 uses QPC. DIRECT and COMPUTE still use the standard timestamp heap when available.The presence bit in
runtime/shims/d3d12_xs_list_values.hpreserves explicit bounds, including[0.0f, 1.0f], and replays values set by a bundle. Reset and ClearState clear the presence bit so a cut starts with the real list's defaults. The replay uses the Windows float ABI, and the shim and mock are gated to Windows inruntime/CMakeLists.txt.At
runtime/test/xs_proxy_mock_test.cpp:4044, the COPY test would pass if the write were dropped altogether. Could you submit a list created with a COPY allocator to a COPY queue and verify that both flags write their destinations via the CPU fallback once the mock fence advances? The existing query-call checks cover the invalid-query regression.AI-assisted.
@aslan2142 on GitHub · 2026-12-01 16:45 UTC · original
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.Pull request closed