Repository navigation
Conversation
|
Overlaps with #440: both deduplicate Both were verified separately on Arch Linux x86_64, Windows MSVC release build under Wine 11.22 (
The difference is where the state lives: this PR dedupes in |
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 657efd8 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed).
I checked that dropping the repeated flush() + writing() keeps behaviour the same:
- For a range already declared,
Shadow::writingalready returned early. The merged snapshot range equals the existing one, so the snapshot was never retaken. The only effects of a repeat were an extrapendingentry and an extra refresh flush. - Refreshes queued between two declarations are still flushed by the next
title_written()step or by the batch flush before the lists run. The copy-back compare (host != old && t != h) gives the same result whichever flush applied them. - Copy-back now walks
batch.gpu_writesin declaration order with the same per-shadow, address and length dedup the removed loop did. It also covers lists named twice in one submission, since the batch spans the whole submission.
No issues found. I cannot reproduce the CPU-copy timings without a game package here.
AI-assisted (Claude Code).
…tions within a submission Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
|
Triage verdict — Narrow the scope and rebase ( Evidence
Checks and limits
Next step
This verification was AI-assisted. |
…ch write coalescing Clean-room GPL-3.0 adaptations from DesertGamer/VIPort@e637e6b and Marvisak/VIctory#435/#2914/#2918: - Fast 4 KiB page-level std::memcmp skip in find_modified_runs() before scanning changed pages for exact dirty byte runs, merging contiguous runs across 4 KiB boundaries and tracking pages_skipped_unchanged. - Parallel diff and copy-back for ranges >= 8 MiB across up to 4 64 KiB-aligned chunks via a lazy-started persistent 3-worker DiffWorkerPool on Registry (and bounded std::thread fallback for standalone calls), with zero thread_local state, zero per-small-call overhead below 8 MiB, chunk-boundary run stitching, and deterministic ascending sync_page delivery. - Fix deferred 64 KiB page hashing in both serial and parallel write-back so pages containing multiple GPU-modified runs are hashed only after every run in that page has landed. - Coalesce identical duplicate (title_va, shadow, bytes) and (va, bytes) write declarations (plus contained linear-mapped sub-ranges) within the same submission batch via O(1) lookup, avoiding redundant window scans and double copy-back. - Expand title_write_back_test to 58 checks covering identical fast-skip (256 KiB & 10 MiB), batch duplicate coalescing (V#, alias, direct, sub-range, topology invalidation), and parallel 12 MiB / 8 MiB unaligned write-back correctness. AI-assisted.
What changed
World passes declare the same writable shadow-buffer ranges repeatedly. Each repeat used to flush the accumulated refreshes, even after the first declaration had taken the pre-submit snapshot and marked that exact range pending. Store the first declaration per shadow, address and length in the submission batch. Use that same ordered list for copy-back after the fence, replacing the second pass over the deferred command steps.
Verification
cargo test --locked -p victory-gpu --features diagnostics -- --test-threads=1passed 46 tests with one existing benchmark ignored. The added test covers repeated declarations, overlapping ranges, distinct shadows, and submission boundaries.cargo xtask policypassed. The PR contains only source and a synthetic test. AI-assisted (Codex).