Skip to content

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

Backlog

Description

@Ahmet-Dedeler

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 Linux (Wine + vkd3d-proton): a retail game reaches what main reaches on Windows; the obstacle is replaced vtables — proposal: proxies #175 and VKD3D Assertion - "iface->lpVtbl == &d3d12_heap_vtbl" #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 Launcher: honor configured executable before auto-detection #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.

Activity

  1. Kalmarv commented on Nov 23, 2026

    @Kalmarv
    Contributor

    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

    (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. VKD3D Assertion - "iface->lpVtbl == &d3d12_heap_vtbl" #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

  2. Ahmet-Dedeler commented on Nov 23, 2026

    @Ahmet-Dedeler
    Author

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

  3. ivall commented on Nov 23, 2026

    @ivall
    Collaborator

    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.

  4. Kalmarv commented on Nov 24, 2026

    @Kalmarv
    Contributor

    @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 macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258 (comment)), 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 #258 (comment)). 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, macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258 (comment), 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. Small fixes found running the tests and the test title under Wine #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

  5. mikebuckets171 commented on Nov 24, 2026

    @mikebuckets171

    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.

  6. us3r40456 commented on Nov 24, 2026

    @us3r40456

    @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 Recompiler: keep a draw's descriptor heaps alive until the list has run #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.

  7. Kalmarv commented on Nov 24, 2026

    @Kalmarv
    Contributor

    @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 (#258 (comment)).

    🤖 Claude Opus 5.5

  8. vakaobr commented on Nov 24, 2026

    @vakaobr
    Contributor

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

  9. us3r40456 commented on Nov 24, 2026

    @us3r40456

    @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 Recompiler: keep a draw's descriptor heaps alive until the list has run #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 / D3D12.X: stand-in pixel shaders write both dual-source colours #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.

  10. us3r40456 commented on Nov 24, 2026

    @us3r40456

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

  11. us3r40456 commented on Nov 24, 2026

    @us3r40456

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

  12. mikebuckets171 commented on Nov 24, 2026

    @mikebuckets171

    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.

  13. Kalmarv commented on Nov 24, 2026

    @Kalmarv
    Contributor

    @mikebuckets171, on (2): ivall answered this above (#258 (comment)):

    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

  14. Kalmarv commented on Nov 24, 2026

    @Kalmarv
    Contributor

    @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

  15. us3r40456 commented on Nov 24, 2026

    @us3r40456

    @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 GPU test results: NVIDIA RTX 3080 (wave32) and AMD RDNA2 iGPU (no mesh shaders) #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 GPU test results: NVIDIA RTX 3080 (wave32) and AMD RDNA2 iGPU (no mesh shaders) #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.

  16. 60 remaining items

  17. us3r40456 commented on Nov 24, 2026

    @us3r40456

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

  18. us3r40456 commented on Nov 25, 2026

    @us3r40456

    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.

  19. us3r40456 commented on Nov 25, 2026

    @us3r40456

    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?

  20. shortside commented on Nov 25, 2026

    @shortside

    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.

  21. shortside commented on Nov 25, 2026

    @shortside

    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 (comment)

    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.

  22. vakaobr commented on Nov 25, 2026

    @vakaobr
    Contributor

    @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 (comment)). 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.

  23. vakaobr commented on Nov 25, 2026

    @vakaobr
    Contributor

    @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 1f9eebe). 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)

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

    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 three commits and #2327, ran the tests, and wrote this comment.

  24. Ahmet-Dedeler commented on Nov 25, 2026

    @Ahmet-Dedeler
    Author

    @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: D3D12.X: a buffer's last release does not wait for the sparse state's lock #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. D3D12.X: decommit released sparse blocks outside the driver callback #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.

  25. shortside commented on Nov 25, 2026

    @shortside

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions