linux: build a wineserver that indexes mapped views (GE-Proton11-14) #157

Manually merged
github merged 4 commits from github-bot/gh-157 into gh-pr/157/base 2026-11-27 07:18:32 +00:00 AGit
Owner

@⁠nullexxx on GitHub · 2026-11-27 04:39 UTC · original
nullexxx:linux/wineserver-view-tree → main · +344 −5 · 5 files · 4 commits · merged 2026-11-27 07:14 UTC

On Linux, Proton's stock wineserver makes this title crawl. The title keeps 90,000 to 136,000 mapped views alive and maps or unmaps about a thousand a second. wineserver keeps each process's views in a list and searches it from the front on every map and unmap request (is_valid_view_addr, find_mapped_view and find_mapped_addr in server/mapping.c), and everything that waits on the server waits behind those searches.

This adds linux/wineserver/:

  • view-tree.patch: a red-black tree of all views (wine/rbtree.h), keyed by process and base address. Views never overlap, so a lookup by address is a search for the nearest base at or below it. The list stays, for its order.
  • build.sh: builds GE-Proton11-14's wineserver from GE's own Wine and wine-staging, with GE's Wine patches, plus this one. It installs into a copy, GE-Proton11-14-viewtree, and keeps the original as files/bin/wineserver.ge.
  • A short "Linux and Proton" section in README.md.

Measured: RTX 5080, Series S profile, same Vice-Tay build and launch options, opening area.

wineserver fps copies per frame
stock GE-Proton11-14 2.7 to 4 190 to 294 ms
GE-Proton11-14-viewtree about 20 22 to 25 ms

The patch was checked against the original searches with 2 million random operations (up to 66,000 live views across three processes). The 7 pipeline hangs in #133 reproduce identically on stock GE-Proton, so they are unrelated to this patch.

GE-Proton's master already carries an equivalent change (patches/wine-hotfixes/em-fixups/0078-server-store-process-views-in-an-rb-tree.patch), but no release includes it yet (the latest is GE-Proton11-14). Once one does, this folder can go.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SEGb52ApL88uPMf5GhSz8K

**@⁠nullexxx** on GitHub · 2026-11-27 04:39 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/157) `nullexxx:linux/wineserver-view-tree` → `main` · +344 −5 · 5 files · 4 commits · merged 2026-11-27 07:14 UTC On Linux, Proton's stock `wineserver` makes this title crawl. The title keeps 90,000 to 136,000 mapped views alive and maps or unmaps about a thousand a second. `wineserver` keeps each process's views in a list and searches it from the front on every map and unmap request (`is_valid_view_addr`, `find_mapped_view` and `find_mapped_addr` in `server/mapping.c`), and everything that waits on the server waits behind those searches. This adds `linux/wineserver/`: - **`view-tree.patch`**: a red-black tree of all views (`wine/rbtree.h`), keyed by process and base address. Views never overlap, so a lookup by address is a search for the nearest base at or below it. The list stays, for its order. - **`build.sh`**: builds GE-Proton11-14's `wineserver` from GE's own Wine and wine-staging, with GE's Wine patches, plus this one. It installs into a copy, `GE-Proton11-14-viewtree`, and keeps the original as `files/bin/wineserver.ge`. - **A short "Linux and Proton" section in `README.md`.** **Measured:** RTX 5080, Series S profile, same Vice-Tay build and launch options, opening area. | `wineserver` | fps | copies per frame | |---|---|---| | stock GE-Proton11-14 | 2.7 to 4 | 190 to 294 ms | | GE-Proton11-14-viewtree | about 20 | 22 to 25 ms | The patch was checked against the original searches with 2 million random operations (up to 66,000 live views across three processes). The 7 pipeline hangs in #133 reproduce identically on stock GE-Proton, so they are unrelated to this patch. GE-Proton's `master` already carries an equivalent change (`patches/wine-hotfixes/em-fixups/0078-server-store-process-views-in-an-rb-tree.patch`), but no release includes it yet (the latest is GE-Proton11-14). Once one does, this folder can go. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SEGb52ApL88uPMf5GhSz8K
Under Proton the title keeps 90,000-136,000 mapped views alive and maps
or unmaps about a thousand a second; stock wineserver searches a
per-process list on each request (is_valid_view_addr, find_mapped_view,
find_mapped_addr in server/mapping.c). view-tree.patch adds a red-black
tree of views (wine/rbtree.h) keyed by process and base; build.sh builds
GE-Proton11-14's wineserver with it into a GE-Proton11-14-viewtree copy.

Same build and settings on an RTX 5080: 2.7-4 fps with 190-294 ms of
copies a frame on stock GE-Proton11-14, about 20 fps with 22-25 ms on
the patched server.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SEGb52ApL88uPMf5GhSz8K
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 04:43:12 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 05:46 UTC · original

@⁠nullexxx I ran bash -n on build.sh. It passed. The installer guard needs one change before this can be used safely with an arbitrary path. A GE version mismatch currently prints a warning and continues, so a server built against GE-Proton11-14 can end up in a different runtime. Turn that tag check into a hard error and reject an OUT that resolves to the source directory before copying or installing.

The stock and indexed 5080 measurements give us the performance comparison for that pinned build.

**@⁠TaynanGT** on GitHub · 2026-11-27 05:46 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7210936787) @⁠nullexxx I ran `bash -n` on `build.sh`. It passed. The installer guard needs one change before this can be used safely with an arbitrary path. A GE version mismatch currently prints a warning and continues, so a server built against `GE-Proton11-14` can end up in a different runtime. Turn that tag check into a hard error and reject an `OUT` that resolves to the source directory before copying or installing. The stock and indexed 5080 measurements give us the performance comparison for that pinned build.
github-bot force-pushed github-bot/gh-157 from 3200c3f4d6 to 992dda1f55 2026-11-27 05:56:07 +00:00 Compare
Author
Owner

@⁠nullexxx on GitHub · 2026-11-27 05:54 UTC · original

Thanks, done in the new commit (the branch is also rebased onto current main, as the earlier test failures came from the older base):

  • A version mismatch is now a hard error. The version file's tag must be exactly GE-Proton11-14; the old check only warned and continued.
  • OUT is resolved with realpath and refused if it is the source Proton's folder, inside it, or contains it, which covers symlinks too. An existing OUT must also be a copy of the same version.
  • One more fix found while testing: mkdir -p "$WORK" && cd "$WORK" did not stop the script under set -e when mkdir failed. They are now separate commands.

Checked against fake Proton folders: a wrong version, OUT equal to, symlinked to, inside or containing the source, and an existing OUT of another version are all refused, and valid paths pass.

**@⁠nullexxx** on GitHub · 2026-11-27 05:54 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7211053985) Thanks, done in the new commit (the branch is also rebased onto current `main`, as the earlier test failures came from the older base): - A version mismatch is now a hard error. The version file's tag must be exactly `GE-Proton11-14`; the old check only warned and continued. - `OUT` is resolved with `realpath` and refused if it is the source Proton's folder, inside it, or contains it, which covers symlinks too. An existing `OUT` must also be a copy of the same version. - One more fix found while testing: `mkdir -p "$WORK" && cd "$WORK"` did not stop the script under `set -e` when `mkdir` failed. They are now separate commands. Checked against fake Proton folders: a wrong version, `OUT` equal to, symlinked to, inside or containing the source, and an existing `OUT` of another version are all refused, and valid paths pass.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 06:02 UTC · original

@⁠nullexxx bash -n and all seven preflight cases passed in Git Bash on Windows. The version check and OUT protection cover what I flagged.

The current CI failure is the asset check rejecting linux/wineserver/view-tree.patch. I tested allowlisting that exact path in xtask/src/policy.rs. It accepts the diff and keeps the existing size and content checks in place. Failing CI job

**@⁠TaynanGT** on GitHub · 2026-11-27 06:02 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7211159367) @⁠nullexxx `bash -n` and all seven preflight cases passed in Git Bash on Windows. The version check and `OUT` protection cover what I flagged. The current CI failure is the asset check rejecting `linux/wineserver/view-tree.patch`. I tested allowlisting that exact path in `xtask/src/policy.rs`. It accepts the diff and keeps the existing size and content checks in place. [Failing CI job](https://github.com/TaynanGT/Vice-Tay/actions/runs/45948605171/job/140338959489)
Allow only the exact GE-Proton patch path and keep the existing size and content checks.
Use the resolved source and copy paths throughout the build, and reject a root destination that contains the source.
github-bot changed target branch from main to gh-pr/157/base 2026-11-27 07:18:31 +00:00
github manually merged commit 5d78efe4ea into gh-pr/157/base 2026-11-27 07:18:32 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 07:22 UTC · original

@⁠nullexxx I built the exact PR revision on Ubuntu 24.04 under WSL2 with the official GE-Proton11-14 archive, then installed it a second time into another copy using the same work directory. Both servers report Wine 11.0. I compared the original binary byte-for-byte with both saved copies after the retry. The build and CI are confirmed, and the PR is on main.

**@⁠TaynanGT** on GitHub · 2026-11-27 07:22 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7212405132) @⁠nullexxx I built the exact PR revision on Ubuntu 24.04 under WSL2 with the official GE-Proton11-14 archive, then installed it a second time into another copy using the same work directory. Both servers report Wine 11.0. I compared the original binary byte-for-byte with both saved copies after the retry. The build and CI are confirmed, and the PR is on `main`.
This discussion has been locked. Commenting is limited to contributors.
No description provided.