Fix #2503: tell GPU write watch before DirectStorage page writes #3063
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!3063
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3063"
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?
@tharun-37 on GitHub · 2026-11-26 05:57 UTC · original
tharun-37:fix/directstorage-write-watch-fresh→main· +32 −11 · 1 files · 1 commits · closed without mergingFix #2503: tell GPU write watch before DirectStorage page writes
write_physical and PageWindow called kernel_will_write (watch::writing) after writing through our own views. The watch must be told before the write so it saves the page's original bytes and keeps the guarded blocks open during the write.
Now report_written returns Writing guards that stay alive during the write, write_physical reports current views after the write, and PageWindow holds pre-write guards until dropped and reports views currently showing the pages on drop.
Fixes #2503.
Supersedes closed PR #3037 (same fix, rebased on clean upstream/main with unrelated aliases changes removed, and with the pre-write + post-write view reporting both included per reviewer feedback).
@Marvisak on GitHub · 2026-11-26 06:17 UTC · original · edited 2026-11-26 07:20 UTC
Automated triage for the maintainers.
Proposed close: duplicate of #2504. The head has not changed. Passing CI and approvals from other contributors don't change the comparison. #2504 fixes the same issue (#2503) the same way in
crates/victory-hle/src/modules/xmem.rs(report_written,write_physical,PageWindow). It is still open and merges cleanly. It also has a regression test with real write-watch trackers, and this PR has none, so reverting the ordering here would still pass the suite. Thanks for removing the attribution from the description.This PR will be closed in 48 hours unless the author pushes a change, or a maintainer removes the label
triage: proposed close. Anything #2504 is missing is best raised as a review comment there.Generated by Claude Code
@tharun-37 on GitHub · 2026-11-26 06:18 UTC · original
Removed the decompiled-code attribution from the description per the asset policy.
This PR is CI-passing and APPROVED by Dukestar69 (14 xmem tests pass, clippy clean, xtask policy ok). It fixes #2503 — DirectStorage page writes through our own views were not seen by the GPU write watch because kernel_will_write was called after the write instead of before. Now pre-write guards stay open during the write, and post-write reporting covers views the title remapped mid-write.
@Dukestar69 on GitHub · 2026-11-26 06:09 UTC · original · approved these changes
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64:KernelWritewrite-watch guards open acrosswrite_physicalandPageWindow(obtained before writing and dropped after the write completes, while still reporting post-write views in case the title remapped a page during the write) cleanly fixes #2503 so DirectStorage page writes do not fault on guarded pages.cargo test -p victory-hle xmem: 14 passed, 0 failed (includingpage_windows_report_where_the_pages_show_when_done).cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@kotekompotek on GitHub · 2026-11-26 06:32 UTC · original · approved these changes
Verified: report_written now returns the KernelWrite guards so they live across the write (the watch must be told before, not after, so it saves pre-write bytes and keeps guarded blocks open); write_physical also reports at post-write views to cover a remap mid-write; PageWindow holds guards for its lifetime and reports at current views on drop. Clean final iteration of the #2503 fix.
@tharun-37 on GitHub · 2026-11-26 09:58 UTC · original
Closing to focus on new issues
Pull request closed