GPU: route non-overlapping CopyMemoryToMemoryX through Step::Copy and scope invalidation to written ranges #1660
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1661"
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?
Imported from Marvisak/VIctory. Originally posted by anlnimus on 2026-11-24T20:33:40Z.
Summary
CopyMemoryToMemoryXthroughHostList::defer_copy(Step::Copy)crates/victory-gpu/src/list.rs, non-overlappingCopyMemoryToMemoryXcalls now uselist.defer_copy(...)(Step::Copy->copy_mappedwithwatch::writing, page-wise fallback on unmapped pages,PREPARINGaccounting, and range-scoped invalidation) instead of resetting all cached refreshes viaStep::Run.list.defer(...)+std::ptr::copy(memmovesemantics) and hold acrate::watch::writing(d, len)guard around the copy so guarded title pages do not fault on submission.DeferredandBatchinvalidation to the written title rangeStaging::title_range()incrates/victory-gpu/src/texture.rsso each staged texture tracks its[start, end)title address span inBatch::textures.Deferred::heapsrather than overloadingDeferred::refreshedwithusize::MAX, clearingheapson any non-empty title write while retaining non-overlappingrefreshedbuffer ranges andfills.Batch::title_written(Some((from, to))), flush only overlapping pendingrefreshes(rebuildingpendingindices for kept refreshes) and evict only overlappingcurrentcopy ranges, stagedtextures, and cachedfills. UnboundedStep::Runclosures (HostList::defer) conservatively keep full invalidation (title_written(None)).Step::Fillupload copies across a list and submissionDeferred::first_fillandBatch::fill_duesharerecord_fill(...), skipping identical(upload_dst, title_src, len)fills when neither the title source range nor an overlapping slice of the upload destination buffer has been overwritten since the earlier fill.Verification (Windows 11 x64, rebased on
main@940d32f)cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)cargo test --workspace --locked: 703 passed, 0 failed, 10 ignored across all 17 test executables, including:victory-gpu: 146 passed, 0 failed, 2 ignored, includinga_texture_is_checked_once_per_submission,title_writes_make_textures_due_again,a_copy_is_refreshed_once_per_submission_by_the_pages_written,disjoint_title_copy_preserves_unrelated_textures,upload_fill_dedup_respects_overlapping_writes_and_dst_overwrite, anddeferred_title_written_scopes_refreshes_and_fillsxtask: 6 passed, 0 failed (policy::tests::repository_passes_policypassed)Prepared and tested with AI assistance.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:19:49Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Non-overlapping CopyMemoryToMemoryX transfers go through the upload path: ranges_overlap() half-open interval check + cached identical-fill eviction on overlapping destinations, 3 tests. The overlap predicate is the correctness core — half-open intervals are the right choice for byte ranges.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:33:43Z.
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/host.rs,crates/victory-gpu/src/texture.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
Imported from Marvisak/VIctory. Originally posted by anlnimus on 2026-11-25T05:57:31Z.
Rebased onto current
main(940d32f); all CI checks (cargo clippy --workspace --all-targets --locked -- -D warnings,cargo clippy --workspace --all-targets --all-features --locked -- -D warnings,cargo test --workspace --locked) pass.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.