Skip to content

docs/d3d12_vulkan.md: drop stale "not yet" claims the runtime already covers, repair spliced text - #5422

Open
lines9686-rgb wants to merge 6 commits into
ItsNotRexed:mainfrom
lines9686-rgb:docs-d3d12-vulkan-stale
Open

lines9686-rgb wants to merge 6 commits into
ItsNotRexed:mainfrom
lines9686-rgb:docs-d3d12-vulkan-stale

Conversation

@lines9686-rgb

Copy link
Copy Markdown
Contributor

Item: new DOC finding, claimed in #5361 (#5361 (comment)). Depends on: none.

docs/d3d12_vulkan.md still said "not yet" about things the runtime already does, mostly an older sentence left beside the newer one that contradicts it. Each change below was checked against the code on main 3faac557; the text that matches the code stays, the stale text goes. Docs only, plus one stale code comment; no behaviour change.

Stale "missing" claims

  • Queues: "every D3D12 queue submits to one VkQueue" (Known gaps found in review) and "Every D3D12 queue shares one VkQueue for now" (Timestamps): each queue leases its own VkQueue of its type's family (d3d12_vulkan_device.cpp ~8213, ~8536-8554), and a Wait before its Signal holds the batch (vulkan_backend.h ~1463). Same stale sentence in the GetTimestampFrequency comment (d3d12_com.cpp); the frequency is still shared because timestampPeriod is per device.
  • Queue families: "dedicated compute/transfer families ... remain future work" and "Resources are VK_SHARING_MODE_EXCLUSIVE": queue_families.h picks async-compute and transfer families and DeviceState::share makes resources CONCURRENT across them.
  • Fences: "a CPU ID3D12Fence::Signal checks only the semaphore's current value": Fence::Signal holds a CPU signal above a pending GPU one (d3d12_com.cpp ~1139-1166).
  • 1D: "1D and 1D-array DSVs wait for 1D textures" and "TEXTURE1D resources are not supported by the layer": 1D RTV/DSV/SRV exist (d3d12_vulkan_device.cpp ~5267, ~5363, ~5533; d3d12_texture1d_test). The copy comparison still doesn't cover 1D, and now says just that.
  • "default-heap buffers are not zero-filled yet": they are zeroed on allocation (~1639, placed ~1776).
  • Set 0 and pipelines: "Nothing in the layer creates such a pipeline yet", "(milestone M2, without the pipelines that will bind the set)" and the Known gaps' "set 0 in pipelines ... geometry ... multisampled pipelines ... primitive restart": PSOs bind set 0 (vulkan_replay.h ~3781), geometry and MSAA PSOs are built, and IBStripCutValue drives primitive restart (~3797). The Known gaps line keeps what is still missing: tessellation and mesh pipelines, stream output, several viewports.
  • Literal S#s "which nothing passes to it yet": register_literal_samplers runs at graphics and compute PSO creation (~2447, ~2802, ~3226).
  • "shader-visible heaps return a GPU handle, but nothing reads it yet": root descriptor tables pass it to shaders (d3d12_com.cpp ~965-973).
  • Predication: "ClearUnorderedAccessView* and ResolveSubresource need the same check when added": both exist; transfers among them are counted in unpredicated_copies (vulkan_replay.h ~2150).
  • Question 13 said the 16-byte tail is routed to a uniform-buffer fallback; push_constants_fit() refuses those PSOs because the tail isn't built (~2643-2654), as section 5.2 already says.
  • The ESRAM row pointed at a d3d12_xs.cpp comment that ab0cf03 removed.

Spliced text

  • A cut-off copy of the Known gaps paragraph ("... are what it") before the Subgroup size bullet.
  • The ResizeBuffers / BufferCount fragment repeated after the DXGI bullet; the variants table it pushed down now sits under "compares each answer below".
  • The xbox_present_test bullet pasted inside the d3d12_sampler2_test bullet.
  • The D3D-90 CreatePlacedResource2 sentence and "(D3D-191)" each written twice.
  • Question 20 listed twice; the older row (42/52) goes, the 51/52 one stays.

