D3D12.X: the tile-mapping fence is signalled once before the next title work #3010
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3010"
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?
Imported from ivall/xcl. Originally posted by voiceovarian1-max on 2026-11-27T12:09:27Z.
For nvidia-dev.
vram::Pagessignalled its fence after each tile mapping (mapandunmap), and title queues wait for that fence inbefore_execute. vkd3d-proton merges consecutive sparse binds into onevkQueueBindSparse, but each signal ends a batch. So a title that streams textures paid one bind per texture, ~0.4 ms each on NVIDIA. In a retail title's world this was 13,000–24,000 sparse ops per 4 s; after the change it was ~700 per 4 s (run on our Linux tree). The frame rate did not rise in that run: the binds still took 2.5–3.1 s of every 4 s, because of the number of tiles (~24,000 a second).Mappings now only mark the fence unsignalled.
before_executesignals it once, before a title queue's next work, then has that queue wait as before. #1747 kept the immediate signal so that tile-mapping operations are fenced before a heap is released. That still holds: pool heaps are only reclaimed inbefore_execute, after this signal, andunmap_marktakes the signalled value.XCL_PAGE_SIGNAL_EACH=1signals after each mapping, as before.What is in it
hle/d3d12x/vram.rs:Pages::unsignalled,mappings_changed, and the signal inbefore_execute. New GPU testtile_mappings_are_signalled_once_before_the_next_title_work: two textures placed on pages, no signal;before_executesignals once; a second call does not signal again.Tested
x86_64-pc-windows-gnu, release. On nvidia-dev3f39671d.cargo test -p xcl --lib -- --test-threads=4), on this commit before the test was added (974d5844): 1691 passed, 8 failed, 28 ignored. nvidia-dev3f39671d: the same 8 failures.67322ca9,cargo test -p xcl --lib vram:: -- --test-threads=1: 23 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timing). With the signal after each mapping forced on, the new test fails (1 failed).Regression run
scripts/smoke.ps1needs Windows, and we only have Linux. A Windows smoke run on nvidia-dev and on this head would be welcome.Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by minimalhipster990 on 2026-11-27T13:22:41Z.
Windows RTX 4090 test of #3010
Five 60-second runs on native Windows completed with exit 0, zero logged crashes and zero device removals. The RTX 4090 exercised the deferred fence in the synthetic test. The frame difference changed sign when the order of the two NVIDIA builds was reversed.
GPU fence test
On clean PR head
67322ca9146d5468f35e5b663feba021fbf22d51, the isolated test reached the native D3D12 tiled-resource path. It placed two 512×512 textures, checked that both mappings left the fence value unchanged, calledbefore_executeand checked that the value advanced exactly once. A second call kept the same value. The test waited for the fence and passed.With
XCL_PAGE_SIGNAL_EACH=1in a fresh process, the same binary reported one pass in 0.00 s. The head contains an early return for that setting, before DXGI initialization. The default run took 0.32 s and logged the tiled-resource device, queue and fence. Only the default run exercised the assertions. Test sourceThe VRAM module reported 23 passed, 0 failed, 1 ignored, with no explicit
SKIPPEDlines. The ignored case was the queue timing benchmark. The complete workspace suite was outside this run.Regression run
RTX 4090 (24 GB), NVIDIA 621.40, Ryzen 7 5800X3D, 32 GB RAM, Windows 11 Pro 26300.10075, Rust 1.99.1 MSVC x64, Windows SDK DXC 1.9.2602.17. Each clean checkout was built with
cargo build --locked --release -p xcl. The first-partyscripts/smoke.ps1was byte-identical on all three revisions.nvidia-devatd1be8103was the branch control. It differs from the PR parent3f39671dby the relicensing commit, which changed documentation, manifest metadata and Rust comments.mainat06f90c19was included for the project's regression comparison. PR #3010 · NVIDIA branch deltaThe title ran for 60 seconds per invocation on the Series X profile. Each invocation received an independently hash-checked copy of the same checkpoint, a fresh XCL shader-cache directory and the same A-button schedule (25, 30, 35 and 40 seconds). The wrapper disabled networking, enabled activity logging and set the timer.
XCL_PREPARE=0bypassed the startup shader preparation. The NVIDIA driver cache remained under driver control.The PR showed 123 more frames than
nvidia-devin the first pair (+9.0%) and 36 fewer in the reversed pair (−2.3%). In the first pair, the real D3D12 backend was ready at 4.653 s on the base and 0.702 s on the PR. In the reversed pair it was ready at 0.721 s on the PR and 0.739 s on the base. The differences in startup time and run order limit any inference about frame rate. The logs show live tiled textures in all five runs. World rendering, visual correctness and per-frame counts of fence signals during gameplay remain unmeasured.Regression blocks for main and PR, copied from the original script output.
AI use. OpenAI Codex (GPT-6) built the revisions, ran the tests and checked the report against the machine-generated logs and manifests.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T02:41:37Z.
I tested the two-consumer mapping dependency on RTX 5070 / NVIDIA 616.92 at head
67322ca9with a test-only native fixture. It gates the production mapping queue, records the same mapping generation on two independent consumer queues, and observes their completion fences.In both deferred mode and
XCL_PAGE_SIGNAL_EACH=1, the two consumer markers stayed at[0, 0]while the mapping queue was gated and advanced to[1, 1]after release. As a sensitivity control, deliberately omitting the second consumer's wait produced[0, 1]before release and failed the expected-dependency assertion in both modes. The proper cases passed with no skips.This covers ordering for synthetic mapped textures and the forced mode, whose existing test returns before GPU setup. It does not measure title behavior, frame time, or performance.
AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:19:06Z.
Triage (#1607) – head
67322caMain's
vram::Pagesstill signals after each mapping (native_queue_signalinmap/unmap), and no open PR on main defers it. #3024 (amd-dev) does the same for the sparse windows'UpdateTileMappings, not forvram::Pages. The old amd-dev base also had57303375("batch vram tile-mapping fence signals into before_execute"), but current amd-dev does not.No problem found in the diff: every read of
pages.valueis inbefore_executeafter the pending signal, includingunmap_markfor heap retirement. Main'svram.rshas changed a lot since (mark_unmap,native_queue_signal, a helper that expectsmapto leave the fence signalled), so the PR conflicts and needs a rebase that checks those new users ofpages.value.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.