gpu/descriptor: lock-free ShapeArena and fast-hashed Views registry #245
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/TaynanGT--Vice-Tay!245
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-245"
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?
@mint17 on GitHub · 2026-11-27 11:55 UTC · original
mint17:perf/views-lockfree-shape-arena→main· +1578 −180 · 2 files · 1 commits · openEliminates global
VIEWSRwLockread contention on placed-view decodes (view_at(PLACED)) andBTreeMap/SipHash overhead on view and shape lookups incrates/victory-gpu/src/descriptor.rs(zero merge conflict with #234).Changes
ShapeArenaCore(2048 × 2048 = 4,194,304shapes): Stores append-only placed-viewShapeentries in heap-allocated[UnsafeCell<MaybeUninit<Shape>>; 2048]slabs with a cache-line-isolatedAtomicU32watermark and direct raw-pointerUnsafeCell::raw_getslot reads/writes.view_at(PLACED)now performs zero locks and zero atomic writes.ShapeKeyhashing: Replaces SipHash-1-3 +BTreeMap<u64, u32>with a fast field-level word hash (ShapeKey+IdentityHash) and a coldshape_collisionsoverflow map (zero heap bytes unless a 64-bit collision occurs, zero 116-byteShapekey duplication).Viewsmaps: ReplacesBTreeMapinindexandby_resourcewithHashMapbacked by a word-chunked cross-platformViewHash, pre-hashesShapeKeyoutsideVIEWS.statelock, and removes the redundantcontains_keylookup inentry_kept.Benchmarks (
cargo test --release --locked -p victory-gpu views_registry_bench -- --ignored --nocapture)RwLock<Vec<Shape>>+ SipHash +BTreeMap)ViewRegistry)view_at(PLACED)view_at(PLACED)(7R + 1W)known_shapehit (65K shapes)entry_ofhit (32K views)Verification
cargo test --locked -p victory-gpu descriptor:: -- --test-threads=1(68 passed, 0 failed — includes 50,000-opBTreeMaporacle parity test, forced-collision & capacity-ceiling test across 4 slabs, hash avalanche test, and 8-thread concurrent stress test indescriptor/views_tests.rs).cargo test --locked -p victory-gpu --all-features descriptor::tests -- --test-threads=1(14 passed, 0 failed).cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--all-features) andcargo test --locked -p xtaskpassed.@TaynanGT on GitHub · 2026-11-27 11:58 UTC · original
@mint17 The 8-thread benchmark isolates contention in placed-view lookups. The first correctness gate for the arena is publication: a reader observing the new watermark must also see the initialised slab and shape. I’ll check that invariant at the slab boundary and keep the benchmark numbers scoped to registry operations.
github-bot referenced this pull request2026-11-27 16:44:35 +00:00
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.