d3d12: parallelize in-place placement checks without XMem lock contention #474
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/474"
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 brcly/TuxBox. Originally posted by DrArroway on 2026-11-29T13:20:53Z.
Summary
Parallelizes in-place
Textureplacement checks (digest_runs,copy_runs,Digest::of) across a persistent worker pool without any cross-threadxmem::POOLlock contention:CheckPool(2..=6persistent workers,STEAL_CHUNK = 4, chunk size128, active whencheck_queue.len() >= 32outside#[cfg(test)]):Watch::rearm,backing::guest_runs_mapped(Step::Resolve), and fallback reads for non-XMem, refused, or previously faulted textures sequentially on the calling thread (Texture::prepare_parallel).CheckPoolworkers): digests and copies changed in-place mips purely over the pre-resolvedGuestRunsholds in parallel (PreparedInPlace::check_in_place), with zero XMem lock calls.PreparedInPlace::finish_fallback), then dropsPreparedInPlacesequentially on the calling thread soTuxBoxReleasePhysicalBackingnever contends across threads.Tally::merge_parallelinsubmit_profile.rs(taking wall-timemaxper step across workers and summing units/bytes/counts).TUXBOX_XMEM_PRIVATE_VIEWS=1and#464default section-backedmain(see #472), where every batch digests all section-backed textures.Tested
GE-Proton11-14Wine):tests.test_repository_hygiene:7/7pass.tuxbox-d3d12 device::placement:93/93pass, includingcheck_chunk_collects_all_changes_and_merges_profileandcheck_chunk_runs_xmem_access_only_on_caller_thread(asserting 64/64accessandreleasecalls run strictly on the caller thread with0worker-thread XMem calls).1002:73bf, RADV, Mesa 26.3.1, GE-Proton11-14) —tuxbox.py check:123/123Lanes & fixtures,22/22D3D12 regression controls, shader translator on GPU, all CPU/CI suites.1002:164e, RADV, Mesa 26.3.1, GE-Proton11-14) —tuxbox.py check:122/122Lanes & fixtures,22/22D3D12 regression controls, shader translator on GPU, all CPU/CI suites.TUXBOX_XMEM_PRIVATE_VIEWS=1(with#462):placement digestdropped from7.7%to3.4%–4.4%of wall time (~2x faster) whileplacement resolve(3.9%) andplacement read(1.4%) stayed free of XMem lock contention, helping lift steady 3D world frame pace from3.84 s/fto3.39 s/f(best window2.75 s/f) when combined with the write-watch/slab optimizations.#464section-backedmain(6e2c5dabcombined with the write-watch/slab PR): ran 17+ minutes (743D world windows) with zero crashes or GPU faults, digesting113.2Mmips (~34 GiBper 5 s window) in14.8%of wall time.1002:73bfand1002:164e); NVIDIA still needs to run checks.Checks
No evidence JSON changed.