Linux/Proton: view-tree Wine server build, hot archives on an SSD, opt-in hole cache for the write watch #3367

Open
ErRusso wants to merge 3 commits from upstream-pr/3367 into main
ErRusso commented 2026-11-29 22:19:20 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ErRusso on 2026-11-29T22:19:20Z.


Related to #2719 and #3141 (Proton: the submitting thread waits on the write watch); no single issue.

What it changes

This ports the Linux/Proton pieces of ErRusso/ViceTux that no open PR here covers yet. Nothing changes on Windows unless a switch is set.

  • scripts/build-wineserver-viewtree.sh builds the Wine server that keeps a process's mapped views in a tree (Wine bug 60868, not fixed in Proton Experimental 11), for the installed Proton Experimental.
    • It reads that build's Wine commit from ValveSoftware/Proton and builds only server/wineserver.
    • The patch is kroeeee-eeee's wineserver-view-tree.patch. It is fetched at a fixed commit and checked against its SHA-256, so the repository holds no patch file.
    • The result is a Proton of links, with its own server, loader and ntdll.so, to pass as umu-run's PROTONPATH. The installed Proton is not touched.
    • docs/linux-proton.md already measured this server: 13.7-15.3 → 19.1-19.3 fps on an RTX 4090. ViceTux measured the write watch going from 25-90 ms a frame to 3-6 ms (11.1 → 15.8 fps) on an RTX 4060.
  • scripts/fast-copy.sh copies the ~108 GB the title streams most (levels.rpf, the hot data/ttdb folders) to an SSD and links everything else, so the folder works as the dump.
    • From a hard disk, textures waited a mean 23 s for their data; from the SSD, 3 s (ViceTux).
    • On btrfs the folder is its own subvolume, so snapshots leave it out.
  • VICTORY_ABSENT_CACHE=1 (watch.rs, off by default): uncommitted regions found by uncommitted_end are remembered instead of asked of the system each time.
    • Background: ViceTux counted 75,000-216,000 VirtualQuery a second under Wine, each one taking Wine's process-wide lock.
    • A region is forgotten when the runtime maps, commits or allocates over it, and all regions are asked again every 8 frames.
    • It is off because memory committed without the runtime hearing of it counts as a hole until that refresh. The existing writes_in_partly_committed_view_blocks_are_reported fails with it on, as it should.
    • It hasn't been measured on this tree, which already asks fewer of these questions under Wine since ee85549b.
  • docs/linux-proton.md: how to use all three.

How it was tested

  • GPU and profile: not run in the game. This PR has no in-game measurement on this tree; the figures above come from ViceTux and from this repo's own docs/linux-proton.md.
  • Unit tests (cargo xwin test -p victory-gpu --lib watch::, run under Wine 11 on Linux):
    • Both new tests pass: a_remembered_hole_is_found_from_any_of_its_blocks and memory_given_anywhere_in_a_hole_forgets_the_whole_hole.
    • 60 passed and 4 failed. The same 4 fail on main under Wine without this change: bits_and_holes_with_faults_that_take_no_lock, holes_are_known_until_the_runtime_tells, no_mapping_is_lost_between_askers, what_is_left_alone_is_no_known_hole. They expect Windows memory semantics.
    • Not run on Windows.
  • Clippy: cargo xwin clippy --workspace --all-targets reports no new warnings from this change.
    • -D warnings already fails on main (unwind_copy in victory-loader/src/crash.rs:804, unused imports in victory-shader).
    • --all-features already fails to compile victory-gpu on main (11 errors, the diagnostics build; see #2744 and #3086).
  • Scripts: both pass bash -n.
    • The pinned patch URL was fetched and its SHA-256 checked. Its changes are line for line those ViceTux builds with.
    • The full wineserver build was not run here. The script is ViceTux's, as used on Proton Experimental 11.0-20261112, with only the patch source and paths changed.
  • cargo xtask policy --staged: the 4 files pass.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related:
    • ViceTux's other Linux work already has PRs here: the composer root signature in code (#2449), dead pipeline workers (#400), the ambient floor (#3073, #1925), and the Linux launchers (#1630, #1702).
    • #2455 and #2776 change watch.rs too, in other places.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5555748267 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3367). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-29T22:19:20Z. --- <!-- Labels: pr-performance, pr-docs --> Related to #2719 and #3141 (Proton: the submitting thread waits on the write watch); no single issue. ## What it changes This ports the Linux/Proton pieces of [ErRusso/ViceTux](https://github.com/ErRusso/ViceTux) that no open PR here covers yet. Nothing changes on Windows unless a switch is set. - **`scripts/build-wineserver-viewtree.sh`** builds the Wine server that keeps a process's mapped views in a tree (Wine bug 60868, not fixed in Proton Experimental 11), for the installed Proton Experimental. - It reads that build's Wine commit from ValveSoftware/Proton and builds only `server/wineserver`. - The patch is kroeeee-eeee's `wineserver-view-tree.patch`. It is fetched at a fixed commit and checked against its SHA-256, so the repository holds no patch file. - The result is a Proton of links, with its own server, loader and `ntdll.so`, to pass as umu-run's `PROTONPATH`. The installed Proton is not touched. - `docs/linux-proton.md` already measured this server: 13.7-15.3 → 19.1-19.3 fps on an RTX 4090. ViceTux measured the write watch going from 25-90 ms a frame to 3-6 ms (11.1 → 15.8 fps) on an RTX 4060. - **`scripts/fast-copy.sh`** copies the ~108 GB the title streams most (`levels.rpf`, the hot `data/ttdb` folders) to an SSD and links everything else, so the folder works as the dump. - From a hard disk, textures waited a mean 23 s for their data; from the SSD, 3 s (ViceTux). - On btrfs the folder is its own subvolume, so snapshots leave it out. - **`VICTORY_ABSENT_CACHE=1`** (`watch.rs`, **off by default**): uncommitted regions found by `uncommitted_end` are remembered instead of asked of the system each time. - Background: ViceTux counted 75,000-216,000 `VirtualQuery` a second under Wine, each one taking Wine's process-wide lock. - A region is forgotten when the runtime maps, commits or allocates over it, and all regions are asked again every 8 frames. - It is off because memory committed without the runtime hearing of it counts as a hole until that refresh. The existing `writes_in_partly_committed_view_blocks_are_reported` fails with it on, as it should. - It hasn't been measured on this tree, which already asks fewer of these questions under Wine since ee85549b. - **`docs/linux-proton.md`**: how to use all three. ## How it was tested - **GPU and profile:** not run in the game. This PR has no in-game measurement on this tree; the figures above come from ViceTux and from this repo's own `docs/linux-proton.md`. - **Unit tests** (`cargo xwin test -p victory-gpu --lib watch::`, run under Wine 11 on Linux): - Both new tests pass: `a_remembered_hole_is_found_from_any_of_its_blocks` and `memory_given_anywhere_in_a_hole_forgets_the_whole_hole`. - 60 passed and 4 failed. The same 4 fail on `main` under Wine without this change: `bits_and_holes_with_faults_that_take_no_lock`, `holes_are_known_until_the_runtime_tells`, `no_mapping_is_lost_between_askers`, `what_is_left_alone_is_no_known_hole`. They expect Windows memory semantics. - Not run on Windows. - **Clippy:** `cargo xwin clippy --workspace --all-targets` reports no new warnings from this change. - `-D warnings` already fails on `main` (`unwind_copy` in `victory-loader/src/crash.rs:804`, unused imports in `victory-shader`). - `--all-features` already fails to compile `victory-gpu` on `main` (11 errors, the diagnostics build; see #2744 and #3086). - **Scripts:** both pass `bash -n`. - The pinned patch URL was fetched and its SHA-256 checked. Its changes are line for line those ViceTux builds with. - **The full wineserver build was not run here.** The script is ViceTux's, as used on Proton Experimental 11.0-20261112, with only the patch source and paths changed. - `cargo xtask policy --staged`: the 4 files pass. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: - ViceTux's other Linux work already has PRs here: the composer root signature in code (#2449), dead pipeline workers (#400), the ambient floor (#3073, #1925), and the Linux launchers (#1630, #1702). - #2455 and #2776 change `watch.rs` too, in other places. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kassadd commented 2026-11-30 00:47:41 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kassadd on 2026-11-30T00:47:41Z.


The script stops with a bare curl: (22) 404 on the current Proton Experimental, and
that is only the tag.

On a build whose version is
experimental-bleeding-edge-11.0-482815-20261128-pdd4cb8-w0be231-d1011dd-v71cae0-x86_64-unstripped,
the run ends at

Proton build: experimental-bleeding-edge-11.0-...-v71cae0-x86_64
curl: (22) The requested URL returned error: 404

tag="${tag%-x86_64}" takes -x86_64 off a name that ends in
-x86_64-unstripped, leaving …-x86_64, so the API is asked for a tag that has
never existed. The tag without it (…-v71cae0) answers 200 and gives
0be231deb686bc9c9dd15dae836baa5b3b02150e.

That -unstripped (and -stripped) is the whole problem here — once taken apart,
the script builds, the check passes, and ~/.local/share/victory/proton-experimental-viewtree
works: ps shows the wineserver under that folder, and in the world the run went from
13.0-15.9 fps to 16.3-17.5 over eight consecutive samples each (about 14.5 to 16.7,
preparing 41.6 to 35.6 ms a frame). Less than the doc's jump, but on this machine only
about 12 of those 35 ms were the server: the rest is copies and copying back, so the
tree cannot reach further here.

Two changes, on top of your branch (they touch nothing else, and the SHA-256 check for the
patch is left as it is):

 tag="$(awk '{print $2}' "$proton_dir/version")"
+tag="${tag%-unstripped}"
+tag="${tag%-stripped}"
 tag="${tag%-x86_64}"
-wine_commit="$(curl -fsSL "…/contents/wine?ref=$tag" | sed …)"
-[[ -n $wine_commit ]] || { echo "Could not find the Wine commit of $tag on GitHub." >&2; exit 1; }
+contents="$(curl -fsSL "…/contents/wine?ref=$tag")" || contents=""
+wine_commit="$(printf '%s' "$contents" | sed …)"
+[[ -n $wine_commit ]] || {
+    echo "Could not read the Wine commit of $tag from ValveSoftware/Proton." >&2
+    echo "Either no released build has that tag (it comes from $proton_dir/version)," >&2
+    echo "or the request failed (network, or GitHub's hourly limit without a token)." >&2
+    exit 1
+}

The second one is not cosmetic: without it curl -fsSL aborts before the note on the
line below can print, so the user sees the 404 and nothing else. Keeping curl's own
error on screen matters too — a network failure or a rate limit looks exactly like a
missing tag from here, so the note names both instead of claiming the tag is gone.

I checked the four version formats in use on this machine — …-x86_64-unstripped,
proton-11.0-3-x86_64, proton-10.0-4b, proton-9.0-4f — and none of the 1,000 tags
published on ValveSoftware/Proton contains stripped or x86_64, so the extra suffixes
cannot eat a real one.

Happy to send it as a PR against your branch if you would rather review it that way.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7265582890 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3367#issuecomment-7265582890). Originally posted by [Kassadd](https://github.com/Kassadd) on 2026-11-30T00:47:41Z. --- **The script stops with a bare `curl: (22) 404` on the current Proton Experimental, and that is only the tag.** On a build whose `version` is `experimental-bleeding-edge-11.0-482815-20261128-pdd4cb8-w0be231-d1011dd-v71cae0-x86_64-unstripped`, the run ends at ```text Proton build: experimental-bleeding-edge-11.0-...-v71cae0-x86_64 curl: (22) The requested URL returned error: 404 ``` `tag="${tag%-x86_64}"` takes `-x86_64` off a name that ends in `-x86_64-unstripped`, leaving `…-x86_64`, so the API is asked for a tag that has never existed. The tag without it (`…-v71cae0`) answers 200 and gives `0be231deb686bc9c9dd15dae836baa5b3b02150e`. That `-unstripped` (and `-stripped`) is the whole problem here — once taken apart, the script builds, the check passes, and `~/.local/share/victory/proton-experimental-viewtree` works: `ps` shows the `wineserver` under that folder, and in the world the run went from 13.0-15.9 fps to 16.3-17.5 over eight consecutive samples each (about 14.5 to 16.7, `preparing` 41.6 to 35.6 ms a frame). Less than the doc's jump, but on this machine only about 12 of those 35 ms were the server: the rest is `copies` and `copying back`, so the tree cannot reach further here. Two changes, on top of your branch (they touch nothing else, and the SHA-256 check for the patch is left as it is): ```diff tag="$(awk '{print $2}' "$proton_dir/version")" +tag="${tag%-unstripped}" +tag="${tag%-stripped}" tag="${tag%-x86_64}" ``` ```diff -wine_commit="$(curl -fsSL "…/contents/wine?ref=$tag" | sed …)" -[[ -n $wine_commit ]] || { echo "Could not find the Wine commit of $tag on GitHub." >&2; exit 1; } +contents="$(curl -fsSL "…/contents/wine?ref=$tag")" || contents="" +wine_commit="$(printf '%s' "$contents" | sed …)" +[[ -n $wine_commit ]] || { + echo "Could not read the Wine commit of $tag from ValveSoftware/Proton." >&2 + echo "Either no released build has that tag (it comes from $proton_dir/version)," >&2 + echo "or the request failed (network, or GitHub's hourly limit without a token)." >&2 + exit 1 +} ``` The second one is not cosmetic: without it `curl -fsSL` aborts before the note on the line below can print, so the user sees the 404 and nothing else. Keeping curl's own error on screen matters too — a network failure or a rate limit looks exactly like a missing tag from here, so the note names both instead of claiming the tag is gone. I checked the four version formats in use on this machine — `…-x86_64-unstripped`, `proton-11.0-3-x86_64`, `proton-10.0-4b`, `proton-9.0-4f` — and none of the 1,000 tags published on ValveSoftware/Proton contains `stripped` or `x86_64`, so the extra suffixes cannot eat a real one. Happy to send it as a PR against your branch if you would rather review it that way.
ErRusso commented 2026-11-30 01:26:20 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ErRusso on 2026-11-30T01:26:20Z.


Thanks, @Kassadd — confirmed and applied directly on the branch as 86587de0, so no separate PR needed.

Checked here: the -x86_64-unstripped name 404s on the contents API, the trimmed tag gives 0be231deb686…, no ValveSoftware/Proton tag contains stripped or x86_64, and proton-11.0-3-x86_64 still resolves (957ac7cf…). A missing tag now prints curl's error and then the note, instead of exiting on the bare 404.

(One detail: ${tag%-x86_64} left the -unstripped name unchanged rather than leaving …-x86_64; the fix is the same.)

Thanks for the fps numbers too — useful to have a machine where copies and copying back dominate.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7266136077 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3367#issuecomment-7266136077). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-30T01:26:20Z. --- Thanks, @Kassadd — confirmed and applied directly on the branch as 86587de0, so no separate PR needed. Checked here: the `-x86_64-unstripped` name 404s on the contents API, the trimmed tag gives `0be231deb686…`, no ValveSoftware/Proton tag contains `stripped` or `x86_64`, and `proton-11.0-3-x86_64` still resolves (`957ac7cf…`). A missing tag now prints curl's error and then the note, instead of exiting on the bare 404. (One detail: `${tag%-x86_64}` left the `-unstripped` name unchanged rather than leaving `…-x86_64`; the fix is the same.) Thanks for the fps numbers too — useful to have a machine where `copies` and `copying back` dominate.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3367:upstream-pr/3367'
git switch 'upstream-pr/3367'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3367'
git switch 'upstream-pr/3367'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3367'
git switch 'upstream-pr/3367'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3367'
git switch 'main'
git merge --squash 'upstream-pr/3367'
git switch 'main'
git merge --ff-only 'upstream-pr/3367'
git switch 'main'
git merge 'upstream-pr/3367'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!3367
No description provided.