macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258

Open
opened 2026-11-26 04:17:50 +00:00 by github-bot · 72 comments
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-23 22:01 UTC · original

I got XCL running on a Mac and want to upstream it. Asking first how you'd like that done, since the merge rules assume a Windows machine.

Where it is

xcl.exe cross-compiled with mingw-w64, run under CrossOver 26.3 (Wine) with Apple's D3DMetal as the D3D12 host and Rosetta 2 for the x86-64 code. One machine: MacBook Pro M5 Max, 64 GB, macOS 27.3.

The newer retail game from the README table shows its first frame at ~35 s, holds 30 fps, and gets through the account prompt and the first-run menus (navigation, brightness, legal notices, the terms page) with complete text. The intro video plays on a separate branch (one run so far). After the terms page it queues ~33,000 pipelines and the process grows to ~38 GB, but that was on 956a476, before pipelines were built at first use.

Branches are in my fork (https://github.com/Ahmet-Dedeler/xcl): mac (on 956a476, with docs/macos.md), mac-video, and mac-on-main-wip (the same work being moved onto current main, not run yet).

What the host needed

  • D3DMetal reads type info in front of an object's vtable and calls virtuals past the public interface, so the replaced vtables crash at device creation. The ext tables now mirror 16 words in front of the table and guard every upper slot. Looks like the same family as #175 and #241.
  • No OpenExistingHeapFromAddress (E_NOTIMPL). The committed window gets a video-memory copy, CPU writes are uploaded before each submit and GPU copies are read back after it.
  • Metal aborts the process on a depth-only view of a depth+stencil texture (Windows drivers return an error). On this host the depth+stencil families become depth-only R32, so stencil is lost for now.
  • Title textures in memory that isn't write-watched here are compared by content and uploaded again when they change. That's what fixed the missing menu letters on this host: the glyph cache is written through a pointer the title keeps after Unmap.
  • Rosetta doesn't run INSERTQ, CLZERO, MONITORX/MWAITX, ADX, RDSEED, MOVNTSS/SD or CLWB.
  • The title's stall watchdog (the write to address 0 at +0x2215c35) fires whenever the host is slow for a moment, so its crash is skipped.

Questions

  1. Would you take macOS support in main if it comes as small PRs that only change behaviour on a native host (D3DMetal, detected at device creation)?
  2. How should those PRs meet the regression rule? Without these changes XCL crashes at device creation on this host (last checked on 956a476), so a main smoke block here is always a crash, and smoke.ps1 is PowerShell. I don't have a Windows GPU machine. I can post a block from the PR head on the Mac (same fields, from a shell port of the script) and the suite's counts under CrossOver. Is that enough if someone on Windows confirms nothing changes there, or do you want something else?
  3. Some of this isn't Mac-specific and I'd send it first, each on its own: the content compare for unwatched title textures, the watchdog skip, the page-pool GPU views (queue #31) the intro video needs, and a window mode that doesn't take the focus plus button presses read from a file, for unattended runs. Tell me if any of these overlap something already in flight.

Not attaching game files or frames.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-23 22:01 UTC · [original](https://github.com/xcl-dev/xcl/issues/258) I got XCL running on a Mac and want to upstream it. Asking first how you'd like that done, since the merge rules assume a Windows machine. **Where it is** `xcl.exe` cross-compiled with mingw-w64, run under CrossOver 26.3 (Wine) with Apple's D3DMetal as the D3D12 host and Rosetta 2 for the x86-64 code. One machine: MacBook Pro M5 Max, 64 GB, macOS 27.3. The newer retail game from the README table shows its first frame at ~35 s, holds 30 fps, and gets through the account prompt and the first-run menus (navigation, brightness, legal notices, the terms page) with complete text. The intro video plays on a separate branch (one run so far). After the terms page it queues ~33,000 pipelines and the process grows to ~38 GB, but that was on 956a476, before pipelines were built at first use. Branches are in my fork (https://github.com/Ahmet-Dedeler/xcl): `mac` (on 956a476, with `docs/macos.md`), `mac-video`, and `mac-on-main-wip` (the same work being moved onto current main, not run yet). **What the host needed** - D3DMetal reads type info in front of an object's vtable and calls virtuals past the public interface, so the replaced vtables crash at device creation. The ext tables now mirror 16 words in front of the table and guard every upper slot. Looks like the same family as #175 and #241. - No `OpenExistingHeapFromAddress` (E_NOTIMPL). The committed window gets a video-memory copy, CPU writes are uploaded before each submit and GPU copies are read back after it. - Metal aborts the process on a depth-only view of a depth+stencil texture (Windows drivers return an error). On this host the depth+stencil families become depth-only R32, so stencil is lost for now. - Title textures in memory that isn't write-watched here are compared by content and uploaded again when they change. That's what fixed the missing menu letters on this host: the glyph cache is written through a pointer the title keeps after Unmap. - Rosetta doesn't run INSERTQ, CLZERO, MONITORX/MWAITX, ADX, RDSEED, MOVNTSS/SD or CLWB. - The title's stall watchdog (the write to address 0 at +0x2215c35) fires whenever the host is slow for a moment, so its crash is skipped. **Questions** 1. Would you take macOS support in main if it comes as small PRs that only change behaviour on a native host (D3DMetal, detected at device creation)? 2. How should those PRs meet the regression rule? Without these changes XCL crashes at device creation on this host (last checked on 956a476), so a `main` smoke block here is always a crash, and `smoke.ps1` is PowerShell. I don't have a Windows GPU machine. I can post a block from the PR head on the Mac (same fields, from a shell port of the script) and the suite's counts under CrossOver. Is that enough if someone on Windows confirms nothing changes there, or do you want something else? 3. Some of this isn't Mac-specific and I'd send it first, each on its own: the content compare for unwatched title textures, the watchdog skip, the page-pool GPU views (queue #31) the intro video needs, and a window mode that doesn't take the focus plus button presses read from a file, for unattended runs. Tell me if any of these overlap something already in flight. Not attaching game files or frames.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:50 +00:00
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-23 22:05 UTC · original · edited 2026-11-23 22:09 UTC

On question 3, what is already in flight. Checked against main 9ab7d76 and the open PRs' diffs:

(a) Content compare for unwatched title textures

  • main: no content compare (nothing in title_textures hashes or compares texels); textures are kept in step through GetWriteWatch.
  • #252 (+49/-0, kernelx.rs): allocates the title's plain-memory reservation with MEM_WRITE_WATCH, so the CPU-filled glyph atlas is uploaded again. Same symptom (missing short lowercase letters), different mechanism: write watch instead of compare. On a host without write watch the compare would still be needed.
  • #211 (merged): small ALLOW_RENDER_TARGET textures the CPU fills are kept in step. Covers the 256x256 glyph caches, not the 2048x2048 atlas.

(b) Stall-watchdog skip at the +0x2215c35 null write

  • main: nothing skips it.
  • No open PR skips the write. Open PRs address causes of it: #203 removes seconds-long stalls in kernelx / sparse windows (its tester: without it the title's hang watchdog ends the game at ~32 s); #194 reports another cause of the same write (an allocation returned NULL with the page file full) and adds a memory line at every crash; #214 and #162 avoid it by not blocking title threads on pipeline creation. #267 (new) caps a draw's wait for pipelines still building at 4 s a frame, aimed at this watchdog.
  • MKS2508 decoded the faulting function as a self-contained stall watchdog (QueryPerformanceCounter, Sleep(1000), QueryPerformanceCounter, compare).
  • Reports: #232 (open, NVIDIA), #159 (closed). A plain-main run on an RTX 5070 Ti did not hit it for 270 s (#232 comment), so a skip would need a case it still fires on.

(c) Page-pool GPU views via queue #31

  • main: queue #31 is a generic stub; no handling.
  • #214 (draft) logs the extension's four arguments once and notes the newer layout; it does not implement it.
  • #228 (named no-ops for #31 and other slots) was closed; ivall's reason was that a no-op is a guess that hides the call from called_stubs, and he asked for one slot per PR with evidence of its arguments and effect. That evidence is what a PR for #31 would need.

(d) No-focus window mode and button presses from a file

  • main already has XCL_PRESS_AT=s:BUTTON,... and XCL_PRESS_A_AT=s,... (hle/gameinput.rs), read from environment variables, not from a file.
  • No open PR touches either. A search of the open PR diffs for NOACTIVATE, no focus and XCL_PRESS found none. Window position and cursor release are on main (#176).

(e) Vtable-prefix / upper-slot guard

  • Same family as #241 and #175: XCL replaces an interface's vtable pointer; vkd3d-proton asserts on it, D3DMetal reads type info in front of the table. #241's log shows XCL already pads upper slots (ID3D12Heap1 - 10 PC methods, 0 internal slots under the guard, +64 stubs), so the open part is the words in front of the table and the identity check.
  • #257 (+396, 9 files): Linux docs, a vkd3d-proton patch and a start-up error under Wine when the loaded d3d12core.dll holds the assertion. It does not change how XCL replaces the vtable.
  • Nothing on main changes the vtable layout for either host.

Also relevant to his OpenExistingHeapFromAddress note

  • main uses it for the committed window (gpu/recomp/runner.rs) and checks at start-up that the GPU sees CPU writes (#220, merged); #239 (open) refactors that code path, so a host fallback would touch the same lines.

🤖 Claude Sonnet 5.5, Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-23 22:05 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7115317435) · edited 2026-11-23 22:09 UTC On question 3, what is already in flight. Checked against `main` `9ab7d76` and the open PRs' diffs: **(a) Content compare for unwatched title textures** - main: no content compare (nothing in `title_textures` hashes or compares texels); textures are kept in step through `GetWriteWatch`. - [#252](https://github.com/ivall/xcl/pull/252) (+49/-0, `kernelx.rs`): allocates the title's plain-memory reservation with `MEM_WRITE_WATCH`, so the CPU-filled glyph atlas is uploaded again. Same symptom (missing short lowercase letters), different mechanism: write watch instead of compare. On a host without write watch the compare would still be needed. - [#211](https://github.com/ivall/xcl/pull/211) (merged): small `ALLOW_RENDER_TARGET` textures the CPU fills are kept in step. Covers the 256x256 glyph caches, not the 2048x2048 atlas. **(b) Stall-watchdog skip at the `+0x2215c35` null write** - main: nothing skips it. - No open PR skips the write. Open PRs address causes of it: [#203](https://github.com/ivall/xcl/pull/203) removes seconds-long stalls in `kernelx` / sparse windows (its tester: without it the title's hang watchdog ends the game at ~32 s); [#194](https://github.com/ivall/xcl/pull/194) reports another cause of the same write (an allocation returned NULL with the page file full) and adds a memory line at every crash; [#214](https://github.com/ivall/xcl/pull/214) and [#162](https://github.com/ivall/xcl/pull/162) avoid it by not blocking title threads on pipeline creation. [#267](https://github.com/ivall/xcl/pull/267) (new) caps a draw's wait for pipelines still building at 4 s a frame, aimed at this watchdog. - MKS2508 [decoded](https://github.com/ivall/xcl/issues/232) the faulting function as a self-contained stall watchdog (QueryPerformanceCounter, Sleep(1000), QueryPerformanceCounter, compare). - Reports: [#232](https://github.com/ivall/xcl/issues/232) (open, NVIDIA), [#159](https://github.com/ivall/xcl/issues/159) (closed). A plain-main run on an RTX 5070 Ti did not hit it for 270 s ([#232 comment](https://github.com/ivall/xcl/issues/232#issuecomment-7114682791)), so a skip would need a case it still fires on. **(c) Page-pool GPU views via queue #31** - main: queue #31 is a generic stub; no handling. - [#214](https://github.com/ivall/xcl/pull/214) (draft) logs the extension's four arguments once and notes the newer layout; it does not implement it. - [#228](https://github.com/ivall/xcl/pull/228) (named no-ops for #31 and other slots) was closed; ivall's reason was that a no-op is a guess that hides the call from `called_stubs`, and he asked for one slot per PR with evidence of its arguments and effect. That evidence is what a PR for #31 would need. **(d) No-focus window mode and button presses from a file** - main already has `XCL_PRESS_AT=s:BUTTON,...` and `XCL_PRESS_A_AT=s,...` (`hle/gameinput.rs`), read from environment variables, not from a file. - No open PR touches either. A search of the open PR diffs for `NOACTIVATE`, `no focus` and `XCL_PRESS` found none. Window position and cursor release are on main ([#176](https://github.com/ivall/xcl/pull/176)). **(e) Vtable-prefix / upper-slot guard** - Same family as [#241](https://github.com/ivall/xcl/issues/241) and [#175](https://github.com/ivall/xcl/issues/175): XCL replaces an interface's vtable pointer; vkd3d-proton asserts on it, D3DMetal reads type info in front of the table. #241's log shows XCL already pads upper slots (`ID3D12Heap1 - 10 PC methods, 0 internal slots under the guard, +64 stubs`), so the open part is the words in front of the table and the identity check. - [#257](https://github.com/ivall/xcl/pull/257) (+396, 9 files): Linux docs, a vkd3d-proton patch and a start-up error under Wine when the loaded `d3d12core.dll` holds the assertion. It does not change how XCL replaces the vtable. - Nothing on main changes the vtable layout for either host. **Also relevant to his `OpenExistingHeapFromAddress` note** - main uses it for the committed window (`gpu/recomp/runner.rs`) and checks at start-up that the GPU sees CPU writes ([#220](https://github.com/ivall/xcl/pull/220), merged); [#239](https://github.com/ivall/xcl/pull/239) (open) refactors that code path, so a host fallback would touch the same lines. 🤖 Claude Sonnet 5.5, Claude Opus 5.5
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-23 22:21 UTC · original

@⁠ivall two quick questions that only you can answer:

  1. Do you want macOS support in main? It would come as small PRs that only change behaviour on that host, nothing changes on Windows.
  2. I only have a Mac, so I can't run the Windows suite or smoke.ps1. What should a PR from me include so you can merge it? I can post the same smoke numbers from a Mac run of the PR head.

If the answer to 1 is no that's fine too. I'll keep the Mac part in my fork and only send the fixes that help every host. The intro video one (queue #31) is probably the most useful, nobody has it yet.

Thanks @⁠Kalmarv for the overlap check, that saved me a lot of searching.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-23 22:21 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7115653312) @⁠ivall two quick questions that only you can answer: 1. Do you want macOS support in main? It would come as small PRs that only change behaviour on that host, nothing changes on Windows. 2. I only have a Mac, so I can't run the Windows suite or `smoke.ps1`. What should a PR from me include so you can merge it? I can post the same smoke numbers from a Mac run of the PR head. If the answer to 1 is no that's fine too. I'll keep the Mac part in my fork and only send the fixes that help every host. The intro video one (queue #31) is probably the most useful, nobody has it yet. Thanks @⁠Kalmarv for the overlap check, that saved me a lot of searching.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 22:42 UTC · original

Welcome - yes, upstream it. How it fits the merge rules (CONTRIBUTING.md, "What a PR needs to be merged"):

  • Small PRs, one change each (the mingw cross-build, then each runtime change on its own).
  • The Windows build stays green: CI (MSVC, Windows runner) is a required check, so nothing may break the MSVC build or the Windows path.
  • macOS-only code stays apart from the Windows path (behind a check of the host / D3D12 implementation, or cfg where it is build-time), so a Windows run is unaffected by construction.
  • Regression run: for a change that only affects the Mac path, an xcl-smoke pair from your Mac (main and the PR's head) is accepted - scripts/smoke.ps1 runs under PowerShell on macOS too; say in Not tested that Windows was not run. A change that touches the shared path needs the usual Windows pair as well (someone with a Windows PC can post it).

Please open the PRs as drafts until your CI run is green, and name the exact model in AI use if one wrote the code.

**@⁠ivall** on GitHub · 2026-11-23 22:42 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7116082521) Welcome - yes, upstream it. How it fits the merge rules (CONTRIBUTING.md, "What a PR needs to be merged"): - **Small PRs**, one change each (the mingw cross-build, then each runtime change on its own). - **The Windows build stays green**: CI (MSVC, Windows runner) is a required check, so nothing may break the MSVC build or the Windows path. - **macOS-only code stays apart** from the Windows path (behind a check of the host / D3D12 implementation, or `cfg` where it is build-time), so a Windows run is unaffected by construction. - **Regression run**: for a change that only affects the Mac path, an `xcl-smoke` pair from your Mac (main and the PR's head) is accepted - `scripts/smoke.ps1` runs under PowerShell on macOS too; say in **Not tested** that Windows was not run. A change that touches the shared path needs the usual Windows pair as well (someone with a Windows PC can post it). Please open the PRs as drafts until your CI run is green, and name the exact model in **AI use** if one wrote the code.
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-24 02:19 UTC · original

@⁠Ahmet-Dedeler: third Apple Silicon run of mac-on-main-wip, at c032920, unit and integration tests only (no game files), compared test by test with main 508a0c7 on the same machine. main was run with #553 on top, so the 7 draw tests do not hang there.

Machine: MacBook Pro M5 Pro (20-core GPU), 24 GB, macOS 27.2.1. CrossOver 26.3.0.39832, D3DMetal 3.0. DXC 1.9.2609.
Build: a different toolchain from the other runs. MSVC target, cross-built with cargo-xwin 0.24.1 (Rust 1.100.0, clang-cl / lld 23.1.6), debug. The branch builds for x86_64-pc-windows-msvc with no error and 4 warnings.
Run: the lib's unit tests one module group at a time (--test-threads=4); a group that hangs or crashes is rerun one test per process. Integration binaries with --test-threads=1. The same script was used for both.

lib unit tests passed failed hung crashed ignored
mac-on-main-wip c032920 (682) 626 (1 SKIPPED: no wave64) 19 7 8 22
main 508a0c7 + #553 (661) 609 27 1 3 21

Better on the branch

  • The OpenExistingHeapFromAddress fallback works. gpu_unified_memory_arena, gpu_memory_windows_above_4_gib, gpu_mesh_mode_reads_memory_windows, gpu_bvh64_intersect_ray_across_memory_windows_and_grazing and gpu_sparse_vram_descriptors_buffers_and_xmem pass; they fail on main. gpu_uma_import_check_at_init fails on both.
  • tests/gpu_compute_e2e.rs: 2 passed. On main there is no result after 300 s, after UMA not available to the GPU: OpenExistingHeapFromAddress (window 3) ... 0x80004001.
  • hle::d3d12x:
    • bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12, title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels and vram::tests::d32s8_targets_take_their_own_size_of_video_memory crash on main and pass here;
    • title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes hangs on main and passes here.
  • gpu::shader::tests::readable_answers_from_the_working_set_without_touching_pages and hle::acphal::tests::xapu_connect_returns_oom_and_cleans_up_on_failure fail on main and pass here.
  • Of the branch's 21 new tests, 20 pass and 1 is ignored.

Worse on the branch

  • 7 hle::d3d12x tests crash here. All of them pass on main when run the same way, one per process:
    • bind::tests::async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect panics in orig_fn at real.rs:705 (misaligned pointer dereference: address must be a multiple of 0x8 but is 0x1d9);
    • list_x::tests::{draw_indexed_x_routes_through_bind_and_restores_index_buffer, kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_range, reset_commits_state_only_after_native_success_and_always_restores_vtable, resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback, set_predication_buffer_state_transitions_and_lifecycle} and real::readback_routing_tests::copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enum page-fault reading 0x158 or 0xc0, all at the same address. orig_fn reads *ext.sub(HDR) on the branch and *ext.sub(1) on main. I did not check whether these tests rely on the one-word header.
    • list_x::tests::timestamps_outside_unified_memory_land_after_the_queue fails on main and crashes here.
  • tests/predication_e2e.rs, set_predication_buffer_state_and_kickoff: passes on main, fails here with EQUAL_ZERO(0) must skip dst[0], left 0xaaaa0000, right 0x11111111. The predicated CopyBufferRegion ran.
  • The 7 graphics draw tests (gpu_graphics_vs_ps_draw, the three gpu_rect_list_*, the three gpu_wave64_{ps,vs}_*) hang. They also hang on main without #553, which this branch does not have.

Same on both:

  • the 12 FP64 tests, gpu_float_compares_random, gpu_more_atomics_sub_dword_scratch_valu, gpu_ps_image_sample_offset_implicit_lod_between_mips and gpu_valu_16_and_64_bit;
  • hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime and hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content;
  • tests/pls_quota.rs (Wine returns error 2 where the test wants 3);
  • tests/e2e.rs test_title_runs_and_game_folder_is_untouched (the test title page-faults writing address 0 at 0x6FFFFFF78D55);
  • every other integration binary passes on both.

Not tested: a retail title, Windows, a release build.

AI use: Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this report.

**@⁠us3r40456** on GitHub · 2026-11-24 02:19 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7120026025) @⁠Ahmet-Dedeler: third Apple Silicon run of `mac-on-main-wip`, at c032920, unit and integration tests only (no game files), compared test by test with `main` 508a0c7 on the same machine. `main` was run with #553 on top, so the 7 draw tests do not hang there. **Machine:** MacBook Pro M5 Pro (20-core GPU), 24 GB, macOS 27.2.1. CrossOver 26.3.0.39832, D3DMetal 3.0. DXC 1.9.2609. **Build:** a different toolchain from the other runs. MSVC target, cross-built with cargo-xwin 0.24.1 (Rust 1.100.0, clang-cl / lld 23.1.6), debug. The branch builds for `x86_64-pc-windows-msvc` with no error and 4 warnings. **Run:** the lib's unit tests one module group at a time (`--test-threads=4`); a group that hangs or crashes is rerun one test per process. Integration binaries with `--test-threads=1`. The same script was used for both. | lib unit tests | passed | failed | hung | crashed | ignored | |---|---|---|---|---|---| | `mac-on-main-wip` c032920 (682) | 626 (1 `SKIPPED: no wave64`) | 19 | 7 | 8 | 22 | | `main` 508a0c7 + #553 (661) | 609 | 27 | 1 | 3 | 21 | **Better on the branch** - The `OpenExistingHeapFromAddress` fallback works. `gpu_unified_memory_arena`, `gpu_memory_windows_above_4_gib`, `gpu_mesh_mode_reads_memory_windows`, `gpu_bvh64_intersect_ray_across_memory_windows_and_grazing` and `gpu_sparse_vram_descriptors_buffers_and_xmem` pass; they fail on `main`. `gpu_uma_import_check_at_init` fails on both. - `tests/gpu_compute_e2e.rs`: 2 passed. On `main` there is no result after 300 s, after `UMA not available to the GPU: OpenExistingHeapFromAddress (window 3) ... 0x80004001`. - `hle::d3d12x`: - `bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12`, `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels` and `vram::tests::d32s8_targets_take_their_own_size_of_video_memory` crash on `main` and pass here; - `title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` hangs on `main` and passes here. - `gpu::shader::tests::readable_answers_from_the_working_set_without_touching_pages` and `hle::acphal::tests::xapu_connect_returns_oom_and_cleans_up_on_failure` fail on `main` and pass here. - Of the branch's 21 new tests, 20 pass and 1 is ignored. **Worse on the branch** - 7 `hle::d3d12x` tests crash here. All of them pass on `main` when run the same way, one per process: - `bind::tests::async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` panics in `orig_fn` at `real.rs:705` (`misaligned pointer dereference: address must be a multiple of 0x8 but is 0x1d9`); - `list_x::tests::{draw_indexed_x_routes_through_bind_and_restores_index_buffer, kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_range, reset_commits_state_only_after_native_success_and_always_restores_vtable, resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback, set_predication_buffer_state_transitions_and_lifecycle}` and `real::readback_routing_tests::copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enum` page-fault reading 0x158 or 0xc0, all at the same address. `orig_fn` reads `*ext.sub(HDR)` on the branch and `*ext.sub(1)` on `main`. I did not check whether these tests rely on the one-word header. - `list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` fails on `main` and crashes here. - `tests/predication_e2e.rs`, `set_predication_buffer_state_and_kickoff`: passes on `main`, fails here with `EQUAL_ZERO(0) must skip dst[0]`, left 0xaaaa0000, right 0x11111111. The predicated `CopyBufferRegion` ran. - The 7 graphics draw tests (`gpu_graphics_vs_ps_draw`, the three `gpu_rect_list_*`, the three `gpu_wave64_{ps,vs}_*`) hang. They also hang on `main` without #553, which this branch does not have. **Same on both:** - the 12 FP64 tests, `gpu_float_compares_random`, `gpu_more_atomics_sub_dword_scratch_valu`, `gpu_ps_image_sample_offset_implicit_lod_between_mips` and `gpu_valu_16_and_64_bit`; - `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` and `hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content`; - `tests/pls_quota.rs` (Wine returns error 2 where the test wants 3); - `tests/e2e.rs` `test_title_runs_and_game_folder_is_untouched` (the test title page-faults writing address 0 at 0x6FFFFFF78D55); - every other integration binary passes on both. **Not tested:** a retail title, Windows, a release build. **AI use:** Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this report.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 02:24 UTC · original

@⁠us3r40456, on the 7 orig_fn crashes: they do rely on the one-word header. At c032920 the branch has HDR = PREFIX + 1, but 8 test fixtures still build the fake vtable the old way, with the original table at ext[-1] (list_x.rs 2668, 3173, 3264, 3394, 3541, 3731; bind.rs 1055; real.rs 5420). So orig_fn (real.rs:705) reads through a null table, which is why the same tests pass on main. The 8th is timestamps_outside_unified_memory_land_after_the_queue, new in c032920. It's in our rerun above (https://github.com/ivall/xcl/issues/258#issuecomment-7118092442).

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 02:24 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7120109777) @⁠us3r40456, on the 7 `orig_fn` crashes: they do rely on the one-word header. At c032920 the branch has `HDR = PREFIX + 1`, but 8 test fixtures still build the fake vtable the old way, with the original table at `ext[-1]` (`list_x.rs` 2668, 3173, 3264, 3394, 3541, 3731; `bind.rs` 1055; `real.rs` 5420). So `orig_fn` (`real.rs:705`) reads through a null table, which is why the same tests pass on main. The 8th is `timestamps_outside_unified_memory_land_after_the_queue`, new in c032920. It's in our rerun above (https://github.com/ivall/xcl/issues/258#issuecomment-7118092442). 🤖 Claude Opus 5.5
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 01:24 UTC · original · edited 2026-11-24 03:00 UTC

Independent retail test on an M5 Pro (48 GB), macOS 27.2.1, CrossOver 26.3, Windows 10 x64 bottle, D3DMetal, networking disabled. Both revisions built from source using Rust 1.100.0 and the x86_64-pc-windows-gnullvm target; DXC 1.9.2609.5.

  • Dedicated mac revision 748fe889e891, cold cache, four DXC workers: first 3840×2160 frame at 16.182 s. The timed 217 s run ended normally with 4,910 frames shown / 4,910 PresentX calls. Last 300-frame interval: 30.0 fps. Four separate frame readbacks confirmed a visible account picker. No controller input, terms acceptance, or gameplay tested in this run.
  • mac-on-main-wip at feb49be68144: both gpu_compute_e2e tests passed with no skips on D3DMetal. Retail first frame at 18.574 s; the activity samples summed to 378 presents before progress stalled and the stall watchdog fired five times. This used default shader worker count and no frame readbacks, so it is not a controlled branch regression comparison.

The Mac branch reaching a visible interactive prompt is independently reproducible on a 48 GB Pro, not just the 64 GB Max. No game data or raw traces attached. AI-assisted testing.

Reproduction details (M5 Pro): Rust 1.100.0; LLVM-MinGW clang 23.1.6; cargo build --locked --release -p xcl --bin xcl --target x86_64-pc-windows-gnullvm. For the dedicated Mac build: XCL_NETWORK=0, XCL_BACKGROUND=1, XCL_DXC_THREADS=4, XCL_ACTIVITY=1, XCL_FRAME_DUMP=600, XCL_RUN_SECONDS=217. For the WIP GPU check: cargo test --locked --release -p xcl --test gpu_compute_e2e --target x86_64-pc-windows-gnullvm --no-run, then ran that test binary under CrossOver with --nocapture (2 passed, 0 failed, 0 ignored, no skip messages). Not tested: Windows, the full GPU suite, gameplay. AI use: OpenCode / GPT-6.2 Astra ran the checks and wrote the report.

M5 Pro follow-up: early presentation stall. On mac-on-main-wip base c032920 and our graphics fallback head 44515ba, scripts/smoke.ps1 with fresh caches and identical 120 s settings reported 256 and 270 frames respectively, exit 0 and no device removals/crashes in either run. Both stopped presenting early. Exit 0 here was the timed stop, not successful gameplay; Wine’s 0 MB peak commit is not a usable memory measurement.

Two samples of the stalled patched process showed sparse::readback_now and the resource-release path waiting in sparse::forget_buffer, with the activity thread blocked in vram::arena_bytes. These are observed waiters, not proof of a particular lock owner. A local experiment deferring both cleanup operations when contended showed 1,324 frames over 90 s, no watchdog firing and 60 presents per 2 s in the final samples. Some intermediate intervals still had no presents. This is one experimental run; we have not isolated which change matters, established resource-lifetime correctness, or reached gameplay.

The test fixtures and Mac graphics fallback work are on the test branch. The synthetic test title now presents a frame and finishes with three failed assertions (window cloaking, timestamps, XMA2 voice state), rather than terminating at the first unknown shader container. No complete passing workspace run claimed. AI-assisted measurements and report: OpenCode / GPT-6.2 Astra.

Isolated Mac test-fixture patch: one commit, eight fixtures, directly on db065d8. Thanks to Kalmarv for identifying the remaining reset and query-routing fixtures. This branch only changes test code: it excludes the runtime experiment and the timestamp skip. cargo test --offline --locked -p xcl --lib --target x86_64-pc-windows-gnullvm --no-run compiled this exact commit. On exact commit 9a9adb44, ran each of the eight affected lib tests separately in the offline CrossOver D3DMetal bottle (<lib-test.exe> <test-name> --nocapture; one matching test per invocation): 7 passed, 1 failed, 0 ignored/skipped. Reset, descriptor copy, indirect dispatch, indexed draw, render target count, predication and query routing passed. timestamps_outside_unified_memory_land_after_the_queue returned exit 101 after 5.33 s (both values zero), not a crash. Full workspace suite not claimed. On this host the timestamp assertion still needs separate investigation: the fixture header and the timestamp values returned by D3DMetal are distinct issues.

Retail evidence: local integration 43debe8 (Mac WIP db065d8 plus our experimental changes): 3,171 frames shown / 3,171 PresentX calls in 142 s, last 300-frame interval 30.0 fps, no stall-watchdog events. Offline, fresh profile, same 48 GB M5 Pro. Two frame readbacks showed the account picker. This is a menu result, not a gameplay claim. No raw game data attached.

After accepting first-run terms: On 43debe8 (Mac base db065d8, offline M5 Pro, 48 GB, four DXC workers), loading ended with process exit 5 at the same title-relative offset documented by the Mac author: +0x23cf683, null write. The final 16 consecutive two-second activity samples had zero presents. The log contains 107 translated compute-pipeline creation messages. These observations identify the stop, not its cause. Gameplay was not reached.

Warm-profile retry and window counters: A saved-profile retry on the same binary showed loading artwork after a blank screen (0.0 then 10.0 fps, screenshots 58 s apart), then exited 5. The same null write recurred. The caption showed 0 DXC compiles running, 2 done, and 58,745 then 58,735 “pipelines queued”. In pso_async::counts the third count includes lazy stand-ins never submitted to a worker; it is not a compiler backlog or a progress estimate. Caption-only patch against main, cross-checked with cargo check --locked --offline -p xcl --target x86_64-pc-windows-gnullvm. No gameplay claim.

Compute pipeline cache follow-up (#636): On dd2ae9a, two builders that miss the same driver-blob key before either finishes can both charge the byte budget even though only one entry remains. This is a code-level accounting finding, not an explanation for the loading crash. Focused fix and regression test. Cross-compiled the full Windows lib test target with cargo test --locked --offline -p xcl --lib --target x86_64-pc-windows-gnullvm --no-run; the exact pure Rust insertion function and its regression test also ran natively on arm64 (1 pass).

Pre-fault timing on both M5 Pro runs: From the timestamp of the last nonzero two-second present sample to the first logged unhandled exception: 29.405 s on the first accepted-profile run and 30.360 s on the warm retry. In those respective intervals the log recorded 71 and 185 translated compute pipeline creation completions. This excludes messages after the exception. The main presentation path stopped making visible progress while pipeline creation still completed; this does not establish why presents stopped. Measured from sample timestamps, not individual frame times.

First Mac trial including upstream #636: cd18062 over 43debe8, using a copy of the same accepted profile, exited 5 at 24.425 s, before any scripted input. One translated compute pipeline was logged and none logged driver-blob reuse. The xcl.exe fault instruction symbolized to IUnknown::clone; stack addresses also resolved into title_textures::refresh_once collecting resource references. This is a different stop than the later title watchdog. This run does not test #636’s loading benefit, establish a cause, or show that #636 introduced the crash.

**@⁠mikebuckets171** on GitHub · 2026-11-24 01:24 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7119074869) · edited 2026-11-24 03:00 UTC Independent retail test on an M5 Pro (48 GB), macOS 27.2.1, CrossOver 26.3, Windows 10 x64 bottle, D3DMetal, networking disabled. Both revisions built from source using Rust 1.100.0 and the x86_64-pc-windows-gnullvm target; DXC 1.9.2609.5. - Dedicated `mac` revision `748fe889e891`, cold cache, four DXC workers: first 3840×2160 frame at 16.182 s. The timed 217 s run ended normally with 4,910 frames shown / 4,910 PresentX calls. Last 300-frame interval: 30.0 fps. Four separate frame readbacks confirmed a visible account picker. No controller input, terms acceptance, or gameplay tested in this run. - `mac-on-main-wip` at `feb49be68144`: both `gpu_compute_e2e` tests passed with no skips on D3DMetal. Retail first frame at 18.574 s; the activity samples summed to 378 presents before progress stalled and the stall watchdog fired five times. This used default shader worker count and no frame readbacks, so it is **not** a controlled branch regression comparison. The Mac branch reaching a visible interactive prompt is independently reproducible on a 48 GB Pro, not just the 64 GB Max. No game data or raw traces attached. AI-assisted testing. **Reproduction details (M5 Pro):** Rust 1.100.0; LLVM-MinGW clang 23.1.6; `cargo build --locked --release -p xcl --bin xcl --target x86_64-pc-windows-gnullvm`. For the dedicated Mac build: `XCL_NETWORK=0`, `XCL_BACKGROUND=1`, `XCL_DXC_THREADS=4`, `XCL_ACTIVITY=1`, `XCL_FRAME_DUMP=600`, `XCL_RUN_SECONDS=217`. For the WIP GPU check: `cargo test --locked --release -p xcl --test gpu_compute_e2e --target x86_64-pc-windows-gnullvm --no-run`, then ran that test binary under CrossOver with `--nocapture` (2 passed, 0 failed, 0 ignored, no skip messages). **Not tested:** Windows, the full GPU suite, gameplay. **AI use:** OpenCode / GPT-6.2 Astra ran the checks and wrote the report. **M5 Pro follow-up: early presentation stall.** On `mac-on-main-wip` base `c032920` and our graphics fallback head `44515ba`, `scripts/smoke.ps1` with fresh caches and identical 120 s settings reported 256 and 270 frames respectively, exit 0 and no device removals/crashes in either run. Both stopped presenting early. Exit 0 here was the timed stop, not successful gameplay; Wine’s 0 MB peak commit is not a usable memory measurement. Two samples of the stalled patched process showed `sparse::readback_now` and the resource-release path waiting in `sparse::forget_buffer`, with the activity thread blocked in `vram::arena_bytes`. These are observed waiters, not proof of a particular lock owner. A local experiment deferring both cleanup operations when contended showed 1,324 frames over 90 s, no watchdog firing and 60 presents per 2 s in the final samples. Some intermediate intervals still had no presents. This is one experimental run; we have not isolated which change matters, established resource-lifetime correctness, or reached gameplay. The test fixtures and Mac graphics fallback work are on [the test branch](https://github.com/mikebuckets171/xcl/tree/mac-tests-ext-table). The synthetic test title now presents a frame and finishes with three failed assertions (window cloaking, timestamps, XMA2 voice state), rather than terminating at the first unknown shader container. No complete passing workspace run claimed. AI-assisted measurements and report: OpenCode / GPT-6.2 Astra. **Isolated Mac test-fixture patch:** [one commit, eight fixtures](https://github.com/mikebuckets171/xcl/commit/9a9adb44bed9ef231ea2653fbed19d4117e01b0a), directly on `db065d8`. Thanks to Kalmarv for identifying the remaining reset and query-routing fixtures. This branch only changes test code: it excludes the runtime experiment and the timestamp skip. `cargo test --offline --locked -p xcl --lib --target x86_64-pc-windows-gnullvm --no-run` compiled this exact commit. On exact commit `9a9adb44`, ran each of the eight affected lib tests separately in the offline CrossOver D3DMetal bottle (`<lib-test.exe> <test-name> --nocapture`; one matching test per invocation): **7 passed, 1 failed, 0 ignored/skipped**. Reset, descriptor copy, indirect dispatch, indexed draw, render target count, predication and query routing passed. `timestamps_outside_unified_memory_land_after_the_queue` returned exit 101 after 5.33 s (both values zero), not a crash. Full workspace suite not claimed. On this host the timestamp assertion still needs separate investigation: the fixture header and the timestamp values returned by D3DMetal are distinct issues. **Retail evidence:** local integration `43debe8` (Mac WIP `db065d8` plus our experimental changes): 3,171 frames shown / 3,171 PresentX calls in 142 s, last 300-frame interval 30.0 fps, no stall-watchdog events. Offline, fresh profile, same 48 GB M5 Pro. Two frame readbacks showed the account picker. This is a menu result, not a gameplay claim. No raw game data attached. **After accepting first-run terms:** On `43debe8` (Mac base `db065d8`, offline M5 Pro, 48 GB, four DXC workers), loading ended with process exit 5 at the same title-relative offset documented by the Mac author: `+0x23cf683`, null write. The final 16 consecutive two-second activity samples had zero presents. The log contains 107 translated compute-pipeline creation messages. These observations identify the stop, not its cause. Gameplay was not reached. **Warm-profile retry and window counters:** A saved-profile retry on the same binary showed loading artwork after a blank screen (0.0 then 10.0 fps, screenshots 58 s apart), then exited 5. The same null write recurred. The caption showed 0 DXC compiles running, 2 done, and 58,745 then 58,735 “pipelines queued”. In `pso_async::counts` the third count includes lazy stand-ins never submitted to a worker; it is not a compiler backlog or a progress estimate. [Caption-only patch against main](https://github.com/mikebuckets171/xcl/commit/047019a20477ac418d23255243a00e6460ec3e53), cross-checked with `cargo check --locked --offline -p xcl --target x86_64-pc-windows-gnullvm`. No gameplay claim. **Compute pipeline cache follow-up (#636):** On `dd2ae9a`, two builders that miss the same driver-blob key before either finishes can both charge the byte budget even though only one entry remains. This is a code-level accounting finding, not an explanation for the loading crash. [Focused fix and regression test](https://github.com/mikebuckets171/xcl/commit/e6da808171fabebc0313417bb369f03e02fab0cd). Cross-compiled the full Windows lib test target with `cargo test --locked --offline -p xcl --lib --target x86_64-pc-windows-gnullvm --no-run`; the exact pure Rust insertion function and its regression test also ran natively on arm64 (1 pass). **Pre-fault timing on both M5 Pro runs:** From the timestamp of the last nonzero two-second present sample to the first logged unhandled exception: 29.405 s on the first accepted-profile run and 30.360 s on the warm retry. In those respective intervals the log recorded 71 and 185 translated compute pipeline creation completions. This excludes messages after the exception. The main presentation path stopped making visible progress while pipeline creation still completed; this does not establish why presents stopped. Measured from sample timestamps, not individual frame times. **First Mac trial including upstream #636:** `cd18062` over `43debe8`, using a copy of the same accepted profile, exited 5 at 24.425 s, before any scripted input. One translated compute pipeline was logged and none logged driver-blob reuse. The xcl.exe fault instruction symbolized to `IUnknown::clone`; stack addresses also resolved into `title_textures::refresh_once` collecting resource references. This is a different stop than the later title watchdog. This run does not test #636’s loading benefit, establish a cause, or show that #636 introduced the crash.
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-24 03:16 UTC · original

@⁠Ahmet-Dedeler: pr/native-host-vtables (ddf3be7) on the same Mac as my run above, before you open it. It was built and tested at its head and compared test by test with main 508a0c7 (its base) with #553 on top, using the same script. pr/standin-dual-source went to #666.

Machine and build: as above. M5 Pro (20-core GPU), 24 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0. MSVC target via cargo-xwin 0.24.1, Rust 1.100.0, debug, DXC 1.9.2609. It builds for x86_64-pc-windows-msvc with no new warning.

  • lib: 607 passed (1 of them SKIPPED: no wave64), 26 failed, 7 hung, 0 crashed, 21 ignored. The 7 hangs are the draw tests, because #553 is not in the branch.
  • hle::d3d12x now runs in one process: 90 passed, 2 failed (present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content and list_x::tests::timestamps_outside_unified_memory_land_after_the_queue, both failing on main too), 1 ignored. On main the group crashes.
  • It fixes the following. I confirmed each one per process on main, on this branch and on pr/standin-dual-source / #666 as a control (same base):
    • bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12, title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels and vram::tests::d32s8_targets_take_their_own_size_of_video_memory crash on main and on the control, and pass here;
    • title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes hangs on main and on the control, and passes here;
    • tests/gpu_compute_e2e.rs has no result in 120 s on main and on the control, and has 2 passed here.
  • The new test a_native_hosts_table_keeps_its_prefix_and_other_tables_keep_theirs passes. tests/predication_e2e.rs passes, so its failure on mac-on-main-wip comes from another commit there.
  • Nothing that passes on main fails here.

hle::acphal::tests::xapu_connect_returns_oom_and_cleans_up_on_failure failed once in main's group run, but it passes one per process on all three, so I did not count it.

Not tested: Windows, a retail title, a release build.

AI use: Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this report.

**@⁠us3r40456** on GitHub · 2026-11-24 03:16 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7120937457) @⁠Ahmet-Dedeler: `pr/native-host-vtables` (ddf3be7) on the same Mac as my run above, before you open it. It was built and tested at its head and compared test by test with `main` 508a0c7 (its base) with #553 on top, using the same script. `pr/standin-dual-source` went to #666. **Machine and build:** as above. M5 Pro (20-core GPU), 24 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0. MSVC target via cargo-xwin 0.24.1, Rust 1.100.0, debug, DXC 1.9.2609. It builds for `x86_64-pc-windows-msvc` with no new warning. - lib: 607 passed (1 of them `SKIPPED: no wave64`), 26 failed, 7 hung, 0 crashed, 21 ignored. The 7 hangs are the draw tests, because #553 is not in the branch. - `hle::d3d12x` now runs in one process: 90 passed, 2 failed (`present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content` and `list_x::tests::timestamps_outside_unified_memory_land_after_the_queue`, both failing on `main` too), 1 ignored. On `main` the group crashes. - It fixes the following. I confirmed each one per process on `main`, on this branch and on `pr/standin-dual-source` / #666 as a control (same base): - `bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12`, `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels` and `vram::tests::d32s8_targets_take_their_own_size_of_video_memory` crash on `main` and on the control, and pass here; - `title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` hangs on `main` and on the control, and passes here; - `tests/gpu_compute_e2e.rs` has no result in 120 s on `main` and on the control, and has 2 passed here. - The new test `a_native_hosts_table_keeps_its_prefix_and_other_tables_keep_theirs` passes. `tests/predication_e2e.rs` passes, so its failure on `mac-on-main-wip` comes from another commit there. - Nothing that passes on `main` fails here. `hle::acphal::tests::xapu_connect_returns_oom_and_cleans_up_on_failure` failed once in `main`'s group run, but it passes one per process on all three, so I did not count it. **Not tested:** Windows, a retail title, a release build. **AI use:** Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this report.
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-24 03:25 UTC · original

@⁠Ahmet-Dedeler: a follow-up on tests/predication_e2e.rs, with a correction to my two reports above.

Correction: on main 508a0c7 and on pr/native-host-vtables, this test does not run on this Mac. It prints SKIPPED set_predication_buffer_state_and_kickoff: no GPU UMA and counts as passed. So my reports should have said "skipped", not "passes".

Bisect: git bisect run over 508a0c7..db065d8 (the test failed twice in a row at db065d8 first) took 4 steps and gives c70bf8a ("Unified memory without OpenExistingHeapFromAddress") as the first failing commit. That is the commit that makes the test run: with XCL_UMA_SHADOW=0 at db065d8 it skips again.

Why it fails: predication is not applied at all on D3DMetal.

  • With a temporary eprintln! (not committed), all four predicated copies of case 1 ran: dst[..4] = [aaaa0000, bbbb0001, cccc0002, dddd0003], which is src, where dst[0] and dst[2] should have kept init.
  • dst[1] (EQUAL_ZERO on slot_one) and dst[2] (NOT_EQUAL_ZERO on slot_one) read the same slot with opposite ops, so no predicate value explains both running.
  • apply_predication_copy copies the predicate into its own default buffer and calls the host's SetPredication on that buffer, so the UMA copy is not in this path. D3DMetal accepts SetPredication and does not skip anything.

Not checked: draws and dispatches (this test only predicates copies), and whether D3DMetal reports this anywhere. A native host would need either predication done by XCL or a skip with that reason. I did not write either.

Machine: as above. M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0, MSVC debug build, DXC 1.9.2609.

AI use: Claude Code, Claude Opus 5.5 ran the bisect and the tests on this machine and wrote this note.

**@⁠us3r40456** on GitHub · 2026-11-24 03:25 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7121082756) @⁠Ahmet-Dedeler: a follow-up on `tests/predication_e2e.rs`, with a correction to my two reports above. **Correction:** on `main` 508a0c7 and on `pr/native-host-vtables`, this test does not run on this Mac. It prints `SKIPPED set_predication_buffer_state_and_kickoff: no GPU UMA` and counts as passed. So my reports should have said "skipped", not "passes". **Bisect:** `git bisect run` over 508a0c7..db065d8 (the test failed twice in a row at db065d8 first) took 4 steps and gives c70bf8a ("Unified memory without OpenExistingHeapFromAddress") as the first failing commit. That is the commit that makes the test run: with `XCL_UMA_SHADOW=0` at db065d8 it skips again. **Why it fails:** predication is not applied at all on D3DMetal. - With a temporary `eprintln!` (not committed), all four predicated copies of case 1 ran: `dst[..4] = [aaaa0000, bbbb0001, cccc0002, dddd0003]`, which is `src`, where `dst[0]` and `dst[2]` should have kept `init`. - `dst[1]` (EQUAL_ZERO on `slot_one`) and `dst[2]` (NOT_EQUAL_ZERO on `slot_one`) read the same slot with opposite ops, so no predicate value explains both running. - `apply_predication_copy` copies the predicate into its own default buffer and calls the host's `SetPredication` on that buffer, so the UMA copy is not in this path. D3DMetal accepts `SetPredication` and does not skip anything. **Not checked:** draws and dispatches (this test only predicates copies), and whether D3DMetal reports this anywhere. A native host would need either predication done by XCL or a skip with that reason. I did not write either. **Machine:** as above. M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0, MSVC debug build, DXC 1.9.2609. **AI use:** Claude Code, Claude Opus 5.5 ran the bisect and the tests on this machine and wrote this note.
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-24 03:31 UTC · original

@⁠Ahmet-Dedeler, @⁠vakaobr: about list_x::tests::timestamps_outside_unified_memory_land_after_the_queue ("non-UMA GPU timestamp never landed") on main 508a0c7 (+ #553). XCL's side works; D3DMetal's timestamp queries produce nothing.

What I measured, with temporary eprintln!s (not committed), one run each:

  • The xcl-cpu-writes worker does its job: the fence reaches its value and it writes the readback value to both targets. That value is 0.
  • I wrote 0xdeadbeefcafef00d into the readback slot before the list runs. It is still there after the fence, and the test then passes with that value. So ResolveQueryData of the TIMESTAMP query writes nothing into the READBACK buffer. Mapping the buffer again before the read changes nothing.
  • I resolved into a DEFAULT buffer and copied that into the readback slot. The sentinel is then overwritten with 0: the copy reaches the readback buffer, and the resolved timestamp is 0.
  • Sleeping 1 s or 3 s before ExecuteCommandLists changes nothing.
  • The queue's GetTimestampFrequency returns 60. GetClockCalibration returns GPU and CPU values 42 apart (65903180759708 / 65903180759750), i.e. the CPU clock.

XCL passes the host's GetTimestampFrequency through, so a title on this host would see 60 Hz and timestamps of 0.

Possible approach (not written): at device creation, check whether a resolved timestamp overwrites a sentinel. On a host where it does not, fill the ReadbackU64 writes from the CPU clock when the fence completes, and report that clock's frequency, behind the native-host check. Top-of-pipe timestamps would then also be the completion time.

Machine: as above. M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0, MSVC debug build.

AI use: Claude Code, Claude Opus 5.5 ran these checks on this machine and wrote this note.

**@⁠us3r40456** on GitHub · 2026-11-24 03:31 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7121180927) @⁠Ahmet-Dedeler, @⁠vakaobr: about `list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` ("non-UMA GPU timestamp never landed") on `main` 508a0c7 (+ #553). XCL's side works; D3DMetal's timestamp queries produce nothing. What I measured, with temporary `eprintln!`s (not committed), one run each: - The `xcl-cpu-writes` worker does its job: the fence reaches its value and it writes the readback value to both targets. That value is 0. - I wrote `0xdeadbeefcafef00d` into the readback slot before the list runs. It is still there after the fence, and the test then passes with that value. So `ResolveQueryData` of the TIMESTAMP query writes nothing into the READBACK buffer. Mapping the buffer again before the read changes nothing. - I resolved into a DEFAULT buffer and copied that into the readback slot. The sentinel is then overwritten with 0: the copy reaches the readback buffer, and the resolved timestamp is 0. - Sleeping 1 s or 3 s before `ExecuteCommandLists` changes nothing. - The queue's `GetTimestampFrequency` returns 60. `GetClockCalibration` returns GPU and CPU values 42 apart (65903180759708 / 65903180759750), i.e. the CPU clock. XCL passes the host's `GetTimestampFrequency` through, so a title on this host would see 60 Hz and timestamps of 0. **Possible approach (not written):** at device creation, check whether a resolved timestamp overwrites a sentinel. On a host where it does not, fill the `ReadbackU64` writes from the CPU clock when the fence completes, and report that clock's frequency, behind the native-host check. Top-of-pipe timestamps would then also be the completion time. **Machine:** as above. M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0, MSVC debug build. **AI use:** Claude Code, Claude Opus 5.5 ran these checks on this machine and wrote this note.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 03:45 UTC · original

Two questions about contributions from an Apple Silicon bench, because the Mac runs posted in this thread keep running into both.

1. Host-port patches. Most of what a Mac host forces is XCL-side work in crates/xcl/src: Rosetta 2 cannot resume a faulting AVX2 masked store, D3DMetal has no OpenExistingHeapFromAddress, no write watch and 32-lane waves only. I am the author, I have read every line of the diff, and I can answer review questions about it. Are patches of that kind welcome upstream even when the code was drafted by a small local model, or should macOS-specific work stay on the port branch and only the findings and measurements come here?

2. Tested / Regression. scripts/smoke.ps1 is PowerShell on Windows, and this bench has no Windows machine. A run here is CrossOver 26.3 + D3DMetal 3.0, x86_64 under Rosetta 2, with presents counts, frame dumps, exit codes and report.json. CONTRIBUTING says a PR with no Windows test run "waits until someone runs one". Is there a form of those two blocks you would accept from this host, or should Mac-host PRs always carry "Not tested: Windows" and wait for a Windows contributor to run them?

#536 is mine and sits in the same file as #527, #513 and #497: I will leave it as it is unless you want it reworked or closed.

Written with help from a local assistant; the questions and everything I claim here are mine.

**@⁠mikebuckets171** on GitHub · 2026-11-24 03:45 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7121387695) Two questions about contributions from an Apple Silicon bench, because the Mac runs posted in this thread keep running into both. **1. Host-port patches.** Most of what a Mac host forces is XCL-side work in `crates/xcl/src`: Rosetta 2 cannot resume a faulting AVX2 masked store, D3DMetal has no `OpenExistingHeapFromAddress`, no write watch and 32-lane waves only. I am the author, I have read every line of the diff, and I can answer review questions about it. Are patches of that kind welcome upstream even when the code was drafted by a small local model, or should macOS-specific work stay on the port branch and only the findings and measurements come here? **2. Tested / Regression.** `scripts/smoke.ps1` is PowerShell on Windows, and this bench has no Windows machine. A run here is CrossOver 26.3 + D3DMetal 3.0, x86_64 under Rosetta 2, with presents counts, frame dumps, exit codes and `report.json`. CONTRIBUTING says a PR with no Windows test run "waits until someone runs one". Is there a form of those two blocks you would accept from this host, or should Mac-host PRs always carry "Not tested: Windows" and wait for a Windows contributor to run them? `#536` is mine and sits in the same file as #527, #513 and #497: I will leave it as it is unless you want it reworked or closed. Written with help from a local assistant; the questions and everything I claim here are mine.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 03:47 UTC · original

@⁠mikebuckets171, on (2): ivall answered this above (https://github.com/ivall/xcl/issues/258#issuecomment-7116082521):

Regression run: for a change that only affects the Mac path, an xcl-smoke pair from your Mac (main and the PR's head) is accepted - scripts/smoke.ps1 runs under PowerShell on macOS too; say in Not tested that Windows was not run. A change that touches the shared path needs the usual Windows pair as well (someone with a Windows PC can post it).

If a Mac PR of yours touches the shared path, ask on the PR and we can post the Windows pair, as we're doing for #666. (1) is for the maintainers.

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 03:47 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7121432692) @⁠mikebuckets171, on (2): ivall answered this above (https://github.com/ivall/xcl/issues/258#issuecomment-7116082521): > **Regression run**: for a change that only affects the Mac path, an `xcl-smoke` pair from your Mac (main and the PR's head) is accepted - `scripts/smoke.ps1` runs under PowerShell on macOS too; say in **Not tested** that Windows was not run. A change that touches the shared path needs the usual Windows pair as well (someone with a Windows PC can post it). If a Mac PR of yours touches the shared path, ask on the PR and we can post the Windows pair, as we're doing for #666. (1) is for the maintainers. 🤖 Claude Opus 5.5
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 04:01 UTC · original

@⁠vakaobr: here is the Windows GPU run your f64 skip diff needed. It does what you described on a GPU with doubles: nothing skips, and the suite is unchanged.

Tested

  • Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5070 Ti, driver 610.74, Rust 1.99.0, debug build. DXC 1.7.2308.16 from the Windows SDK (10.0.26100.0). Each GPU run went through our GPU queue on its own.
  • Your diff, applied with git apply to main dd2ae9a. gpu/recomp/tests.rs hasn't changed since 18c105a, and the diff applied cleanly. Each build had its own worktree and target directory.
  • The 14 tests that call doubles_ready(), by exact name, --test-threads=1:
build result
main dd2ae9a 14 passed
dd2ae9a + diff 14 passed, no SKIPPED line
dd2ae9a + diff, with device_doubles() returning DoublePrecisionFloatShaderOps && false (local only) 14 ok, each with SKIPPED <test>: no doubles

The forced case includes gpu_float_compares_random, which also reports no doubles when only its F64 round is left out.

  • cargo test --workspace -- --test-threads=4, with and without the diff: 690 passed, 0 failed, 41 ignored. Compared test by test, the same 731 tests give the same outcomes. In both runs the only SKIPPED lines are gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware, both no wave64.

Not tested

  • AMD and Intel GPUs, and WARP.
  • A real Windows device without doubles: the "no doubles" case was forced by editing the result of the feature query.
  • XCL_REQUIRE_GPU=wave64 with a no doubles skip.
  • The release build.

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 04:01 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7121632773) @⁠vakaobr: here is the Windows GPU run your f64 skip diff needed. It does what you described on a GPU with doubles: nothing skips, and the suite is unchanged. **Tested** - Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 5070 Ti, driver 610.74, Rust 1.99.0, debug build. DXC 1.7.2308.16 from the Windows SDK (10.0.26100.0). Each GPU run went through our GPU queue on its own. - Your diff, applied with `git apply` to `main` `dd2ae9a`. `gpu/recomp/tests.rs` hasn't changed since `18c105a`, and the diff applied cleanly. Each build had its own worktree and target directory. - The 14 tests that call `doubles_ready()`, by exact name, `--test-threads=1`: | build | result | |---|---| | `main` `dd2ae9a` | 14 passed | | `dd2ae9a` + diff | 14 passed, no `SKIPPED` line | | `dd2ae9a` + diff, with `device_doubles()` returning `DoublePrecisionFloatShaderOps && false` (local only) | 14 `ok`, each with `SKIPPED <test>: no doubles` | The forced case includes `gpu_float_compares_random`, which also reports `no doubles` when only its F64 round is left out. - `cargo test --workspace -- --test-threads=4`, with and without the diff: 690 passed, 0 failed, 41 ignored. Compared test by test, the same 731 tests give the same outcomes. In both runs the only SKIPPED lines are `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`, both `no wave64`. **Not tested** - AMD and Intel GPUs, and WARP. - A real Windows device without doubles: the "no doubles" case was forced by editing the result of the feature query. - `XCL_REQUIRE_GPU=wave64` with a `no doubles` skip. - The release build. 🤖 Claude Opus 5.5
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-24 04:10 UTC · original

@⁠vakaobr, @⁠Kalmarv: some Mac-side data for the f64 skip diff (06ffc1b). It comes from an M5 Pro with D3DMetal 3.0 and from the shader flags (SFI0) that DXC 1.9.2609 writes into each test's DXIL on main. I did not run your branch itself here; I used an equivalent check of the same flag.

  • D3DMetal behaves differently from the A770. It reports DoublePrecisionFloatShaderOps = 0 but still creates the pipelines, where the A770 in #42 refuses them with E_INVALIDARG. The doubles then read 0, and other results of the same program can be wrong too. In gpu_clamp_and_omod_per_instruction, v_cvt_f16_f32 with clamp gives 0 while the five f64 instructions are in the program; with them removed, all its other checks pass here. So skipping whole programs that contain doubles, as your diff does, is the right shape on this host. Skipping only the f64 checks of a program that still runs would not be.
  • 12 of your 14 compile with the Doubles flag (SFI0 bit 0): gpu_f64_roots, gpu_f64_compares_with_nan, gpu_f64_class_compare, gpu_f64_literal_high_word, gpu_f64_rounding_and_conversions, gpu_f64_math_random, gpu_frexp_f64_exp_and_mant, gpu_ldexp_f64, gpu_rndne_f64, gpu_clamp_and_omod_per_instruction and gpu_valu_16_and_64_bit, plus gpu_float_compares_random. That last one compiles three programs, and only one has the flag, which matches your partial skip.
  • gpu_atomic_fcmpswap_x2 and gpu_atomic_fmin_fmax_x2 compile without the flag (SFI0 0xc000, 64-bit integers only). The translator emits them as InterlockedCompareExchange64 / InterlockedMin64 / InterlockedMax64. They are not among the A770's failures in #42, so skipping them on "no doubles" would drop passing coverage there. On D3DMetal they fail for another reason: its 64-bit integer atomics, which it reports as supported. I have not looked into that yet.
  • With the flag check, the first ten tests of that list skip on this Mac with no doubles. My check did not cover gpu_valu_16_and_64_bit or the partial skip.

AI use: Claude Code, Claude Opus 5.5 read the shader flags, ran these checks on this machine and wrote this note.

**@⁠us3r40456** on GitHub · 2026-11-24 04:10 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7121781360) @⁠vakaobr, @⁠Kalmarv: some Mac-side data for the f64 skip diff (06ffc1b). It comes from an M5 Pro with D3DMetal 3.0 and from the shader flags (SFI0) that DXC 1.9.2609 writes into each test's DXIL on `main`. I did not run your branch itself here; I used an equivalent check of the same flag. - **D3DMetal behaves differently from the A770.** It reports `DoublePrecisionFloatShaderOps = 0` but still creates the pipelines, where the A770 in #42 refuses them with `E_INVALIDARG`. The doubles then read 0, and other results of the same program can be wrong too. In `gpu_clamp_and_omod_per_instruction`, `v_cvt_f16_f32` with clamp gives 0 while the five f64 instructions are in the program; with them removed, all its other checks pass here. So skipping whole programs that contain doubles, as your diff does, is the right shape on this host. Skipping only the f64 checks of a program that still runs would not be. - **12 of your 14 compile with the Doubles flag (SFI0 bit 0):** `gpu_f64_roots`, `gpu_f64_compares_with_nan`, `gpu_f64_class_compare`, `gpu_f64_literal_high_word`, `gpu_f64_rounding_and_conversions`, `gpu_f64_math_random`, `gpu_frexp_f64_exp_and_mant`, `gpu_ldexp_f64`, `gpu_rndne_f64`, `gpu_clamp_and_omod_per_instruction` and `gpu_valu_16_and_64_bit`, plus `gpu_float_compares_random`. That last one compiles three programs, and only one has the flag, which matches your partial skip. - **`gpu_atomic_fcmpswap_x2` and `gpu_atomic_fmin_fmax_x2` compile without the flag** (SFI0 `0xc000`, 64-bit integers only). The translator emits them as `InterlockedCompareExchange64` / `InterlockedMin64` / `InterlockedMax64`. They are not among the A770's failures in #42, so skipping them on "no doubles" would drop passing coverage there. On D3DMetal they fail for another reason: its 64-bit integer atomics, which it reports as supported. I have not looked into that yet. - With the flag check, the first ten tests of that list skip on this Mac with `no doubles`. My check did not cover `gpu_valu_16_and_64_bit` or the partial skip. **AI use:** Claude Code, Claude Opus 5.5 read the shader flags, ran these checks on this machine and wrote this note.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 00:27 UTC · original · edited 2026-11-24 04:19 UTC

@⁠Ahmet-Dedeler: rerun of mac-on-main-wip at c032920 (your rebase onto upstream 7ebf1b8), done the same way as the 7894747 run below: same machine (M3 8 GB, macOS 26.2, CrossOver 26.3, D3DMetal), same DXC 1.9.2609, synthetic inputs only.

No test that exists at both commits changed its outcome.

Method (unchanged): each test binary on its own, with an 8-minute cap and --test-threads=4. In the lib unit binary, the non-GPU tests ran one at a time, restarted past each hang or crash (60 s without output counts as stuck), and each ::gpu_ test ran in its own process with a 30 s cap.

Build

The same commands work. There are now 2 warnings: unknown lint: function_casts_as_integer (also at 7894747) and, new, function copies is never used. c032920 has #270's test = false for testgame-mw, so its harness exe is no longer built (at 7894747 it didn't start, exit 53). docs/macos.md is still not on this branch.

Counts, 7894747 → c032920

binary 7894747 passed/failed/ignored/stuck c032920 passed/failed/ignored/stuck
xcl lib, non-GPU 524 / 3 / 19 / 8 (of 554) 556 / 3 / 20 / 9 (of 588)
xcl lib, ::gpu_ 64 / 17 / 0 / 6 (of 87) 70 / 17 / 0 / 7 (of 94)
console_dlls_e2e 13 / 0 / 0 13 / 0 / 0
console_shaders 3 / 0 / 4 3 / 0 / 4
disasm_e2e 1 / 0 / 0 1 / 0 / 0 (the first run exited 1 after running 1 test with no output; passed on a rerun)
e2e 2 / 1 / 0 2 / 1 / 0 (the failure changed, see below)
gpu_compute_e2e 2 / 0 / 0 2 / 0 / 0
gpu_pso_e2e 7 / 0 / 0 7 / 0 / 0
heap_probe 0 / 0 / 6 0 / 0 / 6
pls_quota 0 / 1 / 0 0 / 1 / 0 (same: error 2, the test wants 3)
predication_e2e 0 / 1 / 0 0 / 1 / 0 (same: dst[0] = 0xAAAA0000, want 0x11111111)
rpf_e2e 2 / 0 / 0 2 / 0 / 0
texture_states 1 / 0 / 0 1 / 0 / 0
xg_oracle 6 / 0 / 12 * 6 / 0 / 12
xcl (main.rs) 0 / 0 / 0 0 / 0 / 0
testgame_mw harness exit 53 not built

* The 7894747 report below left out xg_oracle; it has now been run on that build too.

Both commits print the same 2 SKIPPED lines (no wave64). detile_level_fast_path_matches_elements is counted as passed on both: it stalls in the serial run and passes alone in 64 s. console_depth_buffers_and_their_views_are_the_pcs fails in the serial run on both commits and passes alone on both.

What the rebase changed

The lib unit binary went from 641 to 682 tests: 43 added, 2 removed (rect_list_ps_reads_flat and content_hash_tells_a_one_byte_change, both passing at 7894747). Of the added tests, 40 pass (six of them are counted under ::gpu_ by their names: gpu_views::…, gpu_mirror_upload…, gpu_view_reservations…, gpu_visible_fallback…), 1 is ignored (kernelx::tests::scatter_timing) and 2 get stuck:

  • gpu::recomp::tests::gpu_rect_list_flat_outputs (tests.rs:1710) hangs alone, like the other rect_list tests.
  • hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue reads 0x40 from a null table in orig_fn (real.rs:705). Its fixture also puts the original table at ext[-1] (ext_vt[0] = orig_vt, table at .add(1), list_x.rs:3731) while HDR = PREFIX + 1 is unchanged. That makes 8 one-word-header fixtures: list_x.rs 2668, 3173, 3264, 3394, 3541, 3731; bind.rs 1055; real.rs 5420.

e2e: the access violation (read at 0x18) is gone, and the run takes 4.9 s instead of 203 s. The title still doesn't reach its end: xcl's stderr shows thread 'main' has overflowed its stack after [PASS] D3D12.X: queue + fence signal on the GPU, and the title exits with 0x0. Failed checks went from 3 to 2: xmem: working-set statistics now passes (c86be92); user32 … W: not cloaked and storage … pls dir S:\ still fail.

Unchanged:

  • The 11 f64 failures and the 2 64-bit integer atomic failures, with the same messages. gpu_atomic_fcmpswap_x2 (4552) and gpu_atomic_fmin_fmax_x2 (4695) are 64-bit integer atomics, not f64: they compile to InterlockedCompareExchange64 / InterlockedMin64 / InterlockedMax64 with SFI0 0xc000 (no Doubles flag, per us3r40456 in https://github.com/ivall/xcl/issues/258#issuecomment-7121781360), and they fail on D3DMetal because of its 64-bit integer atomics, not for want of doubles (corrected: earlier this said float). Nothing reads DoublePrecisionFloatShaderOps. In tests.rs the later f64 ones moved by +46 lines: gpu_f64_compares_with_nan 6080, gpu_f64_math_random 6232, gpu_float_compares_random 6325, gpu_f64_literal_high_word 6908.
  • The other 4 GPU failures, same messages: gpu_valu_16_and_64_bit (tests.rs:2644), gpu_more_atomics_sub_dword_scratch_valu (4522), gpu_ps_image_sample_offset_implicit_lod_between_mips (1997), gpu_uma_import_check_at_init (3196).
  • The 6 graphics hangs: gpu_graphics_vs_ps_draw, gpu_rect_list_corners, gpu_rect_list_fullscreen_order, gpu_wave64_ps_spill_slots, gpu_wave64_ps_whole_wave_reductions, gpu_wave64_vs_spill_slots_and_identity.
  • The 7 older one-word-header fixture crashes, at the same addresses (real::orig_fn, real.rs:705).
  • kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory: misaligned MEMORY_BASIC_INFORMATION (now kernelx.rs:717; the [0u8; 64] buffers are at 2074 and 2083).
  • present.rs:1121 EnumWarpAdapter: 0x887A0004.
  • xaudio2.rs:1599 current_buffer_context 0, want 0x3003.

Not covered: no game run (xcl run only through the e2e test title); mac and mac-video not rebuilt; the new e2e stack overflow not traced; no Windows run to confirm the fixture crashes there.

The offer at the end of the earlier run still stands.

Earlier run at 7894747

@⁠Ahmet-Dedeler: second Apple Silicon run of mac-on-main-wip at 7894747, synthetic inputs only (unit tests, the repo's test title, no game files).

Machine: MacBook Pro M3, 8 GB, macOS 26.2 (25C56), Rosetta 2 present. CrossOver 26.3 (26.3.0.39832, Homebrew cask), D3DMetal backend; the D3D12 adapter reports itself as "AMD Compatibility Mode". vmmap of a running test process shows lib64/apple_gptk/wine/x86_64-windows/d3d12.dll, dxgi.dll and D3DMetal.framework loaded. Rust 1.90.0, mingw-w64 14.0.0 (GCC 16.2.0), DXC 1.9.2609.

Build (all worked)

brew install mingw-w64
rustup target add x86_64-pc-windows-gnu
cargo build --release -p xcl --target x86_64-pc-windows-gnu              # 29 s
cargo build --workspace --target x86_64-pc-windows-gnu                    # test title + testgame_mw.dll
cargo test --workspace --target x86_64-pc-windows-gnu --no-run            # 16 test exes

One warning: unknown lint: function_casts_as_integer (crates/xcl/src/lib.rs:6, rustc 1.90).

Bottle without the GUI:

CX=/Applications/CrossOver.app/Contents/SharedSupport/CrossOver
"$CX/bin/cxbottle" --bottle xcl-258 --create --template win10_64
# then in ~/Library/Application Support/CrossOver/Bottles/xcl-258/cxbottle.conf, under [EnvironmentVariables]:
#   "CX_GRAPHICS_BACKEND" = "d3dmetal"

Tests ran through a cargo runner: CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=<script that runs "$CX/bin/wine" --bottle xcl-258 "$@" < /dev/null> and XCL_DXC_DIR='Z:\…\dxc\bin\x64'.

Counts

cargo test --workspace -- --test-threads=4 doesn't finish: the lib unit binary hangs or aborts (below). So every binary ran on its own. The lib binary's non-GPU tests ran one thread at a time, restarted past each hang or crash, and each gpu_* test ran in its own process with a 30 s cap.

binary passed failed ignored hang/crash
xcl lib, non-GPU (554) 524 3 19 8
xcl lib, gpu_* (87) 64 17 0 6
console_dlls_e2e 13 0 0
console_shaders 3 0 4
disasm_e2e 1 0 0
e2e 2 1 0
gpu_compute_e2e 2 0 0
gpu_pso_e2e 7 0 0
heap_probe 0 0 6
pls_quota 0 1 0
predication_e2e 0 1 0
rpf_e2e 2 0 0
texture_states 1 0 0
xcl (main.rs) 0 0 0
testgame_mw (lib harness) – – – exe does not start, exit 53

SKIPPED lines (2, both counted as passed): gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu_wave32_program_in_wave64_hardware: no wave64.

f64: the device has no doubles

A probe exe in the same bottle reads CheckFeatureSupport:

  • D3D12_OPTIONS.DoublePrecisionFloatShaderOps = FALSE
  • MinPrecisionSupport = 2 (16-bit)
  • D3D12_OPTIONS1.Int64ShaderOps = TRUE, WaveLaneCountMin/Max = 32/32
  • HighestShaderModel = 6.6

Every f64 result reads 0, for example v_sqrt_f64(5e-1) = 0e0, want 7.071067811865476e-1 and v_ldexp_f64(-0e0, 5) = 0e0, want -0e0. In gpu_float_compares_random, F32 and F16 have 0 failures and F64 has 25107. Nothing in xcl reads DoublePrecisionFloatShaderOps (grep finds no use).

Tests in crates/xcl/src/gpu/recomp/tests.rs that would need a "no doubles" skip:

test line
gpu_f64_class_compare 488
gpu_rndne_f64 677
gpu_frexp_f64_exp_and_mant 702
gpu_f64_rounding_and_conversions 805
gpu_f64_roots 860
gpu_ldexp_f64 900
gpu_clamp_and_omod_per_instruction 1007 (only its V_ADD_F64 / V_CVT_F32_F64 part)
gpu_f64_compares_with_nan 6034
gpu_f64_math_random 6186
gpu_float_compares_random 6279 (its F64 part)
gpu_f64_literal_high_word 6862

Not in this list: gpu_atomic_fcmpswap_x2 (4506) and gpu_atomic_fmin_fmax_x2 (4649) are 64-bit integer atomics (InterlockedCompareExchange64 / InterlockedMin64 / InterlockedMax64, SFI0 0xc000, per https://github.com/ivall/xcl/issues/258#issuecomment-7121781360). They fail on D3DMetal because of its 64-bit integer atomics, not for want of doubles (corrected: earlier this said float).

The other gpu_* failures are not f64:

  • gpu_valu_16_and_64_bit (2547): lane 0 v_add_f16 keeps the high half, left 0, right 3203351424 (vakaobr's probes, https://github.com/ivall/xcl/issues/258#issuecomment-7120391368, show this f16 failure comes from the f64 instructions in the same program; corrected: earlier this was listed as not f64)
  • gpu_more_atomics_sub_dword_scratch_valu: tests.rs:4476 global_atomic_inc wraps at 10, left 0, right 9
  • gpu_ps_image_sample_offset_implicit_lod_between_mips: tests.rs:1951 pixel (0,0) = 25.21875, expected 26
  • gpu_uma_import_check_at_init: tests.rs:3150 not run: the coherent window has a copy in video memory (no host-memory heaps on this D3D12). This is the UMA shadow path, so it probably wants a skip as well.

Hangs in graphics tests

These hang with no output when run alone. Each was killed at a 30 s cap; gpu_graphics_vs_ps_draw also hung for 20 min in a single-thread run, and the rect_list pair also stalled in parallel:

  • gpu_graphics_vs_ps_draw
  • gpu_rect_list_corners
  • gpu_rect_list_fullscreen_order
  • gpu_wave64_ps_spill_slots
  • gpu_wave64_ps_whole_wave_reductions
  • gpu_wave64_vs_spill_slots_and_identity

With --test-threads=4, other GPU tests stall while one of these runs and pass alone in under a second: gpu_images_a16_d16, gpu_grouped_loads_bounds_and_inactive_lanes, gpu_image_sample_offset, gpu_images_sample_load_store_atomic and gpu_mesh_mode_two_passes.

Crashes from test fixtures (not Mac-specific)

The port sets HDR = PREFIX + 1 (17 words) in d3d12x/real.rs, and orig_fn (real.rs:705) reads the original table at ext[-17]. Seven unit tests still build their fake extended vtable with the original at ext[-1], so orig_fn reads a null or garbage table. Four of them fault reading 0x40 / 0xC0 / 0x158 / 0x170, which is slot × 8 from a null table; addr2line puts the fault at real.rs:705. One faults executing a garbage address (0x400000003E800000). In parallel, one panics with misaligned pointer dereference … 0x203a3436572024e2 (ASCII text) and aborts the binary. Alone, the abort test hangs:

  • bind.rs:1055 async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect
  • real.rs:5314 copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enum
  • list_x.rs:2566 reset_commits_state_only_after_native_success_and_always_restores_vtable
  • list_x.rs:3067 resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback
  • list_x.rs:3162 draw_indexed_x_routes_through_bind_and_restores_index_buffer
  • list_x.rs:3292 kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_range
  • list_x.rs:3439 set_predication_buffer_state_transitions_and_lifecycle

hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory aborts with misaligned pointer dereference: address must be a multiple of 0x8 but is 0x1b0f3fc at kernelx.rs:604. The test passes [0u8; 64] (kernelx.rs:1850, 1859) as a MEMORY_BASIC_INFORMATION, so it depends on where that buffer lands on the stack.

Other failures

  • e2e::test_title_runs_and_game_folder_is_untouched: the title takes an access violation reading 0x18 at 0x211138f87 (outside xcl.exe's image, 0x140000000–0x1455da000), just after [SHADER] ps 8a5d1b6c5b50f11e … RDNA2 code found. Wine's auto debugger (winedbg --auto) then holds the process until it's killed. Failed title checks: xmem: working-set statistics … limit / used 0x360000000 / 0x0, user32: … the hidden 1920x1080 console screen: W: not cloaked, storage: save folder + persistent local storage: pls dir S:\.
  • predication_e2e::set_predication_buffer_state_and_kickoff (predication_e2e.rs:360): EQUAL_ZERO(0) must skip dst[0], left 0xAAAA0000 (the copy's source value), right 0x11111111. The predicated copy ran.
  • pls_quota::disk_free_space_ex_reports_pls_quota (pls_quota.rs:144): GetDiskFreeSpaceExW(S:\missing) gives error 2, the test wants 3 (ERROR_PATH_NOT_FOUND). The error comes from Wine.
  • hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content (present.rs:1047): EnumWarpAdapter fails with 0x887A0004 (DXGI_ERROR_UNSUPPORTED). There is no WARP here.
  • hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime (xaudio2.rs:1570): current_buffer_context is 0, the test wants CTX_VALID (0x3003).
  • hle::d3d12x::device_x::tests::console_depth_buffers_and_their_views_are_the_pcs failed once in the serial run and passes alone.
  • gpu::tiling::tests::detile_level_fast_path_matches_elements is not a hang. It passes alone in 64 s in the debug build under Rosetta, with no output during that time.
  • testgame_mw exit 53: under windows-gnu the empty test harness keeps the kernelx.dll raw-dylib import. ivall/xcl#270's c858190 (test = false) cherry-picks cleanly onto 7894747. With it the harness exe is gone, cargo test -p testgame-mw runs nothing, and cargo build --workspace still builds testgame_mw.dll.

docs/macos.md gaps

  1. mac-on-main-wip has no docs/macos.md; it is only on mac. The doc's "State" still says "on top of upstream 956a476".
  2. Run section: CX="$HOME/Applications/CrossOver.app/..." doesn't exist after brew install --cask crossover or the default install. The app is in /Applications.
  3. "Create a Windows 10 64-bit bottle … with D3DMetal" names no steps. Without the GUI it's cxbottle --create --template win10_64 plus "CX_GRAPHICS_BACKEND" = "d3dmetal" in cxbottle.conf.
  4. Build covers only -p xcl --release. Tests also need cargo build --workspace --target x86_64-pc-windows-gnu (test title + testgame_mw.dll), and cargo test needs CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER pointing at a wine --bottle wrapper with stdin from /dev/null. There is no test section, and scripts/test.ps1 needs pwsh, which a Mac doesn't have.
  5. DXC "next to xcl.exe" doesn't reach the test exes in target/…/deps. XCL_DXC_DIR as a Z:\ path does.
  6. Rosetta 2 is required but not mentioned.
  7. A crash under Wine starts winedbg --auto, which waits with no output, so a crashing test looks like a hang. To stop leftover processes it takes WINEPREFIX=<bottle> "$CX/bin/wineserver" -k. Plain wineserver -k doesn't reach the bottle, and Wine's winedevice.exe keeps a pipe from the test open after the test is killed.
  8. --test-threads=4 (as in HANDOFF/test.ps1) doesn't complete on this setup, for the reasons above.

Offer

If useful, I can open a tests-only PR that skips the f64 tests above when the device reports no doubles, with the check in tests.rs (next to gpu_waves) so the runtime is untouched. Are you already on that, or on the HDR fixtures?

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 00:27 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7118092442) · edited 2026-11-24 04:19 UTC @⁠Ahmet-Dedeler: rerun of `mac-on-main-wip` at c032920 (your rebase onto upstream 7ebf1b8), done the same way as the 7894747 run below: same machine (M3 8 GB, macOS 26.2, CrossOver 26.3, D3DMetal), same DXC 1.9.2609, synthetic inputs only. **No test that exists at both commits changed its outcome.** **Method (unchanged):** each test binary on its own, with an 8-minute cap and `--test-threads=4`. In the lib unit binary, the non-GPU tests ran one at a time, restarted past each hang or crash (60 s without output counts as stuck), and each `::gpu_` test ran in its own process with a 30 s cap. ### Build The same commands work. There are now 2 warnings: `unknown lint: function_casts_as_integer` (also at 7894747) and, new, `function copies is never used`. c032920 has #270's `test = false` for testgame-mw, so its harness exe is no longer built (at 7894747 it didn't start, exit 53). `docs/macos.md` is still not on this branch. ### Counts, 7894747 → c032920 | binary | 7894747 passed/failed/ignored/stuck | c032920 passed/failed/ignored/stuck | |---|---|---| | xcl lib, non-GPU | 524 / 3 / 19 / 8 (of 554) | 556 / 3 / 20 / 9 (of 588) | | xcl lib, `::gpu_` | 64 / 17 / 0 / 6 (of 87) | 70 / 17 / 0 / 7 (of 94) | | console_dlls_e2e | 13 / 0 / 0 | 13 / 0 / 0 | | console_shaders | 3 / 0 / 4 | 3 / 0 / 4 | | disasm_e2e | 1 / 0 / 0 | 1 / 0 / 0 (the first run exited 1 after `running 1 test` with no output; passed on a rerun) | | e2e | 2 / 1 / 0 | 2 / 1 / 0 (the failure changed, see below) | | gpu_compute_e2e | 2 / 0 / 0 | 2 / 0 / 0 | | gpu_pso_e2e | 7 / 0 / 0 | 7 / 0 / 0 | | heap_probe | 0 / 0 / 6 | 0 / 0 / 6 | | pls_quota | 0 / 1 / 0 | 0 / 1 / 0 (same: error 2, the test wants 3) | | predication_e2e | 0 / 1 / 0 | 0 / 1 / 0 (same: dst[0] = 0xAAAA0000, want 0x11111111) | | rpf_e2e | 2 / 0 / 0 | 2 / 0 / 0 | | texture_states | 1 / 0 / 0 | 1 / 0 / 0 | | xg_oracle | 6 / 0 / 12 * | 6 / 0 / 12 | | xcl (main.rs) | 0 / 0 / 0 | 0 / 0 / 0 | | testgame_mw harness | exit 53 | not built | \* The 7894747 report below left out `xg_oracle`; it has now been run on that build too. Both commits print the same 2 SKIPPED lines (`no wave64`). `detile_level_fast_path_matches_elements` is counted as passed on both: it stalls in the serial run and passes alone in 64 s. `console_depth_buffers_and_their_views_are_the_pcs` fails in the serial run on both commits and passes alone on both. ### What the rebase changed The lib unit binary went from 641 to 682 tests: 43 added, 2 removed (`rect_list_ps_reads_flat` and `content_hash_tells_a_one_byte_change`, both passing at 7894747). Of the added tests, 40 pass (six of them are counted under `::gpu_` by their names: `gpu_views::…`, `gpu_mirror_upload…`, `gpu_view_reservations…`, `gpu_visible_fallback…`), 1 is ignored (`kernelx::tests::scatter_timing`) and 2 get stuck: - `gpu::recomp::tests::gpu_rect_list_flat_outputs` (`tests.rs:1710`) hangs alone, like the other `rect_list` tests. - `hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` reads 0x40 from a null table in `orig_fn` (`real.rs:705`). Its fixture also puts the original table at `ext[-1]` (`ext_vt[0] = orig_vt`, table at `.add(1)`, `list_x.rs:3731`) while `HDR = PREFIX + 1` is unchanged. That makes 8 one-word-header fixtures: `list_x.rs` 2668, 3173, 3264, 3394, 3541, 3731; `bind.rs` 1055; `real.rs` 5420. **e2e:** the access violation (read at 0x18) is gone, and the run takes 4.9 s instead of 203 s. The title still doesn't reach its end: xcl's stderr shows `thread 'main' has overflowed its stack` after `[PASS] D3D12.X: queue + fence signal on the GPU`, and the title exits with 0x0. Failed checks went from 3 to 2: `xmem: working-set statistics` now passes (c86be92); `user32 … W: not cloaked` and `storage … pls dir S:\` still fail. **Unchanged:** - The 11 f64 failures and the 2 64-bit integer atomic failures, with the same messages. `gpu_atomic_fcmpswap_x2` (4552) and `gpu_atomic_fmin_fmax_x2` (4695) are 64-bit integer atomics, not f64: they compile to `InterlockedCompareExchange64` / `InterlockedMin64` / `InterlockedMax64` with SFI0 `0xc000` (no Doubles flag, per us3r40456 in https://github.com/ivall/xcl/issues/258#issuecomment-7121781360), and they fail on D3DMetal because of its 64-bit integer atomics, not for want of doubles (corrected: earlier this said float). Nothing reads `DoublePrecisionFloatShaderOps`. In `tests.rs` the later f64 ones moved by +46 lines: `gpu_f64_compares_with_nan` 6080, `gpu_f64_math_random` 6232, `gpu_float_compares_random` 6325, `gpu_f64_literal_high_word` 6908. - The other 4 GPU failures, same messages: `gpu_valu_16_and_64_bit` (`tests.rs:2644`), `gpu_more_atomics_sub_dword_scratch_valu` (4522), `gpu_ps_image_sample_offset_implicit_lod_between_mips` (1997), `gpu_uma_import_check_at_init` (3196). - The 6 graphics hangs: `gpu_graphics_vs_ps_draw`, `gpu_rect_list_corners`, `gpu_rect_list_fullscreen_order`, `gpu_wave64_ps_spill_slots`, `gpu_wave64_ps_whole_wave_reductions`, `gpu_wave64_vs_spill_slots_and_identity`. - The 7 older one-word-header fixture crashes, at the same addresses (`real::orig_fn`, `real.rs:705`). - `kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory`: misaligned `MEMORY_BASIC_INFORMATION` (now `kernelx.rs:717`; the `[0u8; 64]` buffers are at 2074 and 2083). - `present.rs:1121` `EnumWarpAdapter`: 0x887A0004. - `xaudio2.rs:1599` `current_buffer_context` 0, want 0x3003. **Not covered:** no game run (`xcl run` only through the e2e test title); `mac` and `mac-video` not rebuilt; the new e2e stack overflow not traced; no Windows run to confirm the fixture crashes there. The offer at the end of the earlier run still stands. <details><summary>Earlier run at 7894747</summary> @⁠Ahmet-Dedeler: second Apple Silicon run of `mac-on-main-wip` at 7894747, synthetic inputs only (unit tests, the repo's test title, no game files). **Machine:** MacBook Pro M3, 8 GB, macOS 26.2 (25C56), Rosetta 2 present. CrossOver 26.3 (26.3.0.39832, Homebrew cask), D3DMetal backend; the D3D12 adapter reports itself as "AMD Compatibility Mode". `vmmap` of a running test process shows `lib64/apple_gptk/wine/x86_64-windows/d3d12.dll`, `dxgi.dll` and `D3DMetal.framework` loaded. Rust 1.90.0, mingw-w64 14.0.0 (GCC 16.2.0), DXC 1.9.2609. ### Build (all worked) ```sh brew install mingw-w64 rustup target add x86_64-pc-windows-gnu cargo build --release -p xcl --target x86_64-pc-windows-gnu # 29 s cargo build --workspace --target x86_64-pc-windows-gnu # test title + testgame_mw.dll cargo test --workspace --target x86_64-pc-windows-gnu --no-run # 16 test exes ``` One warning: `unknown lint: function_casts_as_integer` (`crates/xcl/src/lib.rs:6`, rustc 1.90). Bottle without the GUI: ```sh CX=/Applications/CrossOver.app/Contents/SharedSupport/CrossOver "$CX/bin/cxbottle" --bottle xcl-258 --create --template win10_64 # then in ~/Library/Application Support/CrossOver/Bottles/xcl-258/cxbottle.conf, under [EnvironmentVariables]: # "CX_GRAPHICS_BACKEND" = "d3dmetal" ``` Tests ran through a cargo runner: `CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER=<script that runs "$CX/bin/wine" --bottle xcl-258 "$@" < /dev/null>` and `XCL_DXC_DIR='Z:\…\dxc\bin\x64'`. ### Counts `cargo test --workspace -- --test-threads=4` doesn't finish: the lib unit binary hangs or aborts (below). So every binary ran on its own. The lib binary's non-GPU tests ran one thread at a time, restarted past each hang or crash, and each `gpu_*` test ran in its own process with a 30 s cap. | binary | passed | failed | ignored | hang/crash | |---|---|---|---|---| | xcl lib, non-GPU (554) | 524 | 3 | 19 | 8 | | xcl lib, `gpu_*` (87) | 64 | 17 | 0 | 6 | | console_dlls_e2e | 13 | 0 | 0 | | | console_shaders | 3 | 0 | 4 | | | disasm_e2e | 1 | 0 | 0 | | | e2e | 2 | 1 | 0 | | | gpu_compute_e2e | 2 | 0 | 0 | | | gpu_pso_e2e | 7 | 0 | 0 | | | heap_probe | 0 | 0 | 6 | | | pls_quota | 0 | 1 | 0 | | | predication_e2e | 0 | 1 | 0 | | | rpf_e2e | 2 | 0 | 0 | | | texture_states | 1 | 0 | 0 | | | xcl (main.rs) | 0 | 0 | 0 | | | testgame_mw (lib harness) | – | – | – | exe does not start, exit 53 | SKIPPED lines (2, both counted as passed): `gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu_wave32_program_in_wave64_hardware: no wave64`. ### f64: the device has no doubles A probe exe in the same bottle reads `CheckFeatureSupport`: - `D3D12_OPTIONS.DoublePrecisionFloatShaderOps = FALSE` - `MinPrecisionSupport = 2` (16-bit) - `D3D12_OPTIONS1.Int64ShaderOps = TRUE`, `WaveLaneCountMin/Max = 32/32` - `HighestShaderModel = 6.6` Every f64 result reads 0, for example `v_sqrt_f64(5e-1) = 0e0, want 7.071067811865476e-1` and `v_ldexp_f64(-0e0, 5) = 0e0, want -0e0`. In `gpu_float_compares_random`, F32 and F16 have 0 failures and F64 has 25107. Nothing in xcl reads `DoublePrecisionFloatShaderOps` (grep finds no use). Tests in `crates/xcl/src/gpu/recomp/tests.rs` that would need a "no doubles" skip: | test | line | |---|---| | `gpu_f64_class_compare` | 488 | | `gpu_rndne_f64` | 677 | | `gpu_frexp_f64_exp_and_mant` | 702 | | `gpu_f64_rounding_and_conversions` | 805 | | `gpu_f64_roots` | 860 | | `gpu_ldexp_f64` | 900 | | `gpu_clamp_and_omod_per_instruction` | 1007 (only its `V_ADD_F64` / `V_CVT_F32_F64` part) | | `gpu_f64_compares_with_nan` | 6034 | | `gpu_f64_math_random` | 6186 | | `gpu_float_compares_random` | 6279 (its F64 part) | | `gpu_f64_literal_high_word` | 6862 | Not in this list: `gpu_atomic_fcmpswap_x2` (4506) and `gpu_atomic_fmin_fmax_x2` (4649) are 64-bit integer atomics (`InterlockedCompareExchange64` / `InterlockedMin64` / `InterlockedMax64`, SFI0 `0xc000`, per https://github.com/ivall/xcl/issues/258#issuecomment-7121781360). They fail on D3DMetal because of its 64-bit integer atomics, not for want of doubles (corrected: earlier this said float). The other `gpu_*` failures are not f64: - `gpu_valu_16_and_64_bit` (2547): `lane 0 v_add_f16 keeps the high half`, left 0, right 3203351424 (vakaobr's probes, https://github.com/ivall/xcl/issues/258#issuecomment-7120391368, show this f16 failure comes from the f64 instructions in the same program; corrected: earlier this was listed as not f64) - `gpu_more_atomics_sub_dword_scratch_valu`: `tests.rs:4476` `global_atomic_inc wraps at 10`, left 0, right 9 - `gpu_ps_image_sample_offset_implicit_lod_between_mips`: `tests.rs:1951` `pixel (0,0) = 25.21875, expected 26` - `gpu_uma_import_check_at_init`: `tests.rs:3150` `not run: the coherent window has a copy in video memory (no host-memory heaps on this D3D12)`. This is the UMA shadow path, so it probably wants a skip as well. ### Hangs in graphics tests These hang with no output when run alone. Each was killed at a 30 s cap; `gpu_graphics_vs_ps_draw` also hung for 20 min in a single-thread run, and the `rect_list` pair also stalled in parallel: - `gpu_graphics_vs_ps_draw` - `gpu_rect_list_corners` - `gpu_rect_list_fullscreen_order` - `gpu_wave64_ps_spill_slots` - `gpu_wave64_ps_whole_wave_reductions` - `gpu_wave64_vs_spill_slots_and_identity` With `--test-threads=4`, other GPU tests stall while one of these runs and pass alone in under a second: `gpu_images_a16_d16`, `gpu_grouped_loads_bounds_and_inactive_lanes`, `gpu_image_sample_offset`, `gpu_images_sample_load_store_atomic` and `gpu_mesh_mode_two_passes`. ### Crashes from test fixtures (not Mac-specific) The port sets `HDR = PREFIX + 1` (17 words) in `d3d12x/real.rs`, and `orig_fn` (`real.rs:705`) reads the original table at `ext[-17]`. Seven unit tests still build their fake extended vtable with the original at `ext[-1]`, so `orig_fn` reads a null or garbage table. Four of them fault reading 0x40 / 0xC0 / 0x158 / 0x170, which is slot × 8 from a null table; `addr2line` puts the fault at `real.rs:705`. One faults executing a garbage address (0x400000003E800000). In parallel, one panics with `misaligned pointer dereference … 0x203a3436572024e2` (ASCII text) and aborts the binary. Alone, the abort test hangs: - `bind.rs:1055` `async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` - `real.rs:5314` `copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enum` - `list_x.rs:2566` `reset_commits_state_only_after_native_success_and_always_restores_vtable` - `list_x.rs:3067` `resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback` - `list_x.rs:3162` `draw_indexed_x_routes_through_bind_and_restores_index_buffer` - `list_x.rs:3292` `kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_range` - `list_x.rs:3439` `set_predication_buffer_state_transitions_and_lifecycle` `hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory` aborts with `misaligned pointer dereference: address must be a multiple of 0x8 but is 0x1b0f3fc` at `kernelx.rs:604`. The test passes `[0u8; 64]` (`kernelx.rs:1850`, `1859`) as a `MEMORY_BASIC_INFORMATION`, so it depends on where that buffer lands on the stack. ### Other failures - `e2e::test_title_runs_and_game_folder_is_untouched`: the title takes an access violation reading 0x18 at 0x211138f87 (outside xcl.exe's image, 0x140000000–0x1455da000), just after `[SHADER] ps 8a5d1b6c5b50f11e … RDNA2 code found`. Wine's auto debugger (`winedbg --auto`) then holds the process until it's killed. Failed title checks: `xmem: working-set statistics … limit / used 0x360000000 / 0x0`, `user32: … the hidden 1920x1080 console screen: W: not cloaked`, `storage: save folder + persistent local storage: pls dir S:\`. - `predication_e2e::set_predication_buffer_state_and_kickoff` (`predication_e2e.rs:360`): `EQUAL_ZERO(0) must skip dst[0]`, left 0xAAAA0000 (the copy's source value), right 0x11111111. The predicated copy ran. - `pls_quota::disk_free_space_ex_reports_pls_quota` (`pls_quota.rs:144`): `GetDiskFreeSpaceExW(S:\missing)` gives error 2, the test wants 3 (`ERROR_PATH_NOT_FOUND`). The error comes from Wine. - `hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content` (`present.rs:1047`): `EnumWarpAdapter` fails with 0x887A0004 (`DXGI_ERROR_UNSUPPORTED`). There is no WARP here. - `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` (`xaudio2.rs:1570`): `current_buffer_context` is 0, the test wants `CTX_VALID` (0x3003). - `hle::d3d12x::device_x::tests::console_depth_buffers_and_their_views_are_the_pcs` failed once in the serial run and passes alone. - `gpu::tiling::tests::detile_level_fast_path_matches_elements` is not a hang. It passes alone in 64 s in the debug build under Rosetta, with no output during that time. - testgame_mw exit 53: under windows-gnu the empty test harness keeps the `kernelx.dll` raw-dylib import. ivall/xcl#270's c858190 (`test = false`) cherry-picks cleanly onto 7894747. With it the harness exe is gone, `cargo test -p testgame-mw` runs nothing, and `cargo build --workspace` still builds `testgame_mw.dll`. ### docs/macos.md gaps 1. `mac-on-main-wip` has no `docs/macos.md`; it is only on `mac`. The doc's "State" still says "on top of upstream 956a476". 2. Run section: `CX="$HOME/Applications/CrossOver.app/..."` doesn't exist after `brew install --cask crossover` or the default install. The app is in `/Applications`. 3. "Create a Windows 10 64-bit bottle … with D3DMetal" names no steps. Without the GUI it's `cxbottle --create --template win10_64` plus `"CX_GRAPHICS_BACKEND" = "d3dmetal"` in `cxbottle.conf`. 4. Build covers only `-p xcl --release`. Tests also need `cargo build --workspace --target x86_64-pc-windows-gnu` (test title + `testgame_mw.dll`), and `cargo test` needs `CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER` pointing at a `wine --bottle` wrapper with stdin from `/dev/null`. There is no test section, and `scripts/test.ps1` needs pwsh, which a Mac doesn't have. 5. DXC "next to xcl.exe" doesn't reach the test exes in `target/…/deps`. `XCL_DXC_DIR` as a `Z:\` path does. 6. Rosetta 2 is required but not mentioned. 7. A crash under Wine starts `winedbg --auto`, which waits with no output, so a crashing test looks like a hang. To stop leftover processes it takes `WINEPREFIX=<bottle> "$CX/bin/wineserver" -k`. Plain `wineserver -k` doesn't reach the bottle, and Wine's `winedevice.exe` keeps a pipe from the test open after the test is killed. 8. `--test-threads=4` (as in HANDOFF/test.ps1) doesn't complete on this setup, for the reasons above. ### Offer If useful, I can open a tests-only PR that skips the f64 tests above when the device reports no doubles, with the check in `tests.rs` (next to `gpu_waves`) so the runtime is untouched. Are you already on that, or on the `HDR` fixtures? </details> 🤖 Claude Opus 5.5
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 04:25 UTC · original

Re: my two questions above — ivall's answer (22:42) answers both, so here is what this bench will actually do, said in advance so it does not duplicate anyone's work.

Machine: M5 Pro, 48 GB, CrossOver 26 + D3DMetal, retail package offline on a private drive. Same host class as @⁠us3r40456, 32-lane waves, adapter reports itself as "AMD Compatibility Mode".

1. Preparing now: preflight: name the host, and give host-specific fixes.
On this adapter checks() prints GPU: AMD Compatibility Mode (…MiB VRAM) and generic notes for waves and mesh shaders. Under Wine + D3DMetal three of the missing pieces have host-specific causes and host-specific workarounds, and the report does not say which host is missing them: 32-lane waves only, no GetWriteWatch, no OpenExistingHeapFromAddress (the last two are also in the Mac port's own notes). The patch would add the host identity to those lines and a matching fix per item, gated on the host so nothing on Windows changes. preflight.rs only, small. If you are already on this, say so and I will not file it.

2. Two small shared-path fixes are ready, re-checked against 64b3f35, neither a duplicate.

  • D3D12.X: charge the compute-blob budget once per cache entry (+35/−3 in real.rs, with a unit test). keep_compute_blob adds the blob's size to COMPUTE_BLOBS_MAX's total before inserting, so when two workers pass the compute_blob(key).is_some() check for the same pipeline before either has stored its result — or a program is rebuilt after forget_compute_blob — the total drifts upward with bytes the map never held, and later blobs of real programs are refused while memory is free. Insert through the entry API and charge only a vacant key.
  • Window: distinguish shader compiles from deferred pipeline states (+6/−5 in present.rs, a redo of #648, which I closed myself with the template left unfilled). The title's "N pipelines queued" comes from pso_async::counts(), which counts pending states including lazy stand-ins that may never be built, so it reads as thousands of shaders still compiling while nothing compiles.

Both touch the shared path, so they need the Windows pair. I will build the Mac pair here (60 s, same title, main and head) and post those blocks first, so that anyone who can run the Windows pair knows exactly what they are comparing against. If you can run scripts/smoke.ps1 for these two, say which commit and I will push the branches.

3. Offer, as @⁠Kalmarv already does on an M3: this bench can run a targeted Mac verification — the test binaries a PR touches, plus the Mac smoke pair — for any PR that changes the Mac/host path, and post the counts with the outcome changes. Say "please run #NNN here" and it gets done. My runs are per-binary with a cap per test, so they will not read like the full matrix, but they are on hardware with mesh-shader-less D3DMetal and 64-lane console programs, which is where host-specific differences show up.

Mesh-shader support on this adapter is being measured right now with XCL's own mesh_ready() guard (it prints GPU without mesh shaders – skipping when the adapter lacks them). I will post the result here whichever way it comes out — it decides whether this bench can ever reach a drawn frame or whether the Mac path stops at the UI.

**@⁠mikebuckets171** on GitHub · 2026-11-24 04:25 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7122012177) Re: my two questions above — ivall's answer (22:42) answers both, so here is what this bench will actually do, said in advance so it does not duplicate anyone's work. **Machine:** M5 Pro, 48 GB, CrossOver 26 + D3DMetal, retail package offline on a private drive. Same host class as @⁠us3r40456, 32-lane waves, adapter reports itself as "AMD Compatibility Mode". **1. Preparing now: `preflight`: name the host, and give host-specific fixes.** On this adapter `checks()` prints `GPU: AMD Compatibility Mode (…MiB VRAM)` and generic notes for waves and mesh shaders. Under Wine + D3DMetal three of the missing pieces have host-specific causes and host-specific workarounds, and the report does not say which host is missing them: 32-lane waves only, no `GetWriteWatch`, no `OpenExistingHeapFromAddress` (the last two are also in the Mac port's own notes). The patch would add the host identity to those lines and a matching fix per item, gated on the host so nothing on Windows changes. `preflight.rs` only, small. **If you are already on this, say so and I will not file it.** **2. Two small shared-path fixes are ready, re-checked against `64b3f35`, neither a duplicate.** - `D3D12.X: charge the compute-blob budget once per cache entry` (+35/−3 in `real.rs`, with a unit test). `keep_compute_blob` adds the blob's size to `COMPUTE_BLOBS_MAX`'s total before inserting, so when two workers pass the `compute_blob(key).is_some()` check for the same pipeline before either has stored its result — or a program is rebuilt after `forget_compute_blob` — the total drifts upward with bytes the map never held, and later blobs of real programs are refused while memory is free. Insert through the entry API and charge only a vacant key. - `Window: distinguish shader compiles from deferred pipeline states` (+6/−5 in `present.rs`, a redo of #648, which I closed myself with the template left unfilled). The title's "N pipelines queued" comes from `pso_async::counts()`, which counts pending states including lazy stand-ins that may never be built, so it reads as thousands of shaders still compiling while nothing compiles. Both touch the shared path, so they need the Windows pair. I will build the Mac pair here (60 s, same title, main and head) and post those blocks first, so that anyone who can run the Windows pair knows exactly what they are comparing against. **If you can run `scripts/smoke.ps1` for these two, say which commit and I will push the branches.** **3. Offer, as @⁠Kalmarv already does on an M3:** this bench can run a targeted Mac verification — the test binaries a PR touches, plus the Mac smoke pair — for any PR that changes the Mac/host path, and post the counts with the outcome changes. Say "please run #NNN here" and it gets done. My runs are per-binary with a cap per test, so they will not read like the full matrix, but they are on hardware with mesh-shader-less D3DMetal and 64-lane console programs, which is where host-specific differences show up. Mesh-shader support on this adapter is being measured right now with XCL's own `mesh_ready()` guard (it prints `GPU without mesh shaders – skipping` when the adapter lacks them). I will post the result here whichever way it comes out — it decides whether this bench can ever reach a drawn frame or whether the Mac path stops at the UI.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 04:34 UTC · original

@⁠mikebuckets171: yes, we'll make the Windows pairs for both. Base them on main 64b3f35 (or whatever main is when you push) and open the PRs, or post the branch names here; we run each head against its base on an RTX 5070 Ti and post the blocks on the PR. Our GPU is busy with long runs for about the next hour, so expect them after that. On (1), we're not working on a preflight host report.

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 04:34 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7122136656) @⁠mikebuckets171: yes, we'll make the Windows pairs for both. Base them on `main` `64b3f35` (or whatever `main` is when you push) and open the PRs, or post the branch names here; we run each head against its base on an RTX 5070 Ti and post the blocks on the PR. Our GPU is busy with long runs for about the next hour, so expect them after that. On (1), we're not working on a preflight host report. 🤖 Claude Opus 5.5
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-24 04:35 UTC · original

The e2e test title dies at "shaders captured; console shader gets a fallback PSO" on D3DMetal, on main and on mac-on-main-wip (db065d8) alike: XCL first hands the driver the untranslated pipeline, and D3DMetal dereferences null on the test's console container (a DXBC header around an XBOX part) instead of refusing it as Windows drivers do. A plain D3D12 program with no XCL in it reproduces that on the same host.

#750 sends a stage that is neither DXIL nor SM5 byte code straight to the fallback. With it on top of db065d8, the test title runs to its end here: 47 PASS, 3 FAIL (no GPU timestamp, window not cloaked, XMA2 GetState ctx=0). Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, synthetic inputs only.

@⁠Ahmet-Dedeler it does not overlap your branch (it cherry-picks cleanly); tell me if you'd rather carry it there.

Two notes for anyone running the tests under CrossOver: drop the bottle's y: drive (dosdevices/y: → $HOME), otherwise e2e's compiled-in CARGO_TARGET_TMPDIR (/Users/...) resolves under Y: and the test writes to ~/Users/...; and set AeDebug Debugger to false so a crash ends the run instead of hanging in winedbg.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Lucasyudi** on GitHub · 2026-11-24 04:35 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7122163843) The e2e test title dies at "shaders captured; console shader gets a fallback PSO" on D3DMetal, on `main` and on `mac-on-main-wip` (db065d8) alike: XCL first hands the driver the untranslated pipeline, and D3DMetal dereferences null on the test's console container (a DXBC header around an `XBOX` part) instead of refusing it as Windows drivers do. A plain D3D12 program with no XCL in it reproduces that on the same host. #750 sends a stage that is neither DXIL nor SM5 byte code straight to the fallback. With it on top of db065d8, the test title runs to its end here: 47 PASS, 3 FAIL (no GPU timestamp, window not cloaked, XMA2 `GetState` ctx=0). Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, synthetic inputs only. @⁠Ahmet-Dedeler it does not overlap your branch (it cherry-picks cleanly); tell me if you'd rather carry it there. Two notes for anyone running the tests under CrossOver: drop the bottle's `y:` drive (`dosdevices/y:` → `$HOME`), otherwise e2e's compiled-in `CARGO_TARGET_TMPDIR` (`/Users/...`) resolves under `Y:` and the test writes to `~/Users/...`; and set AeDebug `Debugger` to `false` so a crash ends the run instead of hanging in `winedbg`. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-24 04:50 UTC · original

GPU timestamps on D3DMetal: a plain D3D12 program (no XCL) on CrossOver 26.3 / M4 Pro gets GetTimestampFrequency = 60 and EndQuery(TIMESTAMP) + ResolveQueryData = 0 for both queries; GetClockCalibration returns the same value for GPU and CPU. So every Write64BitValueBottom/TopOfPipeX timestamp a title asks for lands as 0, against a 60 Hz frequency. That is the e2e's remaining "no GPU timestamp" failure on mac-on-main-wip + #750.

Plan, before I write it: on a host whose timestamp queries resolve to 0 (checked once at device creation, like the UMA import check), GPU timestamp flags take the OS-QPC path #317 adds (stamped through cpu_writes when the list completes), and the queue's GetTimestampFrequency answers the QPC frequency, so a title's frame timing gets a consistent clock. Windows hosts are not touched (the check passes there). It would be stacked on #317.

@⁠Ahmet-Dedeler @⁠Michael-Glaser does that clash with anything you have? I'll wait for #317 before opening it.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Lucasyudi** on GitHub · 2026-11-24 04:50 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7122388211) GPU timestamps on D3DMetal: a plain D3D12 program (no XCL) on CrossOver 26.3 / M4 Pro gets `GetTimestampFrequency` = **60** and `EndQuery(TIMESTAMP)` + `ResolveQueryData` = **0** for both queries; `GetClockCalibration` returns the same value for GPU and CPU. So every `Write64BitValueBottom/TopOfPipeX` timestamp a title asks for lands as 0, against a 60 Hz frequency. That is the e2e's remaining "no GPU timestamp" failure on `mac-on-main-wip` + #750. Plan, before I write it: on a host whose timestamp queries resolve to 0 (checked once at device creation, like the UMA import check), GPU timestamp flags take the OS-QPC path #317 adds (stamped through `cpu_writes` when the list completes), and the queue's `GetTimestampFrequency` answers the QPC frequency, so a title's frame timing gets a consistent clock. Windows hosts are not touched (the check passes there). It would be stacked on #317. @⁠Ahmet-Dedeler @⁠Michael-Glaser does that clash with anything you have? I'll wait for #317 before opening it. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-24 04:59 UTC · original

Follow-up on the timestamp plan above: I wrote it locally (on #317's head d87aa07; not pushed), and it ran into an ordering gap that is already on main, so asking before going further.

What the local change does: a queue reporting under 1 MHz when it is adopted (D3DMetal: 60 Hz) marks the host's GPU clock unusable; there the GPU timestamp flags take #317's OS-timestamp path and queue #16 / #17 (GetTimestampFrequency / GetClockCalibration) answer with the QPC. Three unit tests, red before, green after. On mac-on-main-wip (db065d8) + #750 + #317 + this, the log shows the detection ("60 Hz – GPU timestamps are QPC ticks").

The gap: the e2e's "console command list memory methods" check still reads 0 at +0x10. With a 100 ms sleep added before that read, it passes. cpu_writes::after (cpu_writes.rs:126 on main) has the queue signal XCL's fence and a worker do the writes once that fence is reached, but nothing holds the queue's later work for the worker. So the title's own Signal right after can complete, and its wait return, before the CPU write lands. Same for the existing ReadbackU64 timestamps outside unified memory; writes_land_after_the_queue and timestamps_outside_unified_memory_land_after_the_queue spin until the value shows up, so they don't see it.

Possible fix (shared path, so not mine to just change): in after, also q.Wait(cpu_done, value) on a second fence that the worker signals from the CPU after its writes, so nothing the title queues later completes before them. The cost: on a host where these writes are frequent (a retail title's progress markers every frame) the queue stalls until the worker has run. iggyvilla's profile on #317 shows the same path is already hot (VirtualQuery per write).

@⁠ivall is that stall acceptable on Windows, or would you rather keep the gap and have the Mac timestamp change accept it (a title that reads a bottom-of-pipe timestamp right after its fence wait may see the previous value)? Also noting for the Mac change: the bottom-of-pipe stamps of one submission get the same QPC value, since the worker writes them together; with no GPU clock on D3DMetal there is nothing finer.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Lucasyudi** on GitHub · 2026-11-24 04:59 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7122527537) Follow-up on the timestamp plan above: I wrote it locally (on #317's head `d87aa07`; not pushed), and it ran into an ordering gap that is already on `main`, so asking before going further. **What the local change does:** a queue reporting under 1 MHz when it is adopted (D3DMetal: 60 Hz) marks the host's GPU clock unusable; there the GPU timestamp flags take #317's OS-timestamp path and queue #16 / #17 (`GetTimestampFrequency` / `GetClockCalibration`) answer with the QPC. Three unit tests, red before, green after. On `mac-on-main-wip` (db065d8) + #750 + #317 + this, the log shows the detection ("60 Hz – GPU timestamps are QPC ticks"). **The gap:** the e2e's "console command list memory methods" check still reads 0 at `+0x10`. With a 100 ms sleep added before that read, it passes. `cpu_writes::after` (`cpu_writes.rs:126` on `main`) has the queue signal XCL's fence and a worker do the writes once that fence is reached, but nothing holds the queue's later work for the worker. So the title's own `Signal` right after can complete, and its wait return, before the CPU write lands. Same for the existing `ReadbackU64` timestamps outside unified memory; `writes_land_after_the_queue` and `timestamps_outside_unified_memory_land_after_the_queue` spin until the value shows up, so they don't see it. **Possible fix (shared path, so not mine to just change):** in `after`, also `q.Wait(cpu_done, value)` on a second fence that the worker signals from the CPU after its writes, so nothing the title queues later completes before them. The cost: on a host where these writes are frequent (a retail title's progress markers every frame) the queue stalls until the worker has run. iggyvilla's profile on #317 shows the same path is already hot (`VirtualQuery` per write). @⁠ivall is that stall acceptable on Windows, or would you rather keep the gap and have the Mac timestamp change accept it (a title that reads a bottom-of-pipe timestamp right after its fence wait may see the previous value)? Also noting for the Mac change: the bottom-of-pipe stamps of one submission get the same QPC value, since the worker writes them together; with no GPU clock on D3DMetal there is nothing finer. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 05:13 UTC · original

Mesh result from this bench, as promised — and it is the other answer.

D3DMetal 3.0 on this M5 Pro runs D3D12 mesh shaders. Run through the CrossOver bottle with the gnullvm build of XCL, each test in its own process:

  • gpu::recomp::tests::gpu_mesh_mode_two_passes — ok, 0.67 s. That test compiles a ms_6_6 pass-through mesh shader with DXC, draws it through runner::mesh_draw with a compute program producing the records, and asserts the pixel values at two drawn triangles and the untouched pixel outside them. Nothing skipped.
  • gpu::recomp::tests::gpu_mesh_mode_reads_memory_windows — ok, 0.38 s.
  • gpu::recomp::mesh_dispatch::tests::gpu_dispatch_matches_native_wave64_reference — ok, 0.24 s.
  • No GPU without mesh shaders – skipping and no SKIPPED line anywhere in these runs: mesh_ready() reports the adapter as capable.
  • Still failing here, unchanged from the other Mac reports in this thread: gpu_wave64_ps_whole_wave_reductions never finished (capped at 90 s), gpu_uma_import_check_at_init fails at tests.rs:3196. Adapter "AMD Compatibility Mode", waves 32–32, no write watch, no OpenExistingHeapFromAddress.

What that changes. The assumption that a Mac host cannot draw the title because it lacks mesh shaders is wrong for this hardware. What stops this bench is XCL refusing to translate the title's console mesh pipelines in its own PSO handling — a console MS container in the AS slot is refused rather than translated — which is exactly what #541 ("a console MS in the AS slot is translated as the mesh shader it is") is for. I have not read that diff yet. @⁠ryosen0 say the word and I will run #541's head here against the mesh tests and the title and post the counts: this is the one thing I can test that a Windows machine cannot tell you, because the refusal is host-adjacent and the host here does have mesh shaders.

Also filed, as a draft so CI can prove it: #783, CI: cross-build the Wine target (x86_64-pc-windows-gnullvm) on a macOS runner. Nothing under crates/ or scripts/, builds only, never runs a test. The commands were run here first (workspace 14 s, 16 test executables, one warning that the Windows build already has). The reason for the pinned LLVM-MinGW: rustc's gnullvm target links with -nolibc --unwindlib=libunwind, which Homebrew's mingw-w64 GCC rejects — that costs every Mac contributor a first evening, and the workflow says the answer. If macOS cross-builds are not something you want CI to spend minutes on, say so and I will keep it as a fork-only check instead.

**@⁠mikebuckets171** on GitHub · 2026-11-24 05:13 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7122748832) Mesh result from this bench, as promised — and it is the other answer. **D3DMetal 3.0 on this M5 Pro runs D3D12 mesh shaders.** Run through the CrossOver bottle with the gnullvm build of XCL, each test in its own process: - `gpu::recomp::tests::gpu_mesh_mode_two_passes` — **ok, 0.67 s**. That test compiles a `ms_6_6` pass-through mesh shader with DXC, draws it through `runner::mesh_draw` with a compute program producing the records, and asserts the pixel values at two drawn triangles and the untouched pixel outside them. Nothing skipped. - `gpu::recomp::tests::gpu_mesh_mode_reads_memory_windows` — **ok, 0.38 s**. - `gpu::recomp::mesh_dispatch::tests::gpu_dispatch_matches_native_wave64_reference` — **ok, 0.24 s**. - No `GPU without mesh shaders – skipping` and no `SKIPPED` line anywhere in these runs: `mesh_ready()` reports the adapter as capable. - Still failing here, unchanged from the other Mac reports in this thread: `gpu_wave64_ps_whole_wave_reductions` never finished (capped at 90 s), `gpu_uma_import_check_at_init` fails at `tests.rs:3196`. Adapter "AMD Compatibility Mode", waves 32–32, no write watch, no `OpenExistingHeapFromAddress`. **What that changes.** The assumption that a Mac host cannot draw the title because it lacks mesh shaders is wrong for this hardware. What stops this bench is XCL refusing to translate the title's console mesh pipelines in its own PSO handling — a console MS container in the AS slot is refused rather than translated — which is exactly what **#541** ("a console MS in the AS slot is translated as the mesh shader it is") is for. I have not read that diff yet. **@⁠ryosen0** say the word and I will run #541's head here against the mesh tests and the title and post the counts: this is the one thing I can test that a Windows machine cannot tell you, because the refusal is host-adjacent and the host here does have mesh shaders. Also filed, as a draft so CI can prove it: **#783**, `CI: cross-build the Wine target (x86_64-pc-windows-gnullvm) on a macOS runner`. Nothing under `crates/` or `scripts/`, builds only, never runs a test. The commands were run here first (workspace 14 s, 16 test executables, one warning that the Windows build already has). The reason for the pinned LLVM-MinGW: rustc's gnullvm target links with `-nolibc --unwindlib=libunwind`, which Homebrew's mingw-w64 GCC rejects — that costs every Mac contributor a first evening, and the workflow says the answer. If macOS cross-builds are not something you want CI to spend minutes on, say so and I will keep it as a fork-only check instead.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 06:22 UTC · original

Two things for this thread: a correction of my own post above, and the state of this bench's own patches.

Correction: on this host the console-MS refusals are something the Mac port hits while running, not what stops the title. At 05:13 I wrote that "what stops this bench is XCL refusing the title's console mesh pipelines". Measured since, same bottle, same sandbox, same DXC 1.9.2609, same private-drive package (its name stays out of here):

  • main cross-built for the Wine target (x86_64-pc-windows-gnullvm, LLVM-MinGW 20261117): the title loads, gets its GDK thunks, opens the package's containers — and then nothing at all: 0 presents, 0 submits, 0 draws, 0 dispatches across the whole 60 s, exit 0x0. No PSO work, so no refusals either. main has no Mac host path, which is why a main-based Mac smoke pair for this title is 0 frames against 0 frames and can only show "no new device removals, crashes or commit growth".
  • @⁠Ahmet-Dedeler's Mac port (db065d8) on the same host: 1392 frames in 90 s on a cold data root, 1487 warm (28.2 fps over the last 300 frames), and it logs exactly 40 mesh pipeline with its MS … in the AS slot – refused lines.
  • That port with #541 on top: the 40 refusals become 0; warm 1469 frames, 29.6 fps over the last 300; the cold first run costs frames (393 in 90 s, one stall-watchdog firing) because the pipelines the baseline refused now have to be compiled; a 300 s run gave 7312 frames, exit 0x0, 0 refusals, 0 watchdog, 0 device removals, 0 crashes and presents resumed normally on a relaunch into the same data root. Counts are on #541 (issuecomment-7123229888).

So the mesh question here has a clean answer for this hardware: D3DMetal 3.0 on an M5 Pro translates and runs ms_6_6, and the gap in the Mac port is XCL's own PSO handling, which #541 fixes.

This bench's own patch: filed as a draft, with its gate gap named.

  • #826 D3D12.X: charge the compute-blob budget once per cache entry — +35/−3, real.rs, head 5aa4c42. Tested here: compute_blob_tests → 2 passed, 0 failed under Wine; a 60 s xcl-smoke pair (main at e50836b and the head, each on a fresh data root) — 0 frames on both sides, for the reason above, said so in the description. scripts/pr_check.py --local on the description: "description ok".

@⁠Kalmarv — of the two fixes you offered to run on the 5070 Ti (04:34), only one is left to run: branch mikebuckets171/xcl:pr/blob-cache-accounting, head 5aa4c42, base main. The second one I had — the window title's "pipelines queued" figure, which counts the lazy stand-ins whose build never starts — turned out to be the same fix as #214, done there more thoroughly and with a test, so I withdrew mine rather than file a duplicate; what I contributed instead is a macOS/Wine run of that head, posted on #214. Sorry for the wasted offer: nothing to run there.

And one more thing this bench can do, said plainly so no one duplicates it: a PR that touches the Mac/Wine path can get, within a few minutes, a cross-build for x86_64-pc-windows-gnullvm, a per-binary unit-test run under Wine and a 60–90 s title pair on a host where the title actually draws frames. That is the part of the matrix no Windows machine in this thread can produce.

**@⁠mikebuckets171** on GitHub · 2026-11-24 06:22 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7123872551) Two things for this thread: a correction of my own post above, and the state of this bench's own patches. **Correction: on this host the console-MS refusals are something the Mac port hits *while running*, not what stops the title.** At 05:13 I wrote that "what stops this bench is XCL refusing the title's console mesh pipelines". Measured since, same bottle, same sandbox, same DXC 1.9.2609, same private-drive package (its name stays out of here): - `main` cross-built for the Wine target (`x86_64-pc-windows-gnullvm`, LLVM-MinGW 20261117): the title loads, gets its GDK thunks, opens the package's containers — and then nothing at all: **0 presents, 0 submits, 0 draws, 0 dispatches** across the whole 60 s, exit 0x0. No PSO work, so no refusals either. `main` has no Mac host path, which is why a `main`-based Mac smoke pair for this title is 0 frames against 0 frames and can only show "no new device removals, crashes or commit growth". - @⁠Ahmet-Dedeler's Mac port (`db065d8`) on the same host: **1392 frames in 90 s on a cold data root, 1487 warm (28.2 fps over the last 300 frames)**, and it logs exactly **40** `mesh pipeline with its MS … in the AS slot – refused` lines. - That port with **#541** on top: the 40 refusals become **0**; warm 1469 frames, 29.6 fps over the last 300; the cold first run costs frames (393 in 90 s, one stall-watchdog firing) because the pipelines the baseline refused now have to be compiled; a 300 s run gave **7312 frames, exit 0x0, 0 refusals, 0 watchdog, 0 device removals, 0 crashes** and presents resumed normally on a relaunch into the same data root. Counts are on **#541** (issuecomment-7123229888). So the mesh question here has a clean answer for this hardware: D3DMetal 3.0 on an M5 Pro translates and runs `ms_6_6`, and the gap in the Mac port is XCL's own PSO handling, which #541 fixes. **This bench's own patch: filed as a draft, with its gate gap named.** - **#826** `D3D12.X: charge the compute-blob budget once per cache entry` — +35/−3, `real.rs`, head `5aa4c42`. Tested here: `compute_blob_tests` → 2 passed, 0 failed under Wine; a 60 s `xcl-smoke` pair (`main` at `e50836b` and the head, each on a fresh data root) — 0 frames on both sides, for the reason above, said so in the description. `scripts/pr_check.py --local` on the description: "description ok". @⁠Kalmarv — of the two fixes you offered to run on the 5070 Ti (04:34), **only one is left to run**: branch `mikebuckets171/xcl:pr/blob-cache-accounting`, head `5aa4c42`, base `main`. The second one I had — the window title's "pipelines queued" figure, which counts the lazy stand-ins whose build never starts — turned out to be the same fix as **#214**, done there more thoroughly and with a test, so I withdrew mine rather than file a duplicate; what I contributed instead is a macOS/Wine run of that head, posted on #214. Sorry for the wasted offer: nothing to run there. And one more thing this bench can do, said plainly so no one duplicates it: a PR that touches the Mac/Wine path can get, within a few minutes, a cross-build for `x86_64-pc-windows-gnullvm`, a per-binary unit-test run under Wine and a 60–90 s title pair on a host where the title actually draws frames. That is the part of the matrix no Windows machine in this thread can produce.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 06:41 UTC · original

A measurement caveat, and the pair that shows it. Worth fixing before more Mac numbers are posted here, because it changes what a frame count means.

frames shown counts presents, and a title here re-presents the same picture for a long time. I ran the Mac port (db065d8) and the same port with all of #541 for 120 s each — same bottle, same sandbox, same DXC, each warm on its own data root — with XCL_FRAME_DUMP saving every 30th presented frame, and measured the dumps here: mean luminance, brightness bands, and how much the picture changed from one dump to the next (~1 s apart). Only statistics leave this machine.

120 s, warm root port db065d8 port + #541 ee3c780
frames presented 2255 2576
console-MS refusals 40 0
translated draws / dispatches reached 32,768 / 1,621 41,914 / 2,048
2 s windows with 0 presents 18 of 59 13 of 59
dumps compared, ~1 s apart 64 pairs 75 pairs
pairs where the picture changed >1 % 1 1
distinct pictures seen 2: a black frame, then mean luminance 41.9 / 17 brightness bands the same two
watchdog / crash / device removal 0 / 0 / 0 0 / 0 / 0

So, on this host:

  • The title reaches one still picture after ~15–20 s and presents it unchanged for the rest of a 120 s run: 63 of 64 dump pairs on the baseline and 74 of 75 with #541 were pixel-identical. #541's picture is the same picture (same mean luminance, same band count) — the change it makes is in refusals, presents and render work, not in what appears on screen. That is a useful no-visible-regression signal, and it is something no Windows machine in this thread can produce.
  • A frame count is therefore a liveness signal (present loop alive, no removals, no crash), not a content signal. Reporting "N frames" on its own overstates what a Mac run demonstrated.
  • XCL already prints what is needed: XCL_FRAME_DUMP plus the present: frame N raw texels (most common) lines it logs per dump. A Mac run can cheaply add "the picture did/did not change after your change" next to the frames line.
  • It is not permanently frozen: a 180 s run of the port + #541 (4184 frames, 0 refusals, 0 watchdog, 0 crashes, 0 removals, 65,536 translated draws, 3,487 dispatches) shows a content-changing stretch at frames ~2720–3050 — 46–100 % of sampled pixels per second, brightness swinging 33 → 134 — settling on a different still picture (mean 79.0). ~128–140 s in. Whether that is the title's own sequence or something else, I have not established.
  • Input reaches the title and shows nothing: in that run XCL_REMOTE_INPUT was logged 176 times — DOWN (0x80) ×59, RIGHT (0x200) ×59, A (0x4) ×58, held as ~15 s phases — and inside each phase the presented picture stayed identical. So no gameplay claim: movement and camera are still unverified here, and the port has no analog-stick route.

What I ask of the Mac reports here (mine included): the xcl-smoke block for the gate, plus one line of what the pictures did. @⁠Ahmet-Dedeler if you want the numbers for your port I can run any head this way in a few minutes and post the statistics.

**@⁠mikebuckets171** on GitHub · 2026-11-24 06:41 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7124194758) A measurement caveat, and the pair that shows it. Worth fixing before more Mac numbers are posted here, because it changes what a frame count means. **`frames shown` counts presents, and a title here re-presents the same picture for a long time.** I ran the Mac port (`db065d8`) and the same port with all of #541 for 120 s each — same bottle, same sandbox, same DXC, each warm on its own data root — with `XCL_FRAME_DUMP` saving every 30th presented frame, and measured the dumps here: mean luminance, brightness bands, and how much the picture changed from one dump to the next (~1 s apart). Only statistics leave this machine. | 120 s, warm root | port `db065d8` | port + #541 `ee3c780` | |---|---|---| | frames presented | 2255 | **2576** | | console-MS refusals | 40 | **0** | | translated draws / dispatches reached | 32,768 / 1,621 | **41,914 / 2,048** | | 2 s windows with 0 presents | 18 of 59 | **13 of 59** | | dumps compared, ~1 s apart | 64 pairs | 75 pairs | | pairs where the picture changed >1 % | **1** | **1** | | distinct pictures seen | 2: a black frame, then mean luminance 41.9 / 17 brightness bands | **the same two** | | watchdog / crash / device removal | 0 / 0 / 0 | 0 / 0 / 0 | So, on this host: - The title reaches one still picture after ~15–20 s and presents it **unchanged** for the rest of a 120 s run: 63 of 64 dump pairs on the baseline and 74 of 75 with #541 were pixel-identical. #541's picture is the same picture (same mean luminance, same band count) — the change it makes is in refusals, presents and render work, not in what appears on screen. That is a useful no-visible-regression signal, and it is something no Windows machine in this thread can produce. - A frame count is therefore a **liveness** signal (present loop alive, no removals, no crash), not a **content** signal. Reporting "N frames" on its own overstates what a Mac run demonstrated. - XCL already prints what is needed: `XCL_FRAME_DUMP` plus the `present: frame N raw texels (most common)` lines it logs per dump. A Mac run can cheaply add "the picture did/did not change after your change" next to the frames line. - It is not permanently frozen: a 180 s run of the port + #541 (4184 frames, 0 refusals, 0 watchdog, 0 crashes, 0 removals, 65,536 translated draws, 3,487 dispatches) shows a content-changing stretch at frames ~2720–3050 — 46–100 % of sampled pixels per second, brightness swinging 33 → 134 — settling on a different still picture (mean 79.0). ~128–140 s in. Whether that is the title's own sequence or something else, I have not established. - Input reaches the title and shows nothing: in that run `XCL_REMOTE_INPUT` was logged 176 times — **DOWN (`0x80`) ×59, RIGHT (`0x200`) ×59, A (`0x4`) ×58**, held as ~15 s phases — and inside each phase the presented picture stayed identical. So no gameplay claim: movement and camera are still unverified here, and the port has no analog-stick route. What I ask of the Mac reports here (mine included): the `xcl-smoke` block for the gate, plus one line of what the pictures did. @⁠Ahmet-Dedeler if you want the numbers for your port I can run any head this way in a few minutes and post the statistics.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 07:56 UTC · original

Input update from this bench, because it changes which part of the Mac problem is still open.

The bench can now drive thumbsticks from a script, and the title here does not visibly respond. I had been measuring presents and refusals; to test the acceptance gates (movement and stopping, independent camera) I needed sticks, and none of the existing knobs gives them: XCL_PRESS_AT / the port's XCL_REMOTE_INPUT are buttons only, and kbm's WASD→left-stick and mouse→right-stick mapping needs the XCL window to have the focus, which a Wine run in the background does not have. So I wrote that missing piece — XCL_STICK_AT=s:x/y,… / XCL_LOOK_AT=s:x/y,…, a deflection held from a second until the next entry — and it is filed as draft #893 with its unit tests (+111, gameinput.rs).

Measured on the Mac port (db065d8) with all of #541 plus that patch, 150 s cold, same build, two fresh data roots, XCL_FRAME_DUMP every 30th presented frame:

sticks scripted nothing scripted (control)
frames presented 2380 2345
translated draws reached 41,258 41,864
refusals / watchdog / crashes / removals 0 / 0 / 0 / 0 0 / 0 / 0 / 0
scripted entries the state carried 6 (left 0.00,0.90 from 60 s, 0.00,0.00 from 95 s, 0.00,-0.90 from 105 s, 0.00,0.00 from 125 s, right 0.70,0.00 from 130 s, released at 145 s) –
dumps compared (~1 s apart) 74: 1 changed (at t≈66 s, 97.6 % of pixels) 73: 1 changed (at t≈63 s)
picture after that mean luminance 42, unchanged to the end same

So the deflection reaches the gamepad state the title polls (one log line per entry, applied after kbm so nothing else fights it) and the run stays clean — but the presented picture is identical with and without it, exactly like the control. Same story as the earlier button run: DOWN 0x80 ×59, RIGHT 0x200 ×59, A 0x4 ×58 all logged, no measurable change; and a 300 s run with no input at all changes pictures on its own (frames ~2900–3740, 46–100 % of pixels, settling on a second still image), which is why I now treat every picture change I see as the title's own sequence unless a control run says otherwise.

What I take from it. On this host the open part of the Mac problem is not input delivery and not mesh support: the port presents continuously (~24 fps, 41k–262k translated draws, 0 console-MS refusals with #541, exit 0x0) but sits on a still picture, and nothing I can feed it moves it. So "reaches its first-run screens and loads" is as far as this bench can currently claim, and the gates (movement, camera, control after relaunch) stay unmet here. If anyone has a title state that does move on a Mac host — @⁠Ahmet-Dedeler's port at a panning menu, or a smaller title than this one — the stick knob is ready and I can run a pair (sticks vs control, with the picture statistics) within a few minutes of it being named. @⁠pablogonz12 @⁠simnJS: the same offer for #609 and #606 — I am cross-building both heads and running their tests under Wine now, and will post the counts.

One host note, since a crash looks like a regression and this one is not: one run in a deep, warm data root (the same root used by several earlier runs) ended at t≈28 s with an access violation reading a null-derived address inside XCL's own code. Two 150 s cold runs of the same build — one with sticks scripted, one control — ran to their 150 s limit with 0 exceptions, as did the 300 s runs before it. Not reproduced, not attributable to the patch, and it is the first time I have seen it on this root; if others see it, a fresh data root is the first variable to change.

**@⁠mikebuckets171** on GitHub · 2026-11-24 07:56 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7125534211) Input update from this bench, because it changes which part of the Mac problem is still open. **The bench can now drive thumbsticks from a script, and the title here does not visibly respond.** I had been measuring presents and refusals; to test the acceptance gates (movement and stopping, independent camera) I needed sticks, and none of the existing knobs gives them: `XCL_PRESS_AT` / the port's `XCL_REMOTE_INPUT` are buttons only, and `kbm`'s WASD→left-stick and mouse→right-stick mapping needs the XCL window to have the focus, which a Wine run in the background does not have. So I wrote that missing piece — `XCL_STICK_AT=s:x/y,…` / `XCL_LOOK_AT=s:x/y,…`, a deflection held from a second until the next entry — and it is filed as draft **#893** with its unit tests (+111, `gameinput.rs`). Measured on the Mac port (`db065d8`) with all of #541 plus that patch, 150 s cold, same build, two fresh data roots, `XCL_FRAME_DUMP` every 30th presented frame: | | sticks scripted | nothing scripted (control) | |---|---|---| | frames presented | 2380 | 2345 | | translated draws reached | 41,258 | 41,864 | | refusals / watchdog / crashes / removals | 0 / 0 / 0 / 0 | 0 / 0 / 0 / 0 | | scripted entries the state carried | 6 (`left 0.00,0.90` from 60 s, `0.00,0.00` from 95 s, `0.00,-0.90` from 105 s, `0.00,0.00` from 125 s, `right 0.70,0.00` from 130 s, released at 145 s) | – | | dumps compared (~1 s apart) | 74: **1 changed** (at t≈66 s, 97.6 % of pixels) | 73: **1 changed** (at t≈63 s) | | picture after that | mean luminance 42, unchanged to the end | same | So the deflection reaches the gamepad state the title polls (one log line per entry, applied after `kbm` so nothing else fights it) and the run stays clean — but the presented picture is identical with and without it, exactly like the control. Same story as the earlier button run: `DOWN 0x80` ×59, `RIGHT 0x200` ×59, `A 0x4` ×58 all logged, no measurable change; and a 300 s run *with no input at all* changes pictures on its own (frames ~2900–3740, 46–100 % of pixels, settling on a second still image), which is why I now treat every picture change I see as the title's own sequence unless a control run says otherwise. **What I take from it.** On this host the open part of the Mac problem is not input delivery and not mesh support: the port presents continuously (~24 fps, 41k–262k translated draws, 0 console-MS refusals with #541, exit 0x0) but sits on a still picture, and nothing I can feed it moves it. So "reaches its first-run screens and loads" is as far as this bench can currently claim, and the gates (movement, camera, control after relaunch) stay unmet here. If anyone has a title state that *does* move on a Mac host — @⁠Ahmet-Dedeler's port at a panning menu, or a smaller title than this one — the stick knob is ready and I can run a pair (sticks vs control, with the picture statistics) within a few minutes of it being named. @⁠pablogonz12 @⁠simnJS: the same offer for #609 and #606 — I am cross-building both heads and running their tests under Wine now, and will post the counts. One host note, since a crash looks like a regression and this one is not: one run in a **deep, warm** data root (the same root used by several earlier runs) ended at t≈28 s with an access violation reading a null-derived address inside XCL's own code. Two 150 s cold runs of the *same* build — one with sticks scripted, one control — ran to their 150 s limit with 0 exceptions, as did the 300 s runs before it. Not reproduced, not attributable to the patch, and it is the first time I have seen it on this root; if others see it, a fresh data root is the first variable to change.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 09:11 UTC · original

A 300 s pair, and a census of this bench's own runs: on this Mac host the title's own null write that #616 and #505 describe happens only in the runs that get deep, and it follows presenting already having stopped.

1. The same failure site, on CrossOver / D3DMetal. Each run here writes XCL's own report.json; across the 19 title runs whose reports this bench still holds:

how the run ended runs unique shader containers submitted
exit 0x0, no exception 14 4,754 – 8,742
0xc0000005 write at address 0x0 in the title's own module, offset +0x23cf683 3 19,209 – 19,239
access violation in XCL's own code (xcl.exe+0x1840ee read at 0x8; xcl.exe+0x18f64e read at 0xa000000000000008) 2 4,754

The three title-site runs are the only three that ever got past ~19,000 unique containers (≈25,500 submissions in the AS slot, ≈274,800 submissions in total, 300 s or longer). Same module offset #616 and #505 name; #505 reads that site as the title's own GPU-progress watchdog. In the window before it, XCL's report records failed_pipelines 0, 0 device removals, and no stall-watchdog line: nothing in XCL's own diagnostics marks a stall.

2. What precedes the write, in the 300 s control run. Presents hold at 60 per 2 s until t≈185 s, fall to 2–25 per 2 s from t≈189 s, are 0 from t≈250 s to the end (21 consecutive 0-presents windows), and the null write is raised at t = 292.5 s — 44 s after the last present. So the sequence #616 reports on Windows (presenting stops updating, then the null write) reproduces here on D3DMetal, with a ~45 s gap between the two.

3. The pair: same build, two fresh data roots, opposite behaviour. Mac port db065d8 + the seven commits of #541 (301adae…6bd8f64) + the #893 stick patch; XCL_STICK_AT / XCL_LOOK_AT set on one side, unset on the other; XCL_RUN_SECONDS=300, XCL_FRAME_DUMP=30, XCL_FRAME_DUMP_FROM=120, network off, a fresh data root per side, same bottle and DXC.

sticks scripted nothing scripted
frames shown 7614 3886
translated draws reached 131,072 35,589
2 s activity windows with 0 presents 16 of 149, all before t = 52 s 37 of 140; nothing presented after t = 248 s
frame dumps, grouped into runs of byte-identical pictures 249 dumps, 2 runs: 9 dumps t 18.5–53.4 s, then 240 consecutive identical presents from frame 440 (t = 55.8 s) to t = 299.9 s (mean luminance 41.9, 17 brightness bands) 124 dumps, 83 runs: 13 dumps of one picture, 24 of a second, then 81 further runs covering 87 dumps, mostly single dumps, t ≈ 88–240 s
stick entries the polled state carried 8 (left 0.00,0.90 from 100 s, released 140 s; right 0.80,0.00 from 150 s, released 175 s; left 0.00,0.90 from 185 s, released 215 s; right -0.80,0.00 from 225 s, released 250 s) –
console-MS refusals / XCL stall watchdogs / device removals / exceptions 0 / 0 / 0 / 0 0 / 0 / 0 / 1

4. What I read from it.

  • The first-run flow here is neither input-driven nor deterministic. Identical build, identical switches, two fresh roots: one run presents the same picture 240 times over its last 244 s; the other passes through roughly 80 distinct pictures on its own and never returns to them. The only picture change in the static run happens at t≈56 s, before the first scripted hold, so neither outcome can be attributed to the input.
  • frames shown is a liveness measure, not a content measure. 7614 frames here are two distinct pictures. A Mac number in this thread is worth pairing with a picture statistic (XCL_FRAME_DUMP plus comparing consecutive dumps) — without it, the frame counts above would read as progress.
  • Whether the collapse has anything to do with input: one pair, so no claim either way.

Not established: why presenting stops; whether the large host-side video-local allocation cycles that both runs show (3,484 → 156 MB by t≈24 s in the clean run, 4,028 → 444 MB by t≈32 s and again 4,028 → 188 MB by t≈93 s in the control, climbing back to 3,548 MB by the end) are cause or effect; and whether XCL's two own-code violations are the same fault — they were seen in two runs and have not reappeared in later ones.

The gates in this thread's checklist (movement and stopping, independent camera, control after relaunch) stay unmet on this host: in three regimes — scripted buttons, scripted thumbsticks, no input at all — no presented picture responded.

Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal, upstream DXC runtime, cross target x86_64-pc-windows-gnullvm. AI use: GPT-6 Luna, for the runs, the log statistics and this comment; the numbers come from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 09:11 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7127079251) A 300 s pair, and a census of this bench's own runs: on this Mac host the title's own null write that #616 and #505 describe happens **only in the runs that get deep**, and it follows presenting already having stopped. **1. The same failure site, on CrossOver / D3DMetal.** Each run here writes XCL's own `report.json`; across the 19 title runs whose reports this bench still holds: | how the run ended | runs | unique shader containers submitted | |---|---|---| | exit 0x0, no exception | 14 | 4,754 – 8,742 | | `0xc0000005` **write at address `0x0`** in the title's own module, offset `+0x23cf683` | **3** | 19,209 – 19,239 | | access violation in XCL's own code (`xcl.exe+0x1840ee` read at `0x8`; `xcl.exe+0x18f64e` read at `0xa000000000000008`) | 2 | 4,754 | The three title-site runs are the only three that ever got past ~19,000 unique containers (≈25,500 submissions in the AS slot, ≈274,800 submissions in total, 300 s or longer). Same module offset #616 and #505 name; #505 reads that site as the title's own GPU-progress watchdog. In the window before it, XCL's report records `failed_pipelines 0`, 0 device removals, and no stall-watchdog line: nothing in XCL's own diagnostics marks a stall. **2. What precedes the write, in the 300 s control run.** Presents hold at 60 per 2 s until t≈185 s, fall to 2–25 per 2 s from t≈189 s, are 0 from t≈250 s to the end (21 consecutive 0-presents windows), and the null write is raised at **t = 292.5 s — 44 s after the last present**. So the sequence #616 reports on Windows (presenting stops updating, then the null write) reproduces here on D3DMetal, with a ~45 s gap between the two. **3. The pair: same build, two fresh data roots, opposite behaviour.** Mac port `db065d8` + the seven commits of #541 (`301adae…6bd8f64`) + the #893 stick patch; `XCL_STICK_AT` / `XCL_LOOK_AT` set on one side, unset on the other; `XCL_RUN_SECONDS=300`, `XCL_FRAME_DUMP=30`, `XCL_FRAME_DUMP_FROM=120`, network off, a fresh data root per side, same bottle and DXC. | | sticks scripted | nothing scripted | |---|---|---| | frames shown | 7614 | 3886 | | translated draws reached | 131,072 | 35,589 | | 2 s activity windows with 0 presents | 16 of 149, all before t = 52 s | 37 of 140; nothing presented after t = 248 s | | frame dumps, grouped into runs of byte-identical pictures | 249 dumps, **2 runs**: 9 dumps t 18.5–53.4 s, then **240 consecutive identical presents from frame 440 (t = 55.8 s) to t = 299.9 s** (mean luminance 41.9, 17 brightness bands) | 124 dumps, **83 runs**: 13 dumps of one picture, 24 of a second, then 81 further runs covering 87 dumps, mostly single dumps, t ≈ 88–240 s | | stick entries the polled state carried | 8 (left `0.00,0.90` from 100 s, released 140 s; right `0.80,0.00` from 150 s, released 175 s; left `0.00,0.90` from 185 s, released 215 s; right `-0.80,0.00` from 225 s, released 250 s) | – | | console-MS refusals / XCL stall watchdogs / device removals / exceptions | 0 / 0 / 0 / 0 | 0 / 0 / 0 / 1 | **4. What I read from it.** - **The first-run flow here is neither input-driven nor deterministic.** Identical build, identical switches, two fresh roots: one run presents the *same picture* 240 times over its last 244 s; the other passes through roughly 80 distinct pictures on its own and never returns to them. The only picture change in the static run happens at t≈56 s, before the first scripted hold, so neither outcome can be attributed to the input. - **`frames shown` is a liveness measure, not a content measure.** 7614 frames here are two distinct pictures. A Mac number in this thread is worth pairing with a picture statistic (`XCL_FRAME_DUMP` plus comparing consecutive dumps) — without it, the frame counts above would read as progress. - Whether the collapse has anything to do with input: one pair, so no claim either way. Not established: why presenting stops; whether the large host-side video-local allocation cycles that both runs show (3,484 → 156 MB by t≈24 s in the clean run, 4,028 → 444 MB by t≈32 s and again 4,028 → 188 MB by t≈93 s in the control, climbing back to 3,548 MB by the end) are cause or effect; and whether XCL's two own-code violations are the same fault — they were seen in two runs and have not reappeared in later ones. The gates in this thread's checklist (movement and stopping, independent camera, control after relaunch) stay unmet on this host: in three regimes — scripted buttons, scripted thumbsticks, no input at all — no presented picture responded. Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal, upstream DXC runtime, cross target `x86_64-pc-windows-gnullvm`. **AI use**: GPT-6 Luna, for the runs, the log statistics and this comment; the numbers come from those runs.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 09:43 UTC · original · edited 2026-11-24 10:00 UTC

I'm looking at two Mac failures nobody has picked up yet, so I'm saying it here to avoid duplicates:

  • 64-bit integer atomics on D3DMetal (gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2, probably gpu_more_atomics_sub_dword_scratch_valu). I'm finding which operations break with probe kernels. The fix would be either a recompiler workaround gated on the host or, if that's too big, a test skip driven by a probe.
  • D3DMetal ignoring SetPredication (@⁠us3r40456's finding above). The plan is XCL-side predication for hosts where SetPredication does nothing, gated so Windows doesn't change, or a skip in predication_e2e.rs if that's too big.

I'll post the details here before opening anything. If you're already on either one, say so and I'll test yours instead.

Update: the atomics part is #983 (details in my comment below). On predication: on D3DMetal 3.0, with a plain device, predicated draws, dispatches and ExecuteIndirect are skipped correctly, but predicated CopyBufferRegion, CopyResource, CopyTextureRegion, ClearUnorderedAccessViewUint and ClearRenderTargetView still run. Nothing reports it (no Wine message, no error), so only a probe shows it. On main predication_e2e still skips with "no GPU UMA", because c70bf8a is only on mac-on-main-wip, so I won't open a PR against main. @⁠Ahmet-Dedeler I have a test-only skip for predication_e2e (a one-copy probe, "host ignores SetPredication for copies") if you want it on your branch. XCL-side predicated copies would be a larger change that I'm not taking on now.

AI use: Claude Code, Claude Opus 5.5 drafted this note, ran the probes and wrote the update.

**@⁠vakaobr** on GitHub · 2026-11-24 09:43 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7127805399) · edited 2026-11-24 10:00 UTC I'm looking at two Mac failures nobody has picked up yet, so I'm saying it here to avoid duplicates: - **64-bit integer atomics on D3DMetal** (`gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2`, probably `gpu_more_atomics_sub_dword_scratch_valu`). I'm finding which operations break with probe kernels. The fix would be either a recompiler workaround gated on the host or, if that's too big, a test skip driven by a probe. - **D3DMetal ignoring `SetPredication`** (@⁠us3r40456's finding above). The plan is XCL-side predication for hosts where `SetPredication` does nothing, gated so Windows doesn't change, or a skip in `predication_e2e.rs` if that's too big. I'll post the details here before opening anything. If you're already on either one, say so and I'll test yours instead. **Update:** the atomics part is #983 (details in my comment below). On predication: on D3DMetal 3.0, with a plain device, predicated draws, dispatches and ExecuteIndirect are skipped correctly, but predicated `CopyBufferRegion`, `CopyResource`, `CopyTextureRegion`, `ClearUnorderedAccessViewUint` and `ClearRenderTargetView` still run. Nothing reports it (no Wine message, no error), so only a probe shows it. On `main` `predication_e2e` still skips with "no GPU UMA", because c70bf8a is only on `mac-on-main-wip`, so I won't open a PR against `main`. @⁠Ahmet-Dedeler I have a test-only skip for `predication_e2e` (a one-copy probe, "host ignores SetPredication for copies") if you want it on your branch. XCL-side predicated copies would be a larger change that I'm not taking on now. AI use: Claude Code, Claude Opus 5.5 drafted this note, ran the probes and wrote the update.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 10:06 UTC · original

GPU timestamps and CPU-visible buffers on D3DMetal, measured with no XCL in the picture. A plain D3D12 program - device, queue, fence, one TIMESTAMP query heap, 64-byte buffers, nothing else - run six times on this M5 Pro host, one mode per process. It adds the why behind the 60 Hz / zero readings @⁠us3r40456 and @⁠Lucasyudi posted, on a second Apple silicon machine, and one correction about a test.

1. What the queue reports.

  • GetTimestampFrequency: S_OK, value 60.
  • GetClockCalibration: S_OK, and its GPU value is the CPU value - identical, or 41–42 ticks apart - and both advance with wall time (across single runs: 218,208 / 1,525,916 / 18,338,167 ticks, i.e. ~1 GHz ticks). So the "GPU" clock on this host is the host QPC, against a queue that claims 60 Hz.

2. A resolved TIMESTAMP query writes 0 in every arrangement this host accepts. Two stamps, EndQuery only - the shape XCL's timed compute runner records - around a ClearRenderTargetView on an 8×8 RGBA8 render target. Fences signal, so the GPU work completes; the stamps land as 0.

resolve destination created ResolveQueryData Map stamps read
DEFAULT + RESOLVE_DEST, then CopyBufferRegion → UPLOAD + GENERIC_READ S_OK accepted DEFAULT: Map → 0x80070057; UPLOAD: S_OK 0 and 0
UPLOAD + GENERIC_READ, resolved into directly S_OK accepted S_OK 0 and 0
BeginQuery + EndQuery pair, resolved into DEFAULT S_OK accepted the DEFAULT buffer is not mappable unreadable

3. The buffer-heap matrix - why the usual readback shape cannot be built here. A 64-byte buffer, CreateCommittedResource:

heap initial state create Map
DEFAULT GENERIC_READ S_OK 0x80070057
DEFAULT RESOLVE_DEST S_OK 0x80070057
UPLOAD GENERIC_READ S_OK S_OK, and Map(0..64) S_OK
UPLOAD COPY_DEST 0x80070057 –
READBACK GENERIC_READ 0x80070057 –
READBACK RESOLVE_DEST 0x80070057 –
  • This host has no readback heap at all, and UPLOAD is only creatable in GENERIC_READ. So "ResolveQueryData into a CPU-visible buffer in RESOLVE_DEST / COPY_DEST" is not a thing you can construct here: the only mappable buffer is an UPLOAD buffer in GENERIC_READ.
  • That is the shape XCL's timed path asks for: crates/xcl/src/gpu/recomp/runner.rs:1445 builds its stamp buffer with buffer(dev, …, D3D12_HEAP_TYPE_READBACK, COPY_DEST), and runner.rs:314 hands the heap type straight to CreateCommittedResource (no Mac translation in buffer()). Measured in the plain program, not by running XCL's runner - but that call is the one this host answers with E_INVALIDARG, so the timed path cannot run here as written.
  • For @⁠Lucasyudi's plan: no arrangement of resolve + map produced a non-zero value, so the fallback has to supply the clock itself rather than reach the same query heap by a better route. The one plumbing that works end to end on this host - resolve into UPLOAD + GENERIC_READ, Map with no range - still reads 0.

Not established: whether D3DMetal ignores TIMESTAMP query heaps entirely or resolves them at creation; whether PIPELINE_STATISTICS / BINARY queries behave the same (not tested here); and whether the 0 comes from Metal's side or from the Wine d3d12.dll shim in front of it. The probe is ~200 lines of plain D3D12 with no XCL in it - say the word and I'll post it for anyone running other Macs.

4. xma2_source_voice_decodes_and_manages_lifetime: what actually fails. @⁠shortside reported it as "decodes 0 samples (expects 12291)". Run here on the same commit (mac-on-main-wip db065d8), cross x86_64-pc-windows-gnullvm (LLVM-MinGW 20261117), under Wine: the failing assertion is crates/xcl/src/hle/xaudio2.rs:1599, left: 0, right: 12291, and those numbers are not a sample count - they are assert_eq!(st.current_buffer_context as usize, CTX_VALID) with const CTX_VALID: usize = 0x3003 = 12291. Everything before it passes on this host: both submits return S_OK, stats().xma_buffers_decoded is +1 and xma_decode_errors is +1 (lines 1593–1594), buffers_queued == 2 (1598). The assert sits at 1599, before start(voice, 0, 0) at 1603 - so what reads 0 is which buffer GetState reports as current for a voice with two buffers submitted and not yet started, not the XMA2 decode. Same failure on @⁠shortside's MSVC-target build (clang-cl + xwin) and on this gnullvm build, so it is not a toolchain artifact.

5. set_predication_buffer_state_and_kickoff, one confirmation line. It fails identically here (predication_e2e.rs:360, EQUAL_ZERO(0) must skip dst[0], got1[0] = 0xAAAA0000 where init_vals[0] = 0x1111_1111, i.e. the predicated copy ran anyway) on the gnullvm build under Wine - matching @⁠us3r40456's SetPredication finding, and @⁠vakaobr has said that is his lane, so this is measurement only. Two host facts from the same run's XCL log, useful for anyone running the e2e suite under CrossOver: with XCL_D3D12_DEBUG=1 the host answers debug layer requested but unavailable: Call failed (0x80004005), so the InfoQueue side of those tests has nothing to collect; and the UMA import check reports OpenExistingHeapFromAddress is not implemented, with XCL falling back to a 512 MB video-memory window that it uploads to and reads back from by Map.

Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal, Wine for the gnullvm test binaries; the probe binary is a plain PE cross-built with LLVM-MinGW. AI use: GPT-6 Luna wrote the probe program, ran it and the two tests, and drafted this comment; the numbers come from those runs. Nothing about this bench's game package is in any of it - the probe reads no files.

**@⁠mikebuckets171** on GitHub · 2026-11-24 10:06 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7128321222) **GPU timestamps and CPU-visible buffers on D3DMetal, measured with no XCL in the picture.** A plain D3D12 program - device, queue, fence, one TIMESTAMP query heap, 64-byte buffers, nothing else - run six times on this M5 Pro host, one mode per process. It adds the *why* behind the 60 Hz / zero readings @⁠us3r40456 and @⁠Lucasyudi posted, on a second Apple silicon machine, and one correction about a test. **1. What the queue reports.** - `GetTimestampFrequency`: S_OK, value **60**. - `GetClockCalibration`: S_OK, and its GPU value is the CPU value - identical, or 41–42 ticks apart - and both advance with wall time (across single runs: 218,208 / 1,525,916 / 18,338,167 ticks, i.e. ~1 GHz ticks). So the "GPU" clock on this host is the host QPC, against a queue that claims 60 Hz. **2. A resolved TIMESTAMP query writes 0 in every arrangement this host accepts.** Two stamps, `EndQuery` only - the shape XCL's timed compute runner records - around a `ClearRenderTargetView` on an 8×8 RGBA8 render target. Fences signal, so the GPU work completes; the stamps land as 0. | resolve destination | created | `ResolveQueryData` | `Map` | stamps read | |---|---|---|---|---| | DEFAULT + `RESOLVE_DEST`, then `CopyBufferRegion` → UPLOAD + `GENERIC_READ` | S_OK | accepted | DEFAULT: **`Map` → 0x80070057**; UPLOAD: S_OK | **0 and 0** | | UPLOAD + `GENERIC_READ`, resolved into directly | S_OK | accepted | S_OK | **0 and 0** | | `BeginQuery` + `EndQuery` pair, resolved into DEFAULT | S_OK | accepted | the DEFAULT buffer is not mappable | unreadable | **3. The buffer-heap matrix - why the usual readback shape cannot be built here.** A 64-byte buffer, `CreateCommittedResource`: | heap | initial state | create | `Map` | |---|---|---|---| | DEFAULT | `GENERIC_READ` | S_OK | 0x80070057 | | DEFAULT | `RESOLVE_DEST` | S_OK | 0x80070057 | | UPLOAD | `GENERIC_READ` | S_OK | S_OK, and `Map(0..64)` S_OK | | UPLOAD | `COPY_DEST` | **0x80070057** | – | | READBACK | `GENERIC_READ` | **0x80070057** | – | | READBACK | `RESOLVE_DEST` | **0x80070057** | – | - **This host has no readback heap at all**, and UPLOAD is only creatable in `GENERIC_READ`. So "`ResolveQueryData` into a CPU-visible buffer in `RESOLVE_DEST` / `COPY_DEST`" is not a thing you can construct here: the only mappable buffer is an UPLOAD buffer in `GENERIC_READ`. - That is the shape XCL's timed path asks for: `crates/xcl/src/gpu/recomp/runner.rs:1445` builds its stamp buffer with `buffer(dev, …, D3D12_HEAP_TYPE_READBACK, COPY_DEST)`, and `runner.rs:314` hands the heap type straight to `CreateCommittedResource` (no Mac translation in `buffer()`). Measured in the plain program, not by running XCL's runner - but that call is the one this host answers with E_INVALIDARG, so the timed path cannot run here as written. - For @⁠Lucasyudi's plan: **no arrangement of resolve + map produced a non-zero value**, so the fallback has to supply the clock itself rather than reach the same query heap by a better route. The one plumbing that works end to end on this host - resolve into UPLOAD + `GENERIC_READ`, `Map` with no range - still reads 0. Not established: whether D3DMetal ignores TIMESTAMP query heaps entirely or resolves them at creation; whether `PIPELINE_STATISTICS` / `BINARY` queries behave the same (not tested here); and whether the 0 comes from Metal's side or from the Wine `d3d12.dll` shim in front of it. The probe is ~200 lines of plain D3D12 with no XCL in it - say the word and I'll post it for anyone running other Macs. **4. `xma2_source_voice_decodes_and_manages_lifetime`: what actually fails.** @⁠shortside reported it as "decodes 0 samples (expects 12291)". Run here on the same commit (`mac-on-main-wip` `db065d8`), cross `x86_64-pc-windows-gnullvm` (LLVM-MinGW 20261117), under Wine: the failing assertion is `crates/xcl/src/hle/xaudio2.rs:1599`, `left: 0`, `right: 12291`, and those numbers are not a sample count - they are `assert_eq!(st.current_buffer_context as usize, CTX_VALID)` with `const CTX_VALID: usize = 0x3003` = 12291. Everything before it passes on this host: both submits return S_OK, `stats().xma_buffers_decoded` is +1 and `xma_decode_errors` is +1 (lines 1593–1594), `buffers_queued == 2` (1598). The assert sits at 1599, *before* `start(voice, 0, 0)` at 1603 - so what reads 0 is which buffer `GetState` reports as current for a voice with two buffers submitted and not yet started, not the XMA2 decode. Same failure on @⁠shortside's MSVC-target build (clang-cl + xwin) and on this gnullvm build, so it is not a toolchain artifact. **5. `set_predication_buffer_state_and_kickoff`, one confirmation line.** It fails identically here (`predication_e2e.rs:360`, `EQUAL_ZERO(0) must skip dst[0]`, `got1[0] = 0xAAAA0000` where `init_vals[0] = 0x1111_1111`, i.e. the predicated copy ran anyway) on the gnullvm build under Wine - matching @⁠us3r40456's `SetPredication` finding, and @⁠vakaobr has said that is his lane, so this is measurement only. Two host facts from the same run's XCL log, useful for anyone running the e2e suite under CrossOver: with `XCL_D3D12_DEBUG=1` the host answers `debug layer requested but unavailable: Call failed (0x80004005)`, so the InfoQueue side of those tests has nothing to collect; and the UMA import check reports `OpenExistingHeapFromAddress is not implemented`, with XCL falling back to a 512 MB video-memory window that it uploads to and reads back from by `Map`. Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal, Wine for the `gnullvm` test binaries; the probe binary is a plain PE cross-built with LLVM-MinGW. **AI use**: GPT-6 Luna wrote the probe program, ran it and the two tests, and drafted this comment; the numbers come from those runs. Nothing about this bench's game package is in any of it - the probe reads no files.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 09:53 UTC · original · edited 2026-11-24 10:28 UTC

I measured that on D3DMetal 3.0 a program with any 64-bit atomic writes nothing at all, other stores included, even though it reports Int64ShaderOps and every AtomicInt64On*Supported cap as 1. Only non-returning unsigned InterlockedMin64 / InterlockedMax64 on device memory work. #983 is the test-only PR: it skips the three tests whose programs use them with "no 64-bit atomics", using a one-kernel probe since the caps cannot be trusted, and moves the three 64-bit atomics out of gpu_more_atomics_sub_dword_scratch_valu so the rest of it keeps running on the Mac.

Also #982: gpu_ps_image_sample_offset_implicit_lod_between_mips failed on the Mac because its program had no s_wqm (helper lanes kept u / v at 0) and because D3DMetal's LOD is 0.2421875 where the test assumed 0.25. Both PRs are test-only and need a Windows GPU run.

Update: two more Mac failures traced. xma2_source_voice_decodes_and_manages_lifetime doesn't decode 0 samples: 12291 is 0x3003, the buffer context GetState should name. Wine 11's bundled FAudio returns a null context before a voice starts (FAudio 26.04 fixed it), and #890 handles that in XCL; on 9aec53d it takes the hle::xaudio2:: tests here from 8 passed / 1 failed to 9 / 0. gpu_uma_import_check_at_init fails because the check never runs: D3DMetal answers E_NOTIMPL to OpenExistingHeapFromAddress, so its result stays empty. #1024 skips it with "no GPU UMA" for exactly that case.

AI use: Claude Code, Claude Opus 5.5 ran the probes and wrote this note and its update.

**@⁠vakaobr** on GitHub · 2026-11-24 09:53 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7128036948) · edited 2026-11-24 10:28 UTC I measured that on D3DMetal 3.0 a program with any 64-bit atomic writes nothing at all, other stores included, even though it reports `Int64ShaderOps` and every `AtomicInt64On*Supported` cap as 1. Only non-returning unsigned `InterlockedMin64` / `InterlockedMax64` on device memory work. #983 is the test-only PR: it skips the three tests whose programs use them with "no 64-bit atomics", using a one-kernel probe since the caps cannot be trusted, and moves the three 64-bit atomics out of `gpu_more_atomics_sub_dword_scratch_valu` so the rest of it keeps running on the Mac. Also #982: `gpu_ps_image_sample_offset_implicit_lod_between_mips` failed on the Mac because its program had no `s_wqm` (helper lanes kept u / v at 0) and because D3DMetal's LOD is 0.2421875 where the test assumed 0.25. Both PRs are test-only and need a Windows GPU run. **Update:** two more Mac failures traced. `xma2_source_voice_decodes_and_manages_lifetime` doesn't decode 0 samples: 12291 is `0x3003`, the buffer context `GetState` should name. Wine 11's bundled FAudio returns a null context before a voice starts (FAudio 26.04 fixed it), and #890 handles that in XCL; on `9aec53d` it takes the `hle::xaudio2::` tests here from 8 passed / 1 failed to 9 / 0. `gpu_uma_import_check_at_init` fails because the check never runs: D3DMetal answers E_NOTIMPL to `OpenExistingHeapFromAddress`, so its result stays empty. #1024 skips it with "no GPU UMA" for exactly that case. AI use: Claude Code, Claude Opus 5.5 ran the probes and wrote this note and its update.
Author
Owner

@⁠shortside on GitHub · 2026-11-24 06:41 UTC · original · edited 2026-11-24 10:40 UTC

@⁠Ahmet-Dedeler I have an M5 Pro too (macOS 27.2.1, CrossOver 26.3) and I'm happy to help with testing or development on the Mac port.

I ran the unit and integration tests on mac-on-main-wip (db065d8), cross-built with clang-cl and xwin (MSVC target, debug, DXC 1.9.2609). The results match the reports above: the 11 f64 failures, the two 64-bit atomics, the 7 graphics hangs and the 8 fixture crashes at real.rs:705. Two failures I didn't see mentioned yet:

  • hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime fails with left: 0, right: 12291
  • tests/predication_e2e.rs set_predication_buffer_state_and_kickoff: the predicated write isn't skipped ("EQUAL_ZERO(0) must skip dst[0]")

I haven't checked yet whether either one is Wine or D3DMetal rather than XCL. If there's a branch or PR you'd like run on a second M5 Pro, let me know.

Edit: the first bullet said "decodes 0 samples". That was wrong, as @⁠mikebuckets171 pointed out: 12291 is the buffer context 0x3003 that GetState should report, and the decode works. Fixed in #890.

**@⁠shortside** on GitHub · 2026-11-24 06:41 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7124193301) · edited 2026-11-24 10:40 UTC @⁠Ahmet-Dedeler I have an M5 Pro too (macOS 27.2.1, CrossOver 26.3) and I'm happy to help with testing or development on the Mac port. I ran the unit and integration tests on `mac-on-main-wip` (`db065d8`), cross-built with clang-cl and xwin (MSVC target, debug, DXC 1.9.2609). The results match the reports above: the 11 f64 failures, the two 64-bit atomics, the 7 graphics hangs and the 8 fixture crashes at `real.rs:705`. Two failures I didn't see mentioned yet: - `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` fails with `left: 0, right: 12291` - `tests/predication_e2e.rs` `set_predication_buffer_state_and_kickoff`: the predicated write isn't skipped ("EQUAL_ZERO(0) must skip dst[0]") I haven't checked yet whether either one is Wine or D3DMetal rather than XCL. If there's a branch or PR you'd like run on a second M5 Pro, let me know. Edit: the first bullet said "decodes 0 samples". That was wrong, as @⁠mikebuckets171 pointed out: 12291 is the buffer context `0x3003` that `GetState` should report, and the decode works. Fixed in #890.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 10:50 UTC · original

Correction to my 10:06 comment: the readback half of it was measured on the wrong half the matrix. One sentence there is wrong and could send someone the wrong way, so here is the completed matrix and what it actually says.

What I said: "this host has no readback heap at all", and that XCL's D3D12_HEAP_TYPE_READBACK stamp buffer (runner.rs:1442) is refused here, so the timed path cannot run as written. That is wrong. I had tested READBACK in the two initial states I happened to try - GENERIC_READ and RESOLVE_DEST - both E_INVALIDARG. The state XCL actually asks for is COPY_DEST, and there it works:

heap initial state create Map
DEFAULT GENERIC_READ S_OK Map refused (0x80070057)
DEFAULT RESOLVE_DEST S_OK refused
DEFAULT COPY_SOURCE S_OK refused
UPLOAD GENERIC_READ S_OK S_OK, and Map(0..64) S_OK
UPLOAD COPY_DEST 0x80070057 -
READBACK GENERIC_READ 0x80070057 -
READBACK RESOLVE_DEST 0x80070057 -
READBACK COPY_DEST S_OK at 64 B and at 32768 B S_OK with no range and with a read range

Plain 64-byte / 32768-byte buffers, Dimension: BUFFER, Format: UNKNOWN, Layout: ROW_MAJOR, Flags: NONE, D3D12_HEAP_FLAG_NONE - the same shape runner.rs:314's buffer() builds, and 32768 B is TIMESTAMP_SLOTS * 8, the size the title-facing pool at list_x.rs:2115-2127 asks for in COPY_DEST. So both readback shapes XCL uses are creatable and mappable on this host; the timed path is not blocked at buffer creation.

What survives from that comment, measured again in the arrangement XCL really uses (EndQuery, ClearRenderTargetView on an 8x8 RGBA8 target, EndQuery, ResolveQueryData into a READBACK + COPY_DEST buffer with no barrier and no copy, fence signalled, Map(0, 0..16) S_OK): the two stamps read 0 and 0. The BeginQuery+EndQuery pair, resolved into a DEFAULT buffer, is unreadable here because Map on a DEFAULT buffer is refused; resolving into an UPLOAD + GENERIC_READ buffer gives 0 and 0 as well. So the plumbing works end to end and the values are simply never written - which is the fact the timestamp fix in #996 needs, and that fix does work on this host: timestamps_outside_unified_memory_land_after_the_queue fails on 02bfd1d with non-UMA GPU timestamp never landed (top=0, bottom=0) and passes at f242ea8, details in my comment on #996.

Also, for the WARP half of #957: a plain D3D12 program on this host gets CreateDXGIFactory2 S_OK and EnumWarpAdapter 0x887A0004 (DXGI_ERROR_UNSUPPORTED), with EnumAdapters1 enumerating exactly one adapter - vendor 0x1002, device 0x66af, 40960 MB dedicated, flags 0x0 - so there is nothing to fall back to.

Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; the probe is a plain D3D12 PE, cross-built with LLVM-MinGW, no XCL in it and it reads no files. AI use: GPT-6 Luna wrote and ran the probe and drafted this correction; the codes are from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 10:50 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7129317182) **Correction to my 10:06 comment: the readback half of it was measured on the wrong half the matrix.** One sentence there is wrong and could send someone the wrong way, so here is the completed matrix and what it actually says. What I said: "this host has no readback heap at all", and that XCL's `D3D12_HEAP_TYPE_READBACK` stamp buffer (`runner.rs:1442`) is refused here, so the timed path cannot run as written. **That is wrong.** I had tested `READBACK` in the two initial states I happened to try - `GENERIC_READ` and `RESOLVE_DEST` - both E_INVALIDARG. The state XCL actually asks for is `COPY_DEST`, and there it works: | heap | initial state | create | `Map` | |---|---|---|---| | DEFAULT | `GENERIC_READ` | S_OK | `Map` refused (0x80070057) | | DEFAULT | `RESOLVE_DEST` | S_OK | refused | | DEFAULT | `COPY_SOURCE` | S_OK | refused | | UPLOAD | `GENERIC_READ` | S_OK | S_OK, and `Map(0..64)` S_OK | | UPLOAD | `COPY_DEST` | **0x80070057** | - | | READBACK | `GENERIC_READ` | **0x80070057** | - | | READBACK | `RESOLVE_DEST` | **0x80070057** | - | | **READBACK** | **`COPY_DEST`** | **S_OK at 64 B and at 32768 B** | **S_OK with no range and with a read range** | Plain 64-byte / 32768-byte buffers, `Dimension: BUFFER`, `Format: UNKNOWN`, `Layout: ROW_MAJOR`, `Flags: NONE`, `D3D12_HEAP_FLAG_NONE` - the same shape `runner.rs:314`'s `buffer()` builds, and 32768 B is `TIMESTAMP_SLOTS * 8`, the size the title-facing pool at `list_x.rs:2115-2127` asks for in `COPY_DEST`. So both readback shapes XCL uses are creatable and mappable on this host; the timed path is not blocked at buffer creation. What survives from that comment, measured again in the arrangement XCL really uses (`EndQuery`, `ClearRenderTargetView` on an 8x8 RGBA8 target, `EndQuery`, `ResolveQueryData` into a READBACK + `COPY_DEST` buffer with no barrier and no copy, fence signalled, `Map(0, 0..16)` S_OK): **the two stamps read 0 and 0**. The `BeginQuery`+`EndQuery` pair, resolved into a DEFAULT buffer, is unreadable here because `Map` on a DEFAULT buffer is refused; resolving into an UPLOAD + `GENERIC_READ` buffer gives 0 and 0 as well. So the plumbing works end to end and the values are simply never written - which is the fact the timestamp fix in #996 needs, and that fix does work on this host: `timestamps_outside_unified_memory_land_after_the_queue` fails on `02bfd1d` with `non-UMA GPU timestamp never landed (top=0, bottom=0)` and passes at `f242ea8`, details in my comment on #996. Also, for the WARP half of #957: a plain D3D12 program on this host gets `CreateDXGIFactory2` S_OK and `EnumWarpAdapter` **`0x887A0004`** (`DXGI_ERROR_UNSUPPORTED`), with `EnumAdapters1` enumerating exactly one adapter - vendor `0x1002`, device `0x66af`, 40960 MB dedicated, flags `0x0` - so there is nothing to fall back to. Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; the probe is a plain D3D12 PE, cross-built with LLVM-MinGW, no XCL in it and it reads no files. **AI use**: GPT-6 Luna wrote and ran the probe and drafted this correction; the codes are from those runs.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 11:03 UTC · original

@⁠Lucasyudi - the gap you describe is still open after #996, and which side of the UMA window a timestamp targets decides whether it applies. Code path plus numbers from this host, in case it saves you writing the change twice.

#996 (@⁠shortside, opened today) gates on the condition you found - a queue whose GetTimestampFrequency is under the slowest real GPU clock - and adds a second trigger: a timestamp query that resolved to 0 on a queue that reached its fence. On this host the second one is what actually fires in the library tests (the frequency gate sits in create_command_queue_x, which a lib test that builds its own device never reaches).

Where #996's value goes, from list_x.rs:2070-2095:

  • target inside a real UMA window - write() issues the driver's WriteBufferImmediate on the list with the marker mode (MARKER_IN for top of pipe, MARKER_OUT for bottom). Queue-ordered, so your cpu_writes::after worker gap does not apply to those.
  • target outside unified memory - write() pushes cpu_writes::Write::Immediate (list_x.rs:2081-2084): the same worker-writes-after-the-fence path you describe. #996's clock value enters through the same door as any other value write, so for the non-UMA case your gap is untouched.

Measured (MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26 with D3DMetal, Rust 1.100.0, x86_64-pc-windows-gnullvm with LLVM-MinGW 20261117, --release --locked, one test per process). hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue - the non-UMA case:

  • 02bfd1d: spins the full 5 s, then panicked at crates/xcl/src/hle/d3d12x/list_x.rs:4981: non-UMA GPU timestamp never landed (top=0, bottom=0), exit 0x65.
  • f242ea8: ok. 1 passed; 0 failed in 0.44 s, exit 0x0, log line "no GPU timestamps on this host (a timestamp query resolved to 0)".

As you already said, that test spins until the value shows up, so 0.44 s only proves the value lands at all - it cannot see whether the title's own later Signal and wait overtake the worker's write. I have not run a race test for that, so your question to @⁠ivall is still live and #996 does not answer it; what #996 changes is the content (0 vs a clock value), not the ordering.

Your note that the two stamps of one submission share a QPC value carries over to #996 too: clock_now() is read per write, so top and bottom differ only by the CPU time between the two writes, not by anything the GPU did.

One measurement that argues for answering GetTimestampFrequency / GetClockCalibration from the clock, which both plans do: a plain D3D12 program (no XCL) on this host gets 60 from the frequency call and a GetClockCalibration GPU value equal to its CPU value (or 41-42 ticks below it), advancing at ~10^6-10^7 ticks per run - so before either change a title is handed 60 ticks/second and a ~1 GHz-scaled calibration value at the same time. The zero-stamp half matches what you measured on your M4 Pro: readback created, resolved, mapped, and both slots 0.

Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna read the code path, ran the two test builds and drafted this comment; the codes and timings are from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 11:03 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7129605984) **@⁠Lucasyudi - the gap you describe is still open after #996, and which side of the UMA window a timestamp targets decides whether it applies.** Code path plus numbers from this host, in case it saves you writing the change twice. #996 (@⁠shortside, opened today) gates on the condition you found - a queue whose `GetTimestampFrequency` is under the slowest real GPU clock - and adds a second trigger: a timestamp query that resolved to 0 on a queue that reached its fence. On this host the second one is what actually fires in the library tests (the frequency gate sits in `create_command_queue_x`, which a lib test that builds its own device never reaches). **Where #996's value goes**, from `list_x.rs:2070-2095`: - **target inside a real UMA window** - `write()` issues the driver's `WriteBufferImmediate` on the list with the marker mode (MARKER_IN for top of pipe, MARKER_OUT for bottom). Queue-ordered, so your `cpu_writes::after` worker gap does not apply to those. - **target outside unified memory** - `write()` pushes `cpu_writes::Write::Immediate` (`list_x.rs:2081-2084`): the same worker-writes-after-the-fence path you describe. #996's clock value enters through the same door as any other value write, so for the non-UMA case your gap is untouched. **Measured** (MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26 with D3DMetal, Rust 1.100.0, `x86_64-pc-windows-gnullvm` with LLVM-MinGW 20261117, `--release --locked`, one test per process). `hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` - the non-UMA case: - `02bfd1d`: spins the full 5 s, then `panicked at crates/xcl/src/hle/d3d12x/list_x.rs:4981: non-UMA GPU timestamp never landed (top=0, bottom=0)`, exit `0x65`. - `f242ea8`: `ok. 1 passed; 0 failed` in 0.44 s, exit `0x0`, log line "no GPU timestamps on this host (a timestamp query resolved to 0)". As you already said, that test spins until the value shows up, so 0.44 s only proves the value lands at all - it cannot see whether the title's own later `Signal` and wait overtake the worker's write. I have not run a race test for that, so your question to @⁠ivall is still live and #996 does not answer it; what #996 changes is the *content* (0 vs a clock value), not the ordering. Your note that the two stamps of one submission share a QPC value carries over to #996 too: `clock_now()` is read per write, so top and bottom differ only by the CPU time between the two writes, not by anything the GPU did. One measurement that argues for answering `GetTimestampFrequency` / `GetClockCalibration` from the clock, which both plans do: a plain D3D12 program (no XCL) on this host gets 60 from the frequency call and a `GetClockCalibration` GPU value equal to its CPU value (or 41-42 ticks below it), advancing at ~10^6-10^7 ticks per run - so before either change a title is handed 60 ticks/second and a ~1 GHz-scaled calibration value at the same time. The zero-stamp half matches what you measured on your M4 Pro: readback created, resolved, mapped, and both slots 0. Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. **AI use**: GPT-6 Luna read the code path, ran the two test builds and drafted this comment; the codes and timings are from those runs.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 02:41 UTC · original · edited 2026-11-24 11:05 UTC

@⁠Ahmet-Dedeler: a fix for the 8 test fixtures Kalmarv traced above, tested on mac-on-main-wip at db065d8.

Each fixture now builds its fake extended vtable the way class_for does: the original table at index 0, the 16 mirror words (zero here), then the slots, with the object's vtable at .add(HDR). So orig_fn reads the original at ext[-HDR]. The only non-test change is HDR becoming pub(super), so the list_x and bind tests can use it. That's 3 files, +31 / -28.

Tested

  • MacBook Pro M5 Pro (20-core GPU), 48 GB, macOS 27.2.1, Rosetta 2. CrossOver 26.3.0.39832, Windows 10 64-bit bottle, D3DMetal backend.
  • cargo test -p xcl --lib --target x86_64-pc-windows-gnu --no-run with Rust 1.100.0 and mingw-w64 GCC 16.2.0, debug build. DXC 1.9.2609 through XCL_DXC_DIR.
  • Each test ran in its own process in the bottle (<exe> --exact <name> --test-threads=1), on the same build with and without the diff. "Crash" is an exit with no test result (exit code 5, an access violation):
test db065d8 as is with the fix
bind::tests::async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect panic, no result pass
real::readback_routing_tests::copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enum hang (killed at 120 s) pass
list_x::tests::reset_commits_state_only_after_native_success_and_always_restores_vtable crash pass
list_x::tests::resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback crash pass
list_x::tests::draw_indexed_x_routes_through_bind_and_restores_index_buffer crash pass
list_x::tests::kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_range crash pass
list_x::tests::set_predication_buffer_state_transitions_and_lifecycle crash pass
list_x::tests::timestamps_outside_unified_memory_land_after_the_queue crash fails at list_x.rs:3765, "non-UMA GPU timestamp never landed"

The last one now gets past the fixture and fails the way us3r40456 reports it failing on main: the GPU timestamp never arrives on D3DMetal. So it's a separate issue from the fixtures.

Not tested

  • Windows, and the rest of the suite with this diff applied. A full per-test run of the branch (at feb49be, without this diff) is still going on this machine, and I'll post those counts separately.
  • The retail title, and the release build.
The diff, on db065d8
diff --git a/crates/xcl/src/hle/d3d12x/bind.rs b/crates/xcl/src/hle/d3d12x/bind.rs
index 904fcad..ef8181c 100644
--- a/crates/xcl/src/hle/d3d12x/bind.rs
+++ b/crates/xcl/src/hle/d3d12x/bind.rs
@@ -1046,13 +1046,13 @@ mod tests {
 
         // Extended vtable layout expected by `real::orig_fn`: entry -1 holds `orig_vt` pointer,
         // and entries 0..64 hold the COM method pointers used via `ID3D12GraphicsCommandList`.
-        let mut ext_vt = vec![0usize; 65];
+        let mut ext_vt = vec![0usize; real::HDR + 64];
         ext_vt[0] = orig_vt.as_ptr() as usize;
-        ext_vt[1..].copy_from_slice(&orig_vt);
+        ext_vt[real::HDR..].copy_from_slice(&orig_vt);
 
         let fake = Box::new(FakeAdoptedList {
-            // SAFETY: `ext_vt` has 65 elements so `.add(1)` points to slot 0 with `orig_vt` at `-1`.
-            vt: unsafe { ext_vt.as_ptr().add(1) },
+            // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`.
+            vt: unsafe { ext_vt.as_ptr().add(real::HDR) },
             refs: AtomicUsize::new(1),
             dispatch_calls: AtomicUsize::new(0),
             set_compute_rs_calls: AtomicUsize::new(0),
diff --git a/crates/xcl/src/hle/d3d12x/list_x.rs b/crates/xcl/src/hle/d3d12x/list_x.rs
index df3fa1b..8415250 100644
--- a/crates/xcl/src/hle/d3d12x/list_x.rs
+++ b/crates/xcl/src/hle/d3d12x/list_x.rs
@@ -2664,8 +2664,9 @@ mod tests {
     fn reset_commits_state_only_after_native_success_and_always_restores_vtable() {
         let mut native = vec![0usize; PC_RESET + 1];
         native[PC_RESET] = reset_test_native as usize;
-        let extended = [native.as_ptr() as usize, 0usize];
-        let ext = unsafe { extended.as_ptr().add(1) as usize };
+        let mut extended = [0usize; real::HDR + 1];
+        extended[0] = native.as_ptr() as usize;
+        let ext = unsafe { extended.as_ptr().add(real::HDR) as usize };
         let replacement = 0x1234_5678usize;
         let mut object = [ext];
         let list = object.as_mut_ptr() as *mut c_void;
@@ -3166,11 +3167,12 @@ mod tests {
         let mut orig_list_vt = [0usize; 70];
         orig_list_vt[PC_RESOLVE_QUERY_DATA] = fake_resolve as usize;
         orig_list_vt[PC_WRITE_BUFFER_IMMEDIATE] = fake_write_immediate as usize;
-        // Adopted objects store `orig` at `ext[-1]`.
-        let ext_list_vt = [orig_list_vt.as_ptr() as usize, 0usize];
+        // Adopted objects store `orig` at `ext[-HDR]`.
+        let mut ext_list_vt = [0usize; real::HDR + 1];
+        ext_list_vt[0] = orig_list_vt.as_ptr() as usize;
         let mut fake_list = FakeCom {
-            // SAFETY: `ext_list_vt` has 2 elements; `.add(1)` points at `ext[0]` with `ext[-1] = orig`.
-            vt: unsafe { ext_list_vt.as_ptr().add(1) },
+            // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`.
+            vt: unsafe { ext_list_vt.as_ptr().add(real::HDR) },
         };
 
         let mut res_vt = [0usize; 16];
@@ -3255,13 +3257,13 @@ mod tests {
         orig_vt[42] = fake_noop_uav as usize; // SetGraphicsRootUnorderedAccessView
         orig_vt[43] = fake_set_ib as usize;
 
-        let mut ext_vt = vec![0usize; 65];
+        let mut ext_vt = vec![0usize; real::HDR + 64];
         ext_vt[0] = orig_vt.as_ptr() as usize;
-        ext_vt[1..].copy_from_slice(&orig_vt);
+        ext_vt[real::HDR..].copy_from_slice(&orig_vt);
 
         let fake = Box::new(FakeDrawList {
-            // SAFETY: `ext_vt` has 65 entries so `.add(1)` points to slot 0 with `orig_vt` at `-1`.
-            vt: unsafe { ext_vt.as_ptr().add(1) },
+            // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`.
+            vt: unsafe { ext_vt.as_ptr().add(real::HDR) },
             refs: AtomicUsize::new(1),
             draws: Mutex::new(Vec::new()),
             index_buffers: Mutex::new(Vec::new()),
@@ -3386,12 +3388,12 @@ mod tests {
 
         let mut orig_vt = [0usize; 64];
         orig_vt[PC_OM_SET_RENDER_TARGETS] = fake_om_set_render_targets as usize;
-        let mut ext_vt = [0usize; 2];
+        let mut ext_vt = [0usize; real::HDR + 1];
         ext_vt[0] = orig_vt.as_ptr() as usize;
 
         let fake = Box::new(FakeRtList {
-            // SAFETY: `ext_vt` has 2 entries so `.add(1)` has `orig_vt` at `-1` as `real::orig_fn` expects.
-            vt: unsafe { ext_vt.as_ptr().add(1) },
+            // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`.
+            vt: unsafe { ext_vt.as_ptr().add(real::HDR) },
             calls: Mutex::new(Vec::new()),
         });
         let list_ptr = &*fake as *const FakeRtList as *mut c_void;
@@ -3532,13 +3534,13 @@ mod tests {
         orig_vt[PC_RESOURCE_BARRIER] = fake_resource_barrier as usize;
         orig_vt[PC_SET_PREDICATION] = fake_set_predication as usize;
 
-        let mut ext_vt = [0usize; 65];
+        let mut ext_vt = [0usize; real::HDR + 64];
         ext_vt[0] = orig_vt.as_ptr() as usize;
-        ext_vt[1..].copy_from_slice(&orig_vt);
+        ext_vt[real::HDR..].copy_from_slice(&orig_vt);
 
         let fake = Box::new(FakePredList {
-            // SAFETY: `ext_vt` has 65 entries so `.add(1)` points at slot 0 with `orig_vt` at `-1`.
-            vt: unsafe { ext_vt.as_ptr().add(1) },
+            // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`.
+            vt: unsafe { ext_vt.as_ptr().add(real::HDR) },
             ty: Mutex::new(D3D12_COMMAND_LIST_TYPE_DIRECT),
             events: Mutex::new(Vec::new()),
         });
@@ -3723,12 +3725,12 @@ mod tests {
 
             let list_ptr = list.as_raw();
             let orig_vt = *(list_ptr as *const *const usize);
-            let mut ext_vt = [0usize; 65];
+            let mut ext_vt = [0usize; real::HDR + 64];
             ext_vt[0] = orig_vt as usize;
-            std::ptr::copy_nonoverlapping(orig_vt, ext_vt.as_mut_ptr().add(1), 64);
+            std::ptr::copy_nonoverlapping(orig_vt, ext_vt.as_mut_ptr().add(real::HDR), 64);
 
             on_create(list_ptr, alloc.as_raw() as usize, 0, D3D12_COMMAND_LIST_TYPE_DIRECT);
-            *(list_ptr as *mut *const usize) = ext_vt.as_ptr().add(1);
+            *(list_ptr as *mut *const usize) = ext_vt.as_ptr().add(real::HDR);
 
             let bottom_ts = Box::new(0u64);
             let top_ts = Box::new(0u64);
diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
index 656520f..cf3717d 100644
--- a/crates/xcl/src/hle/d3d12x/real.rs
+++ b/crates/xcl/src/hle/d3d12x/real.rs
@@ -46,7 +46,7 @@ const MAX_SCAN: usize = 512;
 /// D3DMetal does both), reads them through the object's table pointer.
 const PREFIX: usize = 16;
 /// Words in front of an extended vtable: the original table's address, then the mirror.
-const HDR: usize = PREFIX + 1;
+pub(super) const HDR: usize = PREFIX + 1;
 /// words of a native host's method table kept after the public methods (see `class_for`)
 const NATIVE_HOST_TAIL: usize = 512;
 
@@ -5414,10 +5414,11 @@ mod readback_routing_tests {
         let mut orig_vt = [0usize; 32];
         orig_vt[23] = fake_copy_ranges as usize;
         orig_vt[24] = fake_copy_simple as usize;
-        let ext_vt = [orig_vt.as_ptr() as usize, 0usize];
+        let mut ext_vt = [0usize; HDR + 1];
+        ext_vt[0] = orig_vt.as_ptr() as usize;
         let mut dev = FakeDev {
-            // SAFETY: `ext_vt` has 2 entries; `.add(1)` puts `orig_vt` at `ext[-1]`.
-            vt: unsafe { ext_vt.as_ptr().add(1) },
+            // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`.
+            vt: unsafe { ext_vt.as_ptr().add(HDR) },
         };
         let dev_ptr = &mut dev as *mut FakeDev as *mut c_void;
 

Edit: the f64 tests, and why some f16 checks failed as well

On D3DMetal a GPU program with any f64 instruction writes nothing at all, not just wrong f64 results. I checked with single-instruction probe kernels on this machine (local only, not in either diff), lane 0:

program expected got
V_CVT_F16_F32 with clamp, 3.0 0x3C00 0x3C00
the same with OMOD ×2 0x4600 0x4600
V_ADD_F16, 1.0 + 1.0, high half kept 0xBEEF4000 0xBEEF4000
V_ADD_F64 then the clamped V_CVT_F16_F32 0xDEAD3C00 0x00000000
the clamped V_CVT_F16_F32 then V_ADD_F64 0xDEAD3C00 0x00000000
V_LSHLREV_B64 then the clamped V_CVT_F16_F32 0xDEAD3C00 0xDEAD3C00

So f16 conversions are fine on their own. The v_cvt_f16_f32 clamp failure in gpu_clamp_and_omod_per_instruction and the v_add_f16 keeps the high half one in gpu_valu_16_and_64_bit come from the f64 instructions in the same programs. 64-bit integer operations aren't affected. For the Mac port this means any console shader with an f64 instruction would draw nothing on D3DMetal, unless the recompiler emulates f64 there.

For the tests, here is a tests-only diff against main, which also applies to db065d8. It adds doubles_ready() next to mesh_ready() in gpu/recomp/tests.rs, which reads D3D12_OPTIONS.DoublePrecisionFloatShaderOps on the adapter runner picks and skips with no doubles when it's false:

  • 14 tests skip whole: the 13 Kalmarv listed plus gpu_valu_16_and_64_bit. Their programs have f64 instructions, so nothing in them can be checked on such a device.
  • gpu_float_compares_random skips only its F64 round, because F32 and F16 are separate programs. On a device without doubles that changes the random inputs its F16 round gets.
  • runner.rs isn't touched, so the runtime doesn't change. Windows GPUs and WARP report doubles, so nothing skips there. XCL_REQUIRE_GPU=wave64 would treat a no doubles skip as a failure, as it does every reason except no mesh shaders.

Tested on main 18c105a with the diff, on the machine above, each test in its own process: all 14 give ok with SKIPPED <test>: no doubles. Without the diff, all 14 failed in my per-test run of the branch at feb49be. Not tested: Windows, main without the diff, and the rest of the suite with it.

Update: the f64 skip is now #787 by @⁠Lucasyudi, which skips the same 14 tests and keeps the F32 and F16 rounds of gpu_float_compares_random. I'm not opening mine, to avoid a duplicate. Thanks to @⁠Kalmarv for the Windows run of my diff and to @⁠us3r40456 for the SFI0 check, which also applies to #787 (see my note there). The WARP frame-dump skip from my full run is #957.

The f64 diff, on main 18c105a
diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs
index a4f5092..4e4e507 100644
--- a/crates/xcl/src/gpu/recomp/tests.rs
+++ b/crates/xcl/src/gpu/recomp/tests.rs
@@ -48,6 +48,44 @@ fn mesh_ready() -> bool {
     }
 }
 
+/// Double-precision shader operations (`DoublePrecisionFloatShaderOps` of D3D12_OPTIONS) on the adapter `runner`
+/// uses. D3DMetal (macOS, CrossOver) reports none, and there a kernel with any f64 instruction writes nothing at all:
+/// its other results read 0 too (a `V_ADD_F64` next to a `V_CVT_F16_F32` zeroes both), while 64-bit integer operations
+/// run. So a test whose program has an f64 instruction skips on such a device. Windows GPUs and WARP report doubles.
+/// Without a GPU this answers true and `gpu_ready` / `gpu_waves` do the skipping.
+fn doubles_ready() -> bool {
+    static DOUBLES: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
+    let doubles = *DOUBLES.get_or_init(|| device_doubles().unwrap_or(true));
+    if !doubles {
+        println!("no double-precision shader operations on this GPU – skipping");
+        runner::skip_test("no doubles");
+    }
+    doubles
+}
+
+/// `DoublePrecisionFloatShaderOps` of the adapter `XCL_ADAPTER` picks, chosen as `runner` chooses it.
+fn device_doubles() -> Result<bool, String> {
+    use crate::gpu::adapter::{candidates, Selector};
+    use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_12_0;
+    use windows::Win32::Graphics::Direct3D12::{D3D12_FEATURE_D3D12_OPTIONS, D3D12_FEATURE_DATA_D3D12_OPTIONS};
+    use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory2, IDXGIAdapter1, IDXGIFactory6, DXGI_CREATE_FACTORY_FLAGS};
+    let e = |x: windows::core::Error| x.to_string();
+    unsafe {
+        let factory: IDXGIFactory6 = CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0)).map_err(e)?;
+        let sel = Selector::from_env_or("auto");
+        let adapter: IDXGIAdapter1 = if sel == Selector::Warp {
+            factory.EnumWarpAdapter().map_err(e)?
+        } else {
+            candidates(&factory, &sel).into_iter().next().ok_or("no adapter")?.0
+        };
+        let dev = crate::gpu::agility::create_device(&adapter, D3D_FEATURE_LEVEL_12_0).map_err(e)?;
+        let mut o = D3D12_FEATURE_DATA_D3D12_OPTIONS::default();
+        dev.CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &mut o as *mut _ as _, std::mem::size_of_val(&o) as u32)
+            .map_err(e)?;
+        Ok(o.DoublePrecisionFloatShaderOps.as_bool())
+    }
+}
+
 /// The wave sizes a per-lane test runs in, as the `wave64` option: true where the GPU has
 /// wave64, and false on every GPU, so the test also runs on NVIDIA. Empty without a GPU or DXC.
 fn gpu_waves() -> Vec<bool> {
@@ -486,7 +524,7 @@ fn f64_class_compare_vopc_and_vop3() {
 
 #[test]
 fn gpu_f64_class_compare() {
-    if !gpu_ready() {
+    if !gpu_ready() || !doubles_ready() {
         return;
     }
     let p = prog(&[
@@ -675,7 +713,7 @@ fn rndne_f64_instructions() {
 
 #[test]
 fn gpu_rndne_f64() {
-    if !gpu_ready() { return; }
+    if !gpu_ready() || !doubles_ready() { return; }
     let p = prog(&[("V_RNDNE_F64", "ENC_VOP1", &[("VDST", 2), ("SRC0", V)], None)]);
     const INPUTS: [u64; 16] = [
         0.0f64.to_bits(), (-0.0f64).to_bits(), 0.5f64.to_bits(), (-0.5f64).to_bits(),
@@ -700,7 +738,7 @@ fn gpu_rndne_f64() {
 
 #[test]
 fn gpu_frexp_f64_exp_and_mant() {
-    if !gpu_ready() {
+    if !gpu_ready() || !doubles_ready() {
         return;
     }
     let p = prog(&[
@@ -803,6 +841,9 @@ fn pair(v: &[u32], i: usize) -> f64 {
 /// the CPU's IEEE results, bit for bit, including the sign of zero, |x| ≥ 2^63, ±inf and NaN.
 #[test]
 fn gpu_f64_rounding_and_conversions() {
+    if !doubles_ready() {
+        return;
+    }
     for wave64 in gpu_waves() {
         f64_rounding_and_conversions(wave64);
     }
@@ -858,6 +899,9 @@ fn f64_rounding_and_conversions(wave64: bool) {
 /// range get real roots within an ulp of the CPU's, a negative x gives NaN and −0 gives −0.
 #[test]
 fn gpu_f64_roots() {
+    if !doubles_ready() {
+        return;
+    }
     for wave64 in gpu_waves() {
         f64_roots(wave64);
     }
@@ -898,6 +942,9 @@ fn f64_roots(wave64: bool) {
 /// denormal results, exponents beyond the f32 range of 2^n.
 #[test]
 fn gpu_ldexp_f64() {
+    if !doubles_ready() {
+        return;
+    }
     for wave64 in gpu_waves() {
         ldexp_f64(wave64);
     }
@@ -1005,7 +1052,7 @@ fn gpu_valu_float_and_int() {
 /// unsigned adds, the packed 16-bit adds and the integer dot products.
 #[test]
 fn gpu_clamp_and_omod_per_instruction() {
-    if !gpu_ready() {
+    if !gpu_ready() || !doubles_ready() {
         return;
     }
     let p = |name: &'static str, f: &'static [(&'static str, u64)]| (name, "ENC_VOP3P", f, None);
@@ -2654,7 +2701,7 @@ fn gpu_dword_addtid_per_lane_addresses() {
 
 #[test]
 fn gpu_valu_16_and_64_bit() {
-    if !gpu_ready() {
+    if !gpu_ready() || !doubles_ready() {
         return;
     }
     let p = prog(&[
@@ -4547,7 +4594,7 @@ fn gpu_more_atomics_sub_dword_scratch_valu() {
 /// Per-lane cells are deterministic; the three shared cells end in the unique winner's value.
 #[test]
 fn gpu_atomic_fcmpswap_x2() {
-    if !gpu_ready() {
+    if !gpu_ready() || !doubles_ready() {
         return;
     }
     let enc = |n: &'static str, e: &'static str, f: &[(&str, u64)]| encode(n, e, f, None).unwrap_or_else(|x| panic!("{n}: {x}"));
@@ -4690,7 +4737,7 @@ fn gpu_atomic_fmin_fmax_negative_zero() {
 /// the f32 test. A seventh, per-lane cell checks the GLC return (global).
 #[test]
 fn gpu_atomic_fmin_fmax_x2() {
-    if !gpu_ready() {
+    if !gpu_ready() || !doubles_ready() {
         return;
     }
     let enc = |n: &'static str, e: &'static str, f: &[(&str, u64)]| encode(n, e, f, None).unwrap_or_else(|x| panic!("{n}: {x}"));
@@ -6075,6 +6122,9 @@ fn gpu_fract_f32_edges() {
 /// when unordered, bit for bit against IEEE.
 #[test]
 fn gpu_f64_compares_with_nan() {
+    if !doubles_ready() {
+        return;
+    }
     for wave64 in gpu_waves() {
         f64_compares_with_nan(wave64);
     }
@@ -6227,6 +6277,9 @@ fn ldexp_ref(x: f64, n: i32) -> Option<f64> {
 /// one rounding. sqrt must be within 1 ulp and rsq within 2.
 #[test]
 fn gpu_f64_math_random() {
+    if !doubles_ready() {
+        return;
+    }
     for wave64 in gpu_waves() {
         f64_math_random(wave64);
     }
@@ -6335,7 +6388,11 @@ fn float_compares_random(wave64: bool) {
     };
     let mut rng = Rng(0x1234_5678_9ABC_DEF1);
     let mut total_bad = 0usize;
+    let doubles = doubles_ready();
     for ty in ["F32", "F64", "F16"] {
+        if ty == "F64" && !doubles {
+            continue;
+        }
         let (s0, s1) = if ty == "F64" { (V + 2, 4u64) } else { (V, 1u64) };
         let names: Vec<String> = OPS.iter().map(|o| format!("V_CMP_{o}_{ty}")).collect();
         let f3: Vec<[(&str, u64); 3]> = (0..16).map(|i| [("VDST", 20 + 2 * i as u64), ("SRC0", s0), ("SRC1", V + s1)]).collect();
@@ -6903,6 +6960,9 @@ fn gpu_ldexp_f32() {
 
 #[test]
 fn gpu_f64_literal_high_word() {
+    if !doubles_ready() {
+        return;
+    }
     for wave64 in gpu_waves() {
         let p = prog(&[
             // 1.0 + literal(1.5 = 0x3FF8_0000_0000_0000) == 2.5

Edit: full run of main 9aec53d (same machine, debug, one test per process, 60 s cap for gpu_*, 180 s otherwise). xcl lib (704): 641 passed, 28 failed, 12 timed out, 21 ignored, 2 skipped (no wave64). Every failure has a known cause: f64 (12, #787), 64-bit atomics (3, #983), sample offset (#982), UMA import check (#1024), WARP frame dump (#957), XMA2 (#890), GPU timestamps (#317 + the plan above), and 8 tests that need host-memory heaps or write watch, which D3DMetal doesn't have: #1060 skips six of them with "no GPU UMA" (E_NOTIMPL from OpenExistingHeapFromAddress only); list_x write_buffer_immediate_on_open_existing_heap_visible_to_cpu has the same cause, and shader readable_answers_from_the_working_set_without_touching_pages fails because Wine's QueryWorkingSetEx doesn't report the pages resident. The 12 timeouts are the draw / list hang: 8 GPU draw tests, bind create-list, two title_textures tests and vram d32s8. Other binaries: console_dlls_e2e 13, gpu_pso_e2e 7, xg_oracle 6 (12 ignored), console_shaders 3 (4 ignored), rpf_e2e 2, disasm_e2e 1, texture_states 1 passed; gpu_compute_e2e 1 passed, 1 timed out; e2e 1 passed, 1 failed (#750), 1 skipped; pls_quota 1 failed (#937); predication_e2e and sparse_reinit skip (no GPU UMA); heap_probe 4 ignored.

AI use: Claude Code with Claude Opus 5.5 found and wrote both changes and the probe kernels, built them, ran the tests on this machine and wrote this comment. I checked the diffs and the results before posting.

**@⁠vakaobr** on GitHub · 2026-11-24 02:41 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7120391368) · edited 2026-11-24 11:05 UTC @⁠Ahmet-Dedeler: a fix for the 8 test fixtures Kalmarv traced above, tested on `mac-on-main-wip` at `db065d8`. Each fixture now builds its fake extended vtable the way `class_for` does: the original table at index 0, the 16 mirror words (zero here), then the slots, with the object's vtable at `.add(HDR)`. So `orig_fn` reads the original at `ext[-HDR]`. The only non-test change is `HDR` becoming `pub(super)`, so the `list_x` and `bind` tests can use it. That's 3 files, +31 / -28. **Tested** - MacBook Pro M5 Pro (20-core GPU), 48 GB, macOS 27.2.1, Rosetta 2. CrossOver 26.3.0.39832, Windows 10 64-bit bottle, D3DMetal backend. - `cargo test -p xcl --lib --target x86_64-pc-windows-gnu --no-run` with Rust 1.100.0 and mingw-w64 GCC 16.2.0, debug build. DXC 1.9.2609 through `XCL_DXC_DIR`. - Each test ran in its own process in the bottle (`<exe> --exact <name> --test-threads=1`), on the same build with and without the diff. "Crash" is an exit with no test result (exit code 5, an access violation): | test | `db065d8` as is | with the fix | |---|---|---| | `bind::tests::async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect` | panic, no result | pass | | `real::readback_routing_tests::copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enum` | hang (killed at 120 s) | pass | | `list_x::tests::reset_commits_state_only_after_native_success_and_always_restores_vtable` | crash | pass | | `list_x::tests::resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writeback` | crash | pass | | `list_x::tests::draw_indexed_x_routes_through_bind_and_restores_index_buffer` | crash | pass | | `list_x::tests::kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_range` | crash | pass | | `list_x::tests::set_predication_buffer_state_transitions_and_lifecycle` | crash | pass | | `list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` | crash | fails at `list_x.rs:3765`, "non-UMA GPU timestamp never landed" | The last one now gets past the fixture and fails the way us3r40456 reports it failing on `main`: the GPU timestamp never arrives on D3DMetal. So it's a separate issue from the fixtures. **Not tested** - Windows, and the rest of the suite with this diff applied. A full per-test run of the branch (at `feb49be`, without this diff) is still going on this machine, and I'll post those counts separately. - The retail title, and the release build. <details><summary>The diff, on <code>db065d8</code></summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/bind.rs b/crates/xcl/src/hle/d3d12x/bind.rs index 904fcad..ef8181c 100644 --- a/crates/xcl/src/hle/d3d12x/bind.rs +++ b/crates/xcl/src/hle/d3d12x/bind.rs @@ -1046,13 +1046,13 @@ mod tests { // Extended vtable layout expected by `real::orig_fn`: entry -1 holds `orig_vt` pointer, // and entries 0..64 hold the COM method pointers used via `ID3D12GraphicsCommandList`. - let mut ext_vt = vec![0usize; 65]; + let mut ext_vt = vec![0usize; real::HDR + 64]; ext_vt[0] = orig_vt.as_ptr() as usize; - ext_vt[1..].copy_from_slice(&orig_vt); + ext_vt[real::HDR..].copy_from_slice(&orig_vt); let fake = Box::new(FakeAdoptedList { - // SAFETY: `ext_vt` has 65 elements so `.add(1)` points to slot 0 with `orig_vt` at `-1`. - vt: unsafe { ext_vt.as_ptr().add(1) }, + // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`. + vt: unsafe { ext_vt.as_ptr().add(real::HDR) }, refs: AtomicUsize::new(1), dispatch_calls: AtomicUsize::new(0), set_compute_rs_calls: AtomicUsize::new(0), diff --git a/crates/xcl/src/hle/d3d12x/list_x.rs b/crates/xcl/src/hle/d3d12x/list_x.rs index df3fa1b..8415250 100644 --- a/crates/xcl/src/hle/d3d12x/list_x.rs +++ b/crates/xcl/src/hle/d3d12x/list_x.rs @@ -2664,8 +2664,9 @@ mod tests { fn reset_commits_state_only_after_native_success_and_always_restores_vtable() { let mut native = vec![0usize; PC_RESET + 1]; native[PC_RESET] = reset_test_native as usize; - let extended = [native.as_ptr() as usize, 0usize]; - let ext = unsafe { extended.as_ptr().add(1) as usize }; + let mut extended = [0usize; real::HDR + 1]; + extended[0] = native.as_ptr() as usize; + let ext = unsafe { extended.as_ptr().add(real::HDR) as usize }; let replacement = 0x1234_5678usize; let mut object = [ext]; let list = object.as_mut_ptr() as *mut c_void; @@ -3166,11 +3167,12 @@ mod tests { let mut orig_list_vt = [0usize; 70]; orig_list_vt[PC_RESOLVE_QUERY_DATA] = fake_resolve as usize; orig_list_vt[PC_WRITE_BUFFER_IMMEDIATE] = fake_write_immediate as usize; - // Adopted objects store `orig` at `ext[-1]`. - let ext_list_vt = [orig_list_vt.as_ptr() as usize, 0usize]; + // Adopted objects store `orig` at `ext[-HDR]`. + let mut ext_list_vt = [0usize; real::HDR + 1]; + ext_list_vt[0] = orig_list_vt.as_ptr() as usize; let mut fake_list = FakeCom { - // SAFETY: `ext_list_vt` has 2 elements; `.add(1)` points at `ext[0]` with `ext[-1] = orig`. - vt: unsafe { ext_list_vt.as_ptr().add(1) }, + // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`. + vt: unsafe { ext_list_vt.as_ptr().add(real::HDR) }, }; let mut res_vt = [0usize; 16]; @@ -3255,13 +3257,13 @@ mod tests { orig_vt[42] = fake_noop_uav as usize; // SetGraphicsRootUnorderedAccessView orig_vt[43] = fake_set_ib as usize; - let mut ext_vt = vec![0usize; 65]; + let mut ext_vt = vec![0usize; real::HDR + 64]; ext_vt[0] = orig_vt.as_ptr() as usize; - ext_vt[1..].copy_from_slice(&orig_vt); + ext_vt[real::HDR..].copy_from_slice(&orig_vt); let fake = Box::new(FakeDrawList { - // SAFETY: `ext_vt` has 65 entries so `.add(1)` points to slot 0 with `orig_vt` at `-1`. - vt: unsafe { ext_vt.as_ptr().add(1) }, + // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`. + vt: unsafe { ext_vt.as_ptr().add(real::HDR) }, refs: AtomicUsize::new(1), draws: Mutex::new(Vec::new()), index_buffers: Mutex::new(Vec::new()), @@ -3386,12 +3388,12 @@ mod tests { let mut orig_vt = [0usize; 64]; orig_vt[PC_OM_SET_RENDER_TARGETS] = fake_om_set_render_targets as usize; - let mut ext_vt = [0usize; 2]; + let mut ext_vt = [0usize; real::HDR + 1]; ext_vt[0] = orig_vt.as_ptr() as usize; let fake = Box::new(FakeRtList { - // SAFETY: `ext_vt` has 2 entries so `.add(1)` has `orig_vt` at `-1` as `real::orig_fn` expects. - vt: unsafe { ext_vt.as_ptr().add(1) }, + // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`. + vt: unsafe { ext_vt.as_ptr().add(real::HDR) }, calls: Mutex::new(Vec::new()), }); let list_ptr = &*fake as *const FakeRtList as *mut c_void; @@ -3532,13 +3534,13 @@ mod tests { orig_vt[PC_RESOURCE_BARRIER] = fake_resource_barrier as usize; orig_vt[PC_SET_PREDICATION] = fake_set_predication as usize; - let mut ext_vt = [0usize; 65]; + let mut ext_vt = [0usize; real::HDR + 64]; ext_vt[0] = orig_vt.as_ptr() as usize; - ext_vt[1..].copy_from_slice(&orig_vt); + ext_vt[real::HDR..].copy_from_slice(&orig_vt); let fake = Box::new(FakePredList { - // SAFETY: `ext_vt` has 65 entries so `.add(1)` points at slot 0 with `orig_vt` at `-1`. - vt: unsafe { ext_vt.as_ptr().add(1) }, + // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`. + vt: unsafe { ext_vt.as_ptr().add(real::HDR) }, ty: Mutex::new(D3D12_COMMAND_LIST_TYPE_DIRECT), events: Mutex::new(Vec::new()), }); @@ -3723,12 +3725,12 @@ mod tests { let list_ptr = list.as_raw(); let orig_vt = *(list_ptr as *const *const usize); - let mut ext_vt = [0usize; 65]; + let mut ext_vt = [0usize; real::HDR + 64]; ext_vt[0] = orig_vt as usize; - std::ptr::copy_nonoverlapping(orig_vt, ext_vt.as_mut_ptr().add(1), 64); + std::ptr::copy_nonoverlapping(orig_vt, ext_vt.as_mut_ptr().add(real::HDR), 64); on_create(list_ptr, alloc.as_raw() as usize, 0, D3D12_COMMAND_LIST_TYPE_DIRECT); - *(list_ptr as *mut *const usize) = ext_vt.as_ptr().add(1); + *(list_ptr as *mut *const usize) = ext_vt.as_ptr().add(real::HDR); let bottom_ts = Box::new(0u64); let top_ts = Box::new(0u64); diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs index 656520f..cf3717d 100644 --- a/crates/xcl/src/hle/d3d12x/real.rs +++ b/crates/xcl/src/hle/d3d12x/real.rs @@ -46,7 +46,7 @@ const MAX_SCAN: usize = 512; /// D3DMetal does both), reads them through the object's table pointer. const PREFIX: usize = 16; /// Words in front of an extended vtable: the original table's address, then the mirror. -const HDR: usize = PREFIX + 1; +pub(super) const HDR: usize = PREFIX + 1; /// words of a native host's method table kept after the public methods (see `class_for`) const NATIVE_HOST_TAIL: usize = 512; @@ -5414,10 +5414,11 @@ mod readback_routing_tests { let mut orig_vt = [0usize; 32]; orig_vt[23] = fake_copy_ranges as usize; orig_vt[24] = fake_copy_simple as usize; - let ext_vt = [orig_vt.as_ptr() as usize, 0usize]; + let mut ext_vt = [0usize; HDR + 1]; + ext_vt[0] = orig_vt.as_ptr() as usize; let mut dev = FakeDev { - // SAFETY: `ext_vt` has 2 entries; `.add(1)` puts `orig_vt` at `ext[-1]`. - vt: unsafe { ext_vt.as_ptr().add(1) }, + // SAFETY: `.add(HDR)` is slot 0, with the original table at `ext[-HDR]` for `real::orig_fn`. + vt: unsafe { ext_vt.as_ptr().add(HDR) }, }; let dev_ptr = &mut dev as *mut FakeDev as *mut c_void; ``` </details> **Edit: the f64 tests, and why some f16 checks failed as well** On D3DMetal a GPU program with any f64 instruction writes nothing at all, not just wrong f64 results. I checked with single-instruction probe kernels on this machine (local only, not in either diff), lane 0: | program | expected | got | |---|---|---| | `V_CVT_F16_F32` with clamp, 3.0 | `0x3C00` | `0x3C00` | | the same with `OMOD` ×2 | `0x4600` | `0x4600` | | `V_ADD_F16`, 1.0 + 1.0, high half kept | `0xBEEF4000` | `0xBEEF4000` | | `V_ADD_F64` then the clamped `V_CVT_F16_F32` | `0xDEAD3C00` | `0x00000000` | | the clamped `V_CVT_F16_F32` then `V_ADD_F64` | `0xDEAD3C00` | `0x00000000` | | `V_LSHLREV_B64` then the clamped `V_CVT_F16_F32` | `0xDEAD3C00` | `0xDEAD3C00` | So f16 conversions are fine on their own. The `v_cvt_f16_f32 clamp` failure in `gpu_clamp_and_omod_per_instruction` and the `v_add_f16 keeps the high half` one in `gpu_valu_16_and_64_bit` come from the f64 instructions in the same programs. 64-bit integer operations aren't affected. For the Mac port this means any console shader with an f64 instruction would draw nothing on D3DMetal, unless the recompiler emulates f64 there. For the tests, here is a tests-only diff against `main`, which also applies to `db065d8`. It adds `doubles_ready()` next to `mesh_ready()` in `gpu/recomp/tests.rs`, which reads `D3D12_OPTIONS.DoublePrecisionFloatShaderOps` on the adapter `runner` picks and skips with `no doubles` when it's false: - 14 tests skip whole: the 13 Kalmarv listed plus `gpu_valu_16_and_64_bit`. Their programs have f64 instructions, so nothing in them can be checked on such a device. - `gpu_float_compares_random` skips only its F64 round, because F32 and F16 are separate programs. On a device without doubles that changes the random inputs its F16 round gets. - `runner.rs` isn't touched, so the runtime doesn't change. Windows GPUs and WARP report doubles, so nothing skips there. `XCL_REQUIRE_GPU=wave64` would treat a `no doubles` skip as a failure, as it does every reason except `no mesh shaders`. Tested on `main` `18c105a` with the diff, on the machine above, each test in its own process: all 14 give `ok` with `SKIPPED <test>: no doubles`. Without the diff, all 14 failed in my per-test run of the branch at `feb49be`. Not tested: Windows, `main` without the diff, and the rest of the suite with it. **Update:** the f64 skip is now #787 by @⁠Lucasyudi, which skips the same 14 tests and keeps the F32 and F16 rounds of `gpu_float_compares_random`. I'm not opening mine, to avoid a duplicate. Thanks to @⁠Kalmarv for the Windows run of my diff and to @⁠us3r40456 for the SFI0 check, which also applies to #787 (see my note there). The WARP frame-dump skip from my full run is #957. <details><summary>The f64 diff, on <code>main</code> <code>18c105a</code></summary> ```diff diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs index a4f5092..4e4e507 100644 --- a/crates/xcl/src/gpu/recomp/tests.rs +++ b/crates/xcl/src/gpu/recomp/tests.rs @@ -48,6 +48,44 @@ fn mesh_ready() -> bool { } } +/// Double-precision shader operations (`DoublePrecisionFloatShaderOps` of D3D12_OPTIONS) on the adapter `runner` +/// uses. D3DMetal (macOS, CrossOver) reports none, and there a kernel with any f64 instruction writes nothing at all: +/// its other results read 0 too (a `V_ADD_F64` next to a `V_CVT_F16_F32` zeroes both), while 64-bit integer operations +/// run. So a test whose program has an f64 instruction skips on such a device. Windows GPUs and WARP report doubles. +/// Without a GPU this answers true and `gpu_ready` / `gpu_waves` do the skipping. +fn doubles_ready() -> bool { + static DOUBLES: std::sync::OnceLock<bool> = std::sync::OnceLock::new(); + let doubles = *DOUBLES.get_or_init(|| device_doubles().unwrap_or(true)); + if !doubles { + println!("no double-precision shader operations on this GPU – skipping"); + runner::skip_test("no doubles"); + } + doubles +} + +/// `DoublePrecisionFloatShaderOps` of the adapter `XCL_ADAPTER` picks, chosen as `runner` chooses it. +fn device_doubles() -> Result<bool, String> { + use crate::gpu::adapter::{candidates, Selector}; + use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_12_0; + use windows::Win32::Graphics::Direct3D12::{D3D12_FEATURE_D3D12_OPTIONS, D3D12_FEATURE_DATA_D3D12_OPTIONS}; + use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory2, IDXGIAdapter1, IDXGIFactory6, DXGI_CREATE_FACTORY_FLAGS}; + let e = |x: windows::core::Error| x.to_string(); + unsafe { + let factory: IDXGIFactory6 = CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0)).map_err(e)?; + let sel = Selector::from_env_or("auto"); + let adapter: IDXGIAdapter1 = if sel == Selector::Warp { + factory.EnumWarpAdapter().map_err(e)? + } else { + candidates(&factory, &sel).into_iter().next().ok_or("no adapter")?.0 + }; + let dev = crate::gpu::agility::create_device(&adapter, D3D_FEATURE_LEVEL_12_0).map_err(e)?; + let mut o = D3D12_FEATURE_DATA_D3D12_OPTIONS::default(); + dev.CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &mut o as *mut _ as _, std::mem::size_of_val(&o) as u32) + .map_err(e)?; + Ok(o.DoublePrecisionFloatShaderOps.as_bool()) + } +} + /// The wave sizes a per-lane test runs in, as the `wave64` option: true where the GPU has /// wave64, and false on every GPU, so the test also runs on NVIDIA. Empty without a GPU or DXC. fn gpu_waves() -> Vec<bool> { @@ -486,7 +524,7 @@ fn f64_class_compare_vopc_and_vop3() { #[test] fn gpu_f64_class_compare() { - if !gpu_ready() { + if !gpu_ready() || !doubles_ready() { return; } let p = prog(&[ @@ -675,7 +713,7 @@ fn rndne_f64_instructions() { #[test] fn gpu_rndne_f64() { - if !gpu_ready() { return; } + if !gpu_ready() || !doubles_ready() { return; } let p = prog(&[("V_RNDNE_F64", "ENC_VOP1", &[("VDST", 2), ("SRC0", V)], None)]); const INPUTS: [u64; 16] = [ 0.0f64.to_bits(), (-0.0f64).to_bits(), 0.5f64.to_bits(), (-0.5f64).to_bits(), @@ -700,7 +738,7 @@ fn gpu_rndne_f64() { #[test] fn gpu_frexp_f64_exp_and_mant() { - if !gpu_ready() { + if !gpu_ready() || !doubles_ready() { return; } let p = prog(&[ @@ -803,6 +841,9 @@ fn pair(v: &[u32], i: usize) -> f64 { /// the CPU's IEEE results, bit for bit, including the sign of zero, |x| ≥ 2^63, ±inf and NaN. #[test] fn gpu_f64_rounding_and_conversions() { + if !doubles_ready() { + return; + } for wave64 in gpu_waves() { f64_rounding_and_conversions(wave64); } @@ -858,6 +899,9 @@ fn f64_rounding_and_conversions(wave64: bool) { /// range get real roots within an ulp of the CPU's, a negative x gives NaN and −0 gives −0. #[test] fn gpu_f64_roots() { + if !doubles_ready() { + return; + } for wave64 in gpu_waves() { f64_roots(wave64); } @@ -898,6 +942,9 @@ fn f64_roots(wave64: bool) { /// denormal results, exponents beyond the f32 range of 2^n. #[test] fn gpu_ldexp_f64() { + if !doubles_ready() { + return; + } for wave64 in gpu_waves() { ldexp_f64(wave64); } @@ -1005,7 +1052,7 @@ fn gpu_valu_float_and_int() { /// unsigned adds, the packed 16-bit adds and the integer dot products. #[test] fn gpu_clamp_and_omod_per_instruction() { - if !gpu_ready() { + if !gpu_ready() || !doubles_ready() { return; } let p = |name: &'static str, f: &'static [(&'static str, u64)]| (name, "ENC_VOP3P", f, None); @@ -2654,7 +2701,7 @@ fn gpu_dword_addtid_per_lane_addresses() { #[test] fn gpu_valu_16_and_64_bit() { - if !gpu_ready() { + if !gpu_ready() || !doubles_ready() { return; } let p = prog(&[ @@ -4547,7 +4594,7 @@ fn gpu_more_atomics_sub_dword_scratch_valu() { /// Per-lane cells are deterministic; the three shared cells end in the unique winner's value. #[test] fn gpu_atomic_fcmpswap_x2() { - if !gpu_ready() { + if !gpu_ready() || !doubles_ready() { return; } let enc = |n: &'static str, e: &'static str, f: &[(&str, u64)]| encode(n, e, f, None).unwrap_or_else(|x| panic!("{n}: {x}")); @@ -4690,7 +4737,7 @@ fn gpu_atomic_fmin_fmax_negative_zero() { /// the f32 test. A seventh, per-lane cell checks the GLC return (global). #[test] fn gpu_atomic_fmin_fmax_x2() { - if !gpu_ready() { + if !gpu_ready() || !doubles_ready() { return; } let enc = |n: &'static str, e: &'static str, f: &[(&str, u64)]| encode(n, e, f, None).unwrap_or_else(|x| panic!("{n}: {x}")); @@ -6075,6 +6122,9 @@ fn gpu_fract_f32_edges() { /// when unordered, bit for bit against IEEE. #[test] fn gpu_f64_compares_with_nan() { + if !doubles_ready() { + return; + } for wave64 in gpu_waves() { f64_compares_with_nan(wave64); } @@ -6227,6 +6277,9 @@ fn ldexp_ref(x: f64, n: i32) -> Option<f64> { /// one rounding. sqrt must be within 1 ulp and rsq within 2. #[test] fn gpu_f64_math_random() { + if !doubles_ready() { + return; + } for wave64 in gpu_waves() { f64_math_random(wave64); } @@ -6335,7 +6388,11 @@ fn float_compares_random(wave64: bool) { }; let mut rng = Rng(0x1234_5678_9ABC_DEF1); let mut total_bad = 0usize; + let doubles = doubles_ready(); for ty in ["F32", "F64", "F16"] { + if ty == "F64" && !doubles { + continue; + } let (s0, s1) = if ty == "F64" { (V + 2, 4u64) } else { (V, 1u64) }; let names: Vec<String> = OPS.iter().map(|o| format!("V_CMP_{o}_{ty}")).collect(); let f3: Vec<[(&str, u64); 3]> = (0..16).map(|i| [("VDST", 20 + 2 * i as u64), ("SRC0", s0), ("SRC1", V + s1)]).collect(); @@ -6903,6 +6960,9 @@ fn gpu_ldexp_f32() { #[test] fn gpu_f64_literal_high_word() { + if !doubles_ready() { + return; + } for wave64 in gpu_waves() { let p = prog(&[ // 1.0 + literal(1.5 = 0x3FF8_0000_0000_0000) == 2.5 ``` </details> **Edit: full run of `main` `9aec53d`** (same machine, debug, one test per process, 60 s cap for `gpu_*`, 180 s otherwise). xcl lib (704): 641 passed, 28 failed, 12 timed out, 21 ignored, 2 skipped (`no wave64`). Every failure has a known cause: f64 (12, #787), 64-bit atomics (3, #983), sample offset (#982), UMA import check (#1024), WARP frame dump (#957), XMA2 (#890), GPU timestamps (#317 + the plan above), and 8 tests that need host-memory heaps or write watch, which D3DMetal doesn't have: #1060 skips six of them with "no GPU UMA" (E_NOTIMPL from `OpenExistingHeapFromAddress` only); `list_x` `write_buffer_immediate_on_open_existing_heap_visible_to_cpu` has the same cause, and `shader` `readable_answers_from_the_working_set_without_touching_pages` fails because Wine's `QueryWorkingSetEx` doesn't report the pages resident. The 12 timeouts are the draw / list hang: 8 GPU draw tests, `bind` create-list, two `title_textures` tests and `vram` d32s8. Other binaries: console_dlls_e2e 13, gpu_pso_e2e 7, xg_oracle 6 (12 ignored), console_shaders 3 (4 ignored), rpf_e2e 2, disasm_e2e 1, texture_states 1 passed; gpu_compute_e2e 1 passed, 1 timed out; e2e 1 passed, 1 failed (#750), 1 skipped; pls_quota 1 failed (#937); predication_e2e and sparse_reinit skip (`no GPU UMA`); heap_probe 4 ignored. **AI use:** Claude Code with Claude Opus 5.5 found and wrote both changes and the probe kernels, built them, ran the tests on this machine and wrote this comment. I checked the diffs and the results before posting.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 11:32 UTC · original

The Mac-lane changes from this thread, stacked: six open commits from five contributors apply together onto one main and each does what it claims on this host.

Why this is worth a comment here: those six are separate PRs, so nobody - including CI - has ever seen them in one tree. On a Mac host they all touch the same handful of host-dependent tests, so an interaction is the thing to rule out. Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal, Rosetta 2, Rust 1.100.0, x86_64-pc-windows-gnullvm (LLVM-MinGW, clang 23.1.6), --release --locked, one test per process (--exact <full test path> --nocapture --test-threads=1), a fresh data root per run.

The stack: onto main 6efdabc, in this order, git cherry-pick -x - all six apply cleanly, no conflicts, one build, 7 files +226 / -32:

76d2ff7 (#890) → 3c43506 (#957) → 3a6f95a (#982) → ab7ce43 (#983) → f242ea8 (#996) → 699975b (#1024)

In that single stacked tree (16 test executables, 708 tests in the lib binary):

test stacked tree
hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime ok 0.31 s
hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue ok 0.43 s, with the log line "no GPU timestamps on this host (a timestamp query resolved to 0)"
hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content SKIPPED … no WARP
gpu::recomp::tests::gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2 SKIPPED … no 64-bit atomics each
gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu ok 0.39 s
gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mips ok 0.47 s
gpu::recomp::tests::gpu_uma_import_check_at_init SKIPPED … no GPU UMA
predication_e2e: set_predication_buffer_state_and_kickoff SKIPPED … no GPU UMA

Baseline for the same runs, unstacked 6efdabc in a second tree: every test the six commits target fails there - mapped_frame_dump_… at present.rs:1099:67, gpu_uma_import_check_at_init at tests.rs:3371:5, gpu_sparse_vram_descriptors_buffers_and_xmem at tests.rs:3397:5 (left: 0, right: 4), gpu_memory_windows_reject_out_of_uma_aliasing at tests.rs:3342:54, write_buffer_immediate_on_open_existing_heap_visible_to_cpu at list_x.rs:5022:74. (The base failures of #982 and #983 were measured separately on their own base 9aec53d, #996's on 02bfd1d, #890's on 1ec4c98 / beaa245 / 6efdabc, #957's on 077ce40 - each pair is on the PR.)

Three still fail in the stack, unchanged - same assertion, line numbers shifted only by the lines the stack adds: gpu_sparse_vram_descriptors_buffers_and_xmem (tests.rs:3455:5, left: 0, right: 4), gpu_memory_windows_reject_out_of_uma_aliasing (tests.rs:3390:54), write_buffer_immediate_on_open_existing_heap_visible_to_cpu (list_x.rs:5027:74). So none of the six changes disturbs them, and they are the remaining Mac-host gap: the first two are in the arena / memory-window set that #1060 takes on, and the third sits in list_x.rs, outside that PR's file, so it keeps failing here - on this host OpenExistingHeapFromAddress is Not implemented (0x80004001), which is the premise that test's title depends on.

What this does not show: Windows or any other host (no Windows machine on this bench), and none of it is a gameplay result - these are library test binaries under Wine with no title running. It says the six changes are compatible with each other on a Mac host, not that they are correct in general; each pair's correctness is on its own PR.

Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna built both trees, ran the tests and drafted this comment; the line numbers, timings and codes are from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 11:32 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7130235649) **The Mac-lane changes from this thread, stacked: six open commits from five contributors apply together onto one `main` and each does what it claims on this host.** Why this is worth a comment here: those six are separate PRs, so nobody - including CI - has ever seen them in one tree. On a Mac host they all touch the same handful of host-dependent tests, so an interaction is the thing to rule out. Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal, Rosetta 2, Rust 1.100.0, `x86_64-pc-windows-gnullvm` (LLVM-MinGW, clang 23.1.6), `--release --locked`, one test per process (`--exact <full test path> --nocapture --test-threads=1`), a fresh data root per run. **The stack:** onto main `6efdabc`, in this order, `git cherry-pick -x` - all six apply cleanly, no conflicts, one build, 7 files `+226 / -32`: `76d2ff7` (#890) → `3c43506` (#957) → `3a6f95a` (#982) → `ab7ce43` (#983) → `f242ea8` (#996) → `699975b` (#1024) **In that single stacked tree** (16 test executables, 708 tests in the lib binary): | test | stacked tree | |---|---| | `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` | `ok` 0.31 s | | `hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` | `ok` 0.43 s, with the log line "no GPU timestamps on this host (a timestamp query resolved to 0)" | | `hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content` | `SKIPPED … no WARP` | | `gpu::recomp::tests::gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2` | `SKIPPED … no 64-bit atomics` each | | `gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu` | `ok` 0.39 s | | `gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mips` | `ok` 0.47 s | | `gpu::recomp::tests::gpu_uma_import_check_at_init` | `SKIPPED … no GPU UMA` | | `predication_e2e`: `set_predication_buffer_state_and_kickoff` | `SKIPPED … no GPU UMA` | **Baseline for the same runs, unstacked `6efdabc` in a second tree:** every test the six commits target fails there - `mapped_frame_dump_…` at `present.rs:1099:67`, `gpu_uma_import_check_at_init` at `tests.rs:3371:5`, `gpu_sparse_vram_descriptors_buffers_and_xmem` at `tests.rs:3397:5` (`left: 0, right: 4`), `gpu_memory_windows_reject_out_of_uma_aliasing` at `tests.rs:3342:54`, `write_buffer_immediate_on_open_existing_heap_visible_to_cpu` at `list_x.rs:5022:74`. (The base failures of #982 and #983 were measured separately on their own base `9aec53d`, #996's on `02bfd1d`, #890's on `1ec4c98` / `beaa245` / `6efdabc`, #957's on `077ce40` - each pair is on the PR.) **Three still fail in the stack, unchanged** - same assertion, line numbers shifted only by the lines the stack adds: `gpu_sparse_vram_descriptors_buffers_and_xmem` (`tests.rs:3455:5`, `left: 0, right: 4`), `gpu_memory_windows_reject_out_of_uma_aliasing` (`tests.rs:3390:54`), `write_buffer_immediate_on_open_existing_heap_visible_to_cpu` (`list_x.rs:5027:74`). So none of the six changes disturbs them, and they are the remaining Mac-host gap: the first two are in the arena / memory-window set that #1060 takes on, and the third sits in `list_x.rs`, outside that PR's file, so it keeps failing here - on this host `OpenExistingHeapFromAddress` is `Not implemented (0x80004001)`, which is the premise that test's title depends on. **What this does not show:** Windows or any other host (no Windows machine on this bench), and none of it is a gameplay result - these are library test binaries under Wine with no title running. It says the six changes are compatible with each other on a Mac host, not that they are correct in general; each pair's correctness is on its own PR. Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. **AI use**: GPT-6 Luna built both trees, ran the tests and drafted this comment; the line numbers, timings and codes are from those runs.
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-24 11:58 UTC · original

@⁠Ahmet-Dedeler, @⁠vakaobr: a proposal before I write it, for the runtime side of the 64-bit atomics gap that #983 reports for the tests.

On D3DMetal, a program with InterlockedAdd64, Or64, Exchange64, CompareExchange64 or a signed Min64 / Max64 runs as a no-op (#983). So a title shader that uses one of the *_atomic_*_x2 operations computes or draws nothing, and nothing reports it. As #983 says, compare-swap, exchange and signed min / max cannot be built from 32-bit atomics without a lock. Part of the set can, though, with the same final memory as the 64-bit atomic:

  • add_x2 / sub_x2: InterlockedAdd on the low dword, then on the high dword with the carry or borrow taken from the low add's old value. Adds commute, so the end state is exact.
  • and_x2 / or_x2 / xor_x2: one 32-bit op per dword, with an exact end state.
  • umin_x2 / umax_x2: the 64-bit op itself works here.

The cost is with GLC: the old value the split forms return is made of the two halves' old values, and another lane's update can land between the two halves.

Measured on this Mac (a temporary test, one thread, with a marker store to show the shader ran):

  • 32-bit InterlockedAnd / Or / Xor / Min are correct.
  • The split add is correct for +1 from 0x1_FFFFFFFF (carry), for +0x2_FFFFFFFF from 0x1_00000001, and for −1 from 0x2_00000000 (borrow).
  • Unsigned InterlockedMax64 / Min64 update the cell with and without the returned value. I did not check the returned value itself.

Plan:

  • A probe at device creation (like #983's) sets a translation option when 64-bit atomics write nothing.
  • With the option on, rmw64 emits the split forms for add / sub / and / or / xor and keeps umin / umax. The rest (cmpswap, swap, smin / smax, inc / dec, the float ones) keeps today's code and stays a no-op on this host.
  • The option goes into the shader cache key. With it off, the HLSL is unchanged, so Windows output stays the same.
  • Each split form gets a GPU test, run on this Mac.

Two questions before I start:

  1. Is this wanted, with the torn GLC return documented?
  2. It changes the Mac runtime path, so it needs an xcl-smoke pair from a Mac with a title, and I have none here. @⁠mikebuckets171, could you run it when the PR is up?

AI use: Claude Code, Claude Opus 5.5 ran the measurements on this machine and wrote this proposal.

**@⁠us3r40456** on GitHub · 2026-11-24 11:58 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7130797049) @⁠Ahmet-Dedeler, @⁠vakaobr: a proposal before I write it, for the runtime side of the 64-bit atomics gap that #983 reports for the tests. On D3DMetal, a program with `InterlockedAdd64`, `Or64`, `Exchange64`, `CompareExchange64` or a signed `Min64` / `Max64` runs as a no-op (#983). So a title shader that uses one of the `*_atomic_*_x2` operations computes or draws nothing, and nothing reports it. As #983 says, compare-swap, exchange and signed min / max cannot be built from 32-bit atomics without a lock. Part of the set can, though, with the same final memory as the 64-bit atomic: - `add_x2` / `sub_x2`: `InterlockedAdd` on the low dword, then on the high dword with the carry or borrow taken from the low add's old value. Adds commute, so the end state is exact. - `and_x2` / `or_x2` / `xor_x2`: one 32-bit op per dword, with an exact end state. - `umin_x2` / `umax_x2`: the 64-bit op itself works here. The cost is with GLC: the old value the split forms return is made of the two halves' old values, and another lane's update can land between the two halves. **Measured on this Mac** (a temporary test, one thread, with a marker store to show the shader ran): - 32-bit `InterlockedAnd` / `Or` / `Xor` / `Min` are correct. - The split add is correct for +1 from 0x1_FFFFFFFF (carry), for +0x2_FFFFFFFF from 0x1_00000001, and for −1 from 0x2_00000000 (borrow). - Unsigned `InterlockedMax64` / `Min64` update the cell with and without the returned value. I did not check the returned value itself. **Plan:** - A probe at device creation (like #983's) sets a translation option when 64-bit atomics write nothing. - With the option on, `rmw64` emits the split forms for add / sub / and / or / xor and keeps umin / umax. The rest (cmpswap, swap, smin / smax, inc / dec, the float ones) keeps today's code and stays a no-op on this host. - The option goes into the shader cache key. With it off, the HLSL is unchanged, so Windows output stays the same. - Each split form gets a GPU test, run on this Mac. Two questions before I start: 1. Is this wanted, with the torn GLC return documented? 2. It changes the Mac runtime path, so it needs an `xcl-smoke` pair from a Mac with a title, and I have none here. @⁠mikebuckets171, could you run it when the PR is up? **AI use:** Claude Code, Claude Opus 5.5 ran the measurements on this machine and wrote this proposal.
Author
Owner

@⁠saltignefer on GitHub · 2026-11-24 12:04 UTC · original

Note

🤖 gemini-4-neon responding on behalf of saltis

Sharing a working alternative macOS backend path in case it helps with the closed-source D3DMetal gaps being tracked here (64-bit atomics, FP64, mesh shaders, UMA).

We are maintaining a Mesa KosmicKrisp Vulkan-on-Metal4 fork paired with vkd3d-proton 3.1 under CrossOver Preview on Apple Silicon, and testing it directly against XCL's full 94-test ::gpu_ suite (93 active + 1 #[ignore], Apple M3 Max):

Backend ok SKIPPED (wave64-only) FAILED ABORT Raw cargo test pass
Apple D3DMetal 3.0 68 2 23 0 70 / 93
saltignefer/kosmickrisp (d91b74ff) + vkd3d-proton 3.1 + macos-kosmickrisp 88 2 3 0 90 / 93

(The 2 SKIPPED tests are gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware, which require 64-lane hardware waves.)

What works on KosmicKrisp + vkd3d-proton 3.1 now

  • 64-bit atomics, FP64, NGG / mesh shaders, VS/PS wave64 split: all pass (fixed nir_fp_preserve_nan / precise::fma in KosmicKrisp for v_rsq_f64 and added a 1-lane VS subgroup fallback).
  • Zero-copy UMA under Rosetta 2 (5 / 5 UMA & multi-window tests pass): fixed OpenExistingHeapFromAddress failures after Wine MEM_WRITE_WATCH splits 16 KiB mappings into 4 KiB XNU vm_map_entry fragments via in-place mach_vm_remap defragmentation on import.
  • Zero vkd3d-proton iface->lpVtbl aborts (0 / 93): added FenceProxy, make_unadopt_self thunks for Resource/Heap/PipelineState/DescriptorHeap, UnadoptGuard wrappers, and skipped adopting zero-override interfaces under Wine.

Remaining 3 failures

  1. gpu_nonfused_mad_and_mac_prevent_fma_contraction — vkd3d-proton's dxil-spirv lowers non-precise mad to OpFMul + OpFAdd rather than Fma.
  2. gpu_ps_image_sample_offset_implicit_lod_between_mips — Apple Silicon trilinear mip-offset behavior (25.21875 vs 26); fails identically on D3DMetal 3.0.
  3. gpu_sparse_vram_descriptors_buffers_and_xmem — no longer aborts, but reads 0 instead of 1077 (sparse 4 GiB reserved buffer / UpdateTileMappings path still open).

Repos & builds

If anyone here wants to test this stack on retail titles or help close the sparse-VRAM / Vulkan gaps, contributions and test reports are very welcome.

**@⁠saltignefer** on GitHub · 2026-11-24 12:04 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7130938126) > [!NOTE] > 🤖 **gemini-4-neon responding on behalf of saltis** Sharing a working alternative macOS backend path in case it helps with the closed-source D3DMetal gaps being tracked here (64-bit atomics, FP64, mesh shaders, UMA). We are maintaining a **Mesa KosmicKrisp** Vulkan-on-Metal4 fork paired with **vkd3d-proton 3.1** under CrossOver Preview on Apple Silicon, and testing it directly against XCL's full 94-test `::gpu_` suite (93 active + 1 `#[ignore]`, Apple M3 Max): | Backend | `ok` | `SKIPPED` (wave64-only) | `FAILED` | `ABORT` | Raw `cargo test` pass | |---|---:|---:|---:|---:|---:| | Apple D3DMetal 3.0 | 68 | 2 | 23 | 0 | 70 / 93 | | `saltignefer/kosmickrisp` (`d91b74ff`) + `vkd3d-proton 3.1` + `macos-kosmickrisp` | **88** | **2** | **3** | **0** | **90 / 93** | *(The 2 `SKIPPED` tests are `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`, which require 64-lane hardware waves.)* ### What works on KosmicKrisp + `vkd3d-proton 3.1` now - **64-bit atomics, FP64, NGG / mesh shaders, VS/PS wave64 split:** all pass (fixed `nir_fp_preserve_nan` / `precise::fma` in KosmicKrisp for `v_rsq_f64` and added a 1-lane VS subgroup fallback). - **Zero-copy UMA under Rosetta 2 (5 / 5 UMA & multi-window tests pass):** fixed `OpenExistingHeapFromAddress` failures after Wine `MEM_WRITE_WATCH` splits 16 KiB mappings into 4 KiB XNU `vm_map_entry` fragments via in-place `mach_vm_remap` defragmentation on import. - **Zero `vkd3d-proton` `iface->lpVtbl` aborts (0 / 93):** added `FenceProxy`, `make_unadopt_self` thunks for `Resource`/`Heap`/`PipelineState`/`DescriptorHeap`, `UnadoptGuard` wrappers, and skipped adopting zero-override interfaces under Wine. ### Remaining 3 failures 1. `gpu_nonfused_mad_and_mac_prevent_fma_contraction` — `vkd3d-proton`'s `dxil-spirv` lowers non-`precise` `mad` to `OpFMul` + `OpFAdd` rather than `Fma`. 2. `gpu_ps_image_sample_offset_implicit_lod_between_mips` — Apple Silicon trilinear mip-offset behavior (`25.21875` vs `26`); fails identically on D3DMetal 3.0. 3. `gpu_sparse_vram_descriptors_buffers_and_xmem` — no longer aborts, but reads `0` instead of `1077` (sparse 4 GiB reserved buffer / `UpdateTileMappings` path still open). ### Repos & builds - **KosmicKrisp fork + prebuilt macOS `x86_64` (CrossOver) / `arm64` tarballs:** https://github.com/saltignefer/kosmickrisp (release [`v2026.11.24`](https://github.com/saltignefer/kosmickrisp/releases/tag/v2026.11.24)) - **XCL branch (`vkd3d-proton` vtable guards + macOS cross-build/suite runner):** https://github.com/saltignefer/xcl/tree/macos-kosmickrisp If anyone here wants to test this stack on retail titles or help close the sparse-VRAM / Vulkan gaps, contributions and test reports are very welcome.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 12:22 UTC · original

@⁠us3r40456: +1 to the split forms. One thing from the probes behind #983 that changes the umin / umax part of the plan: on this M5 Pro (CrossOver 26.3, D3DMetal 3.0), unsigned InterlockedMin64 / InterlockedMax64 work only in the non-returning form. When the shader stores the returned old value, the program writes nothing, like the other 64-bit atomics: one thread on a raw buffer bound as a root UAV, cell 0x00000001FFFFFFF0, the marker store lost too. Non-returning, both are right, also with 64 lanes on one cell. If your test didn't use the returned value, DXC may have emitted the non-returning form, which would explain the difference. So umin_x2 / umax_x2 with GLC would need the split (or a skip) as well. Also on groupshared memory, even the non-returning InterlockedMax64 wrote nothing here.

@⁠saltignefer: gpu_ps_image_sample_offset_implicit_lod_between_mips at 25.21875 against 26 is what #982 fixes on D3DMetal: the host computes the LOD as 0.2421875 instead of 0.25, and the program had no s_wqm, so helper lanes read u / v as 0. #982 takes the expected values from the host's own LOD and adds s_wqm. If your stack gives the same 25.21875, #982 should fix it there too. I have not run your stack.

AI use: Claude Code, Claude Opus 5.5 ran the probes on this machine and wrote this comment.

**@⁠vakaobr** on GitHub · 2026-11-24 12:22 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7131341167) @⁠us3r40456: +1 to the split forms. One thing from the probes behind #983 that changes the umin / umax part of the plan: on this M5 Pro (CrossOver 26.3, D3DMetal 3.0), unsigned `InterlockedMin64` / `InterlockedMax64` work only in the non-returning form. When the shader stores the returned old value, the program writes nothing, like the other 64-bit atomics: one thread on a raw buffer bound as a root UAV, cell `0x00000001FFFFFFF0`, the marker store lost too. Non-returning, both are right, also with 64 lanes on one cell. If your test didn't use the returned value, DXC may have emitted the non-returning form, which would explain the difference. So `umin_x2` / `umax_x2` with GLC would need the split (or a skip) as well. Also on groupshared memory, even the non-returning `InterlockedMax64` wrote nothing here. @⁠saltignefer: `gpu_ps_image_sample_offset_implicit_lod_between_mips` at 25.21875 against 26 is what #982 fixes on D3DMetal: the host computes the LOD as 0.2421875 instead of 0.25, and the program had no `s_wqm`, so helper lanes read u / v as 0. #982 takes the expected values from the host's own LOD and adds `s_wqm`. If your stack gives the same 25.21875, #982 should fix it there too. I have not run your stack. AI use: Claude Code, Claude Opus 5.5 ran the probes on this machine and wrote this comment.
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-24 12:38 UTC · original

@⁠mikebuckets171 thanks for tracing #996's write path. That settles it on my side: #996 (@⁠shortside) covers the timestamp change I had kept local (same frequency gate, plus the zero-resolve trigger that the lib tests actually reach), so I am dropping mine and will not open it. The cpu_writes::after ordering question to @⁠ivall above stands on its own, independent of either change.

Updates on my two PRs, from the reviews they got:

  • #787 (f64 skips): gpu_atomic_fcmpswap_x2 and gpu_atomic_fmin_fmax_x2 are out of it, as @⁠vakaobr and @⁠us3r40456 pointed out (no doubles in their programs, they belong to #983). Now 11 tests skip whole plus the F64 part of gpu_float_compares_random.
  • #750 (non-PC stage → fallback PSO): has @⁠Anon64's Windows smoke pair in its description and the description check is green.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Lucasyudi** on GitHub · 2026-11-24 12:38 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7131721220) @⁠mikebuckets171 thanks for tracing #996's write path. That settles it on my side: #996 (@⁠shortside) covers the timestamp change I had kept local (same frequency gate, plus the zero-resolve trigger that the lib tests actually reach), so I am dropping mine and will not open it. The `cpu_writes::after` ordering question to @⁠ivall above stands on its own, independent of either change. Updates on my two PRs, from the reviews they got: - #787 (f64 skips): `gpu_atomic_fcmpswap_x2` and `gpu_atomic_fmin_fmax_x2` are out of it, as @⁠vakaobr and @⁠us3r40456 pointed out (no doubles in their programs, they belong to #983). Now 11 tests skip whole plus the F64 part of `gpu_float_compares_random`. - #750 (non-PC stage → fallback PSO): has @⁠Anon64's Windows smoke pair in its description and the description check is green. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠shortside on GitHub · 2026-11-24 12:46 UTC · original

@⁠Ahmet-Dedeler where can a second pair of hands help most with getting the port into main? I have an M5 Pro (CrossOver 26.3, D3DMetal). I don't have a title on it yet, so no xcl-smoke runs from me for now. Two things I could take, tell me which you want or what else:

  1. Take one piece of mac-on-main-wip that you have not started splitting out, rebase it onto current main as a small PR, with you credited as the author of the change. You pick the piece.
  2. Test your pr/native-host-vtables and pr/standin-dual-source branches rebased on today's main before you open them (unit tests and the test title, not a retail title).

For context, today I ran main 47efa2e + #553 #750 #794 #890 #957 #982 #983 #996 #1024 as one local tree on this Mac. Non-GPU lib tests: 601 passed, 6 failed, 1 crashed, 20 ignored. GPU lib tests, one per process: 69 passed, 6 skipped, 18 failed, 1 hung. Integration: 12 of 15 binaries pass; the test title gets 33 checks in and then dies at the D3DMetal vtable crash, and gpu_compute_e2e hangs. Apart from the f64 tests (#787 did not merge cleanly into that tree), what is left is mostly what the port fixes: the vtable crash and the tests that need OpenExistingHeapFromAddress. So the port is the part that is missing on main now.

AI use: Claude Code with Claude Fable 5.2 ran the tests and drafted this; I'm deciding what to pick up.

**@⁠shortside** on GitHub · 2026-11-24 12:46 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7131904441) @⁠Ahmet-Dedeler where can a second pair of hands help most with getting the port into `main`? I have an M5 Pro (CrossOver 26.3, D3DMetal). I don't have a title on it yet, so no `xcl-smoke` runs from me for now. Two things I could take, tell me which you want or what else: 1. Take one piece of `mac-on-main-wip` that you have not started splitting out, rebase it onto current `main` as a small PR, with you credited as the author of the change. You pick the piece. 2. Test your `pr/native-host-vtables` and `pr/standin-dual-source` branches rebased on today's `main` before you open them (unit tests and the test title, not a retail title). For context, today I ran `main` `47efa2e` + #553 #750 #794 #890 #957 #982 #983 #996 #1024 as one local tree on this Mac. Non-GPU lib tests: 601 passed, 6 failed, 1 crashed, 20 ignored. GPU lib tests, one per process: 69 passed, 6 skipped, 18 failed, 1 hung. Integration: 12 of 15 binaries pass; the test title gets 33 checks in and then dies at the D3DMetal vtable crash, and `gpu_compute_e2e` hangs. Apart from the f64 tests (#787 did not merge cleanly into that tree), what is left is mostly what the port fixes: the vtable crash and the tests that need `OpenExistingHeapFromAddress`. So the port is the part that is missing on `main` now. AI use: Claude Code with Claude Fable 5.2 ran the tests and drafted this; I'm deciding what to pick up.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 13:36 UTC · original

@⁠us3r40456 — yes, that pair can run here when the PR is up. Two measured things first, one of which supports the split forms.

What I have for it. A title on this bench, on its own drive, run through xcl-smoke with the run bounded by XCL_RUN_SECONDS (crates/xcl/src/host.rs), the same warm data root for both sides, one exclusive run at a time, base and head each built from a clean tree, plus the plain-D3D12 probe (no XCL, reads no files) for the device-level facts. Only counts, timings and codes get posted.

One thing that argues your split emulations will actually compute. The missing 64-bit atomics here do not poison the rest of the program that holds them:

  • gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu at 9aec53d fails on exactly assertion left == right failed: global_atomic_inc wraps at 10, left: 0 (tests.rs:4632) — the 64-bit atomic did nothing.
  • The same test at #983's head ab7ce43 - with its three 64-bit global atomics moved out into the new gpu_global_atomic_add_inc_dec_x2 - runs and passes on this host (0.39-0.62 s, ok. 1 passed; 0 failed).

So the sub-dword scratch work, the VALU work and the 32-bit atomics in that same program are fine on D3DMetal; only the 64-bit atomic results are absent. A rmw64 that emits 32-bit InterlockedAdd / And / Or / Xor per dword should produce real results here rather than a different flavour of nothing, which is the assumption your plan rests on. It also means a "no 64-bit atomics" host is not a "no atomics" host, so the option you add to the cache key is the right granularity.

And the failure mode vakaobr describes is what I see too. gpu_atomic_fcmpswap_x2 at 9aec53d reports left: 4609434218613702656 (tests.rs:4737), which is 0x3FF8000000000000 — the test's own INIT (const INIT: u64 = 0x3FF8_0000_0000_0000, the f64 bits of 1.5) written before the atomic and never replaced. The compare-exchange left the cell exactly as it was, including the shader's other stores in that program. That fits "the whole program writes nothing" rather than "the atomic's result is wrong", and it is the reason I would read your split forms as the fix for a missing store rather than a wrong value.

What the pair can and cannot show on main today — worth knowing before you write the PR, because it decides what the report is worth. On this host, main at 47efa2e makes 0 presents and 0 draws: the title loads and re-presents nothing, so a base/head xcl-smoke pair on main can only prove nothing regressed (0 against 0). Where the same pair carries information is stacked on the Mac port branches: with #541 the title reached 2,576 frames and 41,914 translated draws on a warm root here. So I would run your pair both ways — plain main, where the reading is "no regression, and the unit tests plus your new GPU tests are the real evidence", and stacked with the port pieces, where the frames and draws move and a torn GLC return or a wrong split would show up as a changed picture. Say which you want when the PR is up, or both.

Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, x86_64-pc-windows-gnullvm (LLVM-MinGW, clang 23.1.6), --release --locked. AI use: GPT-6 Luna ran the #983 pair whose numbers are quoted here and drafted this reply; the counts and codes are from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 13:36 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7133062862) **@⁠us3r40456 — yes, that pair can run here when the PR is up. Two measured things first, one of which supports the split forms.** **What I have for it.** A title on this bench, on its own drive, run through `xcl-smoke` with the run bounded by `XCL_RUN_SECONDS` (`crates/xcl/src/host.rs`), the same warm data root for both sides, one exclusive run at a time, base and head each built from a clean tree, plus the plain-D3D12 probe (no XCL, reads no files) for the device-level facts. Only counts, timings and codes get posted. **One thing that argues your split emulations will actually compute.** The missing 64-bit atomics here do not poison the rest of the program that holds them: - `gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu` at `9aec53d` fails on exactly `assertion left == right failed: global_atomic_inc wraps at 10`, `left: 0` (`tests.rs:4632`) — the 64-bit atomic did nothing. - The same test at #983's head `ab7ce43` - with its three 64-bit global atomics moved out into the new `gpu_global_atomic_add_inc_dec_x2` - **runs and passes on this host** (0.39-0.62 s, `ok. 1 passed; 0 failed`). So the sub-dword scratch work, the VALU work and the 32-bit atomics in that same program are fine on D3DMetal; only the 64-bit atomic results are absent. A `rmw64` that emits 32-bit `InterlockedAdd` / `And` / `Or` / `Xor` per dword should produce real results here rather than a different flavour of nothing, which is the assumption your plan rests on. It also means a "no 64-bit atomics" host is not a "no atomics" host, so the option you add to the cache key is the right granularity. **And the failure mode vakaobr describes is what I see too.** `gpu_atomic_fcmpswap_x2` at `9aec53d` reports `left: 4609434218613702656` (`tests.rs:4737`), which is `0x3FF8000000000000` — the test's own `INIT` (`const INIT: u64 = 0x3FF8_0000_0000_0000`, the f64 bits of 1.5) written before the atomic and never replaced. The compare-exchange left the cell exactly as it was, including the shader's other stores in that program. That fits "the whole program writes nothing" rather than "the atomic's result is wrong", and it is the reason I would read your split forms as the fix for a *missing store* rather than a wrong value. **What the pair can and cannot show on `main` today** — worth knowing before you write the PR, because it decides what the report is worth. On this host, `main` at `47efa2e` makes **0 presents and 0 draws**: the title loads and re-presents nothing, so a base/head `xcl-smoke` pair on `main` can only prove *nothing regressed* (0 against 0). Where the same pair carries information is stacked on the Mac port branches: with #541 the title reached 2,576 frames and 41,914 translated draws on a warm root here. So I would run your pair both ways — plain `main`, where the reading is "no regression, and the unit tests plus your new GPU tests are the real evidence", and stacked with the port pieces, where the frames and draws move and a torn GLC return or a wrong split would show up as a changed picture. Say which you want when the PR is up, or both. Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, `x86_64-pc-windows-gnullvm` (LLVM-MinGW, clang 23.1.6), `--release --locked`. **AI use**: GPT-6 Luna ran the #983 pair whose numbers are quoted here and drafted this reply; the counts and codes are from those runs.
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-24 13:39 UTC · original

@⁠shortside on #787 not merging into your tree: that was its earlier head 8b73108, which put no_doubles() on the guards of gpu_atomic_fcmpswap_x2 / gpu_atomic_fmin_fmax_x2, the same lines #983 changes to no_int64_atomics(). Those two are out of #787 now (they have no doubles). The current head 46695ab is rebased on main 930e8b4 and merges cleanly on top of #553 #750 #794 #890 #957 #982 #983 #996 #1024. Here, the 12 f64 / mixed tests skip with "no f64" again on the rebased head.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Lucasyudi** on GitHub · 2026-11-24 13:39 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7133154500) @⁠shortside on #787 not merging into your tree: that was its earlier head `8b73108`, which put `no_doubles()` on the guards of `gpu_atomic_fcmpswap_x2` / `gpu_atomic_fmin_fmax_x2`, the same lines #983 changes to `no_int64_atomics()`. Those two are out of #787 now (they have no doubles). The current head `46695ab` is rebased on `main` `930e8b4` and merges cleanly on top of #553 #750 #794 #890 #957 #982 #983 #996 #1024. Here, the 12 f64 / mixed tests skip with "no f64" again on the rebased head. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 13:48 UTC · original

Sorry for going quiet here, I was heads down on getting the title further and didn't keep up with the thread. Thanks for all the runs, this is way more testing than I could do on one Mac. Catching up on what was asked:

@⁠shortside yes to both, thanks.

  1. Testing pr/native-host-vtables (ddf3be7) and pr/standin-dual-source (#666) on today's main would help a lot. Both are one commit on 508a0c7, so 111 commits behind now. I haven't rebased them because that would throw away the runs people already posted against those heads.
  2. If you want a piece of mac-on-main-wip to split out, the depth formats one is the most self-contained: 8fc0600 (every depth + stencil family is depth only on D3DMetal) with its test in aaf191b. It has a unit test and doesn't need a title. Take it, rebase it on main, open it under your name.

@⁠vakaobr the fixture fix looks right to me, and your table matches what Kalmarv traced. Can you open it as a PR against Ahmet-Dedeler/xcl, base mac-on-main-wip? I'll merge it there so the branch stops crashing in those tests for everyone else running it.

@⁠us3r40456 +1 on the split forms for add_x2 / sub_x2 and the bitwise ones, go ahead. vakaobr's note about umin / umax only working in the non-returning form sounds like the part to pin with a test first. Also thanks for the pr/native-host-vtables run, that was the missing second Mac for it.

Where the port itself is, so nobody chases the wrong thing: on my Mac the title gets through sign-in and the first-run menus at 30 fps with full text, then goes into world loading. It stops there. The world textures come in as BCPack requests, which XCL refuses, nothing new reaches the screen for a while, and the title's GPU-progress watchdog ends the run (the same +0x23cf683 site as #505). So for a Mac host the next real blocker is the same as on Windows, BCPack plus whatever that watchdog waits on, not something D3DMetal specific.

What I still owe: the full suite counts on pr/native-host-vtables before I open it, and the pieces of mac-on-main-wip nobody has claimed (Rosetta 2 masked stores, the unified memory copy path, content-compared title textures). If anyone wants one of those, say so here and it's yours.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 13:48 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7133365549) Sorry for going quiet here, I was heads down on getting the title further and didn't keep up with the thread. Thanks for all the runs, this is way more testing than I could do on one Mac. Catching up on what was asked: @⁠shortside yes to both, thanks. 1. Testing `pr/native-host-vtables` (ddf3be7) and `pr/standin-dual-source` (#666) on today's `main` would help a lot. Both are one commit on 508a0c7, so 111 commits behind now. I haven't rebased them because that would throw away the runs people already posted against those heads. 2. If you want a piece of `mac-on-main-wip` to split out, the depth formats one is the most self-contained: 8fc0600 (every depth + stencil family is depth only on D3DMetal) with its test in aaf191b. It has a unit test and doesn't need a title. Take it, rebase it on `main`, open it under your name. @⁠vakaobr the fixture fix looks right to me, and your table matches what Kalmarv traced. Can you open it as a PR against `Ahmet-Dedeler/xcl`, base `mac-on-main-wip`? I'll merge it there so the branch stops crashing in those tests for everyone else running it. @⁠us3r40456 +1 on the split forms for `add_x2` / `sub_x2` and the bitwise ones, go ahead. vakaobr's note about `umin` / `umax` only working in the non-returning form sounds like the part to pin with a test first. Also thanks for the `pr/native-host-vtables` run, that was the missing second Mac for it. Where the port itself is, so nobody chases the wrong thing: on my Mac the title gets through sign-in and the first-run menus at 30 fps with full text, then goes into world loading. It stops there. The world textures come in as BCPack requests, which XCL refuses, nothing new reaches the screen for a while, and the title's GPU-progress watchdog ends the run (the same `+0x23cf683` site as #505). So for a Mac host the next real blocker is the same as on Windows, BCPack plus whatever that watchdog waits on, not something D3DMetal specific. What I still owe: the full suite counts on `pr/native-host-vtables` before I open it, and the pieces of `mac-on-main-wip` nobody has claimed (Rosetta 2 masked stores, the unified memory copy path, content-compared title textures). If anyone wants one of those, say so here and it's yours.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 13:49 UTC · original

Correction to one line in my note above, and the probe readback from this host.

The failure I quoted is not the 64-bit atomic's own assert. gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu at 9aec53d aborts on its first assert — assert_eq!(r.mem[0x600 / 4], 64 % 11, "global_atomic_inc wraps at 10"), crates/xcl/src/gpu/recomp/tests.rs:4632, left: 0, right: 9. That is the 32-bit global_atomic_inc; the three *_x2 asserts come later in the same test and are never reached. So what I actually measured is the mode #983's own comment describes: a program that contains a 64-bit atomic writes nothing at all, its 32-bit atomics included. Same host, ab7ce43, where the three *_x2 cases move out into gpu_global_atomic_add_inc_dec_x2: that program passes (ok. 1 passed; 0 failed), and the new test is skipped by the probe line. My earlier bullet said "the 64-bit atomic did nothing"; the sharper statement is "the whole program produced no writes", which is the stronger support for a lowering change rather than a host quirk.

The probe readback, which the split-form plan rests on. The probe seeds the UAV with [0xFFFF_FFFF, 1, 0, 0], runs mem.InterlockedAdd64(0, 0x100000001ull, o) and then mem.Store2(8, uint2((uint)o, (uint)(o >> 32))) in a cs_6_6 kernel, and expects [0, 3, 0xFFFF_FFFF, 1] — the carry into the high dword, and the old value the call returned parked at offset 8. This host hands back [0xffffffff, 1, 0, 0] — the seed, unchanged: the add did not happen, nothing carried, and the Store2 of the returned old value landed nowhere. It prints 64-bit atomics do not work on this GPU (InterlockedAdd64 probe: [ffffffff, 1, 0, 0]) – skipping and gates gpu_atomic_fcmpswap_x2 and gpu_atomic_fmin_fmax_x2 into SKIPPED … no 64-bit atomics. Same reading in the runs I took today as part of a seven-PR stack, so it is stable rather than a one-off.

Emitter side, for whoever writes the split forms. At 47efa2e, crates/xcl/src/gpu/recomp/emit.rs maps "add" | "sub" => "InterlockedAdd64", and / or / xor to InterlockedAnd64 / Or64 / Xor64, swap to InterlockedExchange64, umin / umax to InterlockedMin64 / Max64, and smin / smax to InterlockedMin64 / Max64 on int64_t through an out-parameter. So every 64-bit atomic form a title can reach goes through a construct this host answers with nothing, which is why the gate has to be per-family rather than one host flag. My probe evidence covers InterlockedAdd64 only; the "unsigned min / max do work" part is what #983 and @⁠vakaobr measured, and my runs neither confirm nor contradict it.

Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, x86_64-pc-windows-gnullvm (LLVM-MinGW, clang 23.1.6), --release --locked. AI use: GPT-6 Luna read the logs and the source and drafted this; the assertions, line numbers and readbacks are quoted from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 13:49 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7133392001) **Correction to one line in my note above, and the probe readback from this host.** The failure I quoted is not the 64-bit atomic's own assert. `gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu` at `9aec53d` aborts on its **first** assert — `assert_eq!(r.mem[0x600 / 4], 64 % 11, "global_atomic_inc wraps at 10")`, `crates/xcl/src/gpu/recomp/tests.rs:4632`, `left: 0`, `right: 9`. That is the 32-bit `global_atomic_inc`; the three `*_x2` asserts come later in the same test and are never reached. So what I actually measured is the mode #983's own comment describes: a program that contains a 64-bit atomic **writes nothing at all**, its 32-bit atomics included. Same host, `ab7ce43`, where the three `*_x2` cases move out into `gpu_global_atomic_add_inc_dec_x2`: that program passes (`ok. 1 passed; 0 failed`), and the new test is skipped by the probe line. My earlier bullet said "the 64-bit atomic did nothing"; the sharper statement is "the whole program produced no writes", which is the stronger support for a lowering change rather than a host quirk. **The probe readback, which the split-form plan rests on.** The probe seeds the UAV with `[0xFFFF_FFFF, 1, 0, 0]`, runs `mem.InterlockedAdd64(0, 0x100000001ull, o)` and then `mem.Store2(8, uint2((uint)o, (uint)(o >> 32)))` in a `cs_6_6` kernel, and expects `[0, 3, 0xFFFF_FFFF, 1]` — the carry into the high dword, and the old value the call returned parked at offset 8. This host hands back `[0xffffffff, 1, 0, 0]` — the seed, unchanged: the add did not happen, nothing carried, and the `Store2` of the returned old value landed nowhere. It prints `64-bit atomics do not work on this GPU (InterlockedAdd64 probe: [ffffffff, 1, 0, 0]) – skipping` and gates `gpu_atomic_fcmpswap_x2` and `gpu_atomic_fmin_fmax_x2` into `SKIPPED … no 64-bit atomics`. Same reading in the runs I took today as part of a seven-PR stack, so it is stable rather than a one-off. **Emitter side, for whoever writes the split forms.** At `47efa2e`, `crates/xcl/src/gpu/recomp/emit.rs` maps `"add" | "sub" => "InterlockedAdd64"`, `and / or / xor` to `InterlockedAnd64 / Or64 / Xor64`, `swap` to `InterlockedExchange64`, `umin / umax` to `InterlockedMin64 / Max64`, and `smin / smax` to `InterlockedMin64 / Max64` on `int64_t` through an out-parameter. So every 64-bit atomic form a title can reach goes through a construct this host answers with nothing, which is why the gate has to be per-family rather than one host flag. My probe evidence covers `InterlockedAdd64` only; the "unsigned min / max do work" part is what #983 and @⁠vakaobr measured, and my runs neither confirm nor contradict it. Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, `x86_64-pc-windows-gnullvm` (LLVM-MinGW, clang 23.1.6), `--release --locked`. **AI use**: GPT-6 Luna read the logs and the source and drafted this; the assertions, line numbers and readbacks are quoted from those runs.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 14:01 UTC · original

@⁠Ahmet-Dedeler: the fixture fix is https://github.com/Ahmet-Dedeler/xcl/pull/1, against mac-on-main-wip. With #996's commit (f242ea8) cherry-picked on top, the eighth fixture test, timestamps_outside_unified_memory_land_after_the_queue, passes too (M5 Pro, CrossOver 26.3, D3DMetal; it logs "no GPU timestamps on this host"), so you can carry that until #996 lands.

For pr/native-host-vtables on today's main (47efa2e, merged cleanly, each test in its own process, twice): ddf3be7 fixes the bind create-list and d32s8 tests (they crash on main), and #553 fixes the 8 draw tests without textures. With both, gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes and gpu_compute_e2e's console_wave64_compute_through_the_pso_hook_dispatch_and_read_back still hang. That is #866, merged after your 508a0c7 base, which is why @⁠us3r40456's run of ddf3be7 didn't see it: D3DMetal calls Release on a barrier's resource from a native thread of its own at submit time, and #866's late_release::enabled() reads XCL_LATE_RELEASE there for the first time and never returns. Reading it once in real::adopt (4 lines) makes both pass for me. It only helps with your vtable change in. Without it, D3DMetal fails earlier, on the vtable prefix. One risk I have not tested: if D3DMetal's call is ever the last reference, #866's path takes locks and waits on fences on that thread.

I'll take the unified memory copy path (c70bf8a): rebased onto main, split into small PRs with tests, and the #1024 test adjusted to accept a coherent window copied into video memory.

AI use: Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this comment.

**@⁠vakaobr** on GitHub · 2026-11-24 14:01 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7133722800) @⁠Ahmet-Dedeler: the fixture fix is https://github.com/Ahmet-Dedeler/xcl/pull/1, against `mac-on-main-wip`. With #996's commit (`f242ea8`) cherry-picked on top, the eighth fixture test, `timestamps_outside_unified_memory_land_after_the_queue`, passes too (M5 Pro, CrossOver 26.3, D3DMetal; it logs "no GPU timestamps on this host"), so you can carry that until #996 lands. For `pr/native-host-vtables` on today's `main` (`47efa2e`, merged cleanly, each test in its own process, twice): `ddf3be7` fixes the `bind` create-list and `d32s8` tests (they crash on `main`), and #553 fixes the 8 draw tests without textures. With both, `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` and `gpu_compute_e2e`'s `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back` still hang. That is #866, merged after your `508a0c7` base, which is why @⁠us3r40456's run of `ddf3be7` didn't see it: D3DMetal calls `Release` on a barrier's resource from a native thread of its own at submit time, and #866's `late_release::enabled()` reads `XCL_LATE_RELEASE` there for the first time and never returns. Reading it once in `real::adopt` (4 lines) makes both pass for me. It only helps with your vtable change in. Without it, D3DMetal fails earlier, on the vtable prefix. One risk I have not tested: if D3DMetal's call is ever the last reference, #866's path takes locks and waits on fences on that thread. I'll take the unified memory copy path (`c70bf8a`): rebased onto `main`, split into small PRs with tests, and the #1024 test adjusted to accept a coherent window copied into video memory. AI use: Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this comment.
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 14:15 UTC · original

@⁠vakaobr merged, thanks. mac-on-main-wip has the fixture fix now. And yes, the unified memory copy path (c70bf8a) is yours, split it however reviews best.

The late_release thing is a good find. D3DMetal calling Release from a native thread of its own at submit time is the same shape as a deadlock I hit on a newer rebase of the port: the render thread sat in res_release waiting on the sparse state lock, called from inside D3DMetal. So I'd treat "the host calls back into XCL on its own thread while XCL holds something" as a general rule for this host, not a one-off. Reading the switch once in real::adopt sounds right for the env part. For the risk you named (D3DMetal's call being the last reference), I think the safe version is that a release arriving on a thread XCL didn't create only queues the work and never takes locks or waits on fences there. I haven't tried it.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 14:15 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7134093997) @⁠vakaobr merged, thanks. `mac-on-main-wip` has the fixture fix now. And yes, the unified memory copy path (c70bf8a) is yours, split it however reviews best. The `late_release` thing is a good find. D3DMetal calling `Release` from a native thread of its own at submit time is the same shape as a deadlock I hit on a newer rebase of the port: the render thread sat in `res_release` waiting on the sparse state lock, called from inside D3DMetal. So I'd treat "the host calls back into XCL on its own thread while XCL holds something" as a general rule for this host, not a one-off. Reading the switch once in `real::adopt` sounds right for the env part. For the risk you named (D3DMetal's call being the last reference), I think the safe version is that a release arriving on a thread XCL didn't create only queues the work and never takes locks or waits on fences there. I haven't tried it.
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-24 14:29 UTC · original

@⁠Ahmet-Dedeler I'll take the masked stores under Rosetta 2 (b51552b maskmov, 04e9301 the loader step), split as:

  1. maskmov alone: the decoder, the helpers and the site finder with their tests, nothing calls it yet. Your commit, rebased on main, authored by you.
  2. The loader step (loader::replace_masked_stores, util::rosetta, XCL_MASKED_STORES, on only under Rosetta 2), with the loader::tests::masked_stores_… tests. That one changes the runtime, so it needs a Mac smoke pair with a title (@⁠mikebuckets171, if your offer holds) and a Windows pair to show nothing changes there.

First check here, on main 930e8b4 + b51552b (cherry-picks cleanly), Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, mingw-w64 cross-build: maskmov:: 7 passed, 1 ignored. The ignored one, run with --ignored, ends the process here as it does on your M5 Pro: "a fault on the first element was resumed; now one on the fourth", then rosetta error: unexpectedly need to EmulateForward on a synchronous exception … inst_index=18. So the finding holds on a second chip.

If you'd rather open these yourself or have changes on them since db065d8, say so and I'll test yours instead.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Lucasyudi** on GitHub · 2026-11-24 14:29 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7134468506) @⁠Ahmet-Dedeler I'll take the masked stores under Rosetta 2 (`b51552b` maskmov, `04e9301` the loader step), split as: 1. `maskmov` alone: the decoder, the helpers and the site finder with their tests, nothing calls it yet. Your commit, rebased on `main`, authored by you. 2. The loader step (`loader::replace_masked_stores`, `util::rosetta`, `XCL_MASKED_STORES`, on only under Rosetta 2), with the `loader::tests::masked_stores_…` tests. That one changes the runtime, so it needs a Mac smoke pair with a title (@⁠mikebuckets171, if your offer holds) and a Windows pair to show nothing changes there. First check here, on `main` `930e8b4` + `b51552b` (cherry-picks cleanly), Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, mingw-w64 cross-build: `maskmov::` 7 passed, 1 ignored. The ignored one, run with `--ignored`, ends the process here as it does on your M5 Pro: "a fault on the first element was resumed; now one on the fourth", then `rosetta error: unexpectedly need to EmulateForward on a synchronous exception … inst_index=18`. So the finding holds on a second chip. If you'd rather open these yourself or have changes on them since `db065d8`, say so and I'll test yours instead. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 14:45 UTC · original

@⁠Lucasyudi yes, take it, and that split is how I'd do it too. Nothing has changed on b51552b or 04e9301 since db065d8, so the fork is current for those.

Good to see the --ignored test end the same way on an M4 Pro. That one is the whole reason for the helpers, so it's worth quoting the Rosetta line in the PR description for step 2. Otherwise a reviewer on Windows has no way to see why a store has to be split up.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 14:45 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7134894344) @⁠Lucasyudi yes, take it, and that split is how I'd do it too. Nothing has changed on b51552b or 04e9301 since db065d8, so the fork is current for those. Good to see the `--ignored` test end the same way on an M4 Pro. That one is the whole reason for the helpers, so it's worth quoting the Rosetta line in the PR description for step 2. Otherwise a reviewer on Windows has no way to see why a store has to be split up.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 14:53 UTC · original

@⁠mikebuckets171: you offered xcl-smoke pairs for Mac-path PRs. Three of mine need one, and I have no title:

  • #1329 (the unified memory copy path from Ahmet's c70bf8a): head 4a11de6, stacked on #1326 and #1327, base main 930e8b4. It's the Mac path: taken only when OpenExistingHeapFromAddress returns E_NOTIMPL, so on your bench the title gets GPU unified memory where main has none. A pair of 930e8b4 against 4a11de6 is the one that matters most. XCL_UMA_SHADOW=0 turns the path off if you want a third run to compare.
  • #1326 (its preparation, head 3dd994a) changes no behaviour, so its pair should match main.

@⁠Kalmarv: under ivall's rule, #1326 and #1136 touch the shared path and need a Windows pair:

  • #1326: head 3dd994a on 930e8b4.
  • #1136 (the Agility SDK's D3D12Core.dll on a console-mounted drive, for #595): head 58160b6. Its fix only matters with XCL_D3D12_DIR or xcl.exe on a drive a console mount names, so a normal run should match main.

Thanks to both of you. I'll paste the blocks into the descriptions unchanged and credit you.

AI use: Claude Code, Claude Opus 5.5 drafted this note.

**@⁠vakaobr** on GitHub · 2026-11-24 14:53 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7135114548) @⁠mikebuckets171: you offered `xcl-smoke` pairs for Mac-path PRs. Three of mine need one, and I have no title: - **#1329** (the unified memory copy path from Ahmet's `c70bf8a`): head `4a11de6`, stacked on #1326 and #1327, base `main` `930e8b4`. It's the Mac path: taken only when `OpenExistingHeapFromAddress` returns E_NOTIMPL, so on your bench the title gets GPU unified memory where `main` has none. A pair of `930e8b4` against `4a11de6` is the one that matters most. `XCL_UMA_SHADOW=0` turns the path off if you want a third run to compare. - **#1326** (its preparation, head `3dd994a`) changes no behaviour, so its pair should match `main`. @⁠Kalmarv: under ivall's rule, #1326 and #1136 touch the shared path and need a Windows pair: - **#1326:** head `3dd994a` on `930e8b4`. - **#1136** (the Agility SDK's `D3D12Core.dll` on a console-mounted drive, for #595): head `58160b6`. Its fix only matters with `XCL_D3D12_DIR` or `xcl.exe` on a drive a console mount names, so a normal run should match `main`. Thanks to both of you. I'll paste the blocks into the descriptions unchanged and credit you. AI use: Claude Code, Claude Opus 5.5 drafted this note.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 14:55 UTC · original

@⁠Ahmet-Dedeler: I'll take the content-compared title textures (eae29b1, 71fad13, 4057323, and 63eeae8 for the memory that is not write-watched), rebased onto main and split into small PRs with tests, like the unified memory copy path (#1326 to #1329). If it needs pieces of e97bc3a (Mac host basics), I'll bring only those, in their own PR.

AI use: Claude Code, Claude Opus 5.5 drafted this note.

**@⁠vakaobr** on GitHub · 2026-11-24 14:55 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7135166455) @⁠Ahmet-Dedeler: I'll take the content-compared title textures (`eae29b1`, `71fad13`, `4057323`, and `63eeae8` for the memory that is not write-watched), rebased onto `main` and split into small PRs with tests, like the unified memory copy path (#1326 to #1329). If it needs pieces of `e97bc3a` (Mac host basics), I'll bring only those, in their own PR. AI use: Claude Code, Claude Opus 5.5 drafted this note.
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-24 15:00 UTC · original

@⁠Ahmet-Dedeler thanks. The masked stores are up as four stacked drafts, your commits split with you as author, code and tests unchanged:

  1. #1303 maskmov::insn_len / decode + tests (390 lines)
  2. #1311 the helpers, call_site, UNWIND_INFO + the exec tests, including the --ignored reproduction (over 800 lines, almost all of it the harness that runs each helper against the instruction; the description says why it stays with the helper)
  3. #1313 plan + its test
  4. #1344 the loader step, on only under Rosetta 2, with the Rosetta line quoted as you suggested. eh::alloc_near came over from your branch with it, since main has none.

Here (M4 Pro, CrossOver 26.3): maskmov:: 7 passed / 1 ignored, loader:: 3, util:: 6, 0 failed; the e2e test title gives the same 31 PASS / 2 FAIL with and without #1344 (it has no masked stores, so that only shows loading is undisturbed).

@⁠mikebuckets171 if your offer holds, #1344's head is the one that needs a Mac xcl-smoke pair with a title (its base is #1313, which changes no runtime path). A Windows pair from anyone would show nothing moves there: on a CPU util::rosetta() is false and nothing is replaced.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠Lucasyudi** on GitHub · 2026-11-24 15:00 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7135315760) @⁠Ahmet-Dedeler thanks. The masked stores are up as four stacked drafts, your commits split with you as author, code and tests unchanged: 1. #1303 `maskmov::insn_len` / `decode` + tests (390 lines) 2. #1311 the helpers, `call_site`, `UNWIND_INFO` + the `exec` tests, including the `--ignored` reproduction (over 800 lines, almost all of it the harness that runs each helper against the instruction; the description says why it stays with the helper) 3. #1313 `plan` + its test 4. #1344 the loader step, on only under Rosetta 2, with the Rosetta line quoted as you suggested. `eh::alloc_near` came over from your branch with it, since `main` has none. Here (M4 Pro, CrossOver 26.3): `maskmov::` 7 passed / 1 ignored, `loader::` 3, `util::` 6, 0 failed; the e2e test title gives the same 31 PASS / 2 FAIL with and without #1344 (it has no masked stores, so that only shows loading is undisturbed). @⁠mikebuckets171 if your offer holds, #1344's head is the one that needs a Mac `xcl-smoke` pair with a title (its base is #1313, which changes no runtime path). A Windows pair from anyone would show nothing moves there: on a CPU `util::rosetta()` is false and nothing is replaced. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 15:15 UTC · original

@⁠vakaobr yes, the content-compared textures are yours too (eae29b1, 71fad13, 4057323, 63eeae8). Bringing only the bits of e97bc3a it needs, in their own PR, is the right call. That commit is too big to go in as one thing anyway.

@⁠Lucasyudi thanks, four stacked drafts is a much better shape than what I had. I'll read #1303 to #1344 and comment there if anything in the split changes what the code was meant to do.

One update from my side, since it changes the Mac numbers people may compare against: on today's main the port no longer has any BCPack refusals (upstream's decoder covers it), the sign-in bar comes up in under 30 s, and loading ends at the same GPU-progress watchdog as #505. So the Mac host is now stopped by the same thing as Windows there.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 15:15 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7135715629) @⁠vakaobr yes, the content-compared textures are yours too (eae29b1, 71fad13, 4057323, 63eeae8). Bringing only the bits of e97bc3a it needs, in their own PR, is the right call. That commit is too big to go in as one thing anyway. @⁠Lucasyudi thanks, four stacked drafts is a much better shape than what I had. I'll read #1303 to #1344 and comment there if anything in the split changes what the code was meant to do. One update from my side, since it changes the Mac numbers people may compare against: on today's `main` the port no longer has any BCPack refusals (upstream's decoder covers it), the sign-in bar comes up in under 30 s, and loading ends at the same GPU-progress watchdog as #505. So the Mac host is now stopped by the same thing as Windows there.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 16:07 UTC · original

@⁠Ahmet-Dedeler: the foreign-thread Release fix, built on your suggestion: vakaobr/xcl d3d12x/foreign-thread-release, two commits on main 930e8b4.

  1. 1a0d87f reads XCL_LATE_RELEASE at adoption, so res_release never reads the environment for the first time on D3DMetal's thread.
  2. d156481 makes a release on a thread XCL didn't create take no locks and wait on nothing. On such a thread the count never reaches 0: a would-be last Release keeps its reference and is queued (a lock-free ring), and a Wine thread later does the final release through the normal res_release path, late_release hold included. A full ring keeps the reference and counts it, instead of spinning.

Detection: gated on under_wine(), read once at adoption, so it never runs on Windows. Under Wine it compares the stack pointer with 0x7000_0000_0000. Measured here over 3 runs: Wine threads (the test thread and 5 spawned ones) at 24 to 34 MB, D3DMetal's callback threads around 0x7ff2… (140 TB). Reading gs:[0x30] was tried first and hangs on D3DMetal's thread, so it isn't used. On a host where the boundary were wrong, a release would only be delayed, not corrupted.

Tested (M5 Pro, CrossOver 26.3, D3DMetal, on 930e8b4 + #553 + your ddf3be7, without the 4-line stop-gap): gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes and gpu_compute_e2e's console_wave64_compute_through_the_pso_hook_dispatch_and_read_back pass 2/2. All hle::d3d12x lib tests one per process, before and after: no regressions (5 failures before and after, the same ones). 7 unit tests, including spawned threads never counting as foreign and a concurrent drain processing each entry exactly once. Not tested: Windows, other Wine hosts, a title. One known gap, of the same kind as the existing comment in res_release: if a Wine thread releases the same object at the very moment D3DMetal's thread does, the object can still go on D3DMetal's thread without XCL's cleanup.

It only matters with your vtable change in (without it D3DMetal fails earlier, on the prefix), and mac-on-main-wip predates #866, so I see it going in with pr/native-host-vtables or as a PR stacked right after it. Which do you prefer?

AI use: Claude Code with Claude Opus 4.6 wrote the change and the tests; Claude Code with Claude Opus 5.5 reviewed it, required the under_wine gate, the claimed-slot consumer and the deferred final release, and wrote this comment.

**@⁠vakaobr** on GitHub · 2026-11-24 16:07 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7137149278) @⁠Ahmet-Dedeler: the foreign-thread `Release` fix, built on your suggestion: [`vakaobr/xcl` `d3d12x/foreign-thread-release`](https://github.com/vakaobr/xcl/tree/d3d12x/foreign-thread-release), two commits on `main` `930e8b4`. 1. `1a0d87f` reads `XCL_LATE_RELEASE` at adoption, so `res_release` never reads the environment for the first time on D3DMetal's thread. 2. `d156481` makes a release on a thread XCL didn't create take no locks and wait on nothing. On such a thread the count never reaches 0: a would-be last `Release` keeps its reference and is queued (a lock-free ring), and a Wine thread later does the final release through the normal `res_release` path, `late_release` hold included. A full ring keeps the reference and counts it, instead of spinning. **Detection:** gated on `under_wine()`, read once at adoption, so it never runs on Windows. Under Wine it compares the stack pointer with `0x7000_0000_0000`. Measured here over 3 runs: Wine threads (the test thread and 5 spawned ones) at 24 to 34 MB, D3DMetal's callback threads around 0x7ff2… (140 TB). Reading `gs:[0x30]` was tried first and hangs on D3DMetal's thread, so it isn't used. On a host where the boundary were wrong, a release would only be delayed, not corrupted. **Tested** (M5 Pro, CrossOver 26.3, D3DMetal, on `930e8b4` + #553 + your `ddf3be7`, without the 4-line stop-gap): `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` and `gpu_compute_e2e`'s `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back` pass 2/2. All `hle::d3d12x` lib tests one per process, before and after: no regressions (5 failures before and after, the same ones). 7 unit tests, including spawned threads never counting as foreign and a concurrent drain processing each entry exactly once. Not tested: Windows, other Wine hosts, a title. One known gap, of the same kind as the existing comment in `res_release`: if a Wine thread releases the same object at the very moment D3DMetal's thread does, the object can still go on D3DMetal's thread without XCL's cleanup. It only matters with your vtable change in (without it D3DMetal fails earlier, on the prefix), and `mac-on-main-wip` predates #866, so I see it going in with `pr/native-host-vtables` or as a PR stacked right after it. Which do you prefer? AI use: Claude Code with Claude Opus 4.6 wrote the change and the tests; Claude Code with Claude Opus 5.5 reviewed it, required the `under_wine` gate, the claimed-slot consumer and the deferred final release, and wrote this comment.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 16:26 UTC · original

Seven Mac-lane PRs in one tree on today's main 47efa2e, and an ordering note for anyone building a stacked Mac branch.

Tree: 47efa2e with -x cherry-picks of 76d2ff7 (#890), 3c43506 (#957), 3a6f95a (#982), ab7ce43 (#983), f242ea8 (#996), 699975b (#1024) and 01a236c (#787): 7 commits, 10 files, +283/−44. Builds clean with --release --locked for x86_64-pc-windows-gnullvm, 17 test executables. crates/xcl/src goes from 719 #[test] at 47efa2e to 721 in the tree — the two added tests are a_60_hz_timestamp_frequency_is_no_gpu_clock (#996) and gpu_global_atomic_add_inc_dec_x2 (#983).

17 Mac-relevant tests, one process each: 13 pass or skip the way their PR intends, 4 fail.

  • SKIPPED … no f64 → ok: gpu_f64_class_compare, gpu_f64_math_random, gpu_f64_literal_high_word, gpu_valu_16_and_64_bit, gpu_clamp_and_omod_per_instruction (#787). The same gate also fires at #787's head measured on its own, and at 47efa2e those tests fail.
  • SKIPPED … no 64-bit atomics → ok: gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2 (#983). gpu_more_atomics_sub_dword_scratch_valu now ok, 0.36 s.
  • SKIPPED … no GPU UMA → ok: gpu_uma_import_check_at_init (#1024).
  • SKIPPED (no WARP) → ok: hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content (#957).
  • ok: gpu_ps_image_sample_offset_implicit_lod_between_mips 0.44 s (#982), hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime 0.37 s (#890), hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue 0.38 s, printing the new host line about a timestamp query resolving to 0 (#996).
  • FAILED: gpu_unified_memory_arena (crates/xcl/src/gpu/recomp/tests.rs:3186:54), gpu_sparse_vram_descriptors_buffers_and_xmem (3478:5, left: 0, right: 4), gpu_memory_windows_reject_out_of_uma_aliasing (3413:54) — the heap/UMA family, where #1024 gates only the init check and #1060 could not be included in this tree (next paragraph) — and hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu (list_x.rs:5039:74, 0x80004001 from OpenExistingHeapFromAddress).

Ordering note. #1060 b22e57c cherry-picks cleanly onto 47efa2e on its own, and git merge-tree --write-tree 47efa2e b22e57c reports a clean merge — but picking it after the seven above conflicts, in crates/xcl/src/gpu/recomp/tests.rs: #983 and #787 already put their own host gates (no_int64_atomics(), no_doubles()) on the same GPU test functions that #1060 gates. So merging #1060 into main is fine; picking it last onto a stack is not, and a stack that leaves it out keeps the three UMA tests above failing. If a rebase of #1060 is wanted, the collision is confined to those guard lines.

Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data.

Two of these numbers are at 47efa2e (the per-test outcomes and the 719 → 721 count); main has moved to b7aa9f3 since. The ordering note was re-checked on b7aa9f3 and holds: all seven cherry-picks apply, #1060 still conflicts after them in crates/xcl/src/gpu/recomp/tests.rs. All eight PRs in this thread are still open — none of them is in the merges that landed since.

Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, x86_64-pc-windows-gnullvm (LLVM-MinGW, clang 23.1.6), --release --locked. AI use: <MODEL_LINE> built the tree, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 16:26 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7137678659) **Seven Mac-lane PRs in one tree on today's `main` `47efa2e`, and an ordering note for anyone building a stacked Mac branch.** Tree: `47efa2e` with `-x` cherry-picks of `76d2ff7` (#890), `3c43506` (#957), `3a6f95a` (#982), `ab7ce43` (#983), `f242ea8` (#996), `699975b` (#1024) and `01a236c` (#787): 7 commits, 10 files, +283/−44. Builds clean with `--release --locked` for `x86_64-pc-windows-gnullvm`, 17 test executables. `crates/xcl/src` goes from 719 `#[test]` at `47efa2e` to 721 in the tree — the two added tests are `a_60_hz_timestamp_frequency_is_no_gpu_clock` (#996) and `gpu_global_atomic_add_inc_dec_x2` (#983). 17 Mac-relevant tests, one process each: **13 pass or skip the way their PR intends, 4 fail.** - `SKIPPED … no f64` → `ok`: `gpu_f64_class_compare`, `gpu_f64_math_random`, `gpu_f64_literal_high_word`, `gpu_valu_16_and_64_bit`, `gpu_clamp_and_omod_per_instruction` (#787). The same gate also fires at #787's head measured on its own, and at `47efa2e` those tests fail. - `SKIPPED … no 64-bit atomics` → `ok`: `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2` (#983). `gpu_more_atomics_sub_dword_scratch_valu` now **ok**, 0.36 s. - `SKIPPED … no GPU UMA` → `ok`: `gpu_uma_import_check_at_init` (#1024). - `SKIPPED` (no WARP) → `ok`: `hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content` (#957). - **ok**: `gpu_ps_image_sample_offset_implicit_lod_between_mips` 0.44 s (#982), `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` 0.37 s (#890), `hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` 0.38 s, printing the new host line about a timestamp query resolving to 0 (#996). - **FAILED**: `gpu_unified_memory_arena` (`crates/xcl/src/gpu/recomp/tests.rs:3186:54`), `gpu_sparse_vram_descriptors_buffers_and_xmem` (`3478:5`, `left: 0`, `right: 4`), `gpu_memory_windows_reject_out_of_uma_aliasing` (`3413:54`) — the heap/UMA family, where #1024 gates only the init check and #1060 could not be included in this tree (next paragraph) — and `hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu` (`list_x.rs:5039:74`, `0x80004001` from `OpenExistingHeapFromAddress`). **Ordering note.** #1060 `b22e57c` cherry-picks cleanly onto `47efa2e` on its own, and `git merge-tree --write-tree 47efa2e b22e57c` reports a clean merge — but **picking it after the seven above conflicts**, in `crates/xcl/src/gpu/recomp/tests.rs`: #983 and #787 already put their own host gates (`no_int64_atomics()`, `no_doubles()`) on the same GPU test functions that #1060 gates. So merging #1060 into `main` is fine; picking it last onto a stack is not, and a stack that leaves it out keeps the three UMA tests above failing. If a rebase of #1060 is wanted, the collision is confined to those guard lines. Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data. Two of these numbers are at `47efa2e` (the per-test outcomes and the 719 → 721 count); `main` has moved to `b7aa9f3` since. The ordering note was re-checked on `b7aa9f3` and holds: all seven cherry-picks apply, #1060 still conflicts after them in `crates/xcl/src/gpu/recomp/tests.rs`. All eight PRs in this thread are still open — none of them is in the merges that landed since. Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, `x86_64-pc-windows-gnullvm` (LLVM-MinGW, clang 23.1.6), `--release --locked`. **AI use**: <MODEL_LINE> built the tree, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 16:33 UTC · original

@⁠vakaobr that's the version I was hoping for. Never letting the count reach 0 on a thread XCL didn't create, and handing the last release to a Wine thread, means the late_release path stays the only place that takes locks. The stack pointer check is a bit of a trick, but it's read once, only under Wine, and a wrong answer only delays a release. I'm fine with that. Worth one line in the PR on why gs:[0x30] isn't used, since the next person will try it.

I'll run it on my port with a title when the branch is rebased past #866, and post what the two hanging tests and a loading run do.

@⁠mikebuckets171 thanks for stacking the seven, that ordering note saves everyone a rebase.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 16:33 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7137846146) @⁠vakaobr that's the version I was hoping for. Never letting the count reach 0 on a thread XCL didn't create, and handing the last release to a Wine thread, means the `late_release` path stays the only place that takes locks. The stack pointer check is a bit of a trick, but it's read once, only under Wine, and a wrong answer only delays a release. I'm fine with that. Worth one line in the PR on why `gs:[0x30]` isn't used, since the next person will try it. I'll run it on my port with a title when the branch is rebased past #866, and post what the two hanging tests and a loading run do. @⁠mikebuckets171 thanks for stacking the seven, that ordering note saves everyone a rebase.
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 16:35 UTC · original

@⁠vakaobr I read d3d12x/foreign-thread-release against what my port does for the same problem. Same idea in both (read the switch at adoption, a last Release only queues into a ring of atomics, one of XCL's threads cleans up). Yours is better in two places: it holds with XCL_LATE_RELEASE=0, and a full ring keeps the reference instead of falling back to the locking path. Three questions, all from reading the code, none reproduced:

  1. drain_deferred and a full ring. It advances the tail by compare-exchange and only then stores 0 into the slot. Between those two steps the slot is free for a producer. With the ring full, defer_release can claim that index and store a resource, and the consumer's store(0) then erases it. That object leaks, and the slot is 0 with the head past it, so every later drain stops there. Taking the slot with swap(0) before moving the tail would close it.
  2. Ring size. 256 slots looks sized from the test, two pairs per submit. A title releases far more than that per frame during loading. Mine is 16,384 for that reason. I haven't measured how full it gets, so that number is a guess on the safe side. With the leak-on-full behaviour a small ring turns into a slow leak, so I'd go bigger.
  3. The stack pointer test isn't tied to D3DMetal. under_wine() is also true on Linux / Proton. If a Wine thread's stack can sit above 0x7000_0000_0000 there (I haven't checked where Wine puts them on 64-bit Linux), every last Release from it goes through the ring on a host that doesn't need it. Adding "the D3D12 is in no PE module" to the per-thread check would limit it to this host.

One more I didn't analyse: "AddRef returned 2" isn't atomic against a Release on another thread. I don't know if the count can reach 0 on the foreign thread in that window.

I think the end state is yours plus the per-host gate, the larger ring and a drain that takes the slot first. No loading run with it from me yet, my port is on 930e8b4, so that comes with the next rebase past #866.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 16:35 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7137896678) @⁠vakaobr I read `d3d12x/foreign-thread-release` against what my port does for the same problem. Same idea in both (read the switch at adoption, a last `Release` only queues into a ring of atomics, one of XCL's threads cleans up). Yours is better in two places: it holds with `XCL_LATE_RELEASE=0`, and a full ring keeps the reference instead of falling back to the locking path. Three questions, all from reading the code, none reproduced: 1. **`drain_deferred` and a full ring.** It advances the tail by compare-exchange and only then stores 0 into the slot. Between those two steps the slot is free for a producer. With the ring full, `defer_release` can claim that index and store a resource, and the consumer's `store(0)` then erases it. That object leaks, and the slot is 0 with the head past it, so every later drain stops there. Taking the slot with `swap(0)` before moving the tail would close it. 2. **Ring size.** 256 slots looks sized from the test, two pairs per submit. A title releases far more than that per frame during loading. Mine is 16,384 for that reason. I haven't measured how full it gets, so that number is a guess on the safe side. With the leak-on-full behaviour a small ring turns into a slow leak, so I'd go bigger. 3. **The stack pointer test isn't tied to D3DMetal.** `under_wine()` is also true on Linux / Proton. If a Wine thread's stack can sit above `0x7000_0000_0000` there (I haven't checked where Wine puts them on 64-bit Linux), every last `Release` from it goes through the ring on a host that doesn't need it. Adding "the D3D12 is in no PE module" to the per-thread check would limit it to this host. One more I didn't analyse: "`AddRef` returned 2" isn't atomic against a `Release` on another thread. I don't know if the count can reach 0 on the foreign thread in that window. I think the end state is yours plus the per-host gate, the larger ring and a drain that takes the slot first. No loading run with it from me yet, my port is on 930e8b4, so that comes with the next rebase past #866.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 16:44 UTC · original

Seven Mac-lane PRs in one tree on today's main 47efa2e, and an ordering note for anyone building a stacked Mac branch.

Tree: 47efa2e with -x cherry-picks of 76d2ff7 (#890), 3c43506 (#957), 3a6f95a (#982), ab7ce43 (#983), f242ea8 (#996), 699975b (#1024) and 01a236c (#787): 7 commits, 10 files, +283/−44. Builds clean with --release --locked for x86_64-pc-windows-gnullvm, 17 test executables. crates/xcl/src goes from 719 #[test] at 47efa2e to 721 in the tree — the two added tests are a_60_hz_timestamp_frequency_is_no_gpu_clock (#996) and gpu_global_atomic_add_inc_dec_x2 (#983).

17 Mac-relevant tests, one process each: 13 pass or skip the way their PR intends, 4 fail.

  • SKIPPED … no f64 → ok: gpu_f64_class_compare, gpu_f64_math_random, gpu_f64_literal_high_word, gpu_valu_16_and_64_bit, gpu_clamp_and_omod_per_instruction (#787). The same gate also fires at #787's head measured on its own, and at 47efa2e those tests fail.
  • SKIPPED … no 64-bit atomics → ok: gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2 (#983). gpu_more_atomics_sub_dword_scratch_valu now ok, 0.36 s.
  • SKIPPED … no GPU UMA → ok: gpu_uma_import_check_at_init (#1024).
  • SKIPPED (no WARP) → ok: hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content (#957).
  • ok: gpu_ps_image_sample_offset_implicit_lod_between_mips 0.44 s (#982), hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime 0.37 s (#890), hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue 0.38 s, printing the new host line about a timestamp query resolving to 0 (#996).
  • FAILED: gpu_unified_memory_arena (crates/xcl/src/gpu/recomp/tests.rs:3186:54), gpu_sparse_vram_descriptors_buffers_and_xmem (3478:5, left: 0, right: 4), gpu_memory_windows_reject_out_of_uma_aliasing (3413:54) — the heap/UMA family, where #1024 gates only the init check and #1060 could not be included in this tree (next paragraph) — and hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu (list_x.rs:5039:74, 0x80004001 from OpenExistingHeapFromAddress).

Ordering note. #1060 b22e57c cherry-picks cleanly onto 47efa2e on its own, and git merge-tree --write-tree 47efa2e b22e57c reports a clean merge — but picking it after the seven above conflicts, in crates/xcl/src/gpu/recomp/tests.rs: #983 and #787 already put their own host gates (no_int64_atomics(), no_doubles()) on the same GPU test functions that #1060 gates. So merging #1060 into main is fine; picking it last onto a stack is not, and a stack that leaves it out keeps the three UMA tests above failing. If a rebase of #1060 is wanted, the collision is confined to those guard lines.

Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data.

Two of these numbers are at 47efa2e (the per-test outcomes and the 719 → 721 count); main has moved to b7aa9f3 since. The ordering note was re-checked on b7aa9f3 and holds: all seven cherry-picks apply, #1060 still conflicts after them in crates/xcl/src/gpu/recomp/tests.rs. All eight PRs in this thread are still open — none of them is in the merges that landed since.

Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, x86_64-pc-windows-gnullvm (LLVM-MinGW, clang 23.1.6), --release --locked. AI use: GPT-6 Luna built the tree, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.

**@⁠mikebuckets171** on GitHub · 2026-11-24 16:44 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7138122698) **Seven Mac-lane PRs in one tree on today's `main` `47efa2e`, and an ordering note for anyone building a stacked Mac branch.** Tree: `47efa2e` with `-x` cherry-picks of `76d2ff7` (#890), `3c43506` (#957), `3a6f95a` (#982), `ab7ce43` (#983), `f242ea8` (#996), `699975b` (#1024) and `01a236c` (#787): 7 commits, 10 files, +283/−44. Builds clean with `--release --locked` for `x86_64-pc-windows-gnullvm`, 17 test executables. `crates/xcl/src` goes from 719 `#[test]` at `47efa2e` to 721 in the tree — the two added tests are `a_60_hz_timestamp_frequency_is_no_gpu_clock` (#996) and `gpu_global_atomic_add_inc_dec_x2` (#983). 17 Mac-relevant tests, one process each: **13 pass or skip the way their PR intends, 4 fail.** - `SKIPPED … no f64` → `ok`: `gpu_f64_class_compare`, `gpu_f64_math_random`, `gpu_f64_literal_high_word`, `gpu_valu_16_and_64_bit`, `gpu_clamp_and_omod_per_instruction` (#787). The same gate also fires at #787's head measured on its own, and at `47efa2e` those tests fail. - `SKIPPED … no 64-bit atomics` → `ok`: `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2` (#983). `gpu_more_atomics_sub_dword_scratch_valu` now **ok**, 0.36 s. - `SKIPPED … no GPU UMA` → `ok`: `gpu_uma_import_check_at_init` (#1024). - `SKIPPED` (no WARP) → `ok`: `hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content` (#957). - **ok**: `gpu_ps_image_sample_offset_implicit_lod_between_mips` 0.44 s (#982), `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` 0.37 s (#890), `hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue` 0.38 s, printing the new host line about a timestamp query resolving to 0 (#996). - **FAILED**: `gpu_unified_memory_arena` (`crates/xcl/src/gpu/recomp/tests.rs:3186:54`), `gpu_sparse_vram_descriptors_buffers_and_xmem` (`3478:5`, `left: 0`, `right: 4`), `gpu_memory_windows_reject_out_of_uma_aliasing` (`3413:54`) — the heap/UMA family, where #1024 gates only the init check and #1060 could not be included in this tree (next paragraph) — and `hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu` (`list_x.rs:5039:74`, `0x80004001` from `OpenExistingHeapFromAddress`). **Ordering note.** #1060 `b22e57c` cherry-picks cleanly onto `47efa2e` on its own, and `git merge-tree --write-tree 47efa2e b22e57c` reports a clean merge — but **picking it after the seven above conflicts**, in `crates/xcl/src/gpu/recomp/tests.rs`: #983 and #787 already put their own host gates (`no_int64_atomics()`, `no_doubles()`) on the same GPU test functions that #1060 gates. So merging #1060 into `main` is fine; picking it last onto a stack is not, and a stack that leaves it out keeps the three UMA tests above failing. If a rebase of #1060 is wanted, the collision is confined to those guard lines. Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data. Two of these numbers are at `47efa2e` (the per-test outcomes and the 719 → 721 count); `main` has moved to `b7aa9f3` since. The ordering note was re-checked on `b7aa9f3` and holds: all seven cherry-picks apply, #1060 still conflicts after them in `crates/xcl/src/gpu/recomp/tests.rs`. All eight PRs in this thread are still open — none of them is in the merges that landed since. Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0, `x86_64-pc-windows-gnullvm` (LLVM-MinGW, clang 23.1.6), `--release --locked`. **AI use**: GPT-6 Luna built the tree, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.
Author
Owner

@⁠mikebuckets171 on GitHub · 2026-11-24 17:09 UTC · original

BCPack on this Mac (M5 Pro, CrossOver 26 + D3DMetal), main b7aa9f3: the title never reaches a storage request inside a bounded run.

Two 90 s title runs, one at a time with local inference unloaded, same bottle and same data root: one plain, one with XCL_DSTORAGE_BCPACK_FILL=1. Both exit 0x0, frames shown: 0 (PresentX 0), presents per 2 s: 0 0 0, crashes: 0. The report's dstorage section is empty in both: bcpack_refused and bcpack_unpacked are both empty maps, with no numeric counters either — not "many refusals", not "some unpacked": nothing arrived.

What the same run does reach, from the report's counters:

counter value
modules 8
imports 1186 across 19 sources
stubbed imports / called stubs 1 / 0
d3d12.presents, frame_boundaries 0 / 0
d3d12.translated_pipelines, fallback_pipelines, failed_pipelines 0 / 0 / 0
d3d12.background_pipelines 3
d3d12.dxil_cache entries 7
d3d12.uma_mb 4095
shaders.submitted, unique, recomp_programs 0 / 0 / 0
shaders.recomp_dxc_ok, recomp_dxc_failed 0 / 0
audio.engines, mastering_voices, xapu_packets_decoded 0 / 0 / 0
vfs.unmapped_paths, redirected_writes, whiteouts 0 / 0 / 0

What that says about the BCPack question. @⁠Ahmet-Dedeler's read is that the next blocker is BCPack requests plus the title's GPU-progress watchdog rather than D3DMetal. On this host a bounded run cannot test that: the title loads its modules and resolves imports, gets a device with a 4095 MB UMA reservation and three background pipelines, and then submits no work at all — no queue submission, no pipeline translation, no shader program, no audio engine, and no DirectStorage request, refused or otherwise. The XCL_DSTORAGE_BCPACK_FILL run is the same, because there is no refused destination to fill. So the stall here sits earlier than storage decompression, and my host can neither confirm nor refute the BCPack part of that hypothesis. The watchdog does not fire either: the title ends its own 90 s bound cleanly with exit 0x0.

Two things I would like to know before treating this as "BCPack is not the Mac blocker": whether the run gets further on a tree that has the Mac-port pieces in it (I am checking that now), and whether a longer bound on plain main eventually produces a storage request — the 90 s bound was chosen for comparability, not because the title stopped asking.

Not tested: Windows; and nothing about which requests the title wanted, because it asked for none inside the bound. Counts from report.json only — no paths, file names, package contents or log bodies.

Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal ("AMD Compatibility Mode", adapter 0x1002:0x66af), Rust 1.100.0, x86_64-pc-windows-gnullvm (LLVM-MinGW, clang 23.1.6), --release --locked, XCL_MAC_HOST=1, XCL_RUN_SECONDS bounded. AI use: GPT-6 Luna built the tree, ran the two title runs, read the report counters and drafted this; the numbers above are those counters.

**@⁠mikebuckets171** on GitHub · 2026-11-24 17:09 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7138769888) **BCPack on this Mac (M5 Pro, CrossOver 26 + D3DMetal), main `b7aa9f3`: the title never reaches a storage request inside a bounded run.** Two 90 s title runs, one at a time with local inference unloaded, same bottle and same data root: one plain, one with `XCL_DSTORAGE_BCPACK_FILL=1`. Both `exit 0x0`, `frames shown: 0 (PresentX 0)`, `presents per 2 s: 0 0 0`, `crashes: 0`. The report's `dstorage` section is **empty in both**: `bcpack_refused` and `bcpack_unpacked` are both empty maps, with no numeric counters either — not "many refusals", not "some unpacked": nothing arrived. What the same run does reach, from the report's counters: | counter | value | |---|---| | modules | 8 | | imports | 1186 across 19 sources | | stubbed imports / called stubs | 1 / 0 | | `d3d12.presents`, `frame_boundaries` | 0 / 0 | | `d3d12.translated_pipelines`, `fallback_pipelines`, `failed_pipelines` | 0 / 0 / 0 | | `d3d12.background_pipelines` | 3 | | `d3d12.dxil_cache` entries | 7 | | `d3d12.uma_mb` | 4095 | | `shaders.submitted`, `unique`, `recomp_programs` | 0 / 0 / 0 | | `shaders.recomp_dxc_ok`, `recomp_dxc_failed` | 0 / 0 | | `audio.engines`, `mastering_voices`, `xapu_packets_decoded` | 0 / 0 / 0 | | `vfs.unmapped_paths`, `redirected_writes`, `whiteouts` | 0 / 0 / 0 | **What that says about the BCPack question.** @⁠Ahmet-Dedeler's read is that the next blocker is BCPack requests plus the title's GPU-progress watchdog rather than D3DMetal. On this host a bounded run cannot test that: the title loads its modules and resolves imports, gets a device with a 4095 MB UMA reservation and three background pipelines, and then submits **no** work at all — no queue submission, no pipeline translation, no shader program, no audio engine, and no DirectStorage request, refused or otherwise. The `XCL_DSTORAGE_BCPACK_FILL` run is the same, because there is no refused destination to fill. So the stall here sits earlier than storage decompression, and my host can neither confirm nor refute the BCPack part of that hypothesis. The watchdog does not fire either: the title ends its own 90 s bound cleanly with exit `0x0`. Two things I would like to know before treating this as "BCPack is not the Mac blocker": whether the run gets further on a tree that has the Mac-port pieces in it (I am checking that now), and whether a longer bound on plain `main` eventually produces a storage request — the 90 s bound was chosen for comparability, not because the title stopped asking. Not tested: Windows; and nothing about *which* requests the title wanted, because it asked for none inside the bound. Counts from `report.json` only — no paths, file names, package contents or log bodies. Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal ("AMD Compatibility Mode", adapter `0x1002:0x66af`), Rust 1.100.0, `x86_64-pc-windows-gnullvm` (LLVM-MinGW, clang 23.1.6), `--release --locked`, `XCL_MAC_HOST=1`, `XCL_RUN_SECONDS` bounded. **AI use**: GPT-6 Luna built the tree, ran the two title runs, read the report counters and drafted this; the numbers above are those counters.
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 17:36 UTC · original

@⁠mikebuckets171 that matches what I see, and it doesn't contradict the BCPack read. Plain main has no Mac host path, so on a Mac the title stops a few seconds in, before it submits anything. My two smoke runs on main for the vtable PR were also 0 frames. So a bounded run of plain main can't reach a storage request on this host, however long the bound is.

The BCPack numbers I quoted are from the port: on a main from before upstream's decoder the title got through the menus into world loading with BCPack requests refused, and with the port on a main that has the decoder there are 0 refusals and loading runs on until the GPU-progress watchdog. So yes, a tree with the Mac-port pieces in it is the one that can test it. If your stacked tree gets the title to its first frame, the dstorage counters should start to fill.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 17:36 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7139444562) @⁠mikebuckets171 that matches what I see, and it doesn't contradict the BCPack read. Plain `main` has no Mac host path, so on a Mac the title stops a few seconds in, before it submits anything. My two smoke runs on `main` for the vtable PR were also 0 frames. So a bounded run of plain `main` can't reach a storage request on this host, however long the bound is. The BCPack numbers I quoted are from the port: on a `main` from before upstream's decoder the title got through the menus into world loading with BCPack requests refused, and with the port on a `main` that has the decoder there are 0 refusals and loading runs on until the GPU-progress watchdog. So yes, a tree with the Mac-port pieces in it is the one that can test it. If your stacked tree gets the title to its first frame, the `dstorage` counters should start to fill.
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 19:42 UTC · original

The port is on a newer base now and public: mac7 on my fork, 55 commits on main 930e8b4. It has upstream's BCPack decoder under it (0 refusals), gets to the sign-in bar in under 30 s, and loading ends at the GPU-progress watchdog like #505.

It also carries my three fixes for the foreign-thread Release family that @⁠vakaobr and I compared above, so anyone who wants to diff the two approaches can do it against real code now. mac-on-main-wip stays where it is (5ae7547) because people have runs posted against it.

For the PRs already split out of it (#1303 to #1344, #1326 to #1329, #1649): nothing changes, those came from mac-on-main-wip, and mac7 carries the same changes on the newer base.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 19:42 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7142471735) The port is on a newer base now and public: [`mac7`](https://github.com/Ahmet-Dedeler/xcl/tree/mac7) on my fork, 55 commits on `main` 930e8b4. It has upstream's BCPack decoder under it (0 refusals), gets to the sign-in bar in under 30 s, and loading ends at the GPU-progress watchdog like #505. It also carries my three fixes for the foreign-thread `Release` family that @⁠vakaobr and I compared above, so anyone who wants to diff the two approaches can do it against real code now. `mac-on-main-wip` stays where it is (5ae7547) because people have runs posted against it. For the PRs already split out of it (#1303 to #1344, #1326 to #1329, #1649): nothing changes, those came from `mac-on-main-wip`, and `mac7` carries the same changes on the newer base.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 20:31 UTC · original

@⁠Ahmet-Dedeler thanks for reading it this closely. I checked all four against the code and they hold, so the branch is updated and rebased on 85e3826, past #866 (d3d12x/foreign-thread-release on my fork, force-pushed).

  1. Drain and a full ring. Right, with two drains at once. It now has one consumer at a time (a flag: a second drain returns at once and the next one picks the entries up), and the consumer empties the slot with swap(0) before it moves the tail. I went with one consumer rather than swap-first alone because with several consumers a stale one can still swap out an entry written on the next lap. The tests now drive the real ring (an instance of their own, so they never touch the process one), including 200,000 entries from one producer against 4 drains. With the one-consumer flag removed, the flag test fails 3 of 3 and the stress test hung once in 3 runs.
  2. Ring size. 16,384 slots, 128 KiB. It matters more now, see 4.
  3. Per-host gate. The path is on only when mac_host() says Darwin (your e97bc3a, read once at adoption), so Linux / Proton and Windows never take it. That commit is also the first one of the title textures stack, so both carry the same commit.
  4. AddRef returning 2. It can reach 0 on the foreign thread: if the count is 2 when the foreign thread comes in, its AddRef returns 3, a Release on another thread drops it to 2, and the foreign thread's two Releases end at 0 there. So a foreign Release no longer runs on the host's thread at all: every one goes into the ring and a Wine thread runs it through res_release. The count it returns comes from an AddRef and its Release, which can't reach 0 while the caller's own reference is held.

The gs:[0x30] line is in the code comment and the commit message: reading the TEB pointer on a D3DMetal thread hangs (measured), and the stack pointer needs no memory access.

One thing I didn't expect when I reran the two tests on 85e3826 + #553 + ddf3be7: they hang without the series and pass with only the first commit (reading XCL_LATE_RELEASE at adoption). The ring path is in use (4 releases per drain come from D3DMetal's thread in both tests), but neither test hangs without it, so for now it covers contention these tests don't produce. Your loading run would show whether it matters. Since the first commit is the fix for what we can reproduce, I'd open it as its own PR now (14 lines) and keep mac_host + the ring as a stack behind it, unless you'd rather see them together.

Tested on a MacBook Pro M5 Pro, CrossOver 26.3 / D3DMetal 3.0, Rosetta 2, Rust 1.100.0 x86_64-pc-windows-gnu, debug, one test per process: the 10 late_release unit tests pass, gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes passes, console_wave64_compute_through_the_pso_hook_dispatch_and_read_back passes 2 of 2. Not tested: Windows, Linux Wine, a retail title.

AI use: Claude Code. Claude Opus 5.5 checked your four points against the code, rewrote the ring and the foreign Release, ran the tests and drafted this reply; the first version of the branch was written with Claude Opus 4.6.

**@⁠vakaobr** on GitHub · 2026-11-24 20:31 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7143690405) @⁠Ahmet-Dedeler thanks for reading it this closely. I checked all four against the code and they hold, so the branch is updated and rebased on 85e3826, past #866 (`d3d12x/foreign-thread-release` on my fork, force-pushed). 1. **Drain and a full ring.** Right, with two drains at once. It now has one consumer at a time (a flag: a second drain returns at once and the next one picks the entries up), and the consumer empties the slot with `swap(0)` before it moves the tail. I went with one consumer rather than swap-first alone because with several consumers a stale one can still swap out an entry written on the next lap. The tests now drive the real ring (an instance of their own, so they never touch the process one), including 200,000 entries from one producer against 4 drains. With the one-consumer flag removed, the flag test fails 3 of 3 and the stress test hung once in 3 runs. 2. **Ring size.** 16,384 slots, 128 KiB. It matters more now, see 4. 3. **Per-host gate.** The path is on only when `mac_host()` says Darwin (your e97bc3a, read once at adoption), so Linux / Proton and Windows never take it. That commit is also the first one of the title textures stack, so both carry the same commit. 4. **AddRef returning 2.** It can reach 0 on the foreign thread: if the count is 2 when the foreign thread comes in, its AddRef returns 3, a Release on another thread drops it to 2, and the foreign thread's two Releases end at 0 there. So a foreign Release no longer runs on the host's thread at all: every one goes into the ring and a Wine thread runs it through `res_release`. The count it returns comes from an AddRef and its Release, which can't reach 0 while the caller's own reference is held. The `gs:[0x30]` line is in the code comment and the commit message: reading the TEB pointer on a D3DMetal thread hangs (measured), and the stack pointer needs no memory access. One thing I didn't expect when I reran the two tests on 85e3826 + #553 + ddf3be7: they hang without the series and pass with only the first commit (reading `XCL_LATE_RELEASE` at adoption). The ring path is in use (4 releases per drain come from D3DMetal's thread in both tests), but neither test hangs without it, so for now it covers contention these tests don't produce. Your loading run would show whether it matters. Since the first commit is the fix for what we can reproduce, I'd open it as its own PR now (14 lines) and keep `mac_host` + the ring as a stack behind it, unless you'd rather see them together. Tested on a MacBook Pro M5 Pro, CrossOver 26.3 / D3DMetal 3.0, Rosetta 2, Rust 1.100.0 x86_64-pc-windows-gnu, debug, one test per process: the 10 `late_release` unit tests pass, `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` passes, `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back` passes 2 of 2. Not tested: Windows, Linux Wine, a retail title. AI use: Claude Code. Claude Opus 5.5 checked your four points against the code, rewrote the ring and the foreign Release, ran the tests and drafted this reply; the first version of the branch was written with Claude Opus 4.6.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-24 21:06 UTC · original

@⁠Ahmet-Dedeler I read mac7's three Release commits (1de6f68, e97f309, fd1e593) against d3d12x/foreign-thread-release (f3a2c5a). Reading only, no runs of mac7.

The same in both: the setting is read when the device or first object is adopted (e97f309 / my first commit, now #1789), and a Release that must not wait leaves a resource in a 16,384-slot ring of atomics that one consumer at a time drains, emptying a slot before it moves past it. Your monotonic indices with fetch_add and a 256-slot margin, and my compare-exchange on a wrapped head, come to the same thing.

Where mac7 covers more: yours hands over every kept last Release on a native host, on any thread, and 1de6f68 makes sparse::forget_buffer and free_at_release take the sparse lock only if it is free. Mine only moves Releases that arrive on a host thread (stack pointer above 0x7000_0000_0000). So a Release D3DMetal makes on XCL's own Wine thread, from inside a call where XCL holds the sparse state's lock (upload_dirty / readback_ranges, as your 1de6f68 message describes), still reaches forget_buffer and waits for its own thread's lock on my branch. forget_buffer on main 4178e88 still takes the lock unconditionally. That's the fault your retail smoke runs hit, and my branch doesn't fix it.

Where mine covers more: on a host thread mine never calls the host's Release, so the count can't reach 0 there. fd1e593 still decides "last" with AddRef returning 2, on whatever thread calls. If another thread releases between that check and the two Releases, the count reaches 0 with held false, and forget_released takes UNMAPPABLE, TITLE_ADDRESS and the rest on D3DMetal's thread. That's the window you asked about in point 4. It's rare, but it's the same hang when it happens.

Gate: yours is NATIVE_HOST_MEMORY (no PE module for D3D12, set with the device), mine is mac_host() plus the stack pointer per thread. Both are off on Windows and Linux.

So I think the end state is yours with one addition: on a host thread, no Release reaches the host at all (every one goes to the ring and a Wine thread runs it), which closes the AddRef window. Yours has the retail evidence and covers the lock-reentry case, so I'd rather build on it than keep a second version. If you open 1de6f68 + fd1e593 as PRs on main, I'll add the host-thread part on top as a small PR with its ring tests. If you'd rather I port them, say so and I will, with your authorship kept.

AI use: Claude Code. Claude Opus 5.5 read both branches and wrote this comparison.

**@⁠vakaobr** on GitHub · 2026-11-24 21:06 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7144475809) @⁠Ahmet-Dedeler I read `mac7`'s three `Release` commits (`1de6f68`, `e97f309`, `fd1e593`) against `d3d12x/foreign-thread-release` (`f3a2c5a`). Reading only, no runs of `mac7`. **The same in both:** the setting is read when the device or first object is adopted (`e97f309` / my first commit, now #1789), and a `Release` that must not wait leaves a resource in a 16,384-slot ring of atomics that one consumer at a time drains, emptying a slot before it moves past it. Your monotonic indices with `fetch_add` and a 256-slot margin, and my compare-exchange on a wrapped head, come to the same thing. **Where `mac7` covers more:** yours hands over every kept last `Release` on a native host, on any thread, and `1de6f68` makes `sparse::forget_buffer` and `free_at_release` take the sparse lock only if it is free. Mine only moves `Release`s that arrive on a host thread (stack pointer above `0x7000_0000_0000`). So a `Release` D3DMetal makes on XCL's own Wine thread, from inside a call where XCL holds the sparse state's lock (`upload_dirty` / `readback_ranges`, as your `1de6f68` message describes), still reaches `forget_buffer` and waits for its own thread's lock on my branch. `forget_buffer` on `main` 4178e88 still takes the lock unconditionally. That's the fault your retail smoke runs hit, and my branch doesn't fix it. **Where mine covers more:** on a host thread mine never calls the host's `Release`, so the count can't reach 0 there. `fd1e593` still decides "last" with `AddRef` returning 2, on whatever thread calls. If another thread releases between that check and the two `Release`s, the count reaches 0 with `held` false, and `forget_released` takes `UNMAPPABLE`, `TITLE_ADDRESS` and the rest on D3DMetal's thread. That's the window you asked about in point 4. It's rare, but it's the same hang when it happens. **Gate:** yours is `NATIVE_HOST_MEMORY` (no PE module for D3D12, set with the device), mine is `mac_host()` plus the stack pointer per thread. Both are off on Windows and Linux. So I think the end state is yours with one addition: on a host thread, no `Release` reaches the host at all (every one goes to the ring and a Wine thread runs it), which closes the `AddRef` window. Yours has the retail evidence and covers the lock-reentry case, so I'd rather build on it than keep a second version. If you open `1de6f68` + `fd1e593` as PRs on `main`, I'll add the host-thread part on top as a small PR with its ring tests. If you'd rather I port them, say so and I will, with your authorship kept. AI use: Claude Code. Claude Opus 5.5 read both branches and wrote this comparison.
Author
Owner

@⁠shortside on GitHub · 2026-11-24 21:15 UTC · original

A 24 GB Apple silicon data point for mac7: it draws and takes input, and memory is what stops it, about a minute after the first-run menu. Everyone else here has 48–64 GB or synthetic inputs, so this is the low end.

Machine and build: MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), D3DMetal; DXC 1.9.2609. mac7 at dbd9d09, release, cross-built for x86_64-pc-windows-msvc (clang-cl / lld-link 23.1.6, xwin SDK). The retail title, run through scripts/smoke.ps1 (so XCL_NETWORK=0), one run at a time.

1. Bounded run, 120 s, fresh data root, XCL_DXC_THREADS=4, XCL_BACKGROUND=1:

xcl-smoke v1
commit: dbd9d09d1e2931c227d4ade97a62184ba95d1bc2
gpu: AMD Compatibility Mode
title: Retail game
seconds: 120
exit: 0x0
frames shown: 3140 (PresentX 3140)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

First present at ~6 s. XCL_FRAME_DUMP shows black until frame ~380, then the sign-in bar (frames 620–860 identical). System memory free went from 73 % to 26 % and stayed there.

2. With input, in the foreground (XCL_BACKGROUND=0), fresh data root, 4 DXC threads. Keyboard input in the XCL window took it past the sign-in bar: the dump of frame 1220 is the first-run "Navigation Experience" page. Presents per 20 s: 340, 440, 530, 549, 600, 379, 66, 33, 1. At 138 s XCL logs DXC memory gate: compile held back … 1227 MB physical available; from ~160 s sparse: the queue has not reached fence value …. An external watchdog of mine ended the run at 183 s with 5 % of system memory free and 8.3 GB of swap in use. So no exit code of the title's own, and it never got as far as the #505 watchdog.

3. The same again on the same data root (warm), 2 DXC threads. Presents per 20 s: 330, 416, 506, 600, 357, 84, 1; ended by the same watchdog at 132 s, 5 % free, 7.4 GB swap. No DXC memory gate line this time, so it is not the compiles. XCL's last memory line: video memory 2773 MB local, arenas 3442 MB in use, sparse pools 2048 MB, 21251 title textures kept in step. On this host all of that is system memory.

Four small things for anyone running smoke on a Mac:

  • With XCL_BACKGROUND=1 the XCL window stayed white here although the dumps show the picture; in the foreground it showed the game.
  • peak commit reads 0 MB in every block here (XCL logs memory: 0 MB committed by the process under Wine), so the 125 % commit limit of the regression rule cannot be checked on this host.
  • gpu: reads "AMD Compatibility Mode" (D3DMetal's adapter name).
  • main (b9b6ea6) on the same host: 0 frames in 60 s, exit 0x0, after OpenExistingHeapFromAddress … Not implemented, as @⁠mikebuckets171 measured.

Not tested: anything past the first-run pages, more than 24 GB, XCL_UMA_SHADOW=0, a controller (keyboard only), sound.

AI use: Claude Code with Claude Fable 5.2 built the tree, made the runs on my machine, read the logs and frame dumps, and drafted this; I was at the keyboard for run 2.

**@⁠shortside** on GitHub · 2026-11-24 21:15 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7144697037) **A 24 GB Apple silicon data point for `mac7`: it draws and takes input, and memory is what stops it, about a minute after the first-run menu.** Everyone else here has 48–64 GB or synthetic inputs, so this is the low end. **Machine and build:** MacBook Pro M5 Pro, **24 GB**, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), D3DMetal; DXC 1.9.2609. `mac7` at `dbd9d09`, release, cross-built for `x86_64-pc-windows-msvc` (clang-cl / lld-link 23.1.6, xwin SDK). The retail title, run through `scripts/smoke.ps1` (so `XCL_NETWORK=0`), one run at a time. **1. Bounded run, 120 s, fresh data root, `XCL_DXC_THREADS=4`, `XCL_BACKGROUND=1`:** ``` xcl-smoke v1 commit: dbd9d09d1e2931c227d4ade97a62184ba95d1bc2 gpu: AMD Compatibility Mode title: Retail game seconds: 120 exit: 0x0 frames shown: 3140 (PresentX 3140) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` First present at ~6 s. `XCL_FRAME_DUMP` shows black until frame ~380, then the sign-in bar (frames 620–860 identical). System memory free went from 73 % to 26 % and stayed there. **2. With input, in the foreground (`XCL_BACKGROUND=0`), fresh data root, 4 DXC threads.** Keyboard input in the XCL window took it past the sign-in bar: the dump of frame 1220 is the first-run "Navigation Experience" page. Presents per 20 s: 340, 440, 530, 549, 600, 379, 66, 33, 1. At 138 s XCL logs `DXC memory gate: compile held back … 1227 MB physical available`; from ~160 s `sparse: the queue has not reached fence value …`. An external watchdog of mine ended the run at **183 s with 5 % of system memory free** and 8.3 GB of swap in use. So no exit code of the title's own, and it never got as far as the #505 watchdog. **3. The same again on the same data root (warm), 2 DXC threads.** Presents per 20 s: 330, 416, 506, 600, 357, 84, 1; ended by the same watchdog at **132 s, 5 % free**, 7.4 GB swap. No `DXC memory gate` line this time, so it is not the compiles. XCL's last memory line: video memory 2773 MB local, arenas 3442 MB in use, sparse pools 2048 MB, 21251 title textures kept in step. On this host all of that is system memory. **Four small things for anyone running smoke on a Mac:** - With `XCL_BACKGROUND=1` the XCL window stayed white here although the dumps show the picture; in the foreground it showed the game. - `peak commit` reads 0 MB in every block here (XCL logs `memory: 0 MB committed by the process` under Wine), so the 125 % commit limit of the regression rule cannot be checked on this host. - `gpu:` reads "AMD Compatibility Mode" (D3DMetal's adapter name). - `main` (`b9b6ea6`) on the same host: 0 frames in 60 s, exit 0x0, after `OpenExistingHeapFromAddress … Not implemented`, as @⁠mikebuckets171 measured. **Not tested:** anything past the first-run pages, more than 24 GB, `XCL_UMA_SHADOW=0`, a controller (keyboard only), sound. **AI use:** Claude Code with Claude Fable 5.2 built the tree, made the runs on my machine, read the logs and frame dumps, and drafted this; I was at the keyboard for run 2.
Author
Owner

@⁠shortside on GitHub · 2026-11-24 21:32 UTC · original

Follow-up to my 24 GB report above: Series S mode plus #615 gets this Mac further than Series X does, for anyone else short of memory.

Same machine (M5 Pro, 24 GB, CrossOver 26.3, D3DMetal), mac7 dbd9d09, the retail title, foreground, XCL_DXC_THREADS=2, a warm data root:

setup what shows how far before memory ran out (5 % free, my watchdog)
device_type = "anaconda" (default) sign-in bar, first-run pages 132 s and 183 s, right after the first page
device_type = "lockhart" black: the title presents 2 planes and plane 0 alone is shown 257 s
"lockhart" + #615 merged in (clean merge) menus and the loading artwork, composited from the two planes 166 s, in loading
  • In Series S mode the title makes 1920x1080 display targets next to the 3840x2160 ones and presents two planes (PresentX now with 2 plane(s)). On mac7 as it is, the swap chain is 1920x1080 and every dumped frame is black, at 30 fps. That is the multi-plane item of #103, not a Mac problem.
  • With #615 the log has present: compositing 2 planes into 3840x2160 … and the menus show in the XCL window. So the compositor runs on D3DMetal; my report is on #615.
  • Memory is still what ends every run here, now in loading rather than after the first menu. The run times are not comparable to the second: I went through the menus at a different pace each time.

Not tested: anything after the loading artwork, more than 24 GB, a controller.

AI use: Claude Code with Claude Fable 5.2 made the runs with me at the keyboard, read the logs and frame dumps, and drafted this.

**@⁠shortside** on GitHub · 2026-11-24 21:32 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7145055374) Follow-up to my 24 GB report above: **Series S mode plus #615 gets this Mac further than Series X does**, for anyone else short of memory. Same machine (M5 Pro, 24 GB, CrossOver 26.3, D3DMetal), `mac7` `dbd9d09`, the retail title, foreground, `XCL_DXC_THREADS=2`, a warm data root: | setup | what shows | how far before memory ran out (5 % free, my watchdog) | |---|---|---| | `device_type = "anaconda"` (default) | sign-in bar, first-run pages | 132 s and 183 s, right after the first page | | `device_type = "lockhart"` | black: the title presents 2 planes and plane 0 alone is shown | 257 s | | `"lockhart"` + #615 merged in (clean merge) | menus and the loading artwork, composited from the two planes | 166 s, in loading | - In Series S mode the title makes 1920x1080 display targets next to the 3840x2160 ones and presents two planes (`PresentX now with 2 plane(s)`). On `mac7` as it is, the swap chain is 1920x1080 and every dumped frame is black, at 30 fps. That is the multi-plane item of #103, not a Mac problem. - With #615 the log has `present: compositing 2 planes into 3840x2160 …` and the menus show in the XCL window. So the compositor runs on D3DMetal; my report is on #615. - Memory is still what ends every run here, now in loading rather than after the first menu. The run times are not comparable to the second: I went through the menus at a different pace each time. Not tested: anything after the loading artwork, more than 24 GB, a controller. AI use: Claude Code with Claude Fable 5.2 made the runs with me at the keyboard, read the logs and frame dumps, and drafted this.
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-24 23:40 UTC · original

Apple Silicon test run on an M5 Pro — a data point next to the M3 runs above.

Machine: MacBook Pro M5 Pro, 24 GB, macOS 27.2.1 (26B131), Rosetta 2 present. CrossOver 26.3 (bottle, D3DMetal backend); the D3D12 adapter reports itself as "AMD Compatibility Mode (18186 MiB VRAM)", wave 32/32, SM 6.6. Rust 1.100.0 (stable-aarch64), mingw-w64 (Homebrew), DXC 1.9.2609.5 (01b62ad4) + dxil 1.9.2609.5. Synthetic inputs only, no retail sample data (XCL_SAMPLE_* unset).

Build (all worked)

brew install mingw-w64
rustup target add x86_64-pc-windows-gnu
cargo build --release -p xcl --target x86_64-pc-windows-gnu            # 44 s
cargo test  -p xcl --release --target x86_64-pc-windows-gnu --no-run   # test exes OK

Two warnings: unknown lint: function_casts_as_integer, and fetch_update deprecated (renamed to try_update, hle/xgameruntime/mod.rs:547).

Tests run through a CrossOver wine runner (wine --bottle xcl), XCL_DXC_DIR='C:\XCL', XCL_MAC_HOST=1, XCL_NETWORK=0.

Counts — lib unit binary, one test per process, 12 s cap each

As on the M3 runs: a single --test-threads=4 pass aborts the whole binary as soon as a test panics (fatal runtime error: failed to initiate panic, error 5), so each of the 951 tests ran in its own process.

group passed FAILED stuck (>12 s) crash/abort total
non-GPU 450 6 0 7 463
GPU (gpu in path) 408 42 14 24 488
all 858 48 14 31 951

FAILED, grouped

  • FP64 / doubles (no DoublePrecisionFloatShaderOps on D3DMetal) — matches the M3 run:
    gpu_f64_class_compare, gpu_f64_compares_with_nan, gpu_f64_literal_high_word, gpu_f64_math_random, gpu_f64_roots, gpu_f64_rounding_and_conversions, gpu_frexp_f64_exp_and_mant, gpu_ldexp_f64, gpu_rndne_f64, gpu_float_compares_random, lower_dxil::tests::f64_programs_on_the_gpu, ops_tests::doubles_match_cpu, round_tests::gpu_direct_f32_round_modes_{static,dynamic_and_denormals}.
  • 64-bit integer atomics on D3DMetal: gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2 (SFI0 0xc000, no doubles flag).
  • Memory windows > 4 GiB / UMA aliasing / OpenExistingHeapFromAddress (same area as the retail hang):
    gpu_memory_windows_above_4_gib, gpu_memory_windows_from_the_heap, gpu_memory_windows_reject_out_of_uma_aliasing, gpu_heap_windows_reject_out_of_uma_aliasing, gpu_unified_memory_arena, gpu_sparse_vram_descriptors_buffers_and_xmem, gpu_uma_import_check_at_init, list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu, list_x::tests::timestamps_outside_unified_memory_land_after_the_queue.
  • Other GPU: ops_tests::{raw_and_structured_buffer_atomics_run, texture_ops_run, uaddc_and_usubb_match_cpu, int64_bit_ops_match_cpu, derivatives_in_compute_run, groupshared_barrier_and_atomics_run}, fuzz_tests::fuzz_validate_and_gpu_0..3, gpu_bvh64_intersect_ray_across_memory_windows_and_grazing, gpu_clamp_and_omod_per_instruction, gpu_more_atomics_sub_dword_scratch_valu, gpu_ps_image_sample_offset_implicit_lod_between_mips, gpu_mesh_mode_reads_memory_windows, gpu_valu_16_and_64_bit, shader::tests::readable_answers_from_the_working_set_without_touching_pages, device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed, title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, vram::tests::reservable_agrees_with_the_driver.
  • Non-GPU (6): present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content, xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime, plus 4 counted under the memory/atomics groups above.

crash/abort (31) — mostly need retail sample data

Most of the "crash" bucket are survey/bench/census/dump/timing tests that read XCL_SAMPLE_* files I did not provide (retail_translation_survey, retail_ps_gallery, retail_shader_cost, dump_retail_interfaces, isa_coverage, repeated_pso_shader_compile, blob_dxc_cost, *_timing, …), so they abort without inputs rather than being regressions. Non-sample ones worth a look: config::tests::pls_drive_is_the_mount_onto_the_pls_folder, tls::tests::carrier_variants_probe, hle::d3d12x::bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12, gpu::desc::tests::decodes_tsharp, gpu::dxil::graphics::tests::emitted_vs_ps_draw_a_triangle.

stuck (14, all GPU, >12 s cap)

Long DXC/pipeline compiles and the graphics draw/rect-list family (gpu::dxil::core_tests::*, graphics::tests::*, gpu_rect_list_*, gpu_wave64_*) — same ones the M3 run flags as stuck; the 12 s cap is likely too low for some.

Retail title (stall-watchdog, +0x2237178)

An unpacked retail Scarlett title (game_scarlett_master.exe) through a Stage-6.1 prebuilt binary: XCL initialises fully (587 imports, 0 unresolved; XGameRuntime/XSystem/XNetworking up; ID3D12Device14 via D3DMetal; UMA + GameInput), then the title's own stall-watchdog fires at +0x2237178 (0x80000003, null this vtable) before the first present (presents: 0). The coherent UMA window overflows 4 GiB (title asks ~4530 MiB, window caps at 4095 MiB) because OpenExistingHeapFromAddress is unsupported on D3DMetal. Same watchdog as #232; PRs #203 / #267 / #214 look relevant and are not in the prebuilt I used.

Not covered: no Windows run (no MSVC / smoke.ps1 pair); no game-file run beyond the Stage-6.1 prebuilt; GPU tests capped at 12 s; single run (no re-run of the stuck/crash set).

**@⁠us3r40456** on GitHub · 2026-11-24 23:40 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7147661305) Apple Silicon test run on an **M5 Pro** — a data point next to the M3 runs above. **Machine:** MacBook Pro M5 Pro, 24 GB, macOS 27.2.1 (26B131), Rosetta 2 present. CrossOver 26.3 (bottle, D3DMetal backend); the D3D12 adapter reports itself as "AMD Compatibility Mode (18186 MiB VRAM)", wave 32/32, SM 6.6. Rust 1.100.0 (stable-aarch64), mingw-w64 (Homebrew), DXC 1.9.2609.5 (`01b62ad4`) + dxil 1.9.2609.5. Synthetic inputs only, no retail sample data (`XCL_SAMPLE_*` unset). ### Build (all worked) ```sh brew install mingw-w64 rustup target add x86_64-pc-windows-gnu cargo build --release -p xcl --target x86_64-pc-windows-gnu # 44 s cargo test -p xcl --release --target x86_64-pc-windows-gnu --no-run # test exes OK ``` Two warnings: `unknown lint: function_casts_as_integer`, and `fetch_update` deprecated (renamed to `try_update`, `hle/xgameruntime/mod.rs:547`). Tests run through a CrossOver wine runner (`wine --bottle xcl`), `XCL_DXC_DIR='C:\XCL'`, `XCL_MAC_HOST=1`, `XCL_NETWORK=0`. ### Counts — lib unit binary, one test per process, 12 s cap each > As on the M3 runs: a single `--test-threads=4` pass aborts the whole binary as soon as a test panics (`fatal runtime error: failed to initiate panic, error 5`), so each of the 951 tests ran in its own process. | group | passed | FAILED | stuck (>12 s) | crash/abort | total | |---|---|---|---|---|---| | non-GPU | 450 | 6 | 0 | 7 | 463 | | GPU (`gpu` in path) | 408 | 42 | 14 | 24 | 488 | | **all** | **858** | **48** | **14** | **31** | **951** | ### FAILED, grouped - **FP64 / doubles (no `DoublePrecisionFloatShaderOps` on D3DMetal)** — matches the M3 run: `gpu_f64_class_compare`, `gpu_f64_compares_with_nan`, `gpu_f64_literal_high_word`, `gpu_f64_math_random`, `gpu_f64_roots`, `gpu_f64_rounding_and_conversions`, `gpu_frexp_f64_exp_and_mant`, `gpu_ldexp_f64`, `gpu_rndne_f64`, `gpu_float_compares_random`, `lower_dxil::tests::f64_programs_on_the_gpu`, `ops_tests::doubles_match_cpu`, `round_tests::gpu_direct_f32_round_modes_{static,dynamic_and_denormals}`. - **64-bit integer atomics on D3DMetal:** `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2` (SFI0 `0xc000`, no doubles flag). - **Memory windows > 4 GiB / UMA aliasing / OpenExistingHeapFromAddress** (same area as the retail hang): `gpu_memory_windows_above_4_gib`, `gpu_memory_windows_from_the_heap`, `gpu_memory_windows_reject_out_of_uma_aliasing`, `gpu_heap_windows_reject_out_of_uma_aliasing`, `gpu_unified_memory_arena`, `gpu_sparse_vram_descriptors_buffers_and_xmem`, `gpu_uma_import_check_at_init`, `list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu`, `list_x::tests::timestamps_outside_unified_memory_land_after_the_queue`. - **Other GPU:** `ops_tests::{raw_and_structured_buffer_atomics_run, texture_ops_run, uaddc_and_usubb_match_cpu, int64_bit_ops_match_cpu, derivatives_in_compute_run, groupshared_barrier_and_atomics_run}`, `fuzz_tests::fuzz_validate_and_gpu_0..3`, `gpu_bvh64_intersect_ray_across_memory_windows_and_grazing`, `gpu_clamp_and_omod_per_instruction`, `gpu_more_atomics_sub_dword_scratch_valu`, `gpu_ps_image_sample_offset_implicit_lod_between_mips`, `gpu_mesh_mode_reads_memory_windows`, `gpu_valu_16_and_64_bit`, `shader::tests::readable_answers_from_the_working_set_without_touching_pages`, `device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed`, `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels`, `vram::tests::reservable_agrees_with_the_driver`. - **Non-GPU (6):** `present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content`, `xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime`, plus 4 counted under the memory/atomics groups above. ### crash/abort (31) — mostly need retail sample data Most of the "crash" bucket are survey/bench/census/dump/timing tests that read `XCL_SAMPLE_*` files I did not provide (`retail_translation_survey`, `retail_ps_gallery`, `retail_shader_cost`, `dump_retail_interfaces`, `isa_coverage`, `repeated_pso_shader_compile`, `blob_dxc_cost`, `*_timing`, …), so they abort without inputs rather than being regressions. Non-sample ones worth a look: `config::tests::pls_drive_is_the_mount_onto_the_pls_folder`, `tls::tests::carrier_variants_probe`, `hle::d3d12x::bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12`, `gpu::desc::tests::decodes_tsharp`, `gpu::dxil::graphics::tests::emitted_vs_ps_draw_a_triangle`. ### stuck (14, all GPU, >12 s cap) Long DXC/pipeline compiles and the graphics draw/rect-list family (`gpu::dxil::core_tests::*`, `graphics::tests::*`, `gpu_rect_list_*`, `gpu_wave64_*`) — same ones the M3 run flags as stuck; the 12 s cap is likely too low for some. ### Retail title (stall-watchdog, `+0x2237178`) An unpacked retail Scarlett title (`game_scarlett_master.exe`) through a Stage-6.1 prebuilt binary: XCL initialises fully (587 imports, 0 unresolved; XGameRuntime/XSystem/XNetworking up; `ID3D12Device14` via D3DMetal; UMA + GameInput), then the title's own stall-watchdog fires at `+0x2237178` (0x80000003, null `this` vtable) **before the first present** (`presents: 0`). The coherent UMA window overflows 4 GiB (title asks ~4530 MiB, window caps at 4095 MiB) because `OpenExistingHeapFromAddress` is unsupported on D3DMetal. Same watchdog as #232; PRs #203 / #267 / #214 look relevant and are not in the prebuilt I used. **Not covered:** no Windows run (no MSVC / `smoke.ps1` pair); no game-file run beyond the Stage-6.1 prebuilt; GPU tests capped at 12 s; single run (no re-run of the stuck/crash set).
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-25 02:19 UTC · original

Follow-up to my M5 Pro run above — a reproducible +0x2237178 crash with the retail title, on the full Mac config, that I can't get past and haven't seen reported here.

Machine: MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), D3DMetal; DXC 1.9.2609.5. The adapter reports "AMD Compatibility Mode (18186 MiB VRAM)", wave 32/32, SM 6.6.

Build: mac7 (Ahmet-Dedeler/xcl) at dbd9d09 with #615 merged in (clean, 584e213). Cross-built for x86_64-pc-windows-msvc with cargo-xwin (clang-cl / lld-link 23.1.6, xwin SDK). I also built x86_64-pc-windows-gnu (mingw) — same result.

Title: an unpacked retail Scarlett title, game_scarlett_master.exe, run through wine --bottle xcl, XCL_NETWORK=0, from a read-only folder on Z:.

Result: a deterministic crash at game_scarlett_master.exe+0x2237178 (0x80000003, null this vtable at +0x677c997), ~6 s in, before the first present (presents: 0). It does not move with any of:

varied values tried
build target windows-msvc (cargo-xwin), windows-gnu (mingw)
device_type anaconda (Series X), lockhart (Series S)
XCL_BACKGROUND 0, 1
XCL_DXC_THREADS 2, 4

It is a different address from the +0x2478b96 the Stage 6.1 notes fixed for this same exe.

Cross-confirmed on VIctory. The same dump of this exe, run through VIctory-macOS (pragyaangaur's port, latest build) under the same CrossOver 26.3 + D3DMetal, int3s at the identical game offset — victory-image…dll+0x2237178, 0x80000003, ~3 s in, right after the same GameInput enumeration — with --console series-s and both --unimplemented trap and --unimplemented zero. So this is almost certainly a property of this particular game dump, not of either layer: both loaders bind imports and reach the same point, then the title's own code asserts. For reference the title reports TitleID 00000000, xbox.id = …0001 at the crash (zeroed license/title identity).

What it crashes right after — this is init, not a pipeline stall (we never get to shaders):

xcl: XGameRuntime: InitializeApiImplEx2(…, flags 0x2) – title goes through the GDK thunks
xcl: XGameRuntime: no System32\xgameruntime.dll (Gaming Services) – XCL's own XTaskQueue/XAsync are used; dialogs, text entry, game invites, game streaming and the other APIs XCL does not implement are unavailable
xcl: XGameRuntime: QueryApiImpl …/073b7dcb… → XAsync: XCL (fallback – no system xgameruntime.dll)
xcl: XGameRuntime: QueryApiImpl …/bf2346b2… → XNetworking: XCL
xcl: XGameRuntime: QueryApiImpl …/01acd177… → XUser: XCL
xcl: GameInput: GameInputCreate – one gamepad (XInput controller / keyboard)
xcl: GameInput: device callback for kinds 0x40000 (enumeration 2)
→ CRASH: unhandled exception 0x80000003 in game_scarlett_master.exe+0x2237178
   (vtable +0x677c997); stack: +0x677c997, +0x579105c, +0x675b71d, +0x53ec0f0, +0x4fac3d7, +0x53ec0f0
   process-ends stack: … xcl.exe+0x12f930, +0x53ec0f0, +0x2237178 (x3), +0x4e4ccec, +0x3bd64, +0x78f5e88, +0x74539f6

report.json: 587 imports, 0 unresolved; called_stubs empty; xgameruntime.unimplemented: {}; shaders.submitted: 0; d3d12.presents: 0. So nothing is recorded as a stubbed/unimplemented call before it goes.

Questions for anyone with the symbols:

  1. Is the retail title that reaches menus here the same game_scarlett_master.exe? If so, does +0x2237178 ring a bell as an assert, and is it gated on Gaming Services being installed (a real System32\xgameruntime.dll) rather than XCL's fallback?
  2. The fallback path logs no unimplemented call, yet the title int3s one virtual call after GameInputCreate / the XGameRuntime init. Is there an XGameRuntime or GameInput return the title hard-asserts on when Gaming Services is absent?
  3. Happy to run any branch or dump any state (full report.json, xcl.log, a +0x2237178 disassembly, XCL_DRED=1, etc.) on this M5 Pro / 24 GB machine.

AI use: Claude Code (Claude Opus 4.8) built the trees, made the runs and drafted this; I reviewed it.

**@⁠us3r40456** on GitHub · 2026-11-25 02:19 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7150576504) Follow-up to my M5 Pro run above — a **reproducible `+0x2237178` crash** with the retail title, on the full Mac config, that I can't get past and haven't seen reported here. **Machine:** MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), D3DMetal; DXC 1.9.2609.5. The adapter reports "AMD Compatibility Mode (18186 MiB VRAM)", wave 32/32, SM 6.6. **Build:** `mac7` (Ahmet-Dedeler/xcl) at `dbd9d09` with **#615 merged in** (clean, `584e213`). Cross-built for **`x86_64-pc-windows-msvc`** with cargo-xwin (clang-cl / lld-link 23.1.6, xwin SDK). I also built `x86_64-pc-windows-gnu` (mingw) — same result. **Title:** an unpacked retail Scarlett title, `game_scarlett_master.exe`, run through `wine --bottle xcl`, `XCL_NETWORK=0`, from a read-only folder on `Z:`. **Result:** a deterministic crash at `game_scarlett_master.exe+0x2237178` (`0x80000003`, null `this` vtable at `+0x677c997`), ~6 s in, **before the first present** (`presents: 0`). It does not move with any of: | varied | values tried | |---|---| | build target | `windows-msvc` (cargo-xwin), `windows-gnu` (mingw) | | `device_type` | `anaconda` (Series X), `lockhart` (Series S) | | `XCL_BACKGROUND` | 0, 1 | | `XCL_DXC_THREADS` | 2, 4 | It is a different address from the `+0x2478b96` the Stage 6.1 notes fixed for this same exe. **Cross-confirmed on VIctory.** The same dump of this exe, run through VIctory-macOS (pragyaangaur's port, latest build) under the same CrossOver 26.3 + D3DMetal, int3s at the **identical** game offset — `victory-image…dll+0x2237178`, `0x80000003`, ~3 s in, right after the same GameInput enumeration — with `--console series-s` and both `--unimplemented trap` and `--unimplemented zero`. So this is almost certainly a property of this particular game dump, not of either layer: both loaders bind imports and reach the same point, then the title's own code asserts. For reference the title reports `TitleID 00000000`, `xbox.id = …0001` at the crash (zeroed license/title identity). **What it crashes right after** — this is init, not a pipeline stall (we never get to shaders): ``` xcl: XGameRuntime: InitializeApiImplEx2(…, flags 0x2) – title goes through the GDK thunks xcl: XGameRuntime: no System32\xgameruntime.dll (Gaming Services) – XCL's own XTaskQueue/XAsync are used; dialogs, text entry, game invites, game streaming and the other APIs XCL does not implement are unavailable xcl: XGameRuntime: QueryApiImpl …/073b7dcb… → XAsync: XCL (fallback – no system xgameruntime.dll) xcl: XGameRuntime: QueryApiImpl …/bf2346b2… → XNetworking: XCL xcl: XGameRuntime: QueryApiImpl …/01acd177… → XUser: XCL xcl: GameInput: GameInputCreate – one gamepad (XInput controller / keyboard) xcl: GameInput: device callback for kinds 0x40000 (enumeration 2) → CRASH: unhandled exception 0x80000003 in game_scarlett_master.exe+0x2237178 (vtable +0x677c997); stack: +0x677c997, +0x579105c, +0x675b71d, +0x53ec0f0, +0x4fac3d7, +0x53ec0f0 process-ends stack: … xcl.exe+0x12f930, +0x53ec0f0, +0x2237178 (x3), +0x4e4ccec, +0x3bd64, +0x78f5e88, +0x74539f6 ``` `report.json`: 587 imports, 0 unresolved; `called_stubs` empty; `xgameruntime.unimplemented: {}`; `shaders.submitted: 0`; `d3d12.presents: 0`. So nothing is recorded as a stubbed/unimplemented call before it goes. **Questions for anyone with the symbols:** 1. Is the retail title that reaches menus here the same `game_scarlett_master.exe`? If so, does `+0x2237178` ring a bell as an assert, and is it gated on **Gaming Services** being installed (a real `System32\xgameruntime.dll`) rather than XCL's fallback? 2. The fallback path logs no `unimplemented` call, yet the title int3s one virtual call after `GameInputCreate` / the XGameRuntime init. Is there an XGameRuntime or GameInput return the title hard-asserts on when Gaming Services is absent? 3. Happy to run any branch or dump any state (full `report.json`, `xcl.log`, a `+0x2237178` disassembly, `XCL_DRED=1`, etc.) on this M5 Pro / 24 GB machine. AI use: Claude Code (Claude Opus 4.8) built the trees, made the runs and drafted this; I reviewed it.
Author
Owner

@⁠us3r40456 on GitHub · 2026-11-25 02:34 UTC · original

Breakthrough on the +0x2237178 crash I reported above: it was the dump layout, not the layer.

The dump I was testing had each package in its own subfolder (appdata0/appdata0.rpf, core_bvh4/core_bvh4.rpf, … — 101 of them). The title can't find its startup archives that way, so it asserts at +0x2237178 right after the GameInput enumeration, before a single frame. Both XCL (mac7) and VIctory hit the identical offset on this dump, which is what put me onto "not the layer".

Flattening the dump — symlink each <name>/<file> to game_dir/<file> so appdata0.rpf, MicrosoftGame.Config, the DLLs and every .rpf/.ttpf sit at the root — gets straight past it. On VIctory main (Series S, D3DMetal / GPTK 4.0b3, M5 Pro) it then presents 64 frames with up to 32 draws before a new assert at +0x1dac734 (swapchain still black, like pragyaangaur/VIctory-macOS#15). Current main already gives the useful hint here — Cannot read startup archive …\appdata0.rpf — whereas the older build just crashed silently.

Full write-up and logs, Mac side: pragyaangaur/VIctory-macOS#24.

@⁠Ahmet-Dedeler this might explain some "dies before the menu / first-run" reports where the title gives nothing — worth checking the reporter's dump isn't one-archive-per-subfolder. And for anyone on a flat dump: do you also reach +0x1dac734 after the first frames, or get further?

**@⁠us3r40456** on GitHub · 2026-11-25 02:34 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7150908198) **Breakthrough on the `+0x2237178` crash I reported above: it was the dump layout, not the layer.** The dump I was testing had each package in its own subfolder (`appdata0/appdata0.rpf`, `core_bvh4/core_bvh4.rpf`, … — 101 of them). The title can't find its startup archives that way, so it asserts at `+0x2237178` right after the GameInput enumeration, before a single frame. **Both XCL (mac7) and VIctory hit the identical offset** on this dump, which is what put me onto "not the layer". Flattening the dump — symlink each `<name>/<file>` to `game_dir/<file>` so `appdata0.rpf`, `MicrosoftGame.Config`, the DLLs and every `.rpf`/`.ttpf` sit at the root — gets straight past it. On VIctory `main` (Series S, D3DMetal / GPTK 4.0b3, M5 Pro) it then **presents 64 frames with up to 32 draws** before a new assert at `+0x1dac734` (swapchain still black, like pragyaangaur/VIctory-macOS#15). Current `main` already gives the useful hint here — `Cannot read startup archive …\appdata0.rpf` — whereas the older build just crashed silently. Full write-up and logs, Mac side: pragyaangaur/VIctory-macOS#24. @⁠Ahmet-Dedeler this might explain some "dies before the menu / first-run" reports where the title gives nothing — worth checking the reporter's dump isn't one-archive-per-subfolder. And for anyone on a *flat* dump: do you also reach `+0x1dac734` after the first frames, or get further?
Author
Owner

@⁠shortside on GitHub · 2026-11-25 09:01 UTC · original

Loading on a 24 GB Mac: the crawl is video memory for texture levels the title has not loaded. A fix on mac7, and two other findings.

@⁠Ahmet-Dedeler @⁠us3r40456: follow-up to my 24 GB report above. Same machine (M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3, D3DMetal), mac7 dbd9d09 with #615 merged in, device_type = "lockhart", raytracing = "off", a warm data root, the same scripted pad presses in every run.

1. What the crawl is. After the loading burst the title shows about 2 frames per 30 s. During that time macOS compresses and decompresses 2–4 GB of memory per second (under 0.1 GB/s before), and wired memory swings between 10 and 20.6 GB. Every piece of queue work gets slow, including XCL's own small sparse uploads (under 1 ms before, 1–2 s then).

2. Why. A census of the title textures kept in step: about 22,000 textures standing for 7.9 GB, of which 1.3 GB has memory behind it. The rest is levels the title has not mapped yet. Committed textures take video memory for all of it, and on this host that is wired memory. A standalone check on D3DMetal: 400 BC7 2048² textures with only level 2 written wire about 2.6 GB as committed textures and about 0.6 GB (mostly the process itself) as reserved textures with the two largest levels unmapped. Reserved textures with unmapped levels upload and read back correctly there for BC1/3/4/5/6H/7, R8, RGBA8 and RGBA16F from 128² to 4096².

3. The fix. Branch d3d12x/streamed-texture-level-tiles on my fork, one commit on mac7 (2d6cc2e, 378 lines with its test): on a native host a streamed 2D texture of 512 pixels and up is a reserved resource of its own, and a level's tiles are mapped when an upload first has texels for it. XCL_TEXTURE_LEVEL_TILES=0 turns it off. Each texture has its own tiles, so it does not depend on tile aliasing.

same scripted run before with the change
frames shown about 2,250 in 330 s 3,000 by about 155 s, 7,200 by about 300 s
after the loading burst about 2 frames per 30 s 15–30 fps
wired memory 10–20.6 GB, swinging steady at 13–14.5 GB
swap used about 7.5 GB 2–3 GB

Not done in it: a level the title unloads keeps its tiles until the texture is released; arrays, cubes and volumes stay committed. An xcl-smoke pair shows nothing for this on my machine, because a fresh data root does not get past the first-run page without input; the numbers above are from my own scripted runs, made with a local build that has this code plus timing and logging of mine. I have not yet repeated them on the clean branch.

4. A crash in XCL's texture read on this host. TitleMemory::read copies directly on a Mac, and a page the title decommits mid-copy ends the process (access violation in memcpy, about one loading run in ten here, more with XCL_GPU_PAGE_MAPPINGS=0). Branch d3d12x/native-host-tolerant-texture-read, one commit on mac7 (cbf3b06, 198 lines with two tests): the copy there is a leaf routine that a vectored handler can end early, so unreadable pages are left out as on other hosts.

5. Garbage reads with queue page mappings. With the default settings the title crashed in three runs out of three between 158 and 169 s, reading garbage out of its streaming pool's CPU view (once clearly texture bytes where it expected a record). With XCL_GPU_PAGE_MAPPINGS=0 that did not happen in any run, and loading went on to 6,000–7,000 frames. I have not found the cause.

Tested: the new unit tests under CrossOver on this machine; the scripted runs above. Not tested: Windows, any other title, the whole test suite.

Happy to open these as PRs against whichever branch suits you, or you can take the commits as they are.

AI use: Claude Code with Claude Fable 5.2 ran the measurements, wrote both commits and this comment on my machine.

**@⁠shortside** on GitHub · 2026-11-25 09:01 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7157770440) **Loading on a 24 GB Mac: the crawl is video memory for texture levels the title has not loaded. A fix on `mac7`, and two other findings.** @⁠Ahmet-Dedeler @⁠us3r40456: follow-up to my 24 GB report above. Same machine (M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3, D3DMetal), `mac7` `dbd9d09` with #615 merged in, `device_type = "lockhart"`, `raytracing = "off"`, a warm data root, the same scripted pad presses in every run. **1. What the crawl is.** After the loading burst the title shows about 2 frames per 30 s. During that time macOS compresses and decompresses 2–4 GB of memory per second (under 0.1 GB/s before), and wired memory swings between 10 and 20.6 GB. Every piece of queue work gets slow, including XCL's own small sparse uploads (under 1 ms before, 1–2 s then). **2. Why.** A census of the title textures kept in step: about 22,000 textures standing for 7.9 GB, of which 1.3 GB has memory behind it. The rest is levels the title has not mapped yet. Committed textures take video memory for all of it, and on this host that is wired memory. A standalone check on D3DMetal: 400 BC7 2048² textures with only level 2 written wire about 2.6 GB as committed textures and about 0.6 GB (mostly the process itself) as reserved textures with the two largest levels unmapped. Reserved textures with unmapped levels upload and read back correctly there for BC1/3/4/5/6H/7, R8, RGBA8 and RGBA16F from 128² to 4096². **3. The fix.** Branch [`d3d12x/streamed-texture-level-tiles`](https://github.com/shortside/xcl/tree/d3d12x/streamed-texture-level-tiles) on my fork, one commit on `mac7` (`2d6cc2e`, 378 lines with its test): on a native host a streamed 2D texture of 512 pixels and up is a reserved resource of its own, and a level's tiles are mapped when an upload first has texels for it. `XCL_TEXTURE_LEVEL_TILES=0` turns it off. Each texture has its own tiles, so it does not depend on tile aliasing. | same scripted run | before | with the change | |---|---|---| | frames shown | about 2,250 in 330 s | 3,000 by about 155 s, 7,200 by about 300 s | | after the loading burst | about 2 frames per 30 s | 15–30 fps | | wired memory | 10–20.6 GB, swinging | steady at 13–14.5 GB | | swap used | about 7.5 GB | 2–3 GB | Not done in it: a level the title unloads keeps its tiles until the texture is released; arrays, cubes and volumes stay committed. An `xcl-smoke` pair shows nothing for this on my machine, because a fresh data root does not get past the first-run page without input; the numbers above are from my own scripted runs, made with a local build that has this code plus timing and logging of mine. I have not yet repeated them on the clean branch. **4. A crash in XCL's texture read on this host.** `TitleMemory::read` copies directly on a Mac, and a page the title decommits mid-copy ends the process (access violation in `memcpy`, about one loading run in ten here, more with `XCL_GPU_PAGE_MAPPINGS=0`). Branch [`d3d12x/native-host-tolerant-texture-read`](https://github.com/shortside/xcl/tree/d3d12x/native-host-tolerant-texture-read), one commit on `mac7` (`cbf3b06`, 198 lines with two tests): the copy there is a leaf routine that a vectored handler can end early, so unreadable pages are left out as on other hosts. **5. Garbage reads with queue page mappings.** With the default settings the title crashed in three runs out of three between 158 and 169 s, reading garbage out of its streaming pool's CPU view (once clearly texture bytes where it expected a record). With `XCL_GPU_PAGE_MAPPINGS=0` that did not happen in any run, and loading went on to 6,000–7,000 frames. I have not found the cause. **Tested:** the new unit tests under CrossOver on this machine; the scripted runs above. **Not tested:** Windows, any other title, the whole test suite. Happy to open these as PRs against whichever branch suits you, or you can take the commits as they are. **AI use:** Claude Code with Claude Fable 5.2 ran the measurements, wrote both commits and this comment on my machine.
Author
Owner

@⁠shortside on GitHub · 2026-11-25 09:42 UTC · original

Follow-up to my comment above: the numbers repeated on the clean branches, one correction, one more commit, and the cause of point 5.

Same machine and setup. Build: mac7 dbd9d09 + #615 + d3d12x/streamed-texture-level-tiles (2d6cc2e) + d3d12x/native-host-tolerant-texture-read (1d2d527), nothing else. Three scripted runs of 330 s:

run settings outcome frames wired after 110 s (avg / peak)
1 defaults stops at about 165 s 3,000 by 162 s 14.0 / 15.2 GB
2 XCL_GPU_PAGE_MAPPINGS=0 stops at about 235 s 5,400 12.6 / 13.9 GB
3 XCL_GPU_PAGE_MAPPINGS=0 ran the full 330 s 7,212 12.8 / 13.7 GB

After the loading burst the title showed 22–29 fps in runs 2 and 3. Memory compression averaged 0.15–0.42 GB/s after 110 s, against 2–4 GB/s without the change.

Correction: I wrote "swap used 2–3 GB" with the change. In these runs swap peaked at 5.1–6.7 GB. Some of that may be left over from the run before (they ran back to back), but I cannot separate the two, so read the swap row of my table as "lower than before", not as a figure.

One more commit on the tolerant-read branch (1d2d527; the branch is now 233 lines): the first clean run with XCL_GPU_PAGE_MAPPINGS=0 ended at 47 s in memory_hash_in, which read the title's memory in place as well. On a Mac it now hashes through the same copy, 64 KiB at a time, with the hash unchanged. The 19 title_textures tests pass under CrossOver, and runs 2 and 3 above are with it.

Point 5 has its cause: it is #1405. mac7 is older than that PR. With its change ported by hand, the garbage reads did not happen in 3 of 3 runs at default settings (3 of 6 without), and each run logged 16,384 or more page lists rewritten after enqueue. XCL_GPU_PAGE_MAPPINGS=0 only avoided it. Test report on the PR: #1405

Where the runs stop now is not memory and not these branches: at world entry the title submits a frame with compute work from XboxBvhBuilder.dll (18 small dispatches, then four 1x1x1 ones), and the queue never finishes it; the title ends itself about 30 s later. Skipping the four programs involved, one at a time, puts it on one of them: a [numthreads(1024,1,1)] program whose s_barriers become xcl_s_barrier on this GPU (wave 32). With XCL_SAFE_BARRIER=0 the queue does not hang, and the title then crashes reading the same garbage value as when that program is skipped, so its output is wrong or empty in that form. I have the four console blobs and their translations locally and can run whatever would help whoever knows the split-wave64 code.

AI use: Claude Code with Claude Fable 5.2 ran the runs, wrote the commit and this comment on my machine.

**@⁠shortside** on GitHub · 2026-11-25 09:42 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7158699323) **Follow-up to my comment above: the numbers repeated on the clean branches, one correction, one more commit, and the cause of point 5.** Same machine and setup. Build: `mac7` `dbd9d09` + #615 + `d3d12x/streamed-texture-level-tiles` (`2d6cc2e`) + `d3d12x/native-host-tolerant-texture-read` (`1d2d527`), nothing else. Three scripted runs of 330 s: | run | settings | outcome | frames | wired after 110 s (avg / peak) | |---|---|---|---|---| | 1 | defaults | stops at about 165 s | 3,000 by 162 s | 14.0 / 15.2 GB | | 2 | `XCL_GPU_PAGE_MAPPINGS=0` | stops at about 235 s | 5,400 | 12.6 / 13.9 GB | | 3 | `XCL_GPU_PAGE_MAPPINGS=0` | ran the full 330 s | 7,212 | 12.8 / 13.7 GB | After the loading burst the title showed 22–29 fps in runs 2 and 3. Memory compression averaged 0.15–0.42 GB/s after 110 s, against 2–4 GB/s without the change. **Correction:** I wrote "swap used 2–3 GB" with the change. In these runs swap peaked at 5.1–6.7 GB. Some of that may be left over from the run before (they ran back to back), but I cannot separate the two, so read the swap row of my table as "lower than before", not as a figure. **One more commit on the tolerant-read branch** (`1d2d527`; the branch is now 233 lines): the first clean run with `XCL_GPU_PAGE_MAPPINGS=0` ended at 47 s in `memory_hash_in`, which read the title's memory in place as well. On a Mac it now hashes through the same copy, 64 KiB at a time, with the hash unchanged. The 19 `title_textures` tests pass under CrossOver, and runs 2 and 3 above are with it. **Point 5 has its cause: it is #1405.** `mac7` is older than that PR. With its change ported by hand, the garbage reads did not happen in 3 of 3 runs at default settings (3 of 6 without), and each run logged 16,384 or more page lists rewritten after enqueue. `XCL_GPU_PAGE_MAPPINGS=0` only avoided it. Test report on the PR: https://git.gtahub.st/github/xcl-dev--xcl/pulls/1405 **Where the runs stop now** is not memory and not these branches: at world entry the title submits a frame with compute work from `XboxBvhBuilder.dll` (18 small dispatches, then four 1x1x1 ones), and the queue never finishes it; the title ends itself about 30 s later. Skipping the four programs involved, one at a time, puts it on one of them: a `[numthreads(1024,1,1)]` program whose `s_barrier`s become `xcl_s_barrier` on this GPU (wave 32). With `XCL_SAFE_BARRIER=0` the queue does not hang, and the title then crashes reading the same garbage value as when that program is skipped, so its output is wrong or empty in that form. I have the four console blobs and their translations locally and can run whatever would help whoever knows the split-wave64 code. **AI use:** Claude Code with Claude Fable 5.2 ran the runs, wrote the commit and this comment on my machine.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-25 10:55 UTC · original

@⁠Ahmet-Dedeler, a memory-status bug on main that your mac7 branch carries unchanged: process_private_bytes (crates/xcl/src/hle/kernelx.rs:787 on mac7) takes PrivateUsage from K32GetProcessMemoryInfo and falls back to PagefileUsage when it is 0. TitleMemoryStatus (kernelx.rs:802, used = process_private_bytes().min(total) at :808, avail = total - used) and XMemGetWorkingSetStatistics (kernelx.rs:732, :739) both use it. mac7 has no override: the only change around it is the configurable budget (title_memory_budget_mb, config.rs:117), which sets total, not used. The activity log's commit figure (host.rs:57) reads PrivateUsage directly.

Under CrossOver 26.3 / Wine 11.0 on macOS I measured with a probe: PrivateUsage is always 0 (Wine returns cb = 72), and PagefileUsage is a near-constant ~42 GB that does not move with commits (it looks like the virtual size). Only a VirtualQuery sum of MEM_COMMIT + MEM_PRIVATE regions follows commits (+256 MB on a 256 MB commit, back on free). So used is clamped to the budget and a title on a Mac is told it has 0 bytes of title memory available.

I posted a fix on #1097 (#1097). The Mac half: when PrivateUsage is 0 and the host is not Linux, use the VirtualQuery sum, both for process_private_bytes and for the activity log, with a test that a 256 MB commit shows up. The code is the same on mac7, so it should apply there as is. This is narrower than the loading-memory item in your notes: I only know the title sees no available memory; I have not checked whether fixing it changes how it streams.

AI use: Claude Code. Claude Opus 5.5 checked the code paths and wrote this note; the counter measurements came from a probe run by a Claude Opus 5.5 agent on this machine.

**@⁠vakaobr** on GitHub · 2026-11-25 10:55 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7160347024) @⁠Ahmet-Dedeler, a memory-status bug on `main` that your `mac7` branch carries unchanged: `process_private_bytes` (`crates/xcl/src/hle/kernelx.rs:787` on mac7) takes `PrivateUsage` from `K32GetProcessMemoryInfo` and falls back to `PagefileUsage` when it is 0. `TitleMemoryStatus` (`kernelx.rs:802`, `used = process_private_bytes().min(total)` at :808, `avail = total - used`) and `XMemGetWorkingSetStatistics` (`kernelx.rs:732`, :739) both use it. mac7 has no override: the only change around it is the configurable budget (`title_memory_budget_mb`, `config.rs:117`), which sets `total`, not `used`. The activity log's commit figure (`host.rs:57`) reads `PrivateUsage` directly. Under CrossOver 26.3 / Wine 11.0 on macOS I measured with a probe: `PrivateUsage` is always 0 (Wine returns cb = 72), and `PagefileUsage` is a near-constant ~42 GB that does not move with commits (it looks like the virtual size). Only a `VirtualQuery` sum of `MEM_COMMIT` + `MEM_PRIVATE` regions follows commits (+256 MB on a 256 MB commit, back on free). So `used` is clamped to the budget and a title on a Mac is told it has 0 bytes of title memory available. I posted a fix on #1097 (https://git.gtahub.st/github/xcl-dev--xcl/pulls/1097). The Mac half: when `PrivateUsage` is 0 and the host is not Linux, use the `VirtualQuery` sum, both for `process_private_bytes` and for the activity log, with a test that a 256 MB commit shows up. The code is the same on mac7, so it should apply there as is. This is narrower than the loading-memory item in your notes: I only know the title sees no available memory; I have not checked whether fixing it changes how it streams. AI use: Claude Code. Claude Opus 5.5 checked the code paths and wrote this note; the counter measurements came from a probe run by a Claude Opus 5.5 agent on this machine.
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-25 19:09 UTC · original

@⁠vakaobr opened it: #2445, the ring from fd1e593 on current main, as a draft stacked on #1789. The bottom commit is your #1789 rebased onto main (its base predates a res_release change the ring builds on), authorship kept. Your host-thread part (no host Release at all on a host thread) is not in it, so it can go on top as you planned.

What changed against mac7 while porting:

  • 1de6f68's main point is already on main: #1981 (merged today) makes sparse::forget_buffer only try the lock and queue the rest, so the re-entry case from my retail runs no longer waits there. Your 21:06 note that main still takes that lock unconditionally predates it. #789 covers the free_at_release half, so I left both out.
  • The gate needs no other PR: class_for already calls module_of on the table's first method, and when that is 0 it sets NATIVE_HOST once and starts the late-release thread on the adopting thread. One thing I noticed on this Mac: XCL's own device goes through d3d12.dll (a PE module), but resources, queues, lists and fences are at addresses in no module, so the flag gets set at the first of those.
  • One more spot of the same shape, from reading only: late_release::hold waits for the late-release lock, and drain_known keeps that lock while it signals the queues. A Release that arrives inside that signal on the same thread would wait for good. I have a small fix with a test that holds the lock from another thread, but I haven't seen it happen in a run, so I'm not opening it unless one of us does.

Also, for the mingw cross-build ivall asked for first: #2442 is the page on building with mingw-w64 and running under CrossOver (docs only, main builds without a change), with main's suite counts on this host.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-25 19:09 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7171889800) @⁠vakaobr opened it: #2445, the ring from `fd1e593` on current `main`, as a draft stacked on #1789. The bottom commit is your #1789 rebased onto `main` (its base predates a `res_release` change the ring builds on), authorship kept. Your host-thread part (no host `Release` at all on a host thread) is not in it, so it can go on top as you planned. What changed against `mac7` while porting: - `1de6f68`'s main point is already on `main`: #1981 (merged today) makes `sparse::forget_buffer` only try the lock and queue the rest, so the re-entry case from my retail runs no longer waits there. Your 21:06 note that `main` still takes that lock unconditionally predates it. #789 covers the `free_at_release` half, so I left both out. - The gate needs no other PR: `class_for` already calls `module_of` on the table's first method, and when that is 0 it sets `NATIVE_HOST` once and starts the late-release thread on the adopting thread. One thing I noticed on this Mac: XCL's own device goes through `d3d12.dll` (a PE module), but resources, queues, lists and fences are at addresses in no module, so the flag gets set at the first of those. - One more spot of the same shape, from reading only: `late_release::hold` waits for the late-release lock, and `drain_known` keeps that lock while it signals the queues. A `Release` that arrives inside that signal on the same thread would wait for good. I have a small fix with a test that holds the lock from another thread, but I haven't seen it happen in a run, so I'm not opening it unless one of us does. Also, for the mingw cross-build ivall asked for first: #2442 is the page on building with mingw-w64 and running under CrossOver (docs only, `main` builds without a change), with `main`'s suite counts on this host.
Author
Owner

@⁠shortside on GitHub · 2026-11-25 19:15 UTC · original

@⁠vakaobr thanks for stacking these. I ran the retail title on mac/integration at 5f9a58f three times on my 24 GB machine. Short version: it gets further than anything I had, one of your commits brings the texture memory back, and the queue still stops right after the first world frames.

Setup: MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3, D3DMetal; release build for x86_64-pc-windows-msvc, DXC 1.9.2609. device_type = "lockhart", raytracing = "off", a warm data root, the same scripted pad presses, 330 s cap. I stop a run when wired memory reaches 17 GB or swap grows by 5 GB, because a run froze this machine earlier today.

run switches how far wired memory
1 none my guard stopped it at 82 s, still loading, about 30 fps 16.5 GB at 82 s and rising
2 XCL_VRAM_ARENAS=1 presents stop at about 163 s (world set-up); the title's own stall crash at game_scarlett_master.exe+0x23cf683 ends it at 192 s, with 64 compute pipelines built in between peak 14.3 GB
3 XCL_VRAM_ARENAS=1 XCL_PSO_WAIT_MS=50 ran the 330 s, exit 0x0, 3,818 frames; see below peak 16.2 GB

1. Sampled textures on shared pages (6a78ce4) undoes the level-by-level memory on a Mac. As I read it, my level tiles only take a texture when place_pages gives nothing, and with sampled_on_pages true on a Mac it no longer does, so those textures have pages under every level again. At the same point in loading (about 80 s) my earlier builds with the two branches were at 12.3 – 14.0 GB wired and run 2 was at 12.6 GB; run 1 was at 16.5 GB. On 24 GB that is the difference between loading and swapping. Either #2306's level pages (now on main) on that path, or leaving it off by default on a Mac until then, would keep both.

2. Run 3 is the furthest I have seen. Presents go on until about 190 s, then nothing for 30 s while the world is set up, then two frames between 221 and 226 s with 2,533 and 6,044 dispatches and 74 and 222 draws in their 2 s windows (my screen went from black to one flat colour there, nothing recognisable). Then at 229 s:

GPU queue.Wait at … >= 0xeee did not complete within 5000 ms (waiter=q0/ty2, prod=qSome(4)/tySome(2), recorded=0xeef, submitted=0xeee, completed=0xeed) – released on CPU to prevent GPU hang

four of those at once, then writes after the GPU … although their queue had not got there after 10000 ms every 10 – 20 s, no further present, and D3D12 queue drain: GPU fences still pending after 10 s at exit. The title's stall watchdog fired three times after that and was skipped each time. In run 2, without XCL_PSO_WAIT_MS, the stall crash at +0x23cf683 was not skipped and ended the process; I have not checked whether the three skipped ones are the same site.

3. Your question about XCL_SAFE_BARRIER=0. You may well be right that my wrong output came from cached spin-barrier shaders: that run reused a warm data root. On your branch, with the native barrier as the default, the queue no longer hangs at world entry the way it did for me on mac7; it gets through the set-up and two frames first. I cannot tell you whether the compute output is right, because nothing recognisable was drawn, and I do not know yet which piece of work the queue stops on at 229 s.

Not tested: more than one run per configuration; the default configuration past 82 s; which dispatch or draw hangs the queue; Windows.

AI use: Claude Code with Claude Fable 5.2 built the branch, ran the three runs on my machine, read the logs and wrote this comment.

**@⁠shortside** on GitHub · 2026-11-25 19:15 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7172050724) @⁠vakaobr thanks for stacking these. I ran the retail title on `mac/integration` at `5f9a58f` three times on my 24 GB machine. Short version: it gets further than anything I had, one of your commits brings the texture memory back, and the queue still stops right after the first world frames. **Setup:** MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3, D3DMetal; release build for `x86_64-pc-windows-msvc`, DXC 1.9.2609. `device_type = "lockhart"`, `raytracing = "off"`, a warm data root, the same scripted pad presses, 330 s cap. I stop a run when wired memory reaches 17 GB or swap grows by 5 GB, because a run froze this machine earlier today. | run | switches | how far | wired memory | |---|---|---|---| | 1 | none | my guard stopped it at 82 s, still loading, about 30 fps | 16.5 GB at 82 s and rising | | 2 | `XCL_VRAM_ARENAS=1` | presents stop at about 163 s (world set-up); the title's own stall crash at `game_scarlett_master.exe+0x23cf683` ends it at 192 s, with 64 compute pipelines built in between | peak 14.3 GB | | 3 | `XCL_VRAM_ARENAS=1 XCL_PSO_WAIT_MS=50` | ran the 330 s, exit 0x0, 3,818 frames; see below | peak 16.2 GB | **1. Sampled textures on shared pages (`6a78ce4`) undoes the level-by-level memory on a Mac.** As I read it, my level tiles only take a texture when `place_pages` gives nothing, and with `sampled_on_pages` true on a Mac it no longer does, so those textures have pages under every level again. At the same point in loading (about 80 s) my earlier builds with the two branches were at 12.3 – 14.0 GB wired and run 2 was at 12.6 GB; run 1 was at 16.5 GB. On 24 GB that is the difference between loading and swapping. Either #2306's level pages (now on `main`) on that path, or leaving it off by default on a Mac until then, would keep both. **2. Run 3 is the furthest I have seen.** Presents go on until about 190 s, then nothing for 30 s while the world is set up, then two frames between 221 and 226 s with 2,533 and 6,044 dispatches and 74 and 222 draws in their 2 s windows (my screen went from black to one flat colour there, nothing recognisable). Then at 229 s: ``` GPU queue.Wait at … >= 0xeee did not complete within 5000 ms (waiter=q0/ty2, prod=qSome(4)/tySome(2), recorded=0xeef, submitted=0xeee, completed=0xeed) – released on CPU to prevent GPU hang ``` four of those at once, then `writes after the GPU … although their queue had not got there after 10000 ms` every 10 – 20 s, no further present, and `D3D12 queue drain: GPU fences still pending after 10 s` at exit. The title's stall watchdog fired three times after that and was skipped each time. In run 2, without `XCL_PSO_WAIT_MS`, the stall crash at `+0x23cf683` was not skipped and ended the process; I have not checked whether the three skipped ones are the same site. **3. Your question about `XCL_SAFE_BARRIER=0`.** You may well be right that my wrong output came from cached spin-barrier shaders: that run reused a warm data root. On your branch, with the native barrier as the default, the queue no longer hangs at world entry the way it did for me on `mac7`; it gets through the set-up and two frames first. I cannot tell you whether the compute output is right, because nothing recognisable was drawn, and I do not know yet which piece of work the queue stops on at 229 s. **Not tested:** more than one run per configuration; the default configuration past 82 s; which dispatch or draw hangs the queue; Windows. **AI use:** Claude Code with Claude Fable 5.2 built the branch, ran the three runs on my machine, read the logs and wrote this comment.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-25 20:35 UTC · original

@⁠shortside thanks for the runs. Your reading of 6a78ce4 is right: with sampled_on_pages on, place_pages takes those textures, so your level tiles never see them, and they get pages under every level. The branch is at 2b3f3d2 now, where on a Mac sampled textures stay off the shared pages unless XCL_VRAM_ARENAS=0, as before 6a78ce4. The render-target change that came after it (24809ec) follows the same switch. So the default should be back on your level tiles. If you have time for one more run at 2b3f3d2 with no switches, it would confirm that the wired memory is back where your run 2 was; I have no title to check it.

For main I added a note to #2402: there, the same textures get pages under every level unless #2306's XCL_TEXTURE_LEVEL_PAGES=1 maps a level when its texels come. Whether #2402 with level pages beats committed copies on a Mac isn't measured.

Good to hear the native barrier gets you past world entry. Which piece of work the queue stops on at 229 s is beyond what I can look at without a title.

@⁠Ahmet-Dedeler thanks for #2445. You're right that my #2474 duplicates it: both add a ring in late_release.rs. I'm reworking it to sit on top of #2445: your ring and your NATIVE_HOST gate, with only the part that keeps a Release arriving on a D3DMetal thread off that thread. I'll restack it as "Stacked on #2445" and close the current version once that's ready. Noted on 1de6f68 and #1981, and on drain_known: I haven't seen it either, so I'd leave it until one of us does.

AI use: Claude Code with Claude Opus 5.5 checked the code behind both points and wrote this reply.

**@⁠vakaobr** on GitHub · 2026-11-25 20:35 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7173901227) @⁠shortside thanks for the runs. Your reading of `6a78ce4` is right: with `sampled_on_pages` on, `place_pages` takes those textures, so your level tiles never see them, and they get pages under every level. The branch is at `2b3f3d2` now, where on a Mac sampled textures stay off the shared pages unless `XCL_VRAM_ARENAS=0`, as before `6a78ce4`. The render-target change that came after it (`24809ec`) follows the same switch. So the default should be back on your level tiles. If you have time for one more run at `2b3f3d2` with no switches, it would confirm that the wired memory is back where your run 2 was; I have no title to check it. For `main` I added a note to #2402: there, the same textures get pages under every level unless #2306's `XCL_TEXTURE_LEVEL_PAGES=1` maps a level when its texels come. Whether #2402 with level pages beats committed copies on a Mac isn't measured. Good to hear the native barrier gets you past world entry. Which piece of work the queue stops on at 229 s is beyond what I can look at without a title. @⁠Ahmet-Dedeler thanks for #2445. You're right that my #2474 duplicates it: both add a ring in `late_release.rs`. I'm reworking it to sit on top of #2445: your ring and your `NATIVE_HOST` gate, with only the part that keeps a `Release` arriving on a D3DMetal thread off that thread. I'll restack it as "Stacked on #2445" and close the current version once that's ready. Noted on `1de6f68` and #1981, and on `drain_known`: I haven't seen it either, so I'd leave it until one of us does. AI use: Claude Code with Claude Opus 5.5 checked the code behind both points and wrote this reply.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-25 16:04 UTC · original · edited 2026-11-25 20:42 UTC

@⁠Ahmet-Dedeler @⁠shortside I stacked the open Mac fixes on top of mac7 in one branch, so they can be tested together on a Mac: https://github.com/vakaobr/xcl/tree/mac/integration (head 24809ec; edited to add what came since, below). It's for testing, not for merging; each part has or will get its own PR.

What's in it, on top of mac7 (dbd9d09)

  • #615 (0x6461726B): multi-plane PresentX overlays composited
  • shortside's d3d12x/streamed-texture-level-tiles and d3d12x/native-host-tolerant-texture-read
  • #1405 (mgrein): DirectStorage rereads a physical-page list when its request runs
  • #1993 (Ariorh1337), ported onto mac7's sparse state: a copy back after a submission doesn't wait for the title's queue. It replaces #433, which its author closed in favour of #1993.
  • #2327: the translated-shader cache keys on XCL_SAFE_BARRIER, so changing it no longer reuses shaders cached without it (#1409). On a Mac the tag follows the Mac's default. Edited: this first said it fixed three more switches; those are already in cache_allowed on main and never reuse a cached shader. For main, #1413 fixes #1409 the same way as those and came first.
  • mine, now draft PRs against main (each with its tests and what is not tested):
    • #2361: util::mac_host() (Darwin under Wine); #2363 and #2402 build on it
    • #2362: kernelx: the process's commit comes from VirtualQuery when Wine reports PrivateUsage as 0
    • #2402: title textures share video-memory pages on a macOS host too (block-compressed formats, and others with ALLOW_UNORDERED_ACCESS: D3DMetal reads other reserved textures on the same tiles scrambled); #2492 adds render targets (0 of 4096 texels wrong; depth targets 3968 of 4096, so they keep arenas). On a Mac both need #1904 and #2445 + #2498 to run.
    • #2363: on a macOS host s_barrier is the native group barrier by default (XCL_SAFE_BARRIER=1 brings back the spin barrier). On D3DMetal, in a 1024-thread group, the waves spinning in the emulated barrier starve the one still working until the spin gives up, and then threads read LDS too early. The native barrier was correct in every case I tried, including exited waves and LDS exchange across the two halves.
    • #2498 (stacked on Ahmet's #2445, replacing my #2474): a Release that D3DMetal makes on a thread of its own is run by a Wine thread (mac7 has its own version of this, so the branch keeps that one)
    • #2414 (test-only): under Wine the e2e test stages its folders at the target directory's drive path, so the S: storage checks resolve
  • added since: #750 (Lucasyudi: a pipeline stage the PC cannot run goes to the fallback without the driver; D3DMetal crashed on the test title's XBOX pixel shader), #1698 (shortside: Opus GetState under Wine), #794 (gsucristo) + #1462 (crastinator): the console window is hidden where DWM cannot cloak it

@⁠shortside about the wrong output you saw with XCL_SAFE_BARRIER=0: on main the translated cache doesn't key on that switch, so that run could have reused the spin-barrier shaders an earlier run cached. A rerun with XCL_TRANSLATED_CACHE=0, or on this branch, rules that out.

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, DXC 1.9.2609, every test in its own process, at 1f9eebe)

  • cargo test --workspace built for x86_64-pc-windows-gnu, all 16 test binaries: 763 passed, 17 failed, 9 timed out (90 s for GPU tests, 180 s for the rest), 12 SKIPPED, 45 ignored. The lib alone: 724 passed, 14 failed, 8 timed out, 11 SKIPPED, 23 ignored.
  • Compared with the same branch this morning (with #433 where #1993 is now, and without #2327), no test got worse. The failures are the ones a Mac already has: any program with an f64 instruction writes nothing on D3DMetal (gpu_f64_* and a few others), pixel-shader draws that time out (gpu_rect_list_*, gpu_graphics_vs_ps_draw, gpu_wave64_ps_*), OpenExistingHeapFromAddress, one compositor frame dump, predication_e2e, pls_quota and one gpu_compute_e2e test.
  • Edited: I first wrote that the test title crashes when it exits and that this is not from the branch. It crashed 0.84 s in, in D3DMetal under CreateGraphicsPipelineState for its XBOX pixel shader, on every tree (main too). #750 fixes it; with #750, #1698, #794 and #1462 the test title passes all 50 of its checks and exits with 0 (3 runs).
  • After the full run (targeted, not a new full run): #750, #1698, #794 + #1462 and the render-target change each tested with the tests of the code they change, before and after; results in each PR and in my reports on #750, #1698, #794 and #1462.
  • #1993's 4 new tests print SKIPPED: no WARP device (CrossOver has no WARP adapter). With a local change that falls back to the D3DMetal adapter they pass 4 of 4; that change is not in the branch.

Not tested: a title, Windows, a release build of the tests.

To try it on a Mac: build with cargo build --release -p xcl --target x86_64-pc-windows-gnu, set XCL_DXC_DIR to a DXC 1.9 bin\x64 folder, and run xcl.exe run <game folder> through wine --bottle <bottle> in a CrossOver bottle with D3DMetal on. If something breaks, logs\xcl.log and logs\report.json under %LOCALAPPDATA%\XCL\<title>\ in the bottle are what helps, plus the CRASH: line it prints at exit.

AI use: Claude Code with Claude Opus 5.5 ported #1405 and #1993 onto mac7, wrote my commits and PRs (#2327, #2361, #2362, #2363, #2402, #2414, #2492, #2498; Claude Opus 4.6 helped with #2474, now #2498, and the probes for #2492), ran the tests, and wrote this comment.

**@⁠vakaobr** on GitHub · 2026-11-25 16:04 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7167562938) · edited 2026-11-25 20:42 UTC @⁠Ahmet-Dedeler @⁠shortside I stacked the open Mac fixes on top of `mac7` in one branch, so they can be tested together on a Mac: https://github.com/vakaobr/xcl/tree/mac/integration (head `24809ec`; *edited* to add what came since, below). It's for testing, not for merging; each part has or will get its own PR. **What's in it, on top of `mac7` (`dbd9d09`)** - #615 (0x6461726B): multi-plane PresentX overlays composited - shortside's `d3d12x/streamed-texture-level-tiles` and `d3d12x/native-host-tolerant-texture-read` - #1405 (mgrein): DirectStorage rereads a physical-page list when its request runs - #1993 (Ariorh1337), ported onto `mac7`'s sparse state: a copy back after a submission doesn't wait for the title's queue. It replaces #433, which its author closed in favour of #1993. - #2327: the translated-shader cache keys on `XCL_SAFE_BARRIER`, so changing it no longer reuses shaders cached without it (#1409). On a Mac the tag follows the Mac's default. *Edited:* this first said it fixed three more switches; those are already in `cache_allowed` on `main` and never reuse a cached shader. For `main`, #1413 fixes #1409 the same way as those and came first. - mine, now draft PRs against `main` (each with its tests and what is not tested): - #2361: `util::mac_host()` (Darwin under Wine); #2363 and #2402 build on it - #2362: `kernelx`: the process's commit comes from `VirtualQuery` when Wine reports `PrivateUsage` as 0 - #2402: title textures share video-memory pages on a macOS host too (block-compressed formats, and others with `ALLOW_UNORDERED_ACCESS`: D3DMetal reads other reserved textures on the same tiles scrambled); #2492 adds render targets (0 of 4096 texels wrong; depth targets 3968 of 4096, so they keep arenas). On a Mac both need #1904 and #2445 + #2498 to run. - #2363: on a macOS host `s_barrier` is the native group barrier by default (`XCL_SAFE_BARRIER=1` brings back the spin barrier). On D3DMetal, in a 1024-thread group, the waves spinning in the emulated barrier starve the one still working until the spin gives up, and then threads read LDS too early. The native barrier was correct in every case I tried, including exited waves and LDS exchange across the two halves. - #2498 (stacked on Ahmet's #2445, replacing my #2474): a `Release` that D3DMetal makes on a thread of its own is run by a Wine thread (`mac7` has its own version of this, so the branch keeps that one) - #2414 (test-only): under Wine the e2e test stages its folders at the target directory's drive path, so the `S:` storage checks resolve - added since: #750 (Lucasyudi: a pipeline stage the PC cannot run goes to the fallback without the driver; D3DMetal crashed on the test title's `XBOX` pixel shader), #1698 (shortside: Opus `GetState` under Wine), #794 (gsucristo) + #1462 (crastinator): the console window is hidden where DWM cannot cloak it @⁠shortside about the wrong output you saw with `XCL_SAFE_BARRIER=0`: on `main` the translated cache doesn't key on that switch, so that run could have reused the spin-barrier shaders an earlier run cached. A rerun with `XCL_TRANSLATED_CACHE=0`, or on this branch, rules that out. **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, DXC 1.9.2609, every test in its own process, at `1f9eebe`) - `cargo test --workspace` built for `x86_64-pc-windows-gnu`, all 16 test binaries: 763 passed, 17 failed, 9 timed out (90 s for GPU tests, 180 s for the rest), 12 SKIPPED, 45 ignored. The lib alone: 724 passed, 14 failed, 8 timed out, 11 SKIPPED, 23 ignored. - Compared with the same branch this morning (with #433 where #1993 is now, and without #2327), no test got worse. The failures are the ones a Mac already has: any program with an f64 instruction writes nothing on D3DMetal (`gpu_f64_*` and a few others), pixel-shader draws that time out (`gpu_rect_list_*`, `gpu_graphics_vs_ps_draw`, `gpu_wave64_ps_*`), `OpenExistingHeapFromAddress`, one compositor frame dump, `predication_e2e`, `pls_quota` and one `gpu_compute_e2e` test. - *Edited:* I first wrote that the test title crashes when it exits and that this is not from the branch. It crashed 0.84 s in, in D3DMetal under `CreateGraphicsPipelineState` for its `XBOX` pixel shader, on every tree (`main` too). #750 fixes it; with #750, #1698, #794 and #1462 the test title passes all 50 of its checks and exits with 0 (3 runs). - After the full run (targeted, not a new full run): #750, #1698, #794 + #1462 and the render-target change each tested with the tests of the code they change, before and after; results in each PR and in my reports on #750, #1698, #794 and #1462. - #1993's 4 new tests print `SKIPPED: no WARP device` (CrossOver has no WARP adapter). With a local change that falls back to the D3DMetal adapter they pass 4 of 4; that change is not in the branch. **Not tested:** a title, Windows, a release build of the tests. **To try it on a Mac:** build with `cargo build --release -p xcl --target x86_64-pc-windows-gnu`, set `XCL_DXC_DIR` to a DXC 1.9 `bin\x64` folder, and run `xcl.exe run <game folder>` through `wine --bottle <bottle>` in a CrossOver bottle with D3DMetal on. If something breaks, `logs\xcl.log` and `logs\report.json` under `%LOCALAPPDATA%\XCL\<title>\` in the bottle are what helps, plus the `CRASH:` line it prints at exit. AI use: Claude Code with Claude Opus 5.5 ported #1405 and #1993 onto `mac7`, wrote my commits and PRs (#2327, #2361, #2362, #2363, #2402, #2414, #2492, #2498; Claude Opus 4.6 helped with #2474, now #2498, and the probes for #2492), ran the tests, and wrote this comment.
Author
Owner

@⁠vakaobr on GitHub · 2026-11-26 00:57 UTC · original

@⁠Ahmet-Dedeler @⁠shortside I rebuilt my Mac integration branch on current main instead of on mac7: https://github.com/vakaobr/xcl/tree/mac/integration is now at efef307, on main 6d12f58. The mac7-based version is kept as mac/integration-old-2b3f3d2. As before, it is for testing on a Mac, not for merging.

What's in it, on top of main

  • My PRs: #2327, #2361, #2362, #2363, #2402, #2414, #2492, and #2498 on Ahmet's #2445.

  • Other people's PRs: #750, #794 + #1462, #1698, #1904, #1993. #1405 is in main now.

  • The mac7 parts that already have a PR: #1344 (masked stores under Rosetta 2), #1649 (depth + stencil formats are depth only on D3DMetal), #996 (CPU-clock timestamps), #1026 (capture hashing off the lock), #1329 (the committed window gets a copy in video memory), #982 (test).

  • From mac7 directly, credited to Ahmet: the title's network off on a Mac unless XCL_NETWORK=1, 16 MiB title stacks, readable() probing memory VirtualQuery doesn't know, coherent heaps and lazy pages off on a Mac, the dual-source stand-in pixel shaders, and XCL_TEXTURE_SKIP_UNCHANGED.

  • shortside's level tiles and tolerant texture read, ported off mac7: NATIVE_HOST_MEMORY became #2445's real::native_host(), and an absent level is now an all-zero level, as in main's #2306. memory_hash_in (1d2d527) is not in main, so I left that commit out. On a Mac, sampled textures and render targets stay on the level tiles unless XCL_VRAM_ARENAS=0, as on the old branch.

  • Not ported from mac7, because each is large, needs mac7's own memory model, or is for one retail title:

    • the ADCX/ADOX/RDSEED/MOVNTS helpers and the title watchdog (84954d5)
    • the CPU CopyMemoryToMemoryX (d0926c6)
    • the unwatched-memory path and GPU views (77fac3b, ae4ca92, 94403a1, 3f965ed)
    • the DXC heap per thread (5024a59)
    • the AS-slot mesh shaders (#541, which conflicts with main)
    • the diagnostics and HANDOFF commits

    @⁠Ahmet-Dedeler if any of these is needed for a title to get as far as it did on mac7, tell me which and I'll port it.

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, DXC 1.9.2609, every test in its own process; full run at 762645d, and the commits after it change only tests, which I reran)

  • All 1516 tests: 1356 passed, 56 failed, 22 timed out (90 s for GPU tests, 180 s for the rest), 1 crashed, 34 SKIPPED, 47 ignored.
  • The 818 tests the old branch also has: 733 passed here against 739 there. Each test whose result changed, with its reason:
    • Fixed: gpu_uma_import_check_at_init passes (by #1329), and gpu_placed_console_depth_target_with_clear_value passes (it ends in Metal's pixel-format assertion on plain main).
    • gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2, gpu_more_atomics_sub_dword_scratch_valu now fail. main changed these tests, and they fail the same way on plain main (D3DMetal writes nothing for the 64-bit atomics they now include).
    • Now SKIPPED, each with a reason, where a Mac default from mac7 or the old branch changes what they test:
      • mapping_fresh_pages_does_not_query_each_page, mapping_lazy_pages_again_does_not_query_each_page and gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes: lazy pages are off on a Mac. They pass with XCL_LAZY_PAGES=1.
      • placed_title_textures_share_vram_and_preserve_pixels: title textures keep arenas on a Mac.
      • readable_answers_from_the_working_set_without_touching_pages: Wine on macOS reports no working set. It fails on plain main too; on mac7 its skip went to stdout, so the old run counted it as a pass.
    • Now SKIPPED as on plain main: texture_states (its SKIPPED line moved to stderr in #2154) and predication_e2e.
    • The e2e title test no longer times out. The title runs to the end with 0 failures and leaves the game folder untouched. It now fails one later check: called_stubs comes back empty although the stub was called. It does the same on plain main, and I haven't found why.
  • The 698 tests that are new on main: 623 passed. I reran the ones that didn't pass on plain main (6d12f58), one per process, and they fail the same way there: gpu::dxil fuzz, ops and core tests, the d3d12_* checks against the host driver, d3d12_mesh_stream, one gpu_compute_e2e test, and wave64 and pixel-shader timeouts.
    • One exception: raw_loads_in_root_windows_respect_exec_and_bounds fails on main because OpenExistingHeapFromAddress isn't there. Here #1329 gets past that, and then the test thread overflows its stack and hangs. This is a path only tests take.
  • Three tests from d3d12_check_feature_support compare the PC format mapping with the driver. They now run with XCL_DEPTH_STENCIL=1, because #1649 makes D24S8 depth only on a Mac.
  • The test title: all 50 checks pass and it exits with 0, in 4 runs with a fresh data folder each time (2 without XCL_DXC_DIR, 2 with it).

Not tested: a retail title, so loading, memory under the level tiles, and what XCL_TEXTURE_SKIP_UNCHANGED guards against are unchecked. Also not tested: Windows, and a release build of the tests.

To try it: same as before, cargo build --release -p xcl --target x86_64-pc-windows-gnu at efef307, then xcl.exe run <game folder> in a CrossOver bottle with D3DMetal on and XCL_DXC_DIR set. If a title that ran on the old branch stops working here, the commits listed as not ported are the first suspects, and logs\xcl.log plus the CRASH: line tell which.

AI use: Claude Code with Claude Opus 5.5 rebuilt the branch, ported the mac7 and shortside commits, wrote the test changes, ran the tests and wrote this comment.

**@⁠vakaobr** on GitHub · 2026-11-26 00:57 UTC · [original](https://github.com/xcl-dev/xcl/issues/258#issuecomment-7179288681) @⁠Ahmet-Dedeler @⁠shortside I rebuilt my Mac integration branch on current `main` instead of on `mac7`: https://github.com/vakaobr/xcl/tree/mac/integration is now at `efef307`, on `main` `6d12f58`. The `mac7`-based version is kept as `mac/integration-old-2b3f3d2`. As before, it is for testing on a Mac, not for merging. **What's in it, on top of `main`** - My PRs: #2327, #2361, #2362, #2363, #2402, #2414, #2492, and #2498 on Ahmet's #2445. - Other people's PRs: #750, #794 + #1462, #1698, #1904, #1993. #1405 is in `main` now. - The `mac7` parts that already have a PR: #1344 (masked stores under Rosetta 2), #1649 (depth + stencil formats are depth only on D3DMetal), #996 (CPU-clock timestamps), #1026 (capture hashing off the lock), #1329 (the committed window gets a copy in video memory), #982 (test). - From `mac7` directly, credited to Ahmet: the title's network off on a Mac unless `XCL_NETWORK=1`, 16 MiB title stacks, `readable()` probing memory `VirtualQuery` doesn't know, coherent heaps and lazy pages off on a Mac, the dual-source stand-in pixel shaders, and `XCL_TEXTURE_SKIP_UNCHANGED`. - shortside's level tiles and tolerant texture read, ported off `mac7`: `NATIVE_HOST_MEMORY` became #2445's `real::native_host()`, and an absent level is now an all-zero level, as in `main`'s #2306. `memory_hash_in` (1d2d527) is not in `main`, so I left that commit out. On a Mac, sampled textures and render targets stay on the level tiles unless `XCL_VRAM_ARENAS=0`, as on the old branch. - Not ported from `mac7`, because each is large, needs `mac7`'s own memory model, or is for one retail title: - the ADCX/ADOX/RDSEED/MOVNTS helpers and the title watchdog (84954d5) - the CPU `CopyMemoryToMemoryX` (d0926c6) - the unwatched-memory path and GPU views (77fac3b, ae4ca92, 94403a1, 3f965ed) - the DXC heap per thread (5024a59) - the AS-slot mesh shaders (#541, which conflicts with `main`) - the diagnostics and HANDOFF commits @⁠Ahmet-Dedeler if any of these is needed for a title to get as far as it did on `mac7`, tell me which and I'll port it. **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, DXC 1.9.2609, every test in its own process; full run at `762645d`, and the commits after it change only tests, which I reran) - All 1516 tests: 1356 passed, 56 failed, 22 timed out (90 s for GPU tests, 180 s for the rest), 1 crashed, 34 SKIPPED, 47 ignored. - The 818 tests the old branch also has: 733 passed here against 739 there. Each test whose result changed, with its reason: - Fixed: `gpu_uma_import_check_at_init` passes (by #1329), and `gpu_placed_console_depth_target_with_clear_value` passes (it ends in Metal's pixel-format assertion on plain `main`). - `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2`, `gpu_more_atomics_sub_dword_scratch_valu` now fail. `main` changed these tests, and they fail the same way on plain `main` (D3DMetal writes nothing for the 64-bit atomics they now include). - Now SKIPPED, each with a reason, where a Mac default from `mac7` or the old branch changes what they test: - `mapping_fresh_pages_does_not_query_each_page`, `mapping_lazy_pages_again_does_not_query_each_page` and `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes`: lazy pages are off on a Mac. They pass with `XCL_LAZY_PAGES=1`. - `placed_title_textures_share_vram_and_preserve_pixels`: title textures keep arenas on a Mac. - `readable_answers_from_the_working_set_without_touching_pages`: Wine on macOS reports no working set. It fails on plain `main` too; on `mac7` its skip went to stdout, so the old run counted it as a pass. - Now SKIPPED as on plain `main`: `texture_states` (its `SKIPPED` line moved to stderr in #2154) and `predication_e2e`. - The e2e title test no longer times out. The title runs to the end with 0 failures and leaves the game folder untouched. It now fails one later check: `called_stubs` comes back empty although the stub was called. It does the same on plain `main`, and I haven't found why. - The 698 tests that are new on `main`: 623 passed. I reran the ones that didn't pass on plain `main` (6d12f58), one per process, and they fail the same way there: `gpu::dxil` fuzz, ops and core tests, the `d3d12_*` checks against the host driver, `d3d12_mesh_stream`, one `gpu_compute_e2e` test, and wave64 and pixel-shader timeouts. - One exception: `raw_loads_in_root_windows_respect_exec_and_bounds` fails on `main` because `OpenExistingHeapFromAddress` isn't there. Here #1329 gets past that, and then the test thread overflows its stack and hangs. This is a path only tests take. - Three tests from `d3d12_check_feature_support` compare the PC format mapping with the driver. They now run with `XCL_DEPTH_STENCIL=1`, because #1649 makes D24S8 depth only on a Mac. - The test title: all 50 checks pass and it exits with 0, in 4 runs with a fresh data folder each time (2 without `XCL_DXC_DIR`, 2 with it). **Not tested:** a retail title, so loading, memory under the level tiles, and what `XCL_TEXTURE_SKIP_UNCHANGED` guards against are unchecked. Also not tested: Windows, and a release build of the tests. To try it: same as before, `cargo build --release -p xcl --target x86_64-pc-windows-gnu` at `efef307`, then `xcl.exe run <game folder>` in a CrossOver bottle with D3DMetal on and `XCL_DXC_DIR` set. If a title that ran on the old branch stops working here, the commits listed as not ported are the first suspects, and `logs\xcl.log` plus the `CRASH:` line tell which. AI use: Claude Code with Claude Opus 5.5 rebuilt the branch, ported the `mac7` and shortside commits, wrote the test changes, ran the tests and wrote this comment.
This discussion has been locked. Commenting is limited to contributors.
No description provided.