HLE, GPU: coalesce xmem::report_written page runs, Arc<[Hull]> Viewed::ranges, and Batch Step::Heap/Step::Memory dedup #2213
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2213
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2213/head"
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?
@RVZO6 on GitHub · 2026-11-25 08:00 UTC · original
RVZO6:rvzo/stream-batch-coalesce→main· +298 −32 · 3 files · 1 commits · closed without mergingStreaming memory writes and bindless/title-memory submission batching currently do redundant per-page notifications, repeated hull vector/Arc cloning, and duplicate per-submission heap/memory refresh steps:
xmem::report_writtencallsvictory_gpu::kernel_will_writeonce per 64 KiB page instead of coalescing contiguous runs.bindless::Viewed::ranges()clones the fullVec<Hull>and everyArc<Shadow>on every submission even when the heap's views have not changed.host::Batchre-runsStep::HeapandStep::Memoryfor the same heap/generation across multiple command lists in the same submission even when no intervening title write occurred.Claimed on #1633 (
https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7155570873).The change
crates/victory-hle/src/modules/xmem.rs:coalesce_pages(with overflow guards and a zero-alloc fast path for<= 1page) soxmem::report_writtennotifiesvictory_gpu::kernel_will_writeonce per contiguous merged 64 KiB page run.coalesce_pages_empty_and_single,coalesce_pages_merges_sorted_contiguous_run,coalesce_pages_sorts_dedups_and_splits_disjoint_runs,coalesce_pages_guards_overflow_near_max.crates/victory-gpu/src/bindless.rs:Option<Arc<[Hull]>>soViewed::ranges()returns an O(1)Arcclone instead of cloning theVecand everyArc<Shadow>.AtomicU64generation (Viewed::generation()) bumped underInner's lock when distinct buffer ranges change.viewed_ranges_reuses_arc_until_mutated.crates/victory-gpu/src/host.rs:Step::HeapandStep::Memoryper submission inBatchkeyed by(heap, generation)(usingViewed::generation()andshadow::generation()), clearing both maps onBatch::title_written().batch_deduplicates_heap_and_memory_steps.Not a duplicate of
#2199fixes overlapping source ranges inxmem::map_aliasand does not touchxmem::report_written.CLAIMS.mdentry cachesViewed::ranges()asArc<[Hull]>or deduplicatesStep::Heap/Step::Memoryinhost::Batch.Tested
windows-latestMSVC + Windows WARP SM 6.6 CI run45570823602(Clippyclean,Clippy, diagnostics buildclean,Tests:731 passed; 0 failed; 10 ignored,victory-hle:147 passed; 0 failed,victory-gpu:153 passed; 0 failed; 2 ignored+1 passed,xtask:6 passed; 0 failed):modules::xmem::tests::coalesce_pages_empty_and_single ... okmodules::xmem::tests::coalesce_pages_merges_sorted_contiguous_run ... okmodules::xmem::tests::coalesce_pages_sorts_dedups_and_splits_disjoint_runs ... okmodules::xmem::tests::coalesce_pages_guards_overflow_near_max ... okbindless::tests::viewed_ranges_reuses_arc_until_mutated ... okhost::tests::batch_deduplicates_heap_and_memory_steps ... okNot run: the title; any hardware GPU. The title was not used in these tests.
AI-assisted: T3 Code (Antigravity, gemini-4-neon)
@Marvisak on GitHub · 2026-11-25 13:29 UTC · original · edited 2026-11-25 16:03 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/bindless.rs,crates/victory-gpu/src/host.rs,crates/victory-hle/src/modules/xmem.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs-work) was for an older state ofmain.Generated by Claude Code
@RVZO6 on GitHub · 2026-11-25 17:13 UTC · original
Closing as superseded by
main(2922141incremental per-copy merged view ranges and2921092xmempage-window reporting).Pull request closed