macOS (CrossOver + D3DMetal): known host limits and open PRs #3532

Open
opened 2026-11-30 15:30:04 +00:00 by vakaobr · 0 comments
vakaobr commented 2026-11-30 15:30:04 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-30T15:30:04Z.


Mac work on XCL is spread over #258 (one retail title), #42 (test results) and many PRs. This issue collects it in one place: what the Mac host does differently, which open PRs address it, and what is still unexplained. Test results on a Mac still go to #42, and #258 stays about its title. I will keep this description up to date; corrections and additions are welcome in the comments.

Setup most of us use

  • CrossOver 26.3 (Wine) with D3DMetal on Apple Silicon. The title's x64 code runs through Rosetta 2.
  • XCL cross-built for x86_64-pc-windows-gnu or x86_64-pc-windows-gnullvm (#783 builds the latter in CI on a macOS runner).
  • DXC: point XCL_DXC_DIR at a Windows DXC (for example Z:\...\bin\x64) both when building and when running the tests. Without it at run time, the direct DXIL validator fails with dxcompiler.dll not found.
  • Run GPU tests one per process (<lib test exe> --exact <test> --test-threads=1). When a timeout kills wine, the Windows test process keeps running; end it yourself before the next run.
  • Careful with GPU stress tests: a run that made about 78,000 CreatePlacedResourceX calls in 2.4 s restarted macOS WindowServer and logged me out.

Known host limits

what D3DMetal / Wine / Rosetta does effect on XCL PR
A compute program with any 64-bit atomic writes nothing at all (only non-returning unsigned min / max on device memory work), while every AtomicInt64On*Supported cap reads 1 64-bit atomic tests fail; a title's *_X2 atomics are lost with the rest of their program #983 (tests skip)
DoublePrecisionFloatShaderOps is 0; f64 instructions give wrong results, and a program with any f64 instruction loses its other results too f64 tests fail #787
Apple's metal-shaderconverter overflows its stack on DXIL UMul in some programs; the compile never returns a pipeline whose code addresses memory windows can stop at creation (three UMA tests on main hang this way) #3525
Waves spinning in XCL's LDS barrier starve the wave they wait for (1024-thread group), until the spin gives up threads read LDS before it is written #2363
OpenExistingHeapFromAddress fails on process memory fixed: since #1329 (merged 28 Nov) the committed window gets a copy in video memory #1329
D3D12_FORMAT_SUPPORT2_TILED is reported for no format; reserved textures on shared tiles read scrambled bytes unless block-compressed or made with unordered access every title texture keeps its own copy in video memory (about 16 GB more wired memory while a title loads) #2402, #2492
D3DMetal is native code, not a PE module, and expects its own C++ vtable layout XCL's extended vtable layout puts its metadata where D3DMetal looks #1904
A GPU-side queue wait held about 32 s or more gets Metal's "Caused GPU Timeout Error", and the queue never completes work again (15 to 25 s recover) a title that waits that long on a fence stops for good none yet
PrivateUsage is 0 under Wine memory lines and smoke summaries report 0 MB committed #2362 (Mac), #1097 (Linux Wine)
DwmGetWindowAttribute(DWMWA_CLOAKED) returns E_NOTIMPL the test title's "not cloaked" check fails #1462
The exe's TLS callback gets no DLL_PROCESS_DETACH at exit report.json is not rewritten when a title ends #1461, #1479
Rosetta 2 runs an AVX masked store an element at a time and resumes a fault only on the first element a title's masked store into a page Wine's write watch protects ends the run (rosetta error: unexpectedly need to EmulateForward on a synchronous exception) #1303, #1311, #1313, #1344
^C typed in CrossOver's terminal reaches no process; closing the terminal kills everything with no report the host can outlive its launcher #3431

Other open PRs that matter on a Mac

  • #2361: util::mac_host(), detecting a macOS host under Wine. #2402, #2492, #2363 and #3525 are stacked on it.
  • #3430: log lines echo to stderr on their own thread, so an unread stderr no longer stops the title.
  • #2498 (stacked on #2445): a Release on a thread XCL did not create is made on a Wine thread.
  • #1789: the late-release setting is read when the device is adopted.
  • #2327: the translation cache keys on the HLSL emitter's switches.
  • #2414: under Wine, the e2e test stages the test title under the target directory's drive.
  • #982, #1328: test-only fixes and probes.

Not explained yet

  • On main 9dfbe3e, the test title stops on a Mac after 31 checks: the cloaking check fails (#1462), then the run hangs in some tries and crashes with 0xc0000005 in others. On my fork's vakaobr/xcl mac/integration, which carries most of the PRs above plus a few fork-only changes, it passes all 50 checks. I have not found which change makes the difference.
  • After the Metal GPU timeout above, the queue's fence never advances and XCL keeps submitting to it.
  • gpu::dxil::ops_tests::groupshared_barrier_and_atomics_run fails on a Mac (ops_tests.rs:398), with or without #2363.

What would help most

Nearly every PR above was tested only on a Mac. They need a Windows run of the whole suite and, for runtime changes, scripts/smoke.ps1 pairs before they can be merged. If you have a Windows GPU and some time, a merge-check on any of them (see #3041) moves this further than anything else.

AI use: Claude Code with Claude Opus 5.5 collected the issues and PRs and drafted this from my measurements and theirs. I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:issue:6699862001 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3532). Originally posted by [vakaobr](https://github.com/vakaobr) on 2026-11-30T15:30:04Z. --- Mac work on XCL is spread over #258 (one retail title), #42 (test results) and many PRs. This issue collects it in one place: what the Mac host does differently, which open PRs address it, and what is still unexplained. Test results on a Mac still go to #42, and #258 stays about its title. I will keep this description up to date; corrections and additions are welcome in the comments. **Setup most of us use** - CrossOver 26.3 (Wine) with D3DMetal on Apple Silicon. The title's x64 code runs through Rosetta 2. - XCL cross-built for `x86_64-pc-windows-gnu` or `x86_64-pc-windows-gnullvm` (#783 builds the latter in CI on a macOS runner). - DXC: point `XCL_DXC_DIR` at a Windows DXC (for example `Z:\...\bin\x64`) both when building and when running the tests. Without it at run time, the direct DXIL validator fails with `dxcompiler.dll not found`. - Run GPU tests one per process (`<lib test exe> --exact <test> --test-threads=1`). When a timeout kills `wine`, the Windows test process keeps running; end it yourself before the next run. - Careful with GPU stress tests: a run that made about 78,000 `CreatePlacedResourceX` calls in 2.4 s restarted macOS WindowServer and logged me out. **Known host limits** | what D3DMetal / Wine / Rosetta does | effect on XCL | PR | |---|---|---| | A compute program with any 64-bit atomic writes nothing at all (only non-returning unsigned min / max on device memory work), while every `AtomicInt64On*Supported` cap reads 1 | 64-bit atomic tests fail; a title's `*_X2` atomics are lost with the rest of their program | #983 (tests skip) | | `DoublePrecisionFloatShaderOps` is 0; f64 instructions give wrong results, and a program with any f64 instruction loses its other results too | f64 tests fail | #787 | | Apple's metal-shaderconverter overflows its stack on DXIL `UMul` in some programs; the compile never returns | a pipeline whose code addresses memory windows can stop at creation (three UMA tests on `main` hang this way) | #3525 | | Waves spinning in XCL's LDS barrier starve the wave they wait for (1024-thread group), until the spin gives up | threads read LDS before it is written | #2363 | | `OpenExistingHeapFromAddress` fails on process memory | fixed: since #1329 (merged 28 Nov) the committed window gets a copy in video memory | #1329 | | `D3D12_FORMAT_SUPPORT2_TILED` is reported for no format; reserved textures on shared tiles read scrambled bytes unless block-compressed or made with unordered access | every title texture keeps its own copy in video memory (about 16 GB more wired memory while a title loads) | #2402, #2492 | | D3DMetal is native code, not a PE module, and expects its own C++ vtable layout | XCL's extended vtable layout puts its metadata where D3DMetal looks | #1904 | | A GPU-side queue wait held about 32 s or more gets Metal's "Caused GPU Timeout Error", and the queue never completes work again (15 to 25 s recover) | a title that waits that long on a fence stops for good | none yet | | `PrivateUsage` is 0 under Wine | memory lines and smoke summaries report 0 MB committed | #2362 (Mac), #1097 (Linux Wine) | | `DwmGetWindowAttribute(DWMWA_CLOAKED)` returns `E_NOTIMPL` | the test title's "not cloaked" check fails | #1462 | | The exe's TLS callback gets no `DLL_PROCESS_DETACH` at exit | `report.json` is not rewritten when a title ends | #1461, #1479 | | Rosetta 2 runs an AVX masked store an element at a time and resumes a fault only on the first element | a title's masked store into a page Wine's write watch protects ends the run (`rosetta error: unexpectedly need to EmulateForward on a synchronous exception`) | #1303, #1311, #1313, #1344 | | `^C` typed in CrossOver's terminal reaches no process; closing the terminal kills everything with no report | the host can outlive its launcher | #3431 | **Other open PRs that matter on a Mac** - #2361: `util::mac_host()`, detecting a macOS host under Wine. #2402, #2492, #2363 and #3525 are stacked on it. - #3430: log lines echo to stderr on their own thread, so an unread stderr no longer stops the title. - #2498 (stacked on #2445): a `Release` on a thread XCL did not create is made on a Wine thread. - #1789: the late-release setting is read when the device is adopted. - #2327: the translation cache keys on the HLSL emitter's switches. - #2414: under Wine, the e2e test stages the test title under the target directory's drive. - #982, #1328: test-only fixes and probes. **Not explained yet** - On `main` `9dfbe3e`, the test title stops on a Mac after 31 checks: the cloaking check fails (#1462), then the run hangs in some tries and crashes with `0xc0000005` in others. On my fork's `vakaobr/xcl` `mac/integration`, which carries most of the PRs above plus a few fork-only changes, it passes all 50 checks. I have not found which change makes the difference. - After the Metal GPU timeout above, the queue's fence never advances and XCL keeps submitting to it. - `gpu::dxil::ops_tests::groupshared_barrier_and_atomics_run` fails on a Mac (`ops_tests.rs:398`), with or without #2363. **What would help most** Nearly every PR above was tested only on a Mac. They need a Windows run of the whole suite and, for runtime changes, `scripts/smoke.ps1` pairs before they can be merged. If you have a Windows GPU and some time, a `merge-check` on any of them (see #3041) moves this further than anything else. **AI use:** Claude Code with Claude Opus 5.5 collected the issues and PRs and drafted this from my measurements and theirs. I checked it before posting.
Sign in to join this conversation.
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
xcl-dev/xcl#3532
No description provided.