Repository navigation
Memory: bound sparse UMA first-fit searches by address - #483
Conversation
Seek to the requested address range before scanning for a fit, while still checking the one free range that can begin before the lower bound and overlap it. This keeps fragmented windows outside the request from extending the time spent under the sparse allocator lock. Co-Authored-By: GPT 6.2 Sol <noreply@openai.com>
|
Test run and review of Tested
Review: I checked that the bounded search returns what the old Not tested: no retail title or regression run (I have no unpacked game), no timing of the lock hold (the benchmark in the description was not rerun); no Run and review by Claude Code (Claude Opus 5.5) on this machine; each point was checked against the code. |
|
Tested on an RTX 5080: pass, 678 passed, 0 failed. As far as I can see, this is the first run of this PR on NVIDIA.
Not tested
AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2) |
Sparse UMA reservations specify address bounds. The allocator now uses B-tree range queries to skip holes outside those bounds, reducing work under the mutex. It tries the first entry directly and checks the immediate predecessor of the lower bound when seeking.
What is in it
gpu/uma.rs, with tests for a free range crossing the lower bound, alignment, and allocations across a 4 GiB window boundary.Tested
cargo +stable-x86_64-pc-windows-msvc build --workspaceandcargo +stable-x86_64-pc-windows-msvc build --release -p xclpassed.cargo +stable-x86_64-pc-windows-msvc test --workspace --no-fail-fast -- --test-threads=4returned 675 passed, 3 failed, 41 ignored, and 0 emitted GPU SKIPPED lines. All 9 UMA tests passed. The 3D mip readback mismatch inplaced_title_textures_share_vram_and_preserve_pixelsalso reproduced as an isolated MSVC test on2997c9a. The two other failures followed poisoned locks in the head suite.rustc +stable-x86_64-pc-windows-msvc --edition=2021 -O. Each request was 64 KiB with 64 KiB alignment in one 4 GiB window. All synthetic holes were 64 KiB, spaced 128 KiB apart. Successful allocations restored the exact fit between iterations. Median of 15 paired samples with 20,000 requests per variant in alternating order.Regression run
The first pair showed 590 frames on main and 413 on head. The repeat below held the same lock across both 45-second runs. Both pairs used a 3.5 GiB free physical memory watchdog.
Not tested
AI use