Left out on purpose because open PRs already change them: MSAA/set-0 in the "Refused with a log" line (#5271, #5128), stencil references and the shader cache session row (#5133), the segment-pool bullet (#5335), the BVH-builder row (#5334), d3d12_uint_clear_test (#4592). This branch merges cleanly with each of them except #5128, where the conflict is only that #5128 edits question 14's row and this edits question 13's, the line above it.

Tested: Windows 11 (26200), Python 3.12: every tests/test_docs_*.py passes; no test or tool reads any of the removed sentences (git grep); git diff --check clean. No GPU or game files. AI-assisted (Claude Code).

🤖 Generated with Claude Code

… covers, and repair spliced text

Queues each lease their own VkQueue, a CPU fence Signal is held behind pending GPU signals, 1D textures and
1D DSVs exist, default-heap buffers are zeroed, PSOs bind set 0 and honour IBStripCutValue, literal S#s are
registered at PSO creation, shader-visible heap GPU handles reach shaders, resources are shared CONCURRENT
across dedicated queue families, and question 13's uniform-buffer tail is not built (PSOs are refused).
Also: a cut-off duplicate of the Known gaps paragraph, the variants table moved under its introduction,
the xbox_present_test bullet pulled out of the sampler2 bullet, repeated sentences, the stale ESRAM note,
the older duplicate row of question 20, and the matching stale comment in d3d12_com.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

The revised Timestamps paragraph and the matching GetTimestampFrequency comment say that each D3D12 queue has its own VkQueue. A caller-owned device can still use one VkQueue for two live D3D12 queues. The timestamp frequency is shared in both configurations because timestampPeriod is a device property.

I checked head a9a48121 on Windows 11 with a GeForce RTX 4090 and AMD Radeon Graphics. To reproduce:

  1. In runtime/test/d3d12_m4_compute_test.cpp, set const bool distinct_queues = false;. This uses the existing caller-owned device path with an empty info.command_queues.
  2. Build with cmake --build E:/Leonida-review-work-build --config RelWithDebInfo --target d3d12_m4_compute_test.
  3. Run d3d12_m4_compute_test.exe with LEONIDA_VK_VALIDATION=1. On each GPU, the COPY and COMPUTE queues completed the test on one VkQueue. All 1,924 readback words matched the CPU reference.
  4. Restore the original condition and repeat. Both GPUs used two VkQueues. All 1,924 words still matched.

The empty-pool branch in runtime/shims/d3d12_vulkan_device.cpp:4793 passes state_.info.queue to each queue. The earlier queue paragraph already describes this case. The Timestamps paragraph and code comment can simply say that all queues on the device use the same timestampPeriod. All 30 documentation tests passed.

AI-assisted. Synthetic inputs only.

…e timestampPeriod is per device

A caller-owned device without command_queues still gives every D3D12 queue the one legacy VkQueue, so
"each queue has its own VkQueue" was not true there. Wording from @shdann's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lines9686-rgb

Copy link
Copy Markdown
Contributor Author

Thanks @shdann, right: a caller-owned device without command_queues still hands every D3D12 queue the one legacy VkQueue (d3d12_vulkan_device.cpp ~4793). Fixed in f61ab2f: the Timestamps paragraph and the GetTimestampFrequency comment now just say that all queues of a device use the same timestampPeriod, a device property. The queue paragraph above already covers the caller-owned case. tests/test_docs_*.py still pass. AI-assisted (Claude Code).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head: a9a481214b2eb11bb517677c006f02584aa1b380

Windows 11, Python 3.13.7:

  • All ten tests/test_docs_*.py -> OK
  • git diff --check main...HEAD -> clean

Spot-checked the new claims against the code: per-queue VkQueue lease (runtime/shims/d3d12_vulkan_device.cpp:8537), geometry stage in the PSO (:2711, :2751), register_literal_samplers at PSO creation (:2447, :2802, :3226), VK_SHARING_MODE_CONCURRENT (:477), 1D views (:413, :434). Consistent with the restored text. Docs-only plus one comment; no behavior change.

Verdict: LGTM.

@caltr98

caltr98 commented Nov 23, 2026

Copy link
Copy Markdown

Tested f61ab2f on NVIDIA GeForce RTX 5080 Laptop GPU, driver 621.14, Windows 11 (build 26300), MSVC 14.44, RelWithDebInfo: no regression. ctest -R ^d3d12_: 58 of 60 pass. The two failures, d3d12_buffer_tiles and d3d12_heap_properties, fail the same way on main at 3faac55 on this machine, so they are not from this PR. Nit: the new comment line in GetTimestampFrequency (runtime/shims/d3d12_com.cpp ~1337) is longer than the 120 columns the file uses elsewhere. AI-assisted.

lines9686-rgb and others added 2 commits November 23, 2026 14:46
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts them (sparse binding)

With sparse buffers, a dedicated compute or transfer family without VK_QUEUE_SPARSE_BINDING_BIT is passed over
for the graphics family (sparse_capable_queue_families). Pointed out by @Pierre-Kookis and @shdann on ItsNotRexed#5522.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lines9686-rgb

Copy link
Copy Markdown
Contributor Author

Thanks @caltr98. The long GetTimestampFrequency comment line is rewrapped in 113d4aa (after the merge with main). 203eeea also takes the point from #5522's review: with sparse buffers a dedicated compute or transfer family without sparse binding is passed over for the graphics family (sparse_capable_queue_families), so the queue paragraph now says "when the runtime selects one" instead of "where the GPU has one". tests/test_docs_*.py still pass and the branch merges cleanly with main. AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested 203eeea merged with main 561b65a on Linux (WSL2) x86_64, Python 3.12.16 (-I): pass

Docs plus a comment-only change in runtime/shims/d3d12_com.cpp (not built here). tests/test_docs_*.py: 11 files run, 11 OK, 0 failed. Spot-checked the new claims against the tree: register_literal_samplers exists in d3d12_vulkan_device.cpp and is called at PSO creation, runtime/src/queue_families.h and sparse_capable_queue_families exist, IBStripCutValue is read in the PSO code. The moved castable-format table and the orphan fragment removal read correctly. GPU/D3D12 behaviour claims not checked. Negative control: n/a (no new test).

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed documentation in PR #5422: docs/d3d12_vulkan.md: drop stale "not yet" claims the runtime already covers, repair spliced text.

Scope: docs/d3d12_vulkan.md, runtime/shims/d3d12_com.cpp
Diff: +44 / -57 across 2 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @lines9686-rgb - I went through docs/d3d12_vulkan.md: drop stale "not yet" claims the runtime already covers, repair sp... and the diff around docs/d3d12_vulkan.md. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants