Skip to content

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 into
trustno1-coder:mainfrom
ErRusso:linux/vicetux-proton
Open

ErRusso wants to merge 3 commits into
trustno1-coder:mainfrom
ErRusso:linux/vicetux-proton

Conversation

@ErRusso

@ErRusso ErRusso commented Nov 29, 2026

Copy link
Copy Markdown

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 ee85549.
  • 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.
  • 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

🤖 Generated with Claude Code

ErRusso and others added 2 commits November 29, 2026 23:18
…SENT_CACHE=1)

Every asking looked the absent blocks of each uncommitted region up again
with VirtualQuery. Under Wine each one takes the process-wide lock that
every thread queues at: ErRusso/ViceTux counted 75,000-216,000 a second
(RTX 4060, Ryzen 7 7700X, Proton Experimental), as
kroeeee-eeee/VIctory-Linux-Proton-Wine-7900XT-XTX f5c30ef had.

With VICTORY_ABSENT_CACHE=1 the regions found are kept until the runtime
maps, commits or allocates memory over them (title_memory_remapped,
title_memory_made_real, title_memory_allocated), and all are asked again
every 8 frames. Off by default: memory committed without the runtime
hearing of it is taken for a hole until then (the existing
writes_in_partly_committed_view_blocks_are_reported fails with it on), and
it has not been measured on this tree, which asks fewer of these questions
under Wine since ee85549.

Ported from ErRusso/ViceTux 34bc73ab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- scripts/build-wineserver-viewtree.sh: builds the Wine server that keeps
  mapped views in a tree (Wine bug 60868) for the installed Proton
  Experimental, from Proton's own Wine commit and kroeeee-eeee's patch
  (fetched at a fixed commit, checked by SHA-256, not kept here), and a
  Proton of links that uses it, for umu-run's PROTONPATH. docs/linux-proton.md
  already measured that server (13.7-15.3 to 19.1-19.3 fps on an RTX 4090);
  ViceTux: the write watch from 25-90 ms a frame to 3-6 ms on an RTX 4060.
- scripts/fast-copy.sh: copies the ~108 GB the title streams most to an SSD
  and links the rest, so the folder works as the dump: textures waited a
  mean 23 s for their data from a hard disk, 3 s from the SSD (ViceTux).
- docs/linux-proton.md: both, and VICTORY_ABSENT_CACHE.

Ported from ErRusso/ViceTux 13fa9040 and 7912f766.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kassadd

Kassadd commented Nov 30, 2026

Copy link
Copy Markdown

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.

…rl fails

Proton Experimental's version file can name a build
"...-v71cae0-x86_64-unstripped"; taking only -x86_64 off left the suffix
on, and ValveSoftware/Proton has no such tag (none of its tags contains
"stripped" or "x86_64"), so the contents API answered 404. -unstripped and
-stripped now come off first.

curl -f inside the pipeline also ended the script under set -e before the
note below it could print, leaving a bare "curl: (22) 404". The request
is now allowed to fail, and the note names both causes: a tag that no
release has, or a failed request (network, GitHub's unauthenticated limit).

Reported and measured by Kassadd on PR trustno1-coder#3367 (16.3-17.5 fps from
13.0-15.9 with the tree on that machine).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ErRusso

ErRusso commented Nov 30, 2026

Copy link
Copy Markdown
Author

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.

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