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

Merged
nullexxx merged 4 commits from upstream-pr/157 into main 2026-11-27 07:14:58 +00:00
nullexxx commented 2026-11-27 04:39:28 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by nullexxx on 2026-11-27T04:39:28Z.


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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5521287611 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/157). Originally posted by [nullexxx](https://github.com/nullexxx) on 2026-11-27T04:39:28Z. --- 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
TaynanGT commented 2026-11-27 05:46:39 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T05:46:39Z.


@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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7210936787 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7210936787). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T05:46:39Z. --- @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.
nullexxx commented 2026-11-27 05:54:54 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by nullexxx on 2026-11-27T05:54:54Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7211053985 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7211053985). Originally posted by [nullexxx](https://github.com/nullexxx) on 2026-11-27T05:54:54Z. --- 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.
TaynanGT commented 2026-11-27 06:02:14 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T06:02:14Z.


@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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7211159367 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7211159367). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T06:02:14Z. --- @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)
TaynanGT commented 2026-11-27 07:22:14 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T07:22:14Z.


@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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7212405132 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/157#issuecomment-7212405132). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T07:22:14Z. --- @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`.
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
TaynanGT/Vice-Tay!157
No description provided.