perf(gpu): skip redundant shape_see on TLS hit and gate NAMED_WHOLE #505
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!505
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-505"
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?
@Not4Eric on GitHub · 2026-12-04 20:24 UTC · original
Not4Eric:perf/descriptor-tls-hit→main· +16 −10 · 1 files · 1 commits · merged 2026-12-05 17:29 UTCWhat this does
In
victory_gpu::descriptor::words_for, skips callingshape_see(which re-wrote the thread-local cache) whenshape_seenalready hit, and gatesNAMED_WHOLEbehind#[cfg(feature = "diagnostics")]sinceviews_kept()is its only reader and is already#[cfg(all(windows, feature = "diagnostics"))]. This removes redundant TLS writes and global atomic RMWs from the descriptor-recording hot path without changing behaviour.Checks
NAMED_WHOLEand theshape_seenfast path incrates/victory-gpu/src/descriptor.rs.descriptor::unit tests; no failure mode existed before that a unit test could distinguish without timing assertions.perf/descriptor-fxhash-views(separate regions ofdescriptor.rs).cargo xtask policypassed (359 files ok); no fork-only files, configs, or build outputs.Verified
cargo xtask policy—359 files okPROFILE=diag PKG=victory-gpu ./build.sh check— 0 warnings (verified both diagnostics-on and default builds)PKG=victory-gpu ./build.sh test --lib -- descriptor:: --skip views_die_with_their_resource --test-threads=1(Proton Wine on Linux, RX 9070 XT) —40 passed; 0 failedCost
None (removes two
AtomicU64increments in non-diagnostic builds and redundant TLS writes onshape_seenhits; 0 new warnings).AI-assisted: yes
@Kal0s-design on GitHub · 2026-12-04 22:34 UTC · original
Checked
863a9caon native Windows (didn't run the game). Merges clean on current main, victory-gpu lib tests show the same failures as main (indirect host_list x2, pipeline library loads x2, plus the flaky watch test the_rest_of_the_one_asking_has_a_number_of_its_own, which also fails on main when run alone) and clippy with and without diagnostics adds nothing.The hit path returns the same number as before. On main a hit already skipped the lock, and the shape_see after it was a no-op anyway because its guard (descriptor.rs:893) only writes when the slot differs, so what's saved is a second TLS lookup and hash rather than a write. It can't go stale either, since shape_seen compares the whole shape and shapes/shape_index are only ever appended to (descriptor.rs:742), so a number never changes meaning across heaps or threads. NAMED_WHOLE is only read by views_kept, which is already windows + diagnostics only (descriptor.rs:915, 939), so gating the counter changes nothing outside diagnostics builds.
Looks fine to me.
AI-assisted: yes
@Not4Eric on GitHub · 2026-12-05 00:00 UTC · original
Thank you so much for helping, I'm not the best at this and I'm heavily relying on AI to even do this