reprend #1259: d3d12: on Intel the GPU reads a fresh host import before it is handed out (RT-INTEL-IMPORT-SETTLE) #2727
Closed
github-bot
wants to merge 3 commits from
github-bot/gh-2727 into main
AGit
pull from: github-bot/gh-2727
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!2727
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2727"
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?
@OreoFR on GitHub · 2026-11-30 13:38 UTC · original
OreoFR:carry/pr-1259→main· +155 −1 · 3 files · 3 commits · closed without mergingCarries #1259 by @MalexAson, because it conflicts with
mainafter #2566 and the reminder to mergemain(#1259) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped.Item:
RT-INTEL-IMPORT-SETTLE-CARRY(claimed in #2570; original itemRT-INTEL-IMPORT-SETTLE).What this branch is
2702cd33c, unchanged (no rebase, author commits kept).main(from the carry preparation of 29/11) that resolves the conflict, then a merge of currentmainf9f3ec4c6(no new conflict). Both merge commits carryCo-authored-bythe author.What conflicted and how it was resolved
docs/d3d12_vulkan.md:main's Images row; the Heaps row getsmain's two insertions and the PR's Intel paragraph.runtime/shims/d3d12_vulkan_device.cpp(3 hunks):DeviceStatekeepsmain'shost_importscounter and the PR'ssettle_host_importsflag, andmain'sallocate_imagenext to the PR'ssettle_host_import.Resource::create_host_buffer,mainnow holdsDeviceState::memory_mutex()around the import'svkAllocateMemory. The PR calleddevice_.settle_host_import(memory_, i)inside that loop, right after the allocation succeeded;settle_host_importallocates its 4-byte scratch buffer throughallocate(), which takes the same mutex, so calling it there would re-lock it (the recursion GGandCo pointed out on #1259). The loop now only records the imported memory type (imported_type = i) under the lock, anddevice_.settle_host_import(memory_, imported_type)runs once, after the loop and the!memory_check, beforevkBindBufferMemory, outside the lock. Same call, same arguments, same point relative to the bind; its return value is ignored as in the PR. The other caller (OpenExistingHeapFromAddress) holds no lock and is unchanged.The Intel path itself (
settle_host_importstrue only for vendor 0x8086) was not run here: a verifier with an Intel GPU is the useful one.Tests
mainf9f3ec4c6merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run).main), Windows 11, RTX 4070 Laptop:d3d12_existing_heap*,d3d12_host_prefix,d3d12_mapped_plane_async5/5 OK (NVIDIA: the Intel path is not exercised);gta6rtimports identical tomain.python -I scripts/check_no_game_data.pyon every file this PR changes: clean.ctest, the full translator suite).Depends on: none.
Needs an independent verifier before merge (red/green on another machine), as for any carry.
AI-assisted (Claude Code, oreofr-agent).
🤖 Generated with Claude Code
f9f3ec4c6) into the carry of #1259 a6b421f745@MoonEyes on GitHub · 2026-11-30 15:47 UTC · original
Verified by MoonEyes (another owner than OreoFR) on head
a6b421f74merged withmainbe7690805: Windows 11, MSVC 2022 x64, RelWithDebInfo, RTX 4060 8 GB (NVIDIA).ctest -R ^d3d12_existing_heap$: 1/1 passed. Withd3d12_vulkan_device.cppofmainthe same test passes too (1/1), so on this NVIDIA card it shows no regression but does not show the Intel defect.Unit test only: no run of the title (this is the Vulkan path).
AI-assisted (Claude Code).
@KelboLive on GitHub · 2026-12-01 15:44 UTC · original · reviewed
The vendor gate, both call sites and the
memory_mutexmove check out, and the new path is functional on this machine when force-enabled (settle_host_imports = truebuilds, 3/3 ctests pass, no validation errors). On NVIDIA the feature is inert, as intended.One blocker for Intel, though, and it is in the queue the new path creates.
settle_host_importbuilds the shareddevice_.staging_queueas a plainVulkanQueue(*context, info.queue, info.queue_family)(d3d12_vulkan_device.cpp:13941-13942) with neithermake_synchronous()norset_skip_before_execute(true), whilestaged_copyonly configures that queue when it creates it (:16471-16484). Whichever path creates it first wins, and the first host import normally happens at load, so on a real Intel title:WriteToSubresource/ReadFromSubresourcecopy lands oninfo.queue, the title's own direct queue, instead of the spare queue the D9 note deliberately picked (:16463-16466);before_execute_/after_execute_(frame write-back and shadow refresh,:22020) now run for every internal staging copy — exactly what the flag at:16483exists to forbid;LEONIDA_SUBMIT_ASYNC>0,execute()only enqueues (:3302,:3312) andstaged_copy'swait_submitted()(:16491) can read a stalesubmitted_gpu_(:3553-3555) and return before the copy ran, soReadFromSubresourcemayunpack()(:16500) stale bytes.Create the queue exactly as
staged_copydoes (or use a dedicated one), and prefermake_synchronous()+wait_submitted()overidle()(:13946) — that isvkQueueWaitIdleon the title's shared queue, which the same file notes blocks every submission (:3550-3552).Test gap worth stating in the body: the new
check_pages_freed_at_oncepasses with the feature on or off on this machine — replacingsettle_host_import's body withreturn truestill passes 3/3 — so it guards Intel CI only. One real Intel run before merge would cover what this box cannot.Everything else here is clean:
ctest -R d3d12_existing_heap3/3, theLEONIDA_SUBMIT_ASYNC=2run, the docs tests,check_no_game_data, andmerge-treeagainst current main (685 commits behind, clean).@aslan2142 on GitHub · 2026-12-01 16:46 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