Repository navigation
GPU: refreshes of two parts of one page do not make it current whole - #2474
BastienRodz wants to merge 1 commit into
Conversation
|
Verified the merge condition carefully — it is exactly right:
Note the issue's caveat that #2428's disjoint-range rework has the same hole: its The test pins it end-to-end: partial flushes → whole-page refresh actually flushes → |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Ensuring partial refreshes of two parts of one page do not prematurely mark the whole page current builds cleanly and passes all host tests.
cargo test -p victory-gpu host::tests:: -- --skip dynamic_slots_are_held_until_released: 12/12 passed on RTX 5090, 12/12 passed on WARP.cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Refreshes of two parts of one page don't make disjoint copies (+42). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Touches the same refresh-coalescing logic as the #2349/#2419/#2428 triple — 4th overlapping PR now; convergence badly needed in host.rs refreshes.
83f282d to
6cacc63
Compare
|
Rebased onto main da82e44 (main reworked the |
Batch::flush kept, as a copy's current range, the union of the ranges it refreshed whenever they touched. Two flushes of one submission that each refresh part of a 64 KiB page ([p, p + 4 KiB), then the rest) leave the page changed and unguarded: Tracked::take copies a page held in part and "stays changed". Their union still covered the whole page, so a later refresh of all of it in the same submission (Batch::add) was skipped and the page was never taken. After the submission copy_back_marked found it changed with nothing saved and kept the title's bytes, dropping the shaders' writes to it (copy_back_page too). Ranges now join only where they meet across a page boundary, so no page is current unless one refresh covered it whole; whole pages still join. Co-Authored-By: Gemini 4 Neon <noreply@google.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6cacc63 to
0de4743
Compare
Co-authored-by: borosf <borosf@users.noreply.github.com>
|
Automated triage for the maintainers. This PR changes one condition in The new test CI: Generated by Claude Code |
Co-authored-by: borosf <borosf@users.noreply.github.com>
What's wrong
Batch::flushmerged a copy's refreshed ranges into its current range whenever they touched. Two flushes of one submission can each refresh part of a 64 KiB page. Neither takes the page then:Tracked::takeleaves a partly covered page changed and unguarded. Their union still counted as current, soBatch::addskipped a later refresh of the whole page and the page was never taken. If shaders marked it,copy_back_markedthen found it changed with nothing saved and dropped their writes (copy_back_pagetoo).What the fix does
One condition in
Batch::flush: a refreshed range joins the current one only when the two meet across a page boundary (max(a, from).div_ceil(PAGE) <= min(b, to) / PAGE). Otherwise the larger one is kept, as before. Every page inside the current range has then been covered whole by one refresh. Whole-page refreshes still join; two halves of one page no longer do.Tests
New
host::batch::partial_flushes_do_not_hide_a_whole_page_refresh: two partial flushes of a page, then a whole-page refresh, a marked shader write andcopy_back_marked. It also checks that whole pages meeting at a boundary still merge, with nothing copied twice.main(940d32f) it fails:marked write goes back,left: 0,right: 65536.host::batch::,shadow::andwatch::pass (14, 1 benchmark ignored). Run under Wine 10 with vkd3d-proton 3.1 on llvmpipe; the test returns early without a host device.Not tested
No title run, and no AMD/NVIDIA GPU. How often a submission refreshes one page in parts and then whole is not measured. #1818, #2349 and #2428 each rewrite
currentas range sets and will conflict with this one-line change. Whichever lands, the rule is the same: touching ranges inside one page are not a whole-page refresh.Fixes #2473
AI-assisted (Gemini 4 Neon found and wrote it, Claude Code reviewed and verified it). No game data used.
🤖 Generated with Claude Code