D3D12.X: fill memory from the list's upload memory, not a pattern buffer per value #832
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/838"
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 mastrr9 on 2026-11-24T06:39:41Z.
Replaces the leaked 32-entry
PATTERNSupload buffer cache inlist_x::fill()(FillMemoryWith{32,64,128}BitValueX) with the command list's own upload arena (bind::allocate_upload_memory), copying over the destination inFILL_CHUNK(ARENA_BLOCK / 2, 128 KiB) chunks with the same state transitionsCopyMemoryToMemoryXuses.(pattern, size)allocated a committed upload buffer rounded up to a power of two (up to 256 MiB) and kept it forever; after 32 entries, fills with any new value were dropped with a warning.Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC debug, DXC Windows SDK10.0.26100.0,d3d12SDKLayers.dllinstalledba1f7e888b8c1c0386ce62edd3c3b1509a5348f2cargo build --workspace: clean (only pre-existingfetch_updatedeprecation warning)cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored (new testhle::d3d12x::list_x::tests::fill_copies_cover_the_range_oncepassed)SKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64Regression run
Smoke run by @CuteBooty in comment below: https://github.com/xcl-dev/xcl/pull/838#issuecomment-7142452731
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.
main:
PR:
Tester's setup: RTX 3070 8 GB (32-lane waves), NVIDIA 621.24; Ryzen 5 3600, 32 GB; Windows 11 Pro 26200; rustc 1.100.0 MSVC; release build.
Tester's method:
scripts\smoke.ps1 -Game <folder> -Seconds 60, no input, on this PR's head as it is and onmainbeaa245, the commit it branches from, each from a clean checkout. Each build ran twice back to back; the blocks are the second runs. Themainblock is shared with the tester's reports on other PRs of the same base.Tester's AI use: Claude Code (Claude Opus 5.5) made the runs with the tester present and wrote the report from the script's output.
Not tested
AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T07:06:17Z.
Full-suite run, since this PR has no test report yet. Tested exact head
ba1f7e8(on its basebeaa245).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.fill_copies_cover_the_range_once.Not tested
AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T07:17:51Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
ba1f7e8onto maina1672ef, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 706 passed, 10 failed, 41 ignored. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. Upload-memory fill tests green; no new failures.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by CuteBooty on 2026-11-24T19:41:27Z.
Regression run on a retail title for
3784317: pass (no device removal, no crash, frames and peak commit within the check's limits).Tested
scripts\smoke.ps1 -Game <folder> -Seconds 60, no input, on this PR's head as it is and onmainbeaa245, the commit it branches from, each from a clean checkout. Each build ran twice back to back; the blocks are the second runs. Themainblock is shared with my reports on other PRs of the same base.main:
this PR:
Not tested
mainmerged in, AMD and Intel GPUs.AI use
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:57:26Z.
Empirical test report (
37843178)Verified PR #838 at detached head
3784317880c0cff8954a161b33629233d8e9cbb8.Hardware / environment
1.100.0 (0ef1bc386 2026-11-09)and DXC1.9.2609.5 (01b62ad47). Cargo used the unoptimized test profile with debug information and incremental compilation disabled.Invoke-ArcTest.ps1withXCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test binaries.cargo test -p xcl --lib hle::d3d12x::list_x::tests::fill_copies_cover_the_range_once -- --exactexited 0 with 1 passed, 0 failed, 0 ignored, and 0 skipped. The exact filter excluded 693 other library tests.AtomicU32::fetch_updatein XGameRuntime.Observed behavior
The fixture passed its assertions for a fill smaller than one chunk, exactly one chunk, and two full chunks followed by a 36-byte tail. For six representative sizes from 4 bytes up to the 256 MiB fill limit, it checked contiguous offsets, positive copy lengths bounded by the chunk size and divisible by four, and an end offset equal to the requested size.
Not tested
The full GPU workspace suite and game smoke runs were omitted. This run covered CPU chunk planning. GPU copy execution, resource transitions, and the lifetime of the upload allocation were outside the fixture's coverage.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr838-focused.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:27:51Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T19:54:29Z.
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head
3784317880c0cff8954a161b33629233d8e9cbb8(merged cleanly ontomain2898511).Hardware & environment
experimental-11.0-20261112),vkd3d-protonmasterec207194(3.2.0) +dxil-spirvb540c8a2+ relaxed-vtable patch (-Db_ndebug=true), DXVKv3.1.1-209, DXC1.9.2609.5, Rustx86_64-pc-windows-gnu(debug for tests, release for retail)Unit / GPU tests (
XCL_REQUIRE_GPU=wave64,XCL_DXC_DIR,VKD3D_CONFIG=ignore_shared_fence,--test-threads=1 --nocapture)hle::d3d12x::list_x::: 37 passed, 0 failed, 0 ignored (0 skipped)Combined retail sanity run (
main2898511+#2103,#838,#1250,#1733merged together;XCL_DIRECT_DXIL=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PSO_WAIT_MS=50,XCL_SPLIT_MIDLIST_WAIT=0,XCL_COHERENT_MB=1024,VKD3D_CONFIG=ignore_shared_fence,XCL_PSO_PRELOAD=0,XCL_NETWORK=0, warm PSO cache)45,841translated draws,154,125dispatches (+4,634chained split-compute),47,255Opus packets (0 errors),13.2 GiBpeak VRAM (0 GTT spill),15.1 GiBpeak RSS (vs19.3 GiBon cleanmain2898511).268.4 son the same pre-existingmain0xc0000005TOCTOU race intitle_textures::subresources(copy_nonoverlappingreading0x793a08000) also reproduced on cleanmain2898511(161.8 s).Not tested
AI use
main, ran the tests and combined retail run under Proton on this machine, and drafted this report.Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:25:47Z.
Review: COMMENTED
P1: new d==s path violates D3D12 resource state. as_copy_dest transitions entire buffer resource to COPY_DEST, then CopyBufferRegion reads source s from the same resource/another offset without COPY_SOURCE. Buffers are state-tracked per resource, not byte range; non-overlap does not permit simultaneous source COPY_SOURCE/dest COPY_DEST because COPY_DEST is write-only. Use a distinct source resource/window/staging/GPU-fill path and add a debug-layer case where arena allocation/destination share a window.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:16:27Z.
Triage (#1607) – head
3784317No open or merged PR makes the same change;
pattern_buffer/PATTERNSare still on main.list_x.rs:fill: when the list's upload memory and the destination are in the same window buffer (d == s), all chunks are copied inside one buffer held in COPY_DEST. Main'sCopyMemoryToMemoryXstopped doing exactly that (#958, one buffer cannot be COPY_SOURCE and COPY_DEST at once) and goes throughcopy_scratchinstead; the fill could do the same.The branch conflicts with main:
fillthere now callswant_view,uma_window_buffer_gpuandnote_write(.., WriteProducer::InSegmentGpu, ..), so the rebase is not mechanical.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.