Repository navigation
Conversation
Port the checked region writer from e4e015f to current main. Keep the write-watch lease during copyback and acknowledge its page only after full delivery, for declared writes and computed-address writes. The region walker in Marvisak#943 motivated the conservative preflight.
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Delivered bytes accounted in protected bulk copyback: 20K gpu diff on copyback accounting. Windows-only.
VIctory V2: community PRs, merged and testedOpen PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: Unofficial community fork of Marvisak/VIctory, GPL-3.0. |
Melow-code
left a comment
There was a problem hiding this comment.
The VirtualQuery walk is the right approach for protected pages. Concern: a guard page set between VirtualQuery and the write makes that span fail permanently — is retry on guard faults planned, or is the skip intentional?
|
@ruipedro-pinheiro The skip in your review is intentional. A failed kernel write can consume the one-shot I reran the four Windows protection tests at AI-assisted using Codex. |
|
Merged upstream The GitHub workspace run hit the same gather and wave-32 permute test failures as upstream at |
…nce/pr1816-ccfb029
|
Reviewed the PR's own commit (4398fcb, above the merge of main). The design is right: count what WriteProcessMemory actually delivered, walk stable protection spans once instead of the fixed 64K/4K split, and acknowledge a watched page only when the delivery is complete, so a partial copy keeps the page dirty and the next copyback retries it. The no-retry rule for failed spans is the correct one — a failed write can already clear PAGE_GUARD, so re-querying after a failure would trust a stale region. Two non-blocking points:
The two fixtures cover both watched and unwatched shadows with a READONLY page in the middle; the protection is applied after the write-watch lease is dropped, which is the right ordering. Nothing blocking. (Review written with DeepSeek V4 Pro, OpenCode.) |
|
Automated triage for the maintainers. Merge candidate (re-checked on In CI: passing ( Generated by Claude Code |
|
Addressed the write-first feedback at |
…ed-1816 # Conflicts: # crates/victory-gpu/src/shadow.rs
Melow-code
left a comment
There was a problem hiding this comment.
Re-checked at 7f65c84. The write-first path is back, so my earlier VirtualQuery concern no longer applies. Delivery accounting is correct: write_mapped resumes at the first undelivered byte, and the three copy-back sites keep a page dirty until the whole span lands. LGTM — nit only: the write_mapped doc sentence ("as a protection query for each copy cost 39 ms") needs a reword.
fuzeofficlal
left a comment
There was a problem hiding this comment.
Verified 7f65c841e2b60f6a3f8d4f599ac600d30bbce1ef merged cleanly onto 63bcca43 on Windows 11 with both an RTX 5090 (VICTORY_D3D12_DEBUG=1) and WARP (--features diagnostics, VICTORY_D3D12_DEBUG=1).
Code review
copy_in_kernel(crates/victory-gpu/src/host.rs:2529-2539) andwrite_mapped(host.rs:2544-2562) preserve the single-call write-first fast path without upfrontVirtualQuery, guardlen == 0 || base.checked_add(len).is_none(), cap kernel-reported progress withdone.min(len), and fall back in 64 KiB then 4 KiB pieces only over the undelivered tail[base + first, base + len).- All three shadow copy-back sites —
copy_back_page(crates/victory-gpu/src/shadow.rs:203-238),copy_back_or_not(shadow.rs:447-468), andcopy_back_marked(shadow.rs:530-540) — now return actual delivered byte counts and callt.taken(...)only when the full span landed (or whenmerge_writebackfound no title-side change needed and reconciledhostin-place), keeping partially delivered pages dirty so the next refresh sees current title memory.
Verification
cargo xtask policy:191 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.- RTX 5090 +
VICTORY_D3D12_DEBUG=1:shadow:: host::title_copies::15 passed, 0 failed. - WARP +
--features diagnostics+VICTORY_D3D12_DEBUG=1:shadow:: host::title_copies::15 passed, 0 failed. - Additional probe on both RTX 5090 and WARP verifying
len == 0andusize::MAXwraparound guards, an unaligned[2048..10240)write crossing[RW | RO | RW]4 KiB OS pages (delivering exactly 4,096 bytes and leaving the RO page intact), and a watched declaredcopy_backpartial delivery (60 KiB -> stays dirty) followed by restoringPAGE_READWRITE, refreshing, and full 64 KiB delivery clearing dirty: passed on both adapters.
(Minor non-blocking pre-existing note: for_pieces at host.rs:2570 computes (at / step + 1) * step, which could overflow if a synthetic pointer lay in the top 64 KiB of usize::MAX, though unreachable for user-mode Windows addresses.)
What changed
Count bytes delivered during bulk GPU copyback. The normal case keeps upstream's single kernel copy with no upfront protection query. On partial delivery, retry only the undelivered tail in upstream's 64 KiB and 4 KiB pieces. Computed-address copyback, declared-write snapshots, and GPU-marked pages now acknowledge a full tracked span only after complete delivery.
This revision scopes the PR to delivery accounting and keeps the existing write-first protection policy. Guard-specific protection and exact changed-byte reconciliation stay separate.
Verification
The title-copy tests verify delivered bytes over committed blocks, an unmapped hole, a read-only destination, and an unaligned span. The shadow tests verify partial delivery and dirty tracking for computed, declared and GPU-marked writes. Two title-copy tests and all 11 shadow tests passed locally, with the shadow suite run on the default hardware adapter and WARP. Strict GPU diagnostics Clippy passed.
The fixture checks correctness. Title frame time remains unmeasured. AI-assisted with OpenAI Codex.