Skip unrelated buffer slots in each spread heap scan #24
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!24
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-24"
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?
@UwUCammie on GitHub · 2026-11-25 23:45 UTC · original
UwUCammie:perf/avatar-mask-heap-rescan→main· +40 −16 · 2 files · 1 commits · merged 2026-11-26 08:17 UTCThe default heap spread visits one sixteenth of the live buffer slots per pass, but it enumerates every live slot to find that sixteenth. With 83,000 live slots it tests roughly 78,000 indices per pass that it can skip.
Apply a repeating mask to each 64-slot word first, then enumerate the remaining set bits. The compiler checks that the partition count divides the word size. The full scan and draining changed slots retain their order and the atomic loads keep their existing ordering.
On a Ryzen 7 9700X, eight complete rounds through a synthetic 1.2-million-slot heap with 83,000 live slots took a median of 6.28 ms before and 1.42 ms after. With 128 live slots it measured 0.93 and 0.78 ms. Those are CPU enumeration times. The benchmark checks all sixteen result vectors for equality and alternates measurement order. Benchmark source and command
The existing set and drain test and the new partition regression test passed under Wine 11.22 on an RX 7900 XT system with RADV 26.3.1. The regression covers multiple complete words, a partial last word and an empty partition beyond the round.
@Adika713 on GitHub · 2026-11-26 00:19 UTC · original
On
888bf1e(native Windows, RX 6950 XT / Ryzen 5 3600, rustc/cargo 1.98.1, serial tests),spread_scan_visits_each_live_slot_in_its_original_partpasses 1/1. The descriptor-host subset passes 33/33 once the pre-existingviews_are_made_beside_the_heap_and_copied_infailure is skipped; that same failure occurs 10/10 on unmodifiedmain0a43566here. Full lib with that one test skipped: PR326 passed, 0 failed, 34 ignoredversus325 passed, 0 failed, 34 ignoredonmain. I checked that the mask is applied only to the spread scan;take()still drains changed slots with the original order and atomics. I did not measure throughput or FPS on this host, so this is a correctness check, not a performance measurement. I made no repository change.AI-assisted: OpenCode, model Big Pickle. No game data.
@gomeaw on GitHub · 2026-11-26 00:02 UTC · original · reviewed
I ran the descriptor-host tests from
888bf1eon native Windows. All 34 passed, including the new spread-partition test and the existing dynamic range and cursor regressions. The asset policy passed too. Windows runI checked that the mask applies only to the spread scan. Draining changed slots keeps its original order and memory ordering. This is an independent CPU improvement alongside the dynamic-range search hotspot measured on RTX 5080. NVIDIA report
@iLucasRT on GitHub · 2026-11-26 03:57 UTC · original
Tested on an RX 7900 XTX 24 GB, Ryzen 7 5800X3D, 64 GB RAM, Windows 11. The per-frame time of "looking at slots" in the heap pass:
A small gain, about 4 % at the median and 11 % at p90. The sessions went through different places,
so this is only indicative. No correctness issues seen in 25 minutes.
@gomeaw on GitHub · 2026-11-26 07:41 UTC · original
I combined #24 with current main for the NVIDIA preview. Main added
writes_of_other_views_leave_the_spans_as_under_their_lockafter this branch. Its twoheap.spanned.all(|_| true)calls needheap.spanned.all(u64::MAX)with #24's mask-taking API. The first combined Windows build failed with E0308 in those two calls. The preview adjustment keeps the regression's full-scan intent.@avatarmanz on GitHub · 2026-11-26 07:56 UTC · original
Merged into main in the next push (tests pass); thanks.