GPU: a marked page's copy-back reads the title's page into one buffer per thread #3246
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!3246
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3246"
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?
@lhnizdo on GitHub · 2026-11-26 14:25 UTC · original
lhnizdo:pr/marked-page-buffer→main· +50 −1 · 1 files · 1 commits · openShadow::copy_back_markedreads the title's bytes of every page shaders marked into a freshvec![0u8; n], 64 KiB each. In the world that's thousands of pages per frame (about 12,700 on an RTX 2080 here), each allocation zero-filled and its pages faulted in again. The buffer is now one per thread, resized to the page's length. Every byte up to that length is read from the title before it's used, as before.Measured: RTX 2080, Windows 10, a story save that loads into the world, warm caches, 5-minute runs. Reading the title's pages for marked copy-backs took 132 ms per frame before and 100 ms after (median over the last 12 frame reports). Most of what's left of the marked pages' cost is waiting for the guard lock, which this doesn't touch.
Test:
shadow::tests::a_partial_marked_page_after_a_whole_one_takes_none_of_its_bytes. A whole page the shaders filled with0xeegoes back, then the copy's last page, held only in part, which a shader and the title both wrote. The second page keeps both writers' bytes and none of the first page's. The existing marked-page tests still pass.AI-assisted (Claude Code); the runs were on my machine. No game data.
🤖 Generated with Claude Code
https://claude.ai/code/session_018sSQTfPXZpSkjMMNa7RB5G
@Dukestar69 on GitHub · 2026-11-26 14:28 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):
ead_into / write_mapped.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@oni-swr on GitHub · 2026-11-26 15:28 UTC · original
WARP verification of #3246 (test report only, no code changes)
Head
c2e4507ce40ccdf1056ccf9c40e39f27bb8721ef, main63bcca43c6a00a758510398fa43096ce7e4f7df0(merge base = main).Env: Windows 11, WARP only (adapter "Microsoft Basic Render Driver", d3d10warp.dll 10.0.26100.9818), VICTORY_WARP=1 and VICTORY_D3D12_WARP=1, dxil.dll 1.8.2502.11 (Windows Kit 10.0.26100.0), cargo -j 4. No physical GPU used. Each test was run in its own process (
<test> --exact), so one crashing test cannot hide the others. (With the old 10.0.19041 dxil.dll the validator tests crash with an access violation, on main too; unrelated to this PR.)Commands (head, checked out detached):
cargo test -j 4 -p victory-gpu --features diagnostics --lib(thediagnosticsfeature is what makesVICTORY_D3D12_WARPtake effect; without it the host tests would pick the physical adapter)shadow::tests::a_partial_marked_page_after_a_whole_one_takes_none_of_its_bytesResults:
panic!right after that early return and the test hit it, so on WARP it runs through to its assertions (probe reverted; not part of the PR).victory-gpulib on head: 248 tests, 247 passed, 1 ignored, 0 failed. On main: 247 tests, 246 passed, 1 ignored, 0 failed.AI-assisted: verification by Claude Code (Claude Sonnet 5.5). Synthetic tests only; no game files, dumps, shader names or hashes.
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.