Memory: detect a macOS host under Wine (mac_host) #2361

Open
github-bot wants to merge 1 commit from github-bot/gh-2361 into main AGit
Owner

@⁠vakaobr on GitHub · 2026-11-25 16:40 UTC · original
vakaobr:memory/mac-host-detection → main · +44 −0 · 1 files · 1 commits · draft

Adds util::mac_host(): the process runs under Wine on a Mac (CrossOver or the Game Porting Toolkit), where D3D12 is Apple's D3DMetal and the title's code runs through Rosetta 2. ntdll's wine_get_host_version names the host's system, and "Darwin" is a Mac; XCL_MAC_HOST=1 / 0 overrides it. Nothing calls it yet: two Mac changes that need to know they run there build on it (the s_barrier default and title textures on shared pages, both stacked on this). Until now only the mac7 branch from #258 had it. Part of #258.

What is in it

  • crates/xcl/src/util.rs: mac_host() (next to under_wine()), its decision in mac_host_from(forced, sysname), and the test a_mac_host_is_darwin_under_wine_unless_forced.

Tested

  • MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3.0, D3DMetal 3.0, Rust 1.100.0 x86_64-pc-windows-gnu, debug, at 6d6a3e3 (on main 65fc114).
  • util::tests::a_mac_host_is_darwin_under_wine_unless_forced and util::tests::dll_keys, each in its own process in the CrossOver bottle: 2 passed.
  • The detection is the same as mac7's, which has been running on this Mac.

Regression run

  • None: nothing calls the new function, so a run is the same as main's. I have no title of my own to run scripts/smoke.ps1 on.

Not tested

  • Windows (where wine_get_host_version does not exist, so it answers false), Wine on Linux, the whole suite.

AI use

  • Claude Code with Claude Opus 5.5 wrote the change and the test, ran the tests and wrote this description.
**@⁠vakaobr** on GitHub · 2026-11-25 16:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2361) `vakaobr:memory/mac-host-detection` → `main` · +44 −0 · 1 files · 1 commits · draft Adds `util::mac_host()`: the process runs under Wine on a Mac (CrossOver or the Game Porting Toolkit), where D3D12 is Apple's D3DMetal and the title's code runs through Rosetta 2. ntdll's `wine_get_host_version` names the host's system, and "Darwin" is a Mac; `XCL_MAC_HOST=1` / `0` overrides it. Nothing calls it yet: two Mac changes that need to know they run there build on it (the `s_barrier` default and title textures on shared pages, both stacked on this). Until now only the `mac7` branch from #258 had it. Part of #258. **What is in it** - `crates/xcl/src/util.rs`: `mac_host()` (next to `under_wine()`), its decision in `mac_host_from(forced, sysname)`, and the test `a_mac_host_is_darwin_under_wine_unless_forced`. **Tested** - MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3.0, D3DMetal 3.0, Rust 1.100.0 `x86_64-pc-windows-gnu`, debug, at `6d6a3e3` (on `main` `65fc114`). - `util::tests::a_mac_host_is_darwin_under_wine_unless_forced` and `util::tests::dll_keys`, each in its own process in the CrossOver bottle: 2 passed. - The detection is the same as `mac7`'s, which has been running on this Mac. **Regression run** - None: nothing calls the new function, so a run is the same as `main`'s. I have no title of my own to run `scripts/smoke.ps1` on. **Not tested** - Windows (where `wine_get_host_version` does not exist, so it answers false), Wine on Linux, the whole suite. **AI use** - Claude Code with Claude Opus 5.5 wrote the change and the test, ran the tests and wrote this description.
util::mac_host(): the process runs under Wine on a Mac (CrossOver or the
Game Porting Toolkit), where D3D12 is Apple's D3DMetal and the title's
code runs through Rosetta 2. ntdll's wine_get_host_version names the
host's system; "Darwin" is a Mac. XCL_MAC_HOST=1 / 0 overrides it.

Nothing calls it yet. The Mac changes that need to know they run there
(the barrier default, title textures on shared pages) build on it; until
now only Ahmet-Dedeler's mac7 branch had it. Part of #258.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:28:55 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 18:50 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 18:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/2361#issuecomment-7171468272) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2361/head:github-bot/gh-2361'
git switch 'github-bot/gh-2361'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2361'
git switch 'github-bot/gh-2361'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2361'
git switch 'github-bot/gh-2361'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2361'
git switch 'main'
git merge --squash 'github-bot/gh-2361'
git switch 'main'
git merge --ff-only 'github-bot/gh-2361'
git switch 'main'
git merge 'github-bot/gh-2361'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.