Repository navigation
Conversation
…indow only `Uma::used()` summed every live block and `sparse_used()` every sparse reservation on each call. kernelx asks `used()` before each coherent graphics allocation and real.rs before each committed placed resource and readback heap, so allocating N blocks cost O(N^2). Both are now totals updated where blocks and reservations are taken and returned. `alloc_in(k)` filtered the whole free map for window k. Free ranges never straddle windows, so it now walks only the keys in k's 4 GiB range. First fit order is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested I built and tested the full synthetic workspace on the RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, debug. For both revisions I ran
The PR adds one UMA accounting test, and the texture and VRAM failures reported on the RX 6800 did not occur in either run here. Both revisions reported the same wave64 skips ( Not tested Retail titles, release performance, or the PR integrated with newer main commits. AI use Codex with GPT-6.2 Sol ran the tests and drafted this report. |
…indow only From xcl-dev/xcl#522 by @TG0000, squashed.
|
Test run of Tested
Review: I checked that the running totals cannot drift: in Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Test report for this PR's head Tested
SKIPPED tests (the same on
|
Uma::used()added up every live block on each call, andUma::sparse_used()added up every sparse reservation.used()is asked before every coherent graphicsVirtualAlloc(kernelx.rs:315), every committed placed resource (real.rs:1235) and every readback heap (real.rs:1263). So N title allocations cost O(N²) under the UMA lock. Both are now running totals, kept up to date where blocks and reservations are taken and returned.alloc_in(k)also filtered the whole free map for window k. A free range never crosses a window boundary (each window is shorter thanWINDOW), so it now walks only the keys in k's 4 GiB range. First-fit order and results are unchanged.This doesn't change
take_sparse_in's search; #483 bounds that one. The two PRs merge cleanly in either order (checked withgit merge-tree).What is in it
crates/xcl/src/gpu/uma.rsonly:Inner::used_bytesis updated inreserve_pool,alloc_whereandfree.used()and theXCL_TRACE_MEMtrace read it.Uma::sparse_bytesis updated through a newtake_sparsewrapper (used bysparse_reserve,sparse_alloc_inandsparse_alloc) and insparse_release.sparse_used()reads it.alloc_wheresearchesfree.range(k·WINDOW..(k+1)·WINDOW)when it is given a window.used_totals_follow_allocations_and_frees: the totals match the blocks and reservations through allocations, frees, coalescing, failed requests and unknown addresses.Tested
cargo test -p xcl --lib: 634 passed, 3 failed, 21 ignored. The 3 failures are intitle_textures::tests/vram::tests, and the same tests fail onorigin/main(4 failures there on this machine).cargo test -p xcl --lib uma: 10 passed.for_runtime(1 GiB):reserves, each preceded by asize() - used()check, plus 100kused() + sparse_used()reads: 592 ms → 0.97 ms (~600×).sparse_alloc_in(0, 64 KiB)+sparse_used(): 12.2 ms → 0.43 ms (~28×).Regression run
main:
PR:
Not tested
cargo test --workspace(only thexcllib tests were run), other GPUs, MinGW builds.AI use
🤖 Generated with Claude Code