Skip to content

GPU: a window that is one run of a section's pages goes in place through our own view (VICTORY_STRETCH=1) - #1127

Open
FrancescoGelosoEterea wants to merge 1 commit into
fxceless:mainfrom
FrancescoGelosoEterea:stretch-own-view
Open

FrancescoGelosoEterea wants to merge 1 commit into
fxceless:mainfrom
FrancescoGelosoEterea:stretch-own-view

Conversation

@FrancescoGelosoEterea

Copy link
Copy Markdown

The title maps its streaming heaps one 64 KiB view at a time, and each view is an allocation of its own. So place_part cannot open them, and level() turns view memory down: those windows are copied, refreshed and copied back. Their pages do follow one another in their section, though. This PR opens such a window through a view of our own on the whole section, the same view VICTORY_BACK_OWN_VIEW maps:

  1. place_for asks cover(). When a window is one Cover::Run(section, offset), it goes to the new place_stretch.
  2. place_stretch rounds the window out to 64 KiB pages and checks that the rounded range is still the same run. It then commits those blocks through our view and opens the heap there with OpenExistingHeapFromAddress1. The shaders read and write the title's bytes directly: no copy, no refresh, no copy-back.
  3. Every refusal falls back to the copy and logs a warning for the first 8.

own_view() is pulled out of write_own, so both switches share one mapping per section. The inplace stats line also counts windows placed this way and the ones turned down.

The idea is VICTORY_STRETCH from Belobug/VIctory-Belobug-AMD (0434b3a), credit to them. There it works in shadow.rs with a separate MapViewOfFile per stretch. This port reuses the in-place module (cover(), OWN, Placed) instead. It is off by default.

Tested

RTX 5070 Ti (16 GB, driver 621.24), Windows 11, a save past the prologue. Three ~7-minute runs in the world, on main 465b94f plus #854 and #834. Every run used the same switches: WIDE_BACK, CARD_BUFFERS_MB=1024, INDIRECT_WINDOW, ASYNC_SUBMIT, QUEUE2, LEVELS_ON_DEMAND, JOIN_PARTS, BACK_OWN_VIEW, INDIRECT_GATHER, CARD_REHASH_RUNS and COPY_PLAIN.

run fps prep ms GPU ms copy-back ms draws windows through our view
without 5.3 68 84 17 4,890 –
VICTORY_STRETCH=1 5.1 75 90 19 3,084 80 placed, 0 turned down
VICTORY_STRETCH=1 again 5.6 62 102 16 4,292 75 placed, 0 turned down
  • It works on NVIDIA. All of the windows came from one 6,236 MB section, from 4 to 8 MiB each, and none was refused. The picture looked right live. I did not check faces closely, given the earlier report of faces breaking with a similar change.
  • On this stack it does not speed anything up. The differences are within the noise of these runs (about ±0.6 fps). With BACK_OWN_VIEW and WIDE_BACK on, copy-back is already about 17 ms a frame, against the 36 ms Belobug started from.
  • One of the two STRETCH=1 runs ended in a device loss (0x887A0006, about 10 minutes in). Two of four runs without it had the same loss on this merge, so it does not look tied to this switch.

Not tested: together with VICTORY_WINDOW_UPLOAD from 79cfdd9. This branch is rebased on 085ee7c (clean cherry-pick, no clippy warning in inplace.rs, 182 of 183 unit tests pass; the one failure, indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, fails the same way on 085ee7c without this commit)

🤖 Generated with Claude Code

…ugh our own view (VICTORY_STRETCH=1)

The title maps its streaming heaps one 64 KiB view at a time, each view an
allocation of its own, so they cannot be opened as a host heap and every
window on them is a copy, refreshed and copied back. The pages of such a heap
follow one another in their section, though: with VICTORY_STRETCH=1 a window
whose memory is one run of one section (inplace::Cover::Run) is opened as a
heap through the view of our own on that section (the one
VICTORY_BACK_OWN_VIEW maps; the mapping is now one helper, own_view), with
the blocks committed through it, and the window is a buffer placed there.
Off by default. The idea is VICTORY_STRETCH of Belobug/VIctory-Belobug-AMD
(0434b3a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KomanderDG88 added a commit to KomanderDG88/VIniVIdiVIci that referenced this pull request Nov 25, 2026
…VICTORY_STRETCH=1, fxceless#1127)

fxceless#1127 (FrancescoGelosoEterea), after Belobug's
VICTORY_STRETCH: a window that is one run of a section's pages is opened
in place through our own view of the section; anything it cannot open is
copied as before. Off by default, and then the run is not even looked
for. Tested as 9b08008: victory-gpu library suite three runs clean
(201 passed, 5 ignored).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
KomanderDG88 added a commit to KomanderDG88/VIniVIdiVIci that referenced this pull request Nov 25, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Filip722

Copy link
Copy Markdown

I tested the Address1 path from e417d0b in a synthetic 2 MiB memory fixture on Bazzite 44, RTX 5060 Laptop 8 GB, NVIDIA 615.78.08 and GE-Proton11-14/vkd3d-proton cae8353ed7959c4+.

ID3D12Device13 was available. The existing partial import of private anonymous memory passed both CPU-to-GPU and GPU-to-CPU checks at a nonzero offset. With the same writable file mapping flags and ext4 scratch backing used for our #830 test, the own-view commitment required by #1127 returned ERROR_ACCESS_DENIED. In the fixture only, I also tried the underlying Address1 call after that failure. The heap and placed resource were created, but writes in either direction were invisible to the other view. The regular copy remains necessary for this file-backed case.

The fixture used generated bytes only. Test and report prepared with assistance from OpenAI Codex.

ExoCalibra added a commit to ExoCalibra/victory-exo that referenced this pull request Nov 26, 2026
notquiteog added a commit to notquiteog/victory-nvidia that referenced this pull request Nov 26, 2026
…section's pages goes in place through our own view (VICTORY_STRETCH=1) (by FrancescoGelosoEterea)

Changed in porting: this tree has no OWN table of views nor write_own; its
own view of a whole section is the one inplace::beside makes and keeps
(Views::whole), so place_stretch asks beside for the address of the run in
it. The PR's commit of each 64 KiB block through our view is left out: the
runtime here commits a page before it shows it, for every view of the
section, which beside already relies on (a page that were not committed
would have the host refuse the heap, and a copy is made). place_for and
the line of what is in place are as in the PR. VICTORY_STRETCH=1 turns it
on; off by default. Not run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants