[Bug] Apple M5 Pro (24 GB) + CrossOver 26.3 / D3DMetal 3.0: synthetic test hangs on Check #35 with sparse fence stall & Metal GPU timeout #5

Closed
opened 2026-11-26 18:14:02 +00:00 by github-bot · 3 comments
Owner

@⁠jgrizon on GitHub · 2026-11-26 18:13 UTC · original

Test environment

  • Mac: Apple M5 Pro, 24 GB unified memory
  • macOS: 27.3 (Build 26C5047e)
  • ScarlettMac: main at b91d663 (XCL Mac pinned at d0d9889 + patches/mac-compat.patch)
  • CrossOver: 26.3.0.39832 (stable, not Preview)
  • Graphics backend: D3DMetal 3.0 (CX_GRAPHICS_BACKEND=d3dmetal, WINEMSYNC=1) in a dedicated win11_64 bottle (ScarlettLab)
  • Toolchains: Rust 1.99.1 (x86_64-pc-windows-gnullvm), LLVM-MinGW 20261117, DXC 1.9.2609.5

Steps to reproduce

scripts/build.sh --test-title
scripts/run.sh --test-title

Run three separate times from the repository root with fresh per-run test data.

Expected and actual result

  • Expected: All 50 checks run to completion and exit with the failed check count (6–7 failures on M3 Max + CrossOver Preview 27.0.0.41073 / D3DMetal 4.0b3).
  • Actual (3/3 runs identical):
    • Checks 1–34 complete with 33 passes and 1 failure:
      • Check 11: [FAIL] user32: a top-level window made either way (CreateWindowExW / A) is the hidden 1920x1080 console screen: W: not cloaked (same known failure as M3 Max).
    • The process then hangs indefinitely on Check 35 (D3D12.X: triangle rendered on the real GPU and read back (console + derived pipeline) / gpu::render_triangle) immediately after the nested occlusion query log line.
    • XCL logs a 5 s sparse queue fence stall (at 9 waiting for 10), followed by a Metal GPU timeout error (MTLCommandBufferErrorDomain Code=2 / kIOGPUCommandBufferCallbackErrorTimeout), after which the process never exits (verified up to 120 s on run 1, 45 s on run 2, 30 s on run 3).
  • Note: scripts/run.sh --inspect and runtime-preview/run.sh <checkpoint victory.exe> config both succeed cleanly (exit 0) in the same bottle.

Relevant log excerpt (sanitized)

[PASS] D3D12.X: queue + fence signal on the GPU
[PASS] D3D12.X: shaders captured; console shader gets a fallback PSO
[PASS] D3D12.X: retail-format console shader (XDAT/XBCH/FSSM) captured + fallback PSO
xcl: D3D12.X: CreateDerivedPipelineStateX – unknown patch part 4
xcl: D3D12.X: GPU-owned textures in title memory: arenas on this host (XCL_VRAM_ARENAS=0 tries tiled resources on pages)
xcl: D3D12.X: video-memory arena #0 for title addresses 0x700000000..0x700010000 (65536 bytes of arenas made so far)
xcl: console buffers in UMA: Map = console address (0x700020000)
xcl: D3D12.X: nested occlusion query – the outer one ends there and reports visible, the inner one counts
xcl: sparse: the queue has not reached fence value 10 after 5 s (at 9)
[operator()_block_invoke:268][ERROR] command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=2 "Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout)" UserInfo={NSLocalizedDescription=Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout), NSUnderlyingError=... {Error Domain=IOGPUCommandQueueErrorDomain Code=2 "(null)"}}
**@⁠jgrizon** on GitHub · 2026-11-26 18:13 UTC · [original](https://github.com/paveledits/ScarlettMac/issues/5) ### Test environment - **Mac**: Apple M5 Pro, 24 GB unified memory - **macOS**: 27.3 (Build `26C5047e`) - **ScarlettMac**: `main` at `b91d663` (XCL Mac pinned at `d0d9889` + `patches/mac-compat.patch`) - **CrossOver**: `26.3.0.39832` (stable, not Preview) - **Graphics backend**: D3DMetal `3.0` (`CX_GRAPHICS_BACKEND=d3dmetal`, `WINEMSYNC=1`) in a dedicated `win11_64` bottle (`ScarlettLab`) - **Toolchains**: Rust `1.99.1` (`x86_64-pc-windows-gnullvm`), LLVM-MinGW `20261117`, DXC `1.9.2609.5` ### Steps to reproduce ```sh scripts/build.sh --test-title scripts/run.sh --test-title ``` Run three separate times from the repository root with fresh per-run test data. ### Expected and actual result - **Expected**: All 50 checks run to completion and exit with the failed check count (6–7 failures on M3 Max + CrossOver Preview 27.0.0.41073 / D3DMetal 4.0b3). - **Actual (3/3 runs identical)**: - Checks 1–34 complete with **33 passes and 1 failure**: - Check 11: `[FAIL] user32: a top-level window made either way (CreateWindowExW / A) is the hidden 1920x1080 console screen: W: not cloaked` (same known failure as M3 Max). - The process then **hangs indefinitely on Check 35** (`D3D12.X: triangle rendered on the real GPU and read back (console + derived pipeline)` / `gpu::render_triangle`) immediately after the nested occlusion query log line. - XCL logs a 5 s sparse queue fence stall (`at 9` waiting for `10`), followed by a Metal GPU timeout error (`MTLCommandBufferErrorDomain Code=2` / `kIOGPUCommandBufferCallbackErrorTimeout`), after which the process never exits (verified up to 120 s on run 1, 45 s on run 2, 30 s on run 3). - Note: `scripts/run.sh --inspect` and `runtime-preview/run.sh <checkpoint victory.exe> config` both succeed cleanly (`exit 0`) in the same bottle. ### Relevant log excerpt (sanitized) ```text [PASS] D3D12.X: queue + fence signal on the GPU [PASS] D3D12.X: shaders captured; console shader gets a fallback PSO [PASS] D3D12.X: retail-format console shader (XDAT/XBCH/FSSM) captured + fallback PSO xcl: D3D12.X: CreateDerivedPipelineStateX – unknown patch part 4 xcl: D3D12.X: GPU-owned textures in title memory: arenas on this host (XCL_VRAM_ARENAS=0 tries tiled resources on pages) xcl: D3D12.X: video-memory arena #0 for title addresses 0x700000000..0x700010000 (65536 bytes of arenas made so far) xcl: console buffers in UMA: Map = console address (0x700020000) xcl: D3D12.X: nested occlusion query – the outer one ends there and reports visible, the inner one counts xcl: sparse: the queue has not reached fence value 10 after 5 s (at 9) [operator()_block_invoke:268][ERROR] command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=2 "Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout)" UserInfo={NSLocalizedDescription=Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout), NSUnderlyingError=... {Error Domain=IOGPUCommandQueueErrorDomain Code=2 "(null)"}} ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:14:02 +00:00
Author
Owner

@⁠jgrizon on GitHub · 2026-11-26 18:30 UTC · original

Bisect follow-up on Check #35 (Apple M5 Pro + CrossOver 26.3 / D3DMetal 3.0)

Bisected gpu::render_triangle in xcl_testtitle:

  • Not the cause: XCL_VRAM_ARENAS=0, cross-queue queue.Wait / s.queue.Wait (tested with CPU-side fence waits; title queue did not reach rb_fence 1 after 5 s), sparse index buffer / DrawIndexedX, nested occlusion queries, ResolveQueryData, and WriteBufferImmediate.
  • Trigger isolated:
    • Running Check #35 with OMSetRenderTargets + ClearRenderTargetView + DrawInstanced (base + derived PSO), without the ResourceBarrier(RENDER_TARGET -> COPY_SOURCE) + CopyTextureRegion, does not hang: the suite finishes in 6 s with 46/50 checks passing.
    • Adding list.ResourceBarrier([rt: RENDER_TARGET -> COPY_SOURCE]) alone reproduces the hang deterministically.
    • Notably, Check #44 (dynamic_depth_bias), which issues the same RENDER_TARGET -> COPY_SOURCE barrier and CopyTextureRegion after an intervening KickoffX split, passes cleanly.
  • 4 failures observed in the 46/50 run (with Check #35's barrier/copy bypassed):
    1. Check #11 (user32 window cloaking — W: not cloaked, known)
    2. Check #35 (render_triangle — expected failure since queries/copy were skipped)
    3. Check #38 (console_list_methods — no GPU timestamp; D3DMetal 3.0 logs Unsupported API: ID3D12GraphicsCommandList::EndQuery / ResolveQueryData - Type = 2)
    4. Check #50 (XAudio2 — XMA2 GetState: ctx=0x0, queued=1)
    • All sparse/coherent VRAM checks (#39–#41), DMA/title memory (#37), DirectStorage fence (#46), and title/streamed textures (#47–#48) passed on M5 Pro + D3DMetal 3.0.
**@⁠jgrizon** on GitHub · 2026-11-26 18:30 UTC · [original](https://github.com/paveledits/ScarlettMac/issues/5#issuecomment-7200541052) ### Bisect follow-up on Check #35 (Apple M5 Pro + CrossOver 26.3 / D3DMetal 3.0) Bisected `gpu::render_triangle` in `xcl_testtitle`: - **Not the cause**: `XCL_VRAM_ARENAS=0`, cross-queue `queue.Wait` / `s.queue.Wait` (tested with CPU-side fence waits; `title queue did not reach rb_fence 1 after 5 s`), sparse index buffer / `DrawIndexedX`, nested occlusion queries, `ResolveQueryData`, and `WriteBufferImmediate`. - **Trigger isolated**: - Running Check #35 with `OMSetRenderTargets` + `ClearRenderTargetView` + `DrawInstanced` (base + derived PSO), **without** the `ResourceBarrier(RENDER_TARGET -> COPY_SOURCE)` + `CopyTextureRegion`, does **not** hang: the suite finishes in **6 s** with **46/50 checks passing**. - Adding `list.ResourceBarrier([rt: RENDER_TARGET -> COPY_SOURCE])` alone reproduces the hang deterministically. - Notably, Check #44 (`dynamic_depth_bias`), which issues the same `RENDER_TARGET -> COPY_SOURCE` barrier and `CopyTextureRegion` **after** an intervening `KickoffX` split, passes cleanly. - **4 failures observed in the 46/50 run** (with Check #35's barrier/copy bypassed): 1. Check #11 (`user32` window cloaking — `W: not cloaked`, known) 2. Check #35 (`render_triangle` — expected failure since queries/copy were skipped) 3. Check #38 (`console_list_methods` — `no GPU timestamp`; D3DMetal 3.0 logs `Unsupported API: ID3D12GraphicsCommandList::EndQuery / ResolveQueryData - Type = 2`) 4. Check #50 (`XAudio2` — `XMA2 GetState: ctx=0x0, queued=1`) - All sparse/coherent VRAM checks (#39–#41), DMA/title memory (#37), DirectStorage fence (#46), and title/streamed textures (#47–#48) passed on M5 Pro + D3DMetal 3.0.
Author
Owner

@⁠paveledits on GitHub · 2026-11-27 00:45 UTC · original

Thanks for narrowing this down to the render-target transition. The synthetic triangle check now uses KickoffX to submit the draw and query work before the transition and texture copy. It still verifies the readback pixels and occlusion results. Patch on main

I built and ran the full synthetic suite on an M3 Max with CrossOver Preview 27.0.0.41073. Check #35 passed and the suite finished with 43 of 50 checks passing. The same seven checks failed as in the local baseline. The M5 Pro with CrossOver 26.3 and D3DMetal 3.0 still needs a retest.

Could you rebuild with scripts/build.sh --test-title from 55c25ae or newer, then rerun scripts/run.sh --test-title in the same bottle? Please share the Check #35 result and whether the sparse-fence or Metal timeout still appears. I’ll leave the issue open for that result.

**@⁠paveledits** on GitHub · 2026-11-27 00:45 UTC · [original](https://github.com/paveledits/ScarlettMac/issues/5#issuecomment-7206721206) Thanks for narrowing this down to the render-target transition. The synthetic triangle check now uses `KickoffX` to submit the draw and query work before the transition and texture copy. It still verifies the readback pixels and occlusion results. [Patch on main](https://github.com/paveledits/ScarlettMac/commit/55c25ae15cf052dd4e43892a837d2547b901d9e4) I built and ran the full synthetic suite on an M3 Max with CrossOver Preview 27.0.0.41073. Check #35 passed and the suite finished with 43 of 50 checks passing. The same seven checks failed as in the local baseline. The M5 Pro with CrossOver 26.3 and D3DMetal 3.0 still needs a retest. Could you rebuild with `scripts/build.sh --test-title` from `55c25ae` or newer, then rerun `scripts/run.sh --test-title` in the same bottle? Please share the Check #35 result and whether the sparse-fence or Metal timeout still appears. I’ll leave the issue open for that result.
Author
Owner

@⁠jgrizon on GitHub · 2026-11-27 18:42 UTC · original

Retest on 55c25ae or newer: Check #35 passes, no timeout

Setup: Apple M5 Pro, 24 GB, macOS 27.3, CrossOver 26.3.0.39832, D3DMetal 3.0. ScarlettMac main at f4b08d9, which includes 55c25ae. I ran scripts/build.sh --prepare (xcl-mac d0d9889, v0.1.0-stage6), then scripts/build.sh --test-title, then scripts/run.sh --test-title in the same bottle as before.

  • Check #35 (triangle rendered on the real GPU and read back (console + derived pipeline)): PASS
  • The sparse-fence or Metal timeout is gone. No MTLCommandBufferErrorDomain error and no has not reached fence value line in the run. The suite runs to the end.
  • 47 of 50 pass. Exit code 3. The three failures are the ones from my bisect run:
    1. #11 user32: W: not cloaked
    2. #38 console command list memory methods: no GPU timestamp. As far as I can tell, D3DMetal 3.0 returns 0 for timestamp queries.
    3. #50 XAudio2: XMA2 GetState: ctx=0x0, queued=1
  • All sparse and coherent VRAM checks pass (#39 to #41), as do DirectStorage (#46) and the title and streamed textures (#47, #48).

From my side this issue can be closed. The three remaining failures look separate from #35.

**@⁠jgrizon** on GitHub · 2026-11-27 18:42 UTC · [original](https://github.com/paveledits/ScarlettMac/issues/5#issuecomment-7225782573) ### Retest on 55c25ae or newer: Check #35 passes, no timeout Setup: Apple M5 Pro, 24 GB, macOS 27.3, CrossOver 26.3.0.39832, D3DMetal 3.0. ScarlettMac main at `f4b08d9`, which includes `55c25ae`. I ran `scripts/build.sh --prepare` (xcl-mac `d0d9889`, `v0.1.0-stage6`), then `scripts/build.sh --test-title`, then `scripts/run.sh --test-title` in the same bottle as before. - **Check #35** (`triangle rendered on the real GPU and read back (console + derived pipeline)`): **PASS** - **The sparse-fence or Metal timeout is gone.** No `MTLCommandBufferErrorDomain` error and no `has not reached fence value` line in the run. The suite runs to the end. - **47 of 50 pass.** Exit code 3. The three failures are the ones from my bisect run: 1. #11 `user32`: `W: not cloaked` 2. #38 console command list memory methods: `no GPU timestamp`. As far as I can tell, D3DMetal 3.0 returns 0 for timestamp queries. 3. #50 `XAudio2`: `XMA2 GetState: ctx=0x0, queued=1` - All sparse and coherent VRAM checks pass (#39 to #41), as do DirectStorage (#46) and the title and streamed textures (#47, #48). From my side this issue can be closed. The three remaining failures look separate from #35.
This discussion has been locked. Commenting is limited to contributors.
No description provided.