d3d12: report copy queue timestamp support from Vulkan queue capabilities #1154

Merged
PyZikYG merged 2 commits from upstream-pr/1154 into main 2026-11-25 00:02:38 +00:00
PyZikYG commented 2026-11-24 19:17:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PyZikYG on 2026-11-24T19:17:53Z.


Claimed as D3D-COPY-TIMESTAMP-CAPS.

OPTIONS3 always reported copy queue timestamps as unsupported, even when a copy queue could write and resolve them on the graphics family. Heap creation used the graphics family's timestamp support even when a copy queue could be assigned a dedicated transfer family.

Use the same capability check for OPTIONS3 and COPY_QUEUE_TIMESTAMP heaps. Every family the copy queue can use must provide timestamp bits and permit query reset and resolve. GetTimestampFrequency and submission validation now check the queue's actual family, and clock calibration receives that family's timestamp width.

AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478727867 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1154). Originally posted by [PyZikYG](https://github.com/PyZikYG) on 2026-11-24T19:17:53Z. --- Claimed as [D3D-COPY-TIMESTAMP-CAPS](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141774714). OPTIONS3 always reported copy queue timestamps as unsupported, even when a copy queue could write and resolve them on the graphics family. Heap creation used the graphics family's timestamp support even when a copy queue could be assigned a dedicated transfer family. Use the same capability check for OPTIONS3 and COPY_QUEUE_TIMESTAMP heaps. Every family the copy queue can use must provide timestamp bits and permit query reset and resolve. GetTimestampFrequency and submission validation now check the queue's actual family, and clock calibration receives that family's timestamp width. AI-assisted: yes.
KernelSmoker commented 2026-11-24 19:19:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T19:19:47Z.

Review: COMMENTED


Found a capability mismatch in DeviceState::copy_timestamps_supported() (runtime/shims/d3d12_vulkan_device.cpp, around lines 629–634). CreateCommandQueue can select a copy queue from copy_queues or fall back to command_queues when that pool is exhausted (around 5742–5769), but the capability currently checks only timestamp_bits_for(info.copy_family). If the dedicated family supports timestamps while the graphics fallback family has timestampValidBits == 0, OPTIONS3 and COPY_QUEUE_TIMESTAMP heap creation advertise support, yet a copy queue leased from the graphics family gets clock_for(graphicsFamily) with zero valid bits; GetTimestampFrequency then returns E_FAIL and timestamp execution is rejected. The caller-owned-device path also advertises support without checking the actual queue_family when command_queues is empty. Could the capability require support for every family a copy queue can use (including info.queue_family), and add regression coverage for both the dedicated/fallback mismatch and a legacy caller-owned queue with zero valid bits? I did not run the Windows D3D12 integration test; this finding follows the queue-selection and capability code paths.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045790443 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1154#pullrequestreview-6045790443). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T19:19:47Z. **Review:** COMMENTED --- Found a capability mismatch in `DeviceState::copy_timestamps_supported()` (`runtime/shims/d3d12_vulkan_device.cpp`, around lines 629–634). `CreateCommandQueue` can select a copy queue from `copy_queues` or fall back to `command_queues` when that pool is exhausted (around 5742–5769), but the capability currently checks only `timestamp_bits_for(info.copy_family)`. If the dedicated family supports timestamps while the graphics fallback family has `timestampValidBits == 0`, OPTIONS3 and COPY_QUEUE_TIMESTAMP heap creation advertise support, yet a copy queue leased from the graphics family gets `clock_for(graphicsFamily)` with zero valid bits; `GetTimestampFrequency` then returns E_FAIL and timestamp execution is rejected. The caller-owned-device path also advertises support without checking the actual `queue_family` when `command_queues` is empty. Could the capability require support for every family a copy queue can use (including `info.queue_family`), and add regression coverage for both the dedicated/fallback mismatch and a legacy caller-owned queue with zero valid bits? I did not run the Windows D3D12 integration test; this finding follows the queue-selection and capability code paths.
abnalstlll-byte commented 2026-11-24 19:21:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:21:52Z.

Review: APPROVED


Reviewed and verified. Robust handling of copy queue timestamp capabilities in D3D12/Vulkan layer. Accurately evaluates \ imestamp_bits_for\ and queue family resolve capabilities (distinguishing transfer-only families from graphics/compute fallbacks) and aligns \OPTIONS3.CopyQueueTimestampQueriesSupported\ and \COPY_QUEUE_TIMESTAMP\ heap creation with hardware capability. Verified with \d3d12_timestamp_test. 100% clean-room.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045826783 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1154#pullrequestreview-6045826783). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:21:52Z. **Review:** APPROVED --- Reviewed and verified. Robust handling of copy queue timestamp capabilities in D3D12/Vulkan layer. Accurately evaluates \ imestamp_bits_for\ and queue family resolve capabilities (distinguishing transfer-only families from graphics/compute fallbacks) and aligns \OPTIONS3.CopyQueueTimestampQueriesSupported\ and \COPY_QUEUE_TIMESTAMP\ heap creation with hardware capability. Verified with \d3d12_timestamp_test\. 100% clean-room.
KernelSmoker commented 2026-11-24 19:25:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T19:25:44Z.

Review: COMMENTED


Follow-up on the updated head be010a409c: the new copy_queue_timestamp_families_supported() helper now checks the graphics family plus the optional dedicated copy family, and its constexpr cases cover both the fallback mismatch and caller-owned queue using a nonzero family index. I built vk_queue_test from this exact head in the project Vulkan tools container; CTest vk_queue passed 1/1. The explicit no-game-data scan passed on the five changed implementation/test files. This Linux check validates the helper and queue-selection tests only: I could not run the Windows-only d3d12_query_rules_test / D3D12 query integration, and GitHub reports no checks on this head.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045889016 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1154#pullrequestreview-6045889016). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T19:25:44Z. **Review:** COMMENTED --- Follow-up on the updated head be010a409c24c5732c3dc6122f28f2a493a5afc6: the new `copy_queue_timestamp_families_supported()` helper now checks the graphics family plus the optional dedicated copy family, and its constexpr cases cover both the fallback mismatch and caller-owned queue using a nonzero family index. I built `vk_queue_test` from this exact head in the project Vulkan tools container; CTest `vk_queue` passed 1/1. The explicit no-game-data scan passed on the five changed implementation/test files. This Linux check validates the helper and queue-selection tests only: I could not run the Windows-only `d3d12_query_rules_test` / D3D12 query integration, and GitHub reports no checks on this head.
madhyn commented 2026-11-24 19:28:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by madhyn on 2026-11-24T19:28:22Z.


Tested a8ed98c23 on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / Vulkan):

  • d3d12_vulkan_device (Wine): Passed (8.01 s)
  • d3d12_query_rules (Wine): Passed (5.62 s)
  • vk_queue (Linux): Passed (0.54 s)

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142145112 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1154#issuecomment-7142145112). Originally posted by [madhyn](https://github.com/madhyn) on 2026-11-24T19:28:22Z. --- Tested `a8ed98c23` on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / Vulkan): - `d3d12_vulkan_device` (Wine): **Passed** (8.01 s) - `d3d12_query_rules` (Wine): **Passed** (5.62 s) - `vk_queue` (Linux): **Passed** (0.54 s) AI-assisted: yes
Deedlyy commented 2026-11-24 20:12:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:12:30Z.


Recommendation: [MERGE]

Reasoning: Copy-queue timestamp support (OPTIONS3, COPY_QUEUE_TIMESTAMP heaps, GetTimestampFrequency) is now derived from the Vulkan families the copy queue can actually use, instead of hard-coded or the graphics family. KernelSmoker found a capability mismatch; the updated head addresses it with copy_queue_timestamp_families_supported(), and KernelSmoker confirmed. Verified on Wine + RTX 3060 Ti by madhyn. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 5/10

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143191664 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1154#issuecomment-7143191664). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:12:30Z. --- **Recommendation:** [MERGE] **Reasoning:** Copy-queue timestamp support (OPTIONS3, COPY_QUEUE_TIMESTAMP heaps, `GetTimestampFrequency`) is now derived from the Vulkan families the copy queue can actually use, instead of hard-coded or the graphics family. KernelSmoker found a capability mismatch; the updated head addresses it with `copy_queue_timestamp_families_supported()`, and KernelSmoker confirmed. Verified on Wine + RTX 3060 Ti by madhyn. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 5/10
QemmHD commented 2026-11-25 00:02:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T00:02:36Z.


Merging.

Why merged: D3D-COPY-TIMESTAMP-CAPS: timestamp bits are tracked per queue family, and transfer-only families count as 0 bits because they can't reset or resolve queries. This was the first native Windows run of the fixed head; madhyn's Wine run was on an older head, and KernelSmoker ran vk_queue on Linux. Behaviour change: OPTIONS3.CopyQueueTimestampQueriesSupported can now be TRUE, and a copy queue that gets a transfer-only family returns E_FAIL from GetTimestampFrequency and GetClockCalibration instead of borrowing the graphics family's bits.

Why it's good: d3d12_vulkan_device, d3d12_query_rules, vk_queue, vk_queue_query_sync and vk_queue_constructor_oom: 5/5 both plain and under validation on the 4070 SUPER.

Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7148073568 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1154#issuecomment-7148073568). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-25T00:02:36Z. --- Merging. **Why merged:** D3D-COPY-TIMESTAMP-CAPS: timestamp bits are tracked per queue family, and transfer-only families count as 0 bits because they can't reset or resolve queries. This was the first native Windows run of the fixed head; madhyn's Wine run was on an older head, and KernelSmoker ran vk_queue on Linux. Behaviour change: OPTIONS3.CopyQueueTimestampQueriesSupported can now be TRUE, and a copy queue that gets a transfer-only family returns E_FAIL from GetTimestampFrequency and GetClockCalibration instead of borrowing the graphics family's bits. **Why it's good:** d3d12_vulkan_device, d3d12_query_rules, vk_queue, vk_queue_query_sync and vk_queue_constructor_oom: 5/5 both plain and under validation on the 4070 SUPER. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. 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).
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1154
No description provided.