gpu(descriptor): bound placed-view shapes and retire idle views (VSP-19 port) #26
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/ReTerryDavis--ReVIctory!26
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-26"
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?
@gianlukin2001-ops on GitHub · 2026-12-03 11:40 UTC · original
gianlukin2001-ops:vsp19-bounded-view-table→main· +339 −42 · 1 files · 1 commits · merged 2026-12-04 02:42 UTCSummary
Ports the bounded placed-view table and sliced idle eviction from VSP-19 in monte-alt/vesper#25 to ReVIctory's descriptor table.
Today
Viewskeeps every distinct placed-view shape, and every placed/constant view that does not fit a record, for the whole run. The run-65 report indescriptor.rsmeasured 14,000 constant-buffer views a frame, 2,450,139 entries and 1,047 MB with the index after four minutes, growing by 11,000 entries a second. This change bounds both the shape list and the table:PLACED_SHAPE_CAP = 262_144caps inline placed-view shapes; shapes past the cap overflow into the evictable table.ViewEntrygainslast_used(atomic, touched under the read lock) andlive.View::Placed/View::Constantentries unused forIDLE_EVICT_FRAMES = 1_800frames (~60 s at 30 FPS). Resource-backed views (Shader/Unordered) and samplers are never evicted.SWEEP_PERIOD_FRAMES = 4fromsync_heaps, plus on demand when a new entry findsfreeempty and the table is overEVICT_HIGH_WATER = 65_536.None, never to the view that reuses the slot.Views::index/shape_indexmove fromBTreeMaptoHashMap(ViewandShapenow deriveHash) for O(1) lookup.VICTORY_VIEW_EVICT=0turns the cap and eviction off (previous behavior).Adaptation to ReVIctory
ReVIctory keeps a thread-local view cache (
kept_view/keep_view) that upstream Vesper does not have. Evictable views now bypass that cache: a cache hit would not refreshlast_used, so idle eviction could retire a view that is still being read.lookup_entrytoucheslast_usedon every hit; resource-backed views still use the cache.Credit
Testing
cargo test -p victory-gpu --lib: 671 passed, 45 ignored. The only 2 failures (descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytesandpipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws) reproduce on untouchedmainon this machine.placed_shapes_are_bounded,idle_eviction_retires_stale_views_and_reuses_slots,idle_eviction_never_retires_resource_views_or_samplers.cargo check -p victory-gpu --features diagnosticspasses.cargo clippy -p victory-gpu --all-targets --all-features --no-depsreports nothing indescriptor.rs; the crate's pre-existing clippy failures are unchanged (see #20).Scope
crates/victory-gpu/src/descriptor.rsonly. Independent of #8 (the Windows 10 Agility SDK change); neither depends on the other.AI assistance
Implemented with AI assistance (OpenCode, DeepSeek V4.1 Flash Free), then reviewed and tested locally on Windows 10 22H2 (19045.6466) with an RX 9060 XT. The design is adapted from the VSP-19 implementation credited above.
4dac84e2f8to1d5151a146