Soft views: DirectStorage reads into memory the title mapped write through the section's view #3553
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!3553
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3553"
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?
@paales on GitHub · 2026-11-30 00:53 UTC · original
paales:soft-views-dstorage-writes→main· +89 −9 · 2 files · 1 commits · closed without mergingWritten by 🤖:
What it changes
With
VICTORY_SOFT_VIEWS=1(orpool), the title'sXMemMapPhysicalPagesviews stay in the runtime's books, with no view of the host's. But a DirectStorage request with a memory destination (not a page list) opened its destination withvictory_gpu::kernel_writingbefore the kernel wrote the file's bytes there, and that made every soft view in the range a mapping of the host's first (watch::materialize). Then the view cost a map now and an unmap later, as without the switch.A call-site count in
watch::materialize(a local diagnostic, not in this change) showed where the views that the GPU side made real came from: in a 3.5-minute run of the intro cutscene, 35,182 of 35,183 came fromkernel_writing, for 11.5 GB of DirectStorage reads.Now
into_destinationchecks the destination first (xmem::soft_in). If views in the books show any of it, the request fills a buffer, andxmem::soft_writeputs the bytes of each soft view into its pages through the section's view (Section::window, assoft_readreads them and as page-list destinations are written). The rest of the range gets a plain copy, which faults into the GPU side's guard as the title's own writes do. The notices after the write are the same as before. The views stay in the books. Without soft views in the range, nothing changes.How it was tested
GPU and profile: RTX 5070 Ti 16 GB, 32 GB RAM, Windows 11; Series X 2560x1440, DLSS Performance, DLSS frame generation 2X, ray tracing off;
VICTORY_SAMPLED_EVICT=1,VICTORY_TEXSPK_PASS_MS=24. Each run: the intro cutscene with replayed input, 170 s from its first scene frame, saves restored first.Views the GPU side made real, per run: 35,183 before (
VICTORY_SOFT_VIEWS=1), 73 after. The soft-view line every 10 s: before, about 23,000 "asked for by the GPU side"; after, 140, of them 139 by a fault of the title's code.The title's mapping calls over the 45 s after the cut to the boat (
VICTORY_DSTORAGE_LOG,Mlines):VICTORY_SOFT_VIEWS=1, beforeVICTORY_SOFT_VIEWS=1, afterTextures picked by index that wait for the title to fill their memory, the most at the cut: 3,884 and 4,568 with soft views off (2 runs); 287 and 375 with
VICTORY_SOFT_VIEWS=1and this change (2 runs). Textures that show the neutral texture (due plus waiting for their memory) in the 40 s after the cut: 82,735 and 90,370 slot-seconds before; 43,730 and 47,710 after.fps median / 10th percentile: soft views off 25.0 / 15.4 and 25.2 / 17.9;
VICTORY_SOFT_VIEWS=1before 23.4 / 13.5; after 26.8 / 17.5 and 25.0 / 17.5.Build of these runs: v2026.11.29.04 with this change (
xmem.rsanddstorage.rsare the same as onmain41adb551apart from this change).For shader changes, the wave sizes tested: no shader change.
cargo testpassed for the crates it touches:cargo test -p victory-hle --lib: 423 passed. A new test,soft_writes_go_into_the_pages_and_leave_the_view_in_the_books.a_read_by_range_waits_only_for_a_remapping_that_meets_itfails in the full parallel run, onmainwithout this change too, and passes alone.Checked for overlap
SoftViews::writefor what shaders wrote, the copy-back path; this is the DirectStorage path), #2655 (the notices after a DirectStorage write; this keeps them as they are), #3850 (VICTORY_MAP_ONCE: the page-mapping locks, the other side of the same contention). #3586 and #3607 also changedstorage.rs: each merges cleanly with this change, also onmain.The crash in the same runs
Some runs of the intro ended with
a host command list did not close (0x80070057)at the cut into the montage, with and without this change. A run withVICTORY_D3D12_DEBUG=1named the command:CopyTextureRegionfrom aBC3_TYPELESStexture into aBC7_TYPELESStexture. The console copies the blocks as they are. Direct3D 12 refuses a copy between two block-compressed families. The title makes this copy in some runs only, so the crash came in some runs only.#3043 sends such copies through a buffer. With this change and #3043 on v2026.11.29.04, a run hit the same copy at the cut (format 78 into 99), #3043 sent it through a buffer, and the run went on. This change does not touch texture copies.
@trustno1-coder on GitHub · 2026-12-01 18:51 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed