Coalesce dirty page parts into copy ranges #2971
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2971
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2971"
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?
@Brazzo978 on GitHub · 2026-11-29 19:08 UTC · original
Brazzo978:perf/coalesce-written-page-parts→main· +43 −8 · 2 files · 1 commits · merged 2026-11-29 22:54 UTCWhat it changes
Build shadow copy ranges from consecutive dirty parts of each 64 KiB page. The previous shadow loop tested all 16 bits and merged adjacent 4 KiB pieces one at a time. This change reports contiguous runs directly, skips unset parts, and uses a fast path for isolated set bits. The other write-watch range builder uses the same iterator. Range clipping and the merge across page boundaries stay in their existing callers.
How it was tested
cargo test --locked --profile diag -p victory-gpu --lib parts_testspassed on Windows 10 22H2 with Rust 1.98.1 (MSVC target). The new test reconstructs every 16-bit mask from the emitted ranges and checks that they are ordered and maximal. The existing shadow test covers partial ranges and a run crossing a page boundary.by_partsimplementations, compiled with-C opt-level=3. Each sample split 256 pages 1,000 times. The two implementations ran in alternating order for ten samples per process, and five processes were measured. Each pattern was also checked for identical output.0x0040)0x1FFE)0x5555)The table shows the median of the five process medians. These figures describe the CPU-side splitter. Frame times in the title remain unmeasured for this patch.
Checked for overlap
by_parts. #2647 changes submission write-watch work. This patch changes how the splitter visits parts within a page.Codex helped implement and review the change.
@icdmkg2 on GitHub · 2026-11-29 20:43 UTC · original
On an RTX 5060 Laptop GPU (8 GB, driver 621.24), Ryzen 7 H 260, Windows 11, this PR loses the device shortly after the game reaches the world. It happened in every run I made with it, and in none without it.
Builds:
mainat55d06914with launcher defaults, plusVICTORY_LEVELS_ON_DEMAND=0andVICTORY_COMMIT_FLOOR_MB=1024(see #1411). Release build, Series S, DLSS performance, the prologue's cell, a script driving it.main+ #3109 + #3104 + #3103 + #2971main+ #2971 alonemain+ #3109 alone / #3104 alone / #3103 alonemain+ #2549 + #2783 + #2647 + #2665 + #2795 (another set I'm running)The log at the loss, the same in each run:
So it's
DXGI_ERROR_DEVICE_REMOVED(invalid command), not a hang or a timeout. A guess, not checked: coalescing dirty parts across a boundary a copy must not cross (a page-mapping or placed-resource edge) could produce a copy range the device rejects. I haven't runVICTORY_D3D12_DEBUG=1yet. I can if that would help pin the command.@icdmkg2 on GitHub · 2026-11-30 07:16 UTC · original
Follow-up to my earlier report: the crash is still there on
mainat41adb551, which includes this PR as merged.Laptop, 8 GB NVIDIA, Series S profile, DLSS Performance. I ran 5 back-to-back runs (1 warm-up + 4 measured). Run 3 died after about 26 s in the world:
The other 4 runs were fine: median 17.1–18.9 fps. The same harness on
55d06914+ #2549/#2783/#2647/#2665/#2795, without this PR, has not hit 0x887A0006 in this scene. Earlier I bisected this crash to9780f5c4alone.I can run a diagnostics build with
VICTORY_D3D12_DEBUG=1and post the named command if that helps.@icdmkg2 on GitHub · 2026-11-30 07:42 UTC · original
Correction to my two comments above: this PR is not the cause.
part_runsgives exactly the runs the old loops built, and both callers already merged touching ranges, so the output is the same. The same 0x887A0006 shows up in my logs from builds that never had this change, about 1 run in 15. My bisect caught a random crash. Sorry for the false alarm. I'm tracking the real crash in #3796.