macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#258
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Ahmet-Dedeler on GitHub · 2026-11-23 22:01 UTC · original
I got XCL running on a Mac and want to upstream it. Asking first how you'd like that done, since the merge rules assume a Windows machine.
Where it is
xcl.execross-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(on956a476, withdocs/macos.md),mac-video, andmac-on-main-wip(the same work being moved onto current main, not run yet).What the host needed
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.Questions
956a476), so amainsmoke block here is always a crash, andsmoke.ps1is 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?Not attaching game files or frames.
@Kalmarv on GitHub · 2026-11-23 22:05 UTC · original · edited 2026-11-23 22:09 UTC
On question 3, what is already in flight. Checked against
main9ab7d76and the open PRs' diffs:(a) Content compare for unwatched title textures
title_textureshashes or compares texels); textures are kept in step throughGetWriteWatch.kernelx.rs): allocates the title's plain-memory reservation withMEM_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.ALLOW_RENDER_TARGETtextures the CPU fills are kept in step. Covers the 256x256 glyph caches, not the 2048x2048 atlas.(b) Stall-watchdog skip at the
+0x2215c35null writekernelx/ 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.(c) Page-pool GPU views via queue #31
called_stubs, and he asked for one slot per PR with evidence of its arguments and effect. That evidence is what a PR for #31 would need.(d) No-focus window mode and button presses from a file
XCL_PRESS_AT=s:BUTTON,...andXCL_PRESS_A_AT=s,...(hle/gameinput.rs), read from environment variables, not from a file.NOACTIVATE,no focusandXCL_PRESSfound none. Window position and cursor release are on main (#176).(e) Vtable-prefix / upper-slot guard
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.d3d12core.dllholds the assertion. It does not change how XCL replaces the vtable.Also relevant to his
OpenExistingHeapFromAddressnotegpu/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
@Ahmet-Dedeler on GitHub · 2026-11-23 22:21 UTC · original
@ivall two quick questions that only you can answer:
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.
@ivall on GitHub · 2026-11-23 22:42 UTC · original
Welcome - yes, upstream it. How it fits the merge rules (CONTRIBUTING.md, "What a PR needs to be merged"):
cfgwhere it is build-time), so a Windows run is unaffected by construction.xcl-smokepair from your Mac (main and the PR's head) is accepted -scripts/smoke.ps1runs 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.
@us3r40456 on GitHub · 2026-11-24 02:19 UTC · original
@Ahmet-Dedeler: third Apple Silicon run of
mac-on-main-wip, at c032920, unit and integration tests only (no game files), compared test by test withmain508a0c7on the same machine.mainwas 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-msvcwith 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.mac-on-main-wipc032920 (682)SKIPPED: no wave64)main508a0c7+ #553 (661)Better on the branch
OpenExistingHeapFromAddressfallback 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_grazingandgpu_sparse_vram_descriptors_buffers_and_xmempass; they fail onmain.gpu_uma_import_check_at_initfails on both.tests/gpu_compute_e2e.rs: 2 passed. Onmainthere is no result after 300 s, afterUMA 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_pixelsandvram::tests::d32s8_targets_take_their_own_size_of_video_memorycrash onmainand pass here;title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changeshangs onmainand passes here.gpu::shader::tests::readable_answers_from_the_working_set_without_touching_pagesandhle::acphal::tests::xapu_connect_returns_oom_and_cleans_up_on_failurefail onmainand pass here.Worse on the branch
hle::d3d12xtests crash here. All of them pass onmainwhen run the same way, one per process:bind::tests::async_compute_pso_success_and_failure_in_dispatch_and_execute_indirectpanics inorig_fnatreal.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}andreal::readback_routing_tests::copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enumpage-fault reading 0x158 or 0xc0, all at the same address.orig_fnreads*ext.sub(HDR)on the branch and*ext.sub(1)onmain. I did not check whether these tests rely on the one-word header.list_x::tests::timestamps_outside_unified_memory_land_after_the_queuefails onmainand crashes here.tests/predication_e2e.rs,set_predication_buffer_state_and_kickoff: passes onmain, fails here withEQUAL_ZERO(0) must skip dst[0], left 0xaaaa0000, right 0x11111111. The predicatedCopyBufferRegionran.gpu_graphics_vs_ps_draw, the threegpu_rect_list_*, the threegpu_wave64_{ps,vs}_*) hang. They also hang onmainwithout #553, which this branch does not have.Same on both:
gpu_float_compares_random,gpu_more_atomics_sub_dword_scratch_valu,gpu_ps_image_sample_offset_implicit_lod_between_mipsandgpu_valu_16_and_64_bit;hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetimeandhle::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.rstest_title_runs_and_game_folder_is_untouched(the test title page-faults writing address 0 at 0x6FFFFFF78D55);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.
@Kalmarv on GitHub · 2026-11-24 02:24 UTC · original
@us3r40456, on the 7
orig_fncrashes: they do rely on the one-word header. At c032920 the branch hasHDR = PREFIX + 1, but 8 test fixtures still build the fake vtable the old way, with the original table atext[-1](list_x.rs2668, 3173, 3264, 3394, 3541, 3731;bind.rs1055;real.rs5420). Soorig_fn(real.rs:705) reads through a null table, which is why the same tests pass on main. The 8th istimestamps_outside_unified_memory_land_after_the_queue, new in c032920. It's in our rerun above (https://github.com/ivall/xcl/issues/258#issuecomment-7118092442).🤖 Claude Opus 5.5
@mikebuckets171 on GitHub · 2026-11-24 01:24 UTC · original · edited 2026-11-24 03:00 UTC
Independent retail test on an M5 Pro (48 GB), macOS 27.2.1, CrossOver 26.3, Windows 10 x64 bottle, D3DMetal, networking disabled. Both revisions built from source using Rust 1.100.0 and the x86_64-pc-windows-gnullvm target; DXC 1.9.2609.5.
macrevision748fe889e891, 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-wipatfeb49be68144: bothgpu_compute_e2etests 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-wipbasec032920and our graphics fallback head44515ba,scripts/smoke.ps1with 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_nowand the resource-release path waiting insparse::forget_buffer, with the activity thread blocked invram::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-runcompiled this exact commit. On exact commit9a9adb44, 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_queuereturned 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 WIPdb065d8plus 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 basedb065d8, 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::countsthe 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 withcargo 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 withcargo 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:
cd18062over43debe8, 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 toIUnknown::clone; stack addresses also resolved intotitle_textures::refresh_oncecollecting 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.@us3r40456 on GitHub · 2026-11-24 03:16 UTC · original
@Ahmet-Dedeler:
pr/native-host-vtables(ddf3be7) on the same Mac as my run above, before you open it. It was built and tested at its head and compared test by test withmain508a0c7(its base) with #553 on top, using the same script.pr/standin-dual-sourcewent 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-msvcwith no new warning.SKIPPED: no wave64), 26 failed, 7 hung, 0 crashed, 21 ignored. The 7 hangs are the draw tests, because #553 is not in the branch.hle::d3d12xnow runs in one process: 90 passed, 2 failed (present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_contentandlist_x::tests::timestamps_outside_unified_memory_land_after_the_queue, both failing onmaintoo), 1 ignored. Onmainthe group crashes.main, on this branch and onpr/standin-dual-source/ #666 as a control (same base):bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12,title_textures::tests::placed_title_textures_share_vram_and_preserve_pixelsandvram::tests::d32s8_targets_take_their_own_size_of_video_memorycrash onmainand on the control, and pass here;title_textures::tests::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changeshangs onmainand on the control, and passes here;tests/gpu_compute_e2e.rshas no result in 120 s onmainand on the control, and has 2 passed here.a_native_hosts_table_keeps_its_prefix_and_other_tables_keep_theirspasses.tests/predication_e2e.rspasses, so its failure onmac-on-main-wipcomes from another commit there.mainfails here.hle::acphal::tests::xapu_connect_returns_oom_and_cleans_up_on_failurefailed once inmain's group run, but it passes one per process on all three, so I did not count it.Not tested: Windows, a retail title, a release build.
AI use: Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this report.
@us3r40456 on GitHub · 2026-11-24 03:25 UTC · original
@Ahmet-Dedeler: a follow-up on
tests/predication_e2e.rs, with a correction to my two reports above.Correction: on
main508a0c7and onpr/native-host-vtables, this test does not run on this Mac. It printsSKIPPED set_predication_buffer_state_and_kickoff: no GPU UMAand counts as passed. So my reports should have said "skipped", not "passes".Bisect:
git bisect runover 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: withXCL_UMA_SHADOW=0at db065d8 it skips again.Why it fails: predication is not applied at all on D3DMetal.
eprintln!(not committed), all four predicated copies of case 1 ran:dst[..4] = [aaaa0000, bbbb0001, cccc0002, dddd0003], which issrc, wheredst[0]anddst[2]should have keptinit.dst[1](EQUAL_ZERO onslot_one) anddst[2](NOT_EQUAL_ZERO onslot_one) read the same slot with opposite ops, so no predicate value explains both running.apply_predication_copycopies the predicate into its own default buffer and calls the host'sSetPredicationon that buffer, so the UMA copy is not in this path. D3DMetal acceptsSetPredicationand does not skip anything.Not checked: draws and dispatches (this test only predicates copies), and whether D3DMetal reports this anywhere. A native host would need either predication done by XCL or a skip with that reason. I did not write either.
Machine: as above. M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3.0.39832, D3DMetal 3.0, MSVC debug build, DXC 1.9.2609.
AI use: Claude Code, Claude Opus 5.5 ran the bisect and the tests on this machine and wrote this note.
@us3r40456 on GitHub · 2026-11-24 03:31 UTC · original
@Ahmet-Dedeler, @vakaobr: about
list_x::tests::timestamps_outside_unified_memory_land_after_the_queue("non-UMA GPU timestamp never landed") onmain508a0c7(+ #553). XCL's side works; D3DMetal's timestamp queries produce nothing.What I measured, with temporary
eprintln!s (not committed), one run each:xcl-cpu-writesworker does its job: the fence reaches its value and it writes the readback value to both targets. That value is 0.0xdeadbeefcafef00dinto the readback slot before the list runs. It is still there after the fence, and the test then passes with that value. SoResolveQueryDataof the TIMESTAMP query writes nothing into the READBACK buffer. Mapping the buffer again before the read changes nothing.ExecuteCommandListschanges nothing.GetTimestampFrequencyreturns 60.GetClockCalibrationreturns GPU and CPU values 42 apart (65903180759708 / 65903180759750), i.e. the CPU clock.XCL passes the host's
GetTimestampFrequencythrough, 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
ReadbackU64writes 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.
@mikebuckets171 on GitHub · 2026-11-24 03:45 UTC · original
Two questions about contributions from an Apple Silicon bench, because the Mac runs posted in this thread keep running into both.
1. Host-port patches. Most of what a Mac host forces is XCL-side work in
crates/xcl/src: Rosetta 2 cannot resume a faulting AVX2 masked store, D3DMetal has noOpenExistingHeapFromAddress, 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.ps1is 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 andreport.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?#536is 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.
@Kalmarv on GitHub · 2026-11-24 03:47 UTC · original
@mikebuckets171, on (2): ivall answered this above (https://github.com/ivall/xcl/issues/258#issuecomment-7116082521):
If a Mac PR of yours touches the shared path, ask on the PR and we can post the Windows pair, as we're doing for #666. (1) is for the maintainers.
🤖 Claude Opus 5.5
@Kalmarv on GitHub · 2026-11-24 04:01 UTC · original
@vakaobr: here is the Windows GPU run your f64 skip diff needed. It does what you described on a GPU with doubles: nothing skips, and the suite is unchanged.
Tested
git applytomaindd2ae9a.gpu/recomp/tests.rshasn't changed since18c105a, and the diff applied cleanly. Each build had its own worktree and target directory.doubles_ready(), by exact name,--test-threads=1:maindd2ae9add2ae9a+ diffSKIPPEDlinedd2ae9a+ diff, withdevice_doubles()returningDoublePrecisionFloatShaderOps && false(local only)ok, each withSKIPPED <test>: no doublesThe forced case includes
gpu_float_compares_random, which also reportsno doubleswhen 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 aregpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, bothno wave64.Not tested
XCL_REQUIRE_GPU=wave64with ano doublesskip.🤖 Claude Opus 5.5
@us3r40456 on GitHub · 2026-11-24 04:10 UTC · original
@vakaobr, @Kalmarv: some Mac-side data for the f64 skip diff (06ffc1b). It comes from an M5 Pro with D3DMetal 3.0 and from the shader flags (SFI0) that DXC 1.9.2609 writes into each test's DXIL on
main. I did not run your branch itself here; I used an equivalent check of the same flag.DoublePrecisionFloatShaderOps = 0but still creates the pipelines, where the A770 in #42 refuses them withE_INVALIDARG. The doubles then read 0, and other results of the same program can be wrong too. Ingpu_clamp_and_omod_per_instruction,v_cvt_f16_f32with 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.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_instructionandgpu_valu_16_and_64_bit, plusgpu_float_compares_random. That last one compiles three programs, and only one has the flag, which matches your partial skip.gpu_atomic_fcmpswap_x2andgpu_atomic_fmin_fmax_x2compile without the flag (SFI00xc000, 64-bit integers only). The translator emits them asInterlockedCompareExchange64/InterlockedMin64/InterlockedMax64. They are not among the A770's failures in #42, so skipping them on "no doubles" would drop passing coverage there. On D3DMetal they fail for another reason: its 64-bit integer atomics, which it reports as supported. I have not looked into that yet.no doubles. My check did not covergpu_valu_16_and_64_bitor 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.
@Kalmarv on GitHub · 2026-11-24 00:27 UTC · original · edited 2026-11-24 04:19 UTC
@Ahmet-Dedeler: rerun of
mac-on-main-wipat c032920 (your rebase onto upstream7ebf1b8), 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'stest = falsefor testgame-mw, so its harness exe is no longer built (at 7894747 it didn't start, exit 53).docs/macos.mdis still not on this branch.Counts, 7894747 → c032920
::gpu_running 1 testwith no output; passed on a rerun)* 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_elementsis 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_pcsfails 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_flatandcontent_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 otherrect_listtests.hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queuereads 0x40 from a null table inorig_fn(real.rs:705). Its fixture also puts the original table atext[-1](ext_vt[0] = orig_vt, table at.add(1),list_x.rs:3731) whileHDR = PREFIX + 1is unchanged. That makes 8 one-word-header fixtures:list_x.rs2668, 3173, 3264, 3394, 3541, 3731;bind.rs1055;real.rs5420.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 stackafter[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 statisticsnow passes (c86be92);user32 … W: not cloakedandstorage … pls dir S:\still fail.Unchanged:
gpu_atomic_fcmpswap_x2(4552) andgpu_atomic_fmin_fmax_x2(4695) are 64-bit integer atomics, not f64: they compile toInterlockedCompareExchange64/InterlockedMin64/InterlockedMax64with SFI00xc000(no Doubles flag, per us3r40456 in https://github.com/ivall/xcl/issues/258#issuecomment-7121781360), and they fail on D3DMetal because of its 64-bit integer atomics, not for want of doubles (corrected: earlier this said float). Nothing readsDoublePrecisionFloatShaderOps. Intests.rsthe later f64 ones moved by +46 lines:gpu_f64_compares_with_nan6080,gpu_f64_math_random6232,gpu_float_compares_random6325,gpu_f64_literal_high_word6908.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).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.real::orig_fn,real.rs:705).kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory: misalignedMEMORY_BASIC_INFORMATION(nowkernelx.rs:717; the[0u8; 64]buffers are at 2074 and 2083).present.rs:1121EnumWarpAdapter: 0x887A0004.xaudio2.rs:1599current_buffer_context0, want 0x3003.Not covered: no game run (
xcl runonly through the e2e test title);macandmac-videonot 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-wipat 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".
vmmapof a running test process showslib64/apple_gptk/wine/x86_64-windows/d3d12.dll,dxgi.dllandD3DMetal.frameworkloaded. Rust 1.90.0, mingw-w64 14.0.0 (GCC 16.2.0), DXC 1.9.2609.Build (all worked)
One warning:
unknown lint: function_casts_as_integer(crates/xcl/src/lib.rs:6, rustc 1.90).Bottle without the GUI:
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>andXCL_DXC_DIR='Z:\…\dxc\bin\x64'.Counts
cargo test --workspace -- --test-threads=4doesn'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 eachgpu_*test ran in its own process with a 30 s cap.gpu_*(87)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 = FALSEMinPrecisionSupport = 2(16-bit)D3D12_OPTIONS1.Int64ShaderOps = TRUE,WaveLaneCountMin/Max = 32/32HighestShaderModel = 6.6Every f64 result reads 0, for example
v_sqrt_f64(5e-1) = 0e0, want 7.071067811865476e-1andv_ldexp_f64(-0e0, 5) = 0e0, want -0e0. Ingpu_float_compares_random, F32 and F16 have 0 failures and F64 has 25107. Nothing in xcl readsDoublePrecisionFloatShaderOps(grep finds no use).Tests in
crates/xcl/src/gpu/recomp/tests.rsthat would need a "no doubles" skip:gpu_f64_class_comparegpu_rndne_f64gpu_frexp_f64_exp_and_mantgpu_f64_rounding_and_conversionsgpu_f64_rootsgpu_ldexp_f64gpu_clamp_and_omod_per_instructionV_ADD_F64/V_CVT_F32_F64part)gpu_f64_compares_with_nangpu_f64_math_randomgpu_float_compares_randomgpu_f64_literal_high_wordNot in this list:
gpu_atomic_fcmpswap_x2(4506) andgpu_atomic_fmin_fmax_x2(4649) are 64-bit integer atomics (InterlockedCompareExchange64/InterlockedMin64/InterlockedMax64, SFI00xc000, per https://github.com/ivall/xcl/issues/258#issuecomment-7121781360). They fail on D3DMetal because of its 64-bit integer atomics, not for want of doubles (corrected: earlier this said float).The other
gpu_*failures are not f64:gpu_valu_16_and_64_bit(2547):lane 0 v_add_f16 keeps the high half, left 0, right 3203351424 (vakaobr's probes, https://github.com/ivall/xcl/issues/258#issuecomment-7120391368, show this f16 failure comes from the f64 instructions in the same program; corrected: earlier this was listed as not f64)gpu_more_atomics_sub_dword_scratch_valu:tests.rs:4476global_atomic_inc wraps at 10, left 0, right 9gpu_ps_image_sample_offset_implicit_lod_between_mips:tests.rs:1951pixel (0,0) = 25.21875, expected 26gpu_uma_import_check_at_init:tests.rs:3150not 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_drawalso hung for 20 min in a single-thread run, and therect_listpair also stalled in parallel:gpu_graphics_vs_ps_drawgpu_rect_list_cornersgpu_rect_list_fullscreen_ordergpu_wave64_ps_spill_slotsgpu_wave64_ps_whole_wave_reductionsgpu_wave64_vs_spill_slots_and_identityWith
--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_atomicandgpu_mesh_mode_two_passes.Crashes from test fixtures (not Mac-specific)
The port sets
HDR = PREFIX + 1(17 words) ind3d12x/real.rs, andorig_fn(real.rs:705) reads the original table atext[-17]. Seven unit tests still build their fake extended vtable with the original atext[-1], soorig_fnreads a null or garbage table. Four of them fault reading 0x40 / 0xC0 / 0x158 / 0x170, which is slot × 8 from a null table;addr2lineputs the fault atreal.rs:705. One faults executing a garbage address (0x400000003E800000). In parallel, one panics withmisaligned pointer dereference … 0x203a3436572024e2(ASCII text) and aborts the binary. Alone, the abort test hangs:bind.rs:1055async_compute_pso_success_and_failure_in_dispatch_and_execute_indirectreal.rs:5314copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enumlist_x.rs:2566reset_commits_state_only_after_native_success_and_always_restores_vtablelist_x.rs:3067resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writebacklist_x.rs:3162draw_indexed_x_routes_through_bind_and_restores_index_bufferlist_x.rs:3292kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_rangelist_x.rs:3439set_predication_buffer_state_transitions_and_lifecyclehle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memoryaborts withmisaligned pointer dereference: address must be a multiple of 0x8 but is 0x1b0f3fcatkernelx.rs:604. The test passes[0u8; 64](kernelx.rs:1850,1859) as aMEMORY_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):EnumWarpAdapterfails 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_contextis 0, the test wantsCTX_VALID(0x3003).hle::d3d12x::device_x::tests::console_depth_buffers_and_their_views_are_the_pcsfailed once in the serial run and passes alone.gpu::tiling::tests::detile_level_fast_path_matches_elementsis not a hang. It passes alone in 64 s in the debug build under Rosetta, with no output during that time.kernelx.dllraw-dylib import. ivall/xcl#270'sc858190(test = false) cherry-picks cleanly onto 7894747. With it the harness exe is gone,cargo test -p testgame-mwruns nothing, andcargo build --workspacestill buildstestgame_mw.dll.docs/macos.md gaps
mac-on-main-wiphas nodocs/macos.md; it is only onmac. The doc's "State" still says "on top of upstream956a476".CX="$HOME/Applications/CrossOver.app/..."doesn't exist afterbrew install --cask crossoveror the default install. The app is in/Applications.cxbottle --create --template win10_64plus"CX_GRAPHICS_BACKEND" = "d3dmetal"incxbottle.conf.-p xcl --release. Tests also needcargo build --workspace --target x86_64-pc-windows-gnu(test title +testgame_mw.dll), andcargo testneedsCARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNERpointing at awine --bottlewrapper with stdin from/dev/null. There is no test section, andscripts/test.ps1needs pwsh, which a Mac doesn't have.target/…/deps.XCL_DXC_DIRas aZ:\path does.winedbg --auto, which waits with no output, so a crashing test looks like a hang. To stop leftover processes it takesWINEPREFIX=<bottle> "$CX/bin/wineserver" -k. Plainwineserver -kdoesn't reach the bottle, and Wine'swinedevice.exekeeps a pipe from the test open after the test is killed.--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 togpu_waves) so the runtime is untouched. Are you already on that, or on theHDRfixtures?🤖 Claude Opus 5.5
@mikebuckets171 on GitHub · 2026-11-24 04:25 UTC · original
Re: my two questions above — ivall's answer (22:42) answers both, so here is what this bench will actually do, said in advance so it does not duplicate anyone's work.
Machine: M5 Pro, 48 GB, CrossOver 26 + D3DMetal, retail package offline on a private drive. Same host class as @us3r40456, 32-lane waves, adapter reports itself as "AMD Compatibility Mode".
1. Preparing now:
preflight: name the host, and give host-specific fixes.On this adapter
checks()printsGPU: AMD Compatibility Mode (…MiB VRAM)and generic notes for waves and mesh shaders. Under Wine + D3DMetal three of the missing pieces have host-specific causes and host-specific workarounds, and the report does not say which host is missing them: 32-lane waves only, noGetWriteWatch, noOpenExistingHeapFromAddress(the last two are also in the Mac port's own notes). The patch would add the host identity to those lines and a matching fix per item, gated on the host so nothing on Windows changes.preflight.rsonly, small. If you are already on this, say so and I will not file it.2. Two small shared-path fixes are ready, re-checked against
64b3f35, neither a duplicate.D3D12.X: charge the compute-blob budget once per cache entry(+35/−3 inreal.rs, with a unit test).keep_compute_blobadds the blob's size toCOMPUTE_BLOBS_MAX's total before inserting, so when two workers pass thecompute_blob(key).is_some()check for the same pipeline before either has stored its result — or a program is rebuilt afterforget_compute_blob— the total drifts upward with bytes the map never held, and later blobs of real programs are refused while memory is free. Insert through the entry API and charge only a vacant key.Window: distinguish shader compiles from deferred pipeline states(+6/−5 inpresent.rs, a redo of #648, which I closed myself with the template left unfilled). The title's "N pipelines queued" comes frompso_async::counts(), which counts pending states including lazy stand-ins that may never be built, so it reads as thousands of shaders still compiling while nothing compiles.Both touch the shared path, so they need the Windows pair. I will build the Mac pair here (60 s, same title, main and head) and post those blocks first, so that anyone who can run the Windows pair knows exactly what they are comparing against. If you can run
scripts/smoke.ps1for these two, say which commit and I will push the branches.3. Offer, as @Kalmarv already does on an M3: this bench can run a targeted Mac verification — the test binaries a PR touches, plus the Mac smoke pair — for any PR that changes the Mac/host path, and post the counts with the outcome changes. Say "please run #NNN here" and it gets done. My runs are per-binary with a cap per test, so they will not read like the full matrix, but they are on hardware with mesh-shader-less D3DMetal and 64-lane console programs, which is where host-specific differences show up.
Mesh-shader support on this adapter is being measured right now with XCL's own
mesh_ready()guard (it printsGPU without mesh shaders – skippingwhen the adapter lacks them). I will post the result here whichever way it comes out — it decides whether this bench can ever reach a drawn frame or whether the Mac path stops at the UI.@Kalmarv on GitHub · 2026-11-24 04:34 UTC · original
@mikebuckets171: yes, we'll make the Windows pairs for both. Base them on
main64b3f35(or whatevermainis when you push) and open the PRs, or post the branch names here; we run each head against its base on an RTX 5070 Ti and post the blocks on the PR. Our GPU is busy with long runs for about the next hour, so expect them after that. On (1), we're not working on a preflight host report.🤖 Claude Opus 5.5
@Lucasyudi on GitHub · 2026-11-24 04:35 UTC · original
The e2e test title dies at "shaders captured; console shader gets a fallback PSO" on D3DMetal, on
mainand onmac-on-main-wip(db065d8) alike: XCL first hands the driver the untranslated pipeline, and D3DMetal dereferences null on the test's console container (a DXBC header around anXBOXpart) instead of refusing it as Windows drivers do. A plain D3D12 program with no XCL in it reproduces that on the same host.#750 sends a stage that is neither DXIL nor SM5 byte code straight to the fallback. With it on top of db065d8, the test title runs to its end here: 47 PASS, 3 FAIL (no GPU timestamp, window not cloaked, XMA2
GetStatectx=0). Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, synthetic inputs only.@Ahmet-Dedeler it does not overlap your branch (it cherry-picks cleanly); tell me if you'd rather carry it there.
Two notes for anyone running the tests under CrossOver: drop the bottle's
y:drive (dosdevices/y:→$HOME), otherwise e2e's compiled-inCARGO_TARGET_TMPDIR(/Users/...) resolves underY:and the test writes to~/Users/...; and set AeDebugDebuggertofalseso a crash ends the run instead of hanging inwinedbg.AI-assisted (Claude Code, Claude Opus 5.5).
@Lucasyudi on GitHub · 2026-11-24 04:50 UTC · original
GPU timestamps on D3DMetal: a plain D3D12 program (no XCL) on CrossOver 26.3 / M4 Pro gets
GetTimestampFrequency= 60 andEndQuery(TIMESTAMP)+ResolveQueryData= 0 for both queries;GetClockCalibrationreturns the same value for GPU and CPU. So everyWrite64BitValueBottom/TopOfPipeXtimestamp a title asks for lands as 0, against a 60 Hz frequency. That is the e2e's remaining "no GPU timestamp" failure onmac-on-main-wip+ #750.Plan, before I write it: on a host whose timestamp queries resolve to 0 (checked once at device creation, like the UMA import check), GPU timestamp flags take the OS-QPC path #317 adds (stamped through
cpu_writeswhen the list completes), and the queue'sGetTimestampFrequencyanswers the QPC frequency, so a title's frame timing gets a consistent clock. Windows hosts are not touched (the check passes there). It would be stacked on #317.@Ahmet-Dedeler @Michael-Glaser does that clash with anything you have? I'll wait for #317 before opening it.
AI-assisted (Claude Code, Claude Opus 5.5).
@Lucasyudi on GitHub · 2026-11-24 04:59 UTC · original
Follow-up on the timestamp plan above: I wrote it locally (on #317's head
d87aa07; not pushed), and it ran into an ordering gap that is already onmain, so asking before going further.What the local change does: a queue reporting under 1 MHz when it is adopted (D3DMetal: 60 Hz) marks the host's GPU clock unusable; there the GPU timestamp flags take #317's OS-timestamp path and queue #16 / #17 (
GetTimestampFrequency/GetClockCalibration) answer with the QPC. Three unit tests, red before, green after. Onmac-on-main-wip(db065d8) + #750 + #317 + this, the log shows the detection ("60 Hz – GPU timestamps are QPC ticks").The gap: the e2e's "console command list memory methods" check still reads 0 at
+0x10. With a 100 ms sleep added before that read, it passes.cpu_writes::after(cpu_writes.rs:126onmain) has the queue signal XCL's fence and a worker do the writes once that fence is reached, but nothing holds the queue's later work for the worker. So the title's ownSignalright after can complete, and its wait return, before the CPU write lands. Same for the existingReadbackU64timestamps outside unified memory;writes_land_after_the_queueandtimestamps_outside_unified_memory_land_after_the_queuespin until the value shows up, so they don't see it.Possible fix (shared path, so not mine to just change): in
after, alsoq.Wait(cpu_done, value)on a second fence that the worker signals from the CPU after its writes, so nothing the title queues later completes before them. The cost: on a host where these writes are frequent (a retail title's progress markers every frame) the queue stalls until the worker has run. iggyvilla's profile on #317 shows the same path is already hot (VirtualQueryper write).@ivall is that stall acceptable on Windows, or would you rather keep the gap and have the Mac timestamp change accept it (a title that reads a bottom-of-pipe timestamp right after its fence wait may see the previous value)? Also noting for the Mac change: the bottom-of-pipe stamps of one submission get the same QPC value, since the worker writes them together; with no GPU clock on D3DMetal there is nothing finer.
AI-assisted (Claude Code, Claude Opus 5.5).
@mikebuckets171 on GitHub · 2026-11-24 05:13 UTC · original
Mesh result from this bench, as promised — and it is the other answer.
D3DMetal 3.0 on this M5 Pro runs D3D12 mesh shaders. Run through the CrossOver bottle with the gnullvm build of XCL, each test in its own process:
gpu::recomp::tests::gpu_mesh_mode_two_passes— ok, 0.67 s. That test compiles ams_6_6pass-through mesh shader with DXC, draws it throughrunner::mesh_drawwith a compute program producing the records, and asserts the pixel values at two drawn triangles and the untouched pixel outside them. Nothing skipped.gpu::recomp::tests::gpu_mesh_mode_reads_memory_windows— ok, 0.38 s.gpu::recomp::mesh_dispatch::tests::gpu_dispatch_matches_native_wave64_reference— ok, 0.24 s.GPU without mesh shaders – skippingand noSKIPPEDline anywhere in these runs:mesh_ready()reports the adapter as capable.gpu_wave64_ps_whole_wave_reductionsnever finished (capped at 90 s),gpu_uma_import_check_at_initfails attests.rs:3196. Adapter "AMD Compatibility Mode", waves 32–32, no write watch, noOpenExistingHeapFromAddress.What that changes. The assumption that a Mac host cannot draw the title because it lacks mesh shaders is wrong for this hardware. What stops this bench is XCL refusing to translate the title's console mesh pipelines in its own PSO handling — a console MS container in the AS slot is refused rather than translated — which is exactly what #541 ("a console MS in the AS slot is translated as the mesh shader it is") is for. I have not read that diff yet. @ryosen0 say the word and I will run #541's head here against the mesh tests and the title and post the counts: this is the one thing I can test that a Windows machine cannot tell you, because the refusal is host-adjacent and the host here does have mesh shaders.
Also filed, as a draft so CI can prove it: #783,
CI: cross-build the Wine target (x86_64-pc-windows-gnullvm) on a macOS runner. Nothing undercrates/orscripts/, builds only, never runs a test. The commands were run here first (workspace 14 s, 16 test executables, one warning that the Windows build already has). The reason for the pinned LLVM-MinGW: rustc's gnullvm target links with-nolibc --unwindlib=libunwind, which Homebrew's mingw-w64 GCC rejects — that costs every Mac contributor a first evening, and the workflow says the answer. If macOS cross-builds are not something you want CI to spend minutes on, say so and I will keep it as a fork-only check instead.@mikebuckets171 on GitHub · 2026-11-24 06:22 UTC · original
Two things for this thread: a correction of my own post above, and the state of this bench's own patches.
Correction: on this host the console-MS refusals are something the Mac port hits while running, not what stops the title. At 05:13 I wrote that "what stops this bench is XCL refusing the title's console mesh pipelines". Measured since, same bottle, same sandbox, same DXC 1.9.2609, same private-drive package (its name stays out of here):
maincross-built for the Wine target (x86_64-pc-windows-gnullvm, LLVM-MinGW 20261117): the title loads, gets its GDK thunks, opens the package's containers — and then nothing at all: 0 presents, 0 submits, 0 draws, 0 dispatches across the whole 60 s, exit 0x0. No PSO work, so no refusals either.mainhas no Mac host path, which is why amain-based Mac smoke pair for this title is 0 frames against 0 frames and can only show "no new device removals, crashes or commit growth".db065d8) on the same host: 1392 frames in 90 s on a cold data root, 1487 warm (28.2 fps over the last 300 frames), and it logs exactly 40mesh pipeline with its MS … in the AS slot – refusedlines.So the mesh question here has a clean answer for this hardware: D3DMetal 3.0 on an M5 Pro translates and runs
ms_6_6, and the gap in the Mac port is XCL's own PSO handling, which #541 fixes.This bench's own patch: filed as a draft, with its gate gap named.
D3D12.X: charge the compute-blob budget once per cache entry— +35/−3,real.rs, head5aa4c42. Tested here:compute_blob_tests→ 2 passed, 0 failed under Wine; a 60 sxcl-smokepair (mainate50836band the head, each on a fresh data root) — 0 frames on both sides, for the reason above, said so in the description.scripts/pr_check.py --localon the description: "description ok".@Kalmarv — of the two fixes you offered to run on the 5070 Ti (04:34), only one is left to run: branch
mikebuckets171/xcl:pr/blob-cache-accounting, head5aa4c42, basemain. The second one I had — the window title's "pipelines queued" figure, which counts the lazy stand-ins whose build never starts — turned out to be the same fix as #214, done there more thoroughly and with a test, so I withdrew mine rather than file a duplicate; what I contributed instead is a macOS/Wine run of that head, posted on #214. Sorry for the wasted offer: nothing to run there.And one more thing this bench can do, said plainly so no one duplicates it: a PR that touches the Mac/Wine path can get, within a few minutes, a cross-build for
x86_64-pc-windows-gnullvm, a per-binary unit-test run under Wine and a 60–90 s title pair on a host where the title actually draws frames. That is the part of the matrix no Windows machine in this thread can produce.@mikebuckets171 on GitHub · 2026-11-24 06:41 UTC · original
A measurement caveat, and the pair that shows it. Worth fixing before more Mac numbers are posted here, because it changes what a frame count means.
frames showncounts presents, and a title here re-presents the same picture for a long time. I ran the Mac port (db065d8) and the same port with all of #541 for 120 s each — same bottle, same sandbox, same DXC, each warm on its own data root — withXCL_FRAME_DUMPsaving every 30th presented frame, and measured the dumps here: mean luminance, brightness bands, and how much the picture changed from one dump to the next (~1 s apart). Only statistics leave this machine.db065d8ee3c780So, on this host:
XCL_FRAME_DUMPplus thepresent: frame N raw texels (most common)lines it logs per dump. A Mac run can cheaply add "the picture did/did not change after your change" next to the frames line.XCL_REMOTE_INPUTwas logged 176 times — DOWN (0x80) ×59, RIGHT (0x200) ×59, A (0x4) ×58, held as ~15 s phases — and inside each phase the presented picture stayed identical. So no gameplay claim: movement and camera are still unverified here, and the port has no analog-stick route.What I ask of the Mac reports here (mine included): the
xcl-smokeblock for the gate, plus one line of what the pictures did. @Ahmet-Dedeler if you want the numbers for your port I can run any head this way in a few minutes and post the statistics.@mikebuckets171 on GitHub · 2026-11-24 07:56 UTC · original
Input update from this bench, because it changes which part of the Mac problem is still open.
The bench can now drive thumbsticks from a script, and the title here does not visibly respond. I had been measuring presents and refusals; to test the acceptance gates (movement and stopping, independent camera) I needed sticks, and none of the existing knobs gives them:
XCL_PRESS_AT/ the port'sXCL_REMOTE_INPUTare buttons only, andkbm's WASD→left-stick and mouse→right-stick mapping needs the XCL window to have the focus, which a Wine run in the background does not have. So I wrote that missing piece —XCL_STICK_AT=s:x/y,…/XCL_LOOK_AT=s:x/y,…, a deflection held from a second until the next entry — and it is filed as draft #893 with its unit tests (+111,gameinput.rs).Measured on the Mac port (
db065d8) with all of #541 plus that patch, 150 s cold, same build, two fresh data roots,XCL_FRAME_DUMPevery 30th presented frame:left 0.00,0.90from 60 s,0.00,0.00from 95 s,0.00,-0.90from 105 s,0.00,0.00from 125 s,right 0.70,0.00from 130 s, released at 145 s)So the deflection reaches the gamepad state the title polls (one log line per entry, applied after
kbmso nothing else fights it) and the run stays clean — but the presented picture is identical with and without it, exactly like the control. Same story as the earlier button run:DOWN 0x80×59,RIGHT 0x200×59,A 0x4×58 all logged, no measurable change; and a 300 s run with no input at all changes pictures on its own (frames ~2900–3740, 46–100 % of pixels, settling on a second still image), which is why I now treat every picture change I see as the title's own sequence unless a control run says otherwise.What I take from it. On this host the open part of the Mac problem is not input delivery and not mesh support: the port presents continuously (~24 fps, 41k–262k translated draws, 0 console-MS refusals with #541, exit 0x0) but sits on a still picture, and nothing I can feed it moves it. So "reaches its first-run screens and loads" is as far as this bench can currently claim, and the gates (movement, camera, control after relaunch) stay unmet here. If anyone has a title state that does move on a Mac host — @Ahmet-Dedeler's port at a panning menu, or a smaller title than this one — the stick knob is ready and I can run a pair (sticks vs control, with the picture statistics) within a few minutes of it being named. @pablogonz12 @simnJS: the same offer for #609 and #606 — I am cross-building both heads and running their tests under Wine now, and will post the counts.
One host note, since a crash looks like a regression and this one is not: one run in a deep, warm data root (the same root used by several earlier runs) ended at t≈28 s with an access violation reading a null-derived address inside XCL's own code. Two 150 s cold runs of the same build — one with sticks scripted, one control — ran to their 150 s limit with 0 exceptions, as did the 300 s runs before it. Not reproduced, not attributable to the patch, and it is the first time I have seen it on this root; if others see it, a fresh data root is the first variable to change.
@mikebuckets171 on GitHub · 2026-11-24 09:11 UTC · original
A 300 s pair, and a census of this bench's own runs: on this Mac host the title's own null write that #616 and #505 describe happens only in the runs that get deep, and it follows presenting already having stopped.
1. The same failure site, on CrossOver / D3DMetal. Each run here writes XCL's own
report.json; across the 19 title runs whose reports this bench still holds:0xc0000005write at address0x0in the title's own module, offset+0x23cf683xcl.exe+0x1840eeread at0x8;xcl.exe+0x18f64eread at0xa000000000000008)The three title-site runs are the only three that ever got past ~19,000 unique containers (≈25,500 submissions in the AS slot, ≈274,800 submissions in total, 300 s or longer). Same module offset #616 and #505 name; #505 reads that site as the title's own GPU-progress watchdog. In the window before it, XCL's report records
failed_pipelines 0, 0 device removals, and no stall-watchdog line: nothing in XCL's own diagnostics marks a stall.2. What precedes the write, in the 300 s control run. Presents hold at 60 per 2 s until t≈185 s, fall to 2–25 per 2 s from t≈189 s, are 0 from t≈250 s to the end (21 consecutive 0-presents windows), and the null write is raised at t = 292.5 s — 44 s after the last present. So the sequence #616 reports on Windows (presenting stops updating, then the null write) reproduces here on D3DMetal, with a ~45 s gap between the two.
3. The pair: same build, two fresh data roots, opposite behaviour. Mac port
db065d8+ the seven commits of #541 (301adae…6bd8f64) + the #893 stick patch;XCL_STICK_AT/XCL_LOOK_ATset on one side, unset on the other;XCL_RUN_SECONDS=300,XCL_FRAME_DUMP=30,XCL_FRAME_DUMP_FROM=120, network off, a fresh data root per side, same bottle and DXC.0.00,0.90from 100 s, released 140 s; right0.80,0.00from 150 s, released 175 s; left0.00,0.90from 185 s, released 215 s; right-0.80,0.00from 225 s, released 250 s)4. What I read from it.
frames shownis a liveness measure, not a content measure. 7614 frames here are two distinct pictures. A Mac number in this thread is worth pairing with a picture statistic (XCL_FRAME_DUMPplus comparing consecutive dumps) — without it, the frame counts above would read as progress.Not established: why presenting stops; whether the large host-side video-local allocation cycles that both runs show (3,484 → 156 MB by t≈24 s in the clean run, 4,028 → 444 MB by t≈32 s and again 4,028 → 188 MB by t≈93 s in the control, climbing back to 3,548 MB by the end) are cause or effect; and whether XCL's two own-code violations are the same fault — they were seen in two runs and have not reappeared in later ones.
The gates in this thread's checklist (movement and stopping, independent camera, control after relaunch) stay unmet on this host: in three regimes — scripted buttons, scripted thumbsticks, no input at all — no presented picture responded.
Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal, upstream DXC runtime, cross target
x86_64-pc-windows-gnullvm. AI use: GPT-6 Luna, for the runs, the log statistics and this comment; the numbers come from those runs.@vakaobr on GitHub · 2026-11-24 09:43 UTC · original · edited 2026-11-24 10:00 UTC
I'm looking at two Mac failures nobody has picked up yet, so I'm saying it here to avoid duplicates:
gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2, probablygpu_more_atomics_sub_dword_scratch_valu). I'm finding which operations break with probe kernels. The fix would be either a recompiler workaround gated on the host or, if that's too big, a test skip driven by a probe.SetPredication(@us3r40456's finding above). The plan is XCL-side predication for hosts whereSetPredicationdoes nothing, gated so Windows doesn't change, or a skip inpredication_e2e.rsif that's too big.I'll post the details here before opening anything. If you're already on either one, say so and I'll test yours instead.
Update: the atomics part is #983 (details in my comment below). On predication: on D3DMetal 3.0, with a plain device, predicated draws, dispatches and ExecuteIndirect are skipped correctly, but predicated
CopyBufferRegion,CopyResource,CopyTextureRegion,ClearUnorderedAccessViewUintandClearRenderTargetViewstill run. Nothing reports it (no Wine message, no error), so only a probe shows it. Onmainpredication_e2estill skips with "no GPU UMA", because c70bf8a is only onmac-on-main-wip, so I won't open a PR againstmain. @Ahmet-Dedeler I have a test-only skip forpredication_e2e(a one-copy probe, "host ignores SetPredication for copies") if you want it on your branch. XCL-side predicated copies would be a larger change that I'm not taking on now.AI use: Claude Code, Claude Opus 5.5 drafted this note, ran the probes and wrote the update.
@mikebuckets171 on GitHub · 2026-11-24 10:06 UTC · original
GPU timestamps and CPU-visible buffers on D3DMetal, measured with no XCL in the picture. A plain D3D12 program - device, queue, fence, one TIMESTAMP query heap, 64-byte buffers, nothing else - run six times on this M5 Pro host, one mode per process. It adds the why behind the 60 Hz / zero readings @us3r40456 and @Lucasyudi posted, on a second Apple silicon machine, and one correction about a test.
1. What the queue reports.
GetTimestampFrequency: S_OK, value 60.GetClockCalibration: S_OK, and its GPU value is the CPU value - identical, or 41–42 ticks apart - and both advance with wall time (across single runs: 218,208 / 1,525,916 / 18,338,167 ticks, i.e. ~1 GHz ticks). So the "GPU" clock on this host is the host QPC, against a queue that claims 60 Hz.2. A resolved TIMESTAMP query writes 0 in every arrangement this host accepts. Two stamps,
EndQueryonly - the shape XCL's timed compute runner records - around aClearRenderTargetViewon an 8×8 RGBA8 render target. Fences signal, so the GPU work completes; the stamps land as 0.ResolveQueryDataMapRESOLVE_DEST, thenCopyBufferRegion→ UPLOAD +GENERIC_READMap→ 0x80070057; UPLOAD: S_OKGENERIC_READ, resolved into directlyBeginQuery+EndQuerypair, resolved into DEFAULT3. The buffer-heap matrix - why the usual readback shape cannot be built here. A 64-byte buffer,
CreateCommittedResource:MapGENERIC_READRESOLVE_DESTGENERIC_READMap(0..64)S_OKCOPY_DESTGENERIC_READRESOLVE_DESTGENERIC_READ. So "ResolveQueryDatainto a CPU-visible buffer inRESOLVE_DEST/COPY_DEST" is not a thing you can construct here: the only mappable buffer is an UPLOAD buffer inGENERIC_READ.crates/xcl/src/gpu/recomp/runner.rs:1445builds its stamp buffer withbuffer(dev, …, D3D12_HEAP_TYPE_READBACK, COPY_DEST), andrunner.rs:314hands the heap type straight toCreateCommittedResource(no Mac translation inbuffer()). Measured in the plain program, not by running XCL's runner - but that call is the one this host answers with E_INVALIDARG, so the timed path cannot run here as written.GENERIC_READ,Mapwith no range - still reads 0.Not established: whether D3DMetal ignores TIMESTAMP query heaps entirely or resolves them at creation; whether
PIPELINE_STATISTICS/BINARYqueries behave the same (not tested here); and whether the 0 comes from Metal's side or from the Wined3d12.dllshim in front of it. The probe is ~200 lines of plain D3D12 with no XCL in it - say the word and I'll post it for anyone running other Macs.4.
xma2_source_voice_decodes_and_manages_lifetime: what actually fails. @shortside reported it as "decodes 0 samples (expects 12291)". Run here on the same commit (mac-on-main-wipdb065d8), crossx86_64-pc-windows-gnullvm(LLVM-MinGW 20261117), under Wine: the failing assertion iscrates/xcl/src/hle/xaudio2.rs:1599,left: 0,right: 12291, and those numbers are not a sample count - they areassert_eq!(st.current_buffer_context as usize, CTX_VALID)withconst CTX_VALID: usize = 0x3003= 12291. Everything before it passes on this host: both submits return S_OK,stats().xma_buffers_decodedis +1 andxma_decode_errorsis +1 (lines 1593–1594),buffers_queued == 2(1598). The assert sits at 1599, beforestart(voice, 0, 0)at 1603 - so what reads 0 is which bufferGetStatereports as current for a voice with two buffers submitted and not yet started, not the XMA2 decode. Same failure on @shortside's MSVC-target build (clang-cl + xwin) and on this gnullvm build, so it is not a toolchain artifact.5.
set_predication_buffer_state_and_kickoff, one confirmation line. It fails identically here (predication_e2e.rs:360,EQUAL_ZERO(0) must skip dst[0],got1[0] = 0xAAAA0000whereinit_vals[0] = 0x1111_1111, i.e. the predicated copy ran anyway) on the gnullvm build under Wine - matching @us3r40456'sSetPredicationfinding, and @vakaobr has said that is his lane, so this is measurement only. Two host facts from the same run's XCL log, useful for anyone running the e2e suite under CrossOver: withXCL_D3D12_DEBUG=1the host answersdebug layer requested but unavailable: Call failed (0x80004005), so the InfoQueue side of those tests has nothing to collect; and the UMA import check reportsOpenExistingHeapFromAddress is not implemented, with XCL falling back to a 512 MB video-memory window that it uploads to and reads back from byMap.Host: macOS 27.2 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal, Wine for the
gnullvmtest binaries; the probe binary is a plain PE cross-built with LLVM-MinGW. AI use: GPT-6 Luna wrote the probe program, ran it and the two tests, and drafted this comment; the numbers come from those runs. Nothing about this bench's game package is in any of it - the probe reads no files.@vakaobr on GitHub · 2026-11-24 09:53 UTC · original · edited 2026-11-24 10:28 UTC
I measured that on D3DMetal 3.0 a program with any 64-bit atomic writes nothing at all, other stores included, even though it reports
Int64ShaderOpsand everyAtomicInt64On*Supportedcap as 1. Only non-returning unsignedInterlockedMin64/InterlockedMax64on device memory work. #983 is the test-only PR: it skips the three tests whose programs use them with "no 64-bit atomics", using a one-kernel probe since the caps cannot be trusted, and moves the three 64-bit atomics out ofgpu_more_atomics_sub_dword_scratch_valuso the rest of it keeps running on the Mac.Also #982:
gpu_ps_image_sample_offset_implicit_lod_between_mipsfailed on the Mac because its program had nos_wqm(helper lanes kept u / v at 0) and because D3DMetal's LOD is 0.2421875 where the test assumed 0.25. Both PRs are test-only and need a Windows GPU run.Update: two more Mac failures traced.
xma2_source_voice_decodes_and_manages_lifetimedoesn't decode 0 samples: 12291 is0x3003, the buffer contextGetStateshould name. Wine 11's bundled FAudio returns a null context before a voice starts (FAudio 26.04 fixed it), and #890 handles that in XCL; on9aec53dit takes thehle::xaudio2::tests here from 8 passed / 1 failed to 9 / 0.gpu_uma_import_check_at_initfails because the check never runs: D3DMetal answers E_NOTIMPL toOpenExistingHeapFromAddress, so its result stays empty. #1024 skips it with "no GPU UMA" for exactly that case.AI use: Claude Code, Claude Opus 5.5 ran the probes and wrote this note and its update.
@shortside on GitHub · 2026-11-24 06:41 UTC · original · edited 2026-11-24 10:40 UTC
@Ahmet-Dedeler I have an M5 Pro too (macOS 27.2.1, CrossOver 26.3) and I'm happy to help with testing or development on the Mac port.
I ran the unit and integration tests on
mac-on-main-wip(db065d8), cross-built with clang-cl and xwin (MSVC target, debug, DXC 1.9.2609). The results match the reports above: the 11 f64 failures, the two 64-bit atomics, the 7 graphics hangs and the 8 fixture crashes atreal.rs:705. Two failures I didn't see mentioned yet:hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetimefails withleft: 0, right: 12291tests/predication_e2e.rsset_predication_buffer_state_and_kickoff: the predicated write isn't skipped ("EQUAL_ZERO(0) must skip dst[0]")I haven't checked yet whether either one is Wine or D3DMetal rather than XCL. If there's a branch or PR you'd like run on a second M5 Pro, let me know.
Edit: the first bullet said "decodes 0 samples". That was wrong, as @mikebuckets171 pointed out: 12291 is the buffer context
0x3003thatGetStateshould report, and the decode works. Fixed in #890.@mikebuckets171 on GitHub · 2026-11-24 10:50 UTC · original
Correction to my 10:06 comment: the readback half of it was measured on the wrong half the matrix. One sentence there is wrong and could send someone the wrong way, so here is the completed matrix and what it actually says.
What I said: "this host has no readback heap at all", and that XCL's
D3D12_HEAP_TYPE_READBACKstamp buffer (runner.rs:1442) is refused here, so the timed path cannot run as written. That is wrong. I had testedREADBACKin the two initial states I happened to try -GENERIC_READandRESOLVE_DEST- both E_INVALIDARG. The state XCL actually asks for isCOPY_DEST, and there it works:MapGENERIC_READMaprefused (0x80070057)RESOLVE_DESTCOPY_SOURCEGENERIC_READMap(0..64)S_OKCOPY_DESTGENERIC_READRESOLVE_DESTCOPY_DESTPlain 64-byte / 32768-byte buffers,
Dimension: BUFFER,Format: UNKNOWN,Layout: ROW_MAJOR,Flags: NONE,D3D12_HEAP_FLAG_NONE- the same shaperunner.rs:314'sbuffer()builds, and 32768 B isTIMESTAMP_SLOTS * 8, the size the title-facing pool atlist_x.rs:2115-2127asks for inCOPY_DEST. So both readback shapes XCL uses are creatable and mappable on this host; the timed path is not blocked at buffer creation.What survives from that comment, measured again in the arrangement XCL really uses (
EndQuery,ClearRenderTargetViewon an 8x8 RGBA8 target,EndQuery,ResolveQueryDatainto a READBACK +COPY_DESTbuffer with no barrier and no copy, fence signalled,Map(0, 0..16)S_OK): the two stamps read 0 and 0. TheBeginQuery+EndQuerypair, resolved into a DEFAULT buffer, is unreadable here becauseMapon a DEFAULT buffer is refused; resolving into an UPLOAD +GENERIC_READbuffer gives 0 and 0 as well. So the plumbing works end to end and the values are simply never written - which is the fact the timestamp fix in #996 needs, and that fix does work on this host:timestamps_outside_unified_memory_land_after_the_queuefails on02bfd1dwithnon-UMA GPU timestamp never landed (top=0, bottom=0)and passes atf242ea8, details in my comment on #996.Also, for the WARP half of #957: a plain D3D12 program on this host gets
CreateDXGIFactory2S_OK andEnumWarpAdapter0x887A0004(DXGI_ERROR_UNSUPPORTED), withEnumAdapters1enumerating exactly one adapter - vendor0x1002, device0x66af, 40960 MB dedicated, flags0x0- so there is nothing to fall back to.Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; the probe is a plain D3D12 PE, cross-built with LLVM-MinGW, no XCL in it and it reads no files. AI use: GPT-6 Luna wrote and ran the probe and drafted this correction; the codes are from those runs.
@mikebuckets171 on GitHub · 2026-11-24 11:03 UTC · original
@Lucasyudi - the gap you describe is still open after #996, and which side of the UMA window a timestamp targets decides whether it applies. Code path plus numbers from this host, in case it saves you writing the change twice.
#996 (@shortside, opened today) gates on the condition you found - a queue whose
GetTimestampFrequencyis under the slowest real GPU clock - and adds a second trigger: a timestamp query that resolved to 0 on a queue that reached its fence. On this host the second one is what actually fires in the library tests (the frequency gate sits increate_command_queue_x, which a lib test that builds its own device never reaches).Where #996's value goes, from
list_x.rs:2070-2095:write()issues the driver'sWriteBufferImmediateon the list with the marker mode (MARKER_IN for top of pipe, MARKER_OUT for bottom). Queue-ordered, so yourcpu_writes::afterworker gap does not apply to those.write()pushescpu_writes::Write::Immediate(list_x.rs:2081-2084): the same worker-writes-after-the-fence path you describe. #996's clock value enters through the same door as any other value write, so for the non-UMA case your gap is untouched.Measured (MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26 with D3DMetal, Rust 1.100.0,
x86_64-pc-windows-gnullvmwith LLVM-MinGW 20261117,--release --locked, one test per process).hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue- the non-UMA case:02bfd1d: spins the full 5 s, thenpanicked at crates/xcl/src/hle/d3d12x/list_x.rs:4981: non-UMA GPU timestamp never landed (top=0, bottom=0), exit0x65.f242ea8:ok. 1 passed; 0 failedin 0.44 s, exit0x0, log line "no GPU timestamps on this host (a timestamp query resolved to 0)".As you already said, that test spins until the value shows up, so 0.44 s only proves the value lands at all - it cannot see whether the title's own later
Signaland wait overtake the worker's write. I have not run a race test for that, so your question to @ivall is still live and #996 does not answer it; what #996 changes is the content (0 vs a clock value), not the ordering.Your note that the two stamps of one submission share a QPC value carries over to #996 too:
clock_now()is read per write, so top and bottom differ only by the CPU time between the two writes, not by anything the GPU did.One measurement that argues for answering
GetTimestampFrequency/GetClockCalibrationfrom the clock, which both plans do: a plain D3D12 program (no XCL) on this host gets 60 from the frequency call and aGetClockCalibrationGPU value equal to its CPU value (or 41-42 ticks below it), advancing at ~10^6-10^7 ticks per run - so before either change a title is handed 60 ticks/second and a ~1 GHz-scaled calibration value at the same time. The zero-stamp half matches what you measured on your M4 Pro: readback created, resolved, mapped, and both slots 0.Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna read the code path, ran the two test builds and drafted this comment; the codes and timings are from those runs.
@vakaobr on GitHub · 2026-11-24 02:41 UTC · original · edited 2026-11-24 11:05 UTC
@Ahmet-Dedeler: a fix for the 8 test fixtures Kalmarv traced above, tested on
mac-on-main-wipatdb065d8.Each fixture now builds its fake extended vtable the way
class_fordoes: the original table at index 0, the 16 mirror words (zero here), then the slots, with the object's vtable at.add(HDR). Soorig_fnreads the original atext[-HDR]. The only non-test change isHDRbecomingpub(super), so thelist_xandbindtests can use it. That's 3 files, +31 / -28.Tested
cargo test -p xcl --lib --target x86_64-pc-windows-gnu --no-runwith Rust 1.100.0 and mingw-w64 GCC 16.2.0, debug build. DXC 1.9.2609 throughXCL_DXC_DIR.<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):db065d8as isbind::tests::async_compute_pso_success_and_failure_in_dispatch_and_execute_indirectreal::readback_routing_tests::copy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enumlist_x::tests::reset_commits_state_only_after_native_success_and_always_restores_vtablelist_x::tests::resolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writebacklist_x::tests::draw_indexed_x_routes_through_bind_and_restores_index_bufferlist_x::tests::kickoff_x_render_targets_preserve_mrt_count_for_single_descriptor_rangelist_x::tests::set_predication_buffer_state_transitions_and_lifecyclelist_x::tests::timestamps_outside_unified_memory_land_after_the_queuelist_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
feb49be, without this diff) is still going on this machine, and I'll post those counts separately.The diff, on
db065d8Edit: 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:
V_CVT_F16_F32with clamp, 3.00x3C000x3C00OMOD×20x46000x4600V_ADD_F16, 1.0 + 1.0, high half kept0xBEEF40000xBEEF4000V_ADD_F64then the clampedV_CVT_F16_F320xDEAD3C000x00000000V_CVT_F16_F32thenV_ADD_F640xDEAD3C000x00000000V_LSHLREV_B64then the clampedV_CVT_F16_F320xDEAD3C000xDEAD3C00So f16 conversions are fine on their own. The
v_cvt_f16_f32 clampfailure ingpu_clamp_and_omod_per_instructionand thev_add_f16 keeps the high halfone ingpu_valu_16_and_64_bitcome 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 todb065d8. It addsdoubles_ready()next tomesh_ready()ingpu/recomp/tests.rs, which readsD3D12_OPTIONS.DoublePrecisionFloatShaderOpson the adapterrunnerpicks and skips withno doubleswhen it's false: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_randomskips 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.rsisn't touched, so the runtime doesn't change. Windows GPUs and WARP report doubles, so nothing skips there.XCL_REQUIRE_GPU=wave64would treat ano doublesskip as a failure, as it does every reason exceptno mesh shaders.Tested on
main18c105awith the diff, on the machine above, each test in its own process: all 14 giveokwithSKIPPED <test>: no doubles. Without the diff, all 14 failed in my per-test run of the branch atfeb49be. Not tested: Windows,mainwithout 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
main18c105aEdit: full run of
main9aec53d(same machine, debug, one test per process, 60 s cap forgpu_*, 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 fromOpenExistingHeapFromAddressonly);list_xwrite_buffer_immediate_on_open_existing_heap_visible_to_cpuhas the same cause, andshaderreadable_answers_from_the_working_set_without_touching_pagesfails because Wine'sQueryWorkingSetExdoesn't report the pages resident. The 12 timeouts are the draw / list hang: 8 GPU draw tests,bindcreate-list, twotitle_texturestests andvramd32s8. 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.
@mikebuckets171 on GitHub · 2026-11-24 11:32 UTC · original
The Mac-lane changes from this thread, stacked: six open commits from five contributors apply together onto one
mainand each does what it claims on this host.Why this is worth a comment here: those six are separate PRs, so nobody - including CI - has ever seen them in one tree. On a Mac host they all touch the same handful of host-dependent tests, so an interaction is the thing to rule out. Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal, Rosetta 2, Rust 1.100.0,
x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked, one test per process (--exact <full test path> --nocapture --test-threads=1), a fresh data root per run.The stack: onto main
6efdabc, in this order,git cherry-pick -x- all six apply cleanly, no conflicts, one build, 7 files+226 / -32:76d2ff7(#890) →3c43506(#957) →3a6f95a(#982) →ab7ce43(#983) →f242ea8(#996) →699975b(#1024)In that single stacked tree (16 test executables, 708 tests in the lib binary):
hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetimeok0.31 shle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queueok0.43 s, with the log line "no GPU timestamps on this host (a timestamp query resolved to 0)"hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_contentSKIPPED … no WARPgpu::recomp::tests::gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2SKIPPED … no 64-bit atomicseachgpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valuok0.39 sgpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mipsok0.47 sgpu::recomp::tests::gpu_uma_import_check_at_initSKIPPED … no GPU UMApredication_e2e:set_predication_buffer_state_and_kickoffSKIPPED … no GPU UMABaseline for the same runs, unstacked
6efdabcin a second tree: every test the six commits target fails there -mapped_frame_dump_…atpresent.rs:1099:67,gpu_uma_import_check_at_initattests.rs:3371:5,gpu_sparse_vram_descriptors_buffers_and_xmemattests.rs:3397:5(left: 0, right: 4),gpu_memory_windows_reject_out_of_uma_aliasingattests.rs:3342:54,write_buffer_immediate_on_open_existing_heap_visible_to_cpuatlist_x.rs:5022:74. (The base failures of #982 and #983 were measured separately on their own base9aec53d, #996's on02bfd1d, #890's on1ec4c98/beaa245/6efdabc, #957's on077ce40- each pair is on the PR.)Three still fail in the stack, unchanged - same assertion, line numbers shifted only by the lines the stack adds:
gpu_sparse_vram_descriptors_buffers_and_xmem(tests.rs:3455:5,left: 0, right: 4),gpu_memory_windows_reject_out_of_uma_aliasing(tests.rs:3390:54),write_buffer_immediate_on_open_existing_heap_visible_to_cpu(list_x.rs:5027:74). So none of the six changes disturbs them, and they are the remaining Mac-host gap: the first two are in the arena / memory-window set that #1060 takes on, and the third sits inlist_x.rs, outside that PR's file, so it keeps failing here - on this hostOpenExistingHeapFromAddressisNot implemented (0x80004001), which is the premise that test's title depends on.What this does not show: Windows or any other host (no Windows machine on this bench), and none of it is a gameplay result - these are library test binaries under Wine with no title running. It says the six changes are compatible with each other on a Mac host, not that they are correct in general; each pair's correctness is on its own PR.
Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna built both trees, ran the tests and drafted this comment; the line numbers, timings and codes are from those runs.
@us3r40456 on GitHub · 2026-11-24 11:58 UTC · original
@Ahmet-Dedeler, @vakaobr: a proposal before I write it, for the runtime side of the 64-bit atomics gap that #983 reports for the tests.
On D3DMetal, a program with
InterlockedAdd64,Or64,Exchange64,CompareExchange64or a signedMin64/Max64runs as a no-op (#983). So a title shader that uses one of the*_atomic_*_x2operations computes or draws nothing, and nothing reports it. As #983 says, compare-swap, exchange and signed min / max cannot be built from 32-bit atomics without a lock. Part of the set can, though, with the same final memory as the 64-bit atomic:add_x2/sub_x2:InterlockedAddon the low dword, then on the high dword with the carry or borrow taken from the low add's old value. Adds commute, so the end state is exact.and_x2/or_x2/xor_x2: one 32-bit op per dword, with an exact end state.umin_x2/umax_x2: the 64-bit op itself works here.The cost is with GLC: the old value the split forms return is made of the two halves' old values, and another lane's update can land between the two halves.
Measured on this Mac (a temporary test, one thread, with a marker store to show the shader ran):
InterlockedAnd/Or/Xor/Minare correct.InterlockedMax64/Min64update the cell with and without the returned value. I did not check the returned value itself.Plan:
rmw64emits the split forms for add / sub / and / or / xor and keeps umin / umax. The rest (cmpswap, swap, smin / smax, inc / dec, the float ones) keeps today's code and stays a no-op on this host.Two questions before I start:
xcl-smokepair from a Mac with a title, and I have none here. @mikebuckets171, could you run it when the PR is up?AI use: Claude Code, Claude Opus 5.5 ran the measurements on this machine and wrote this proposal.
@saltignefer on GitHub · 2026-11-24 12:04 UTC · original
Sharing a working alternative macOS backend path in case it helps with the closed-source D3DMetal gaps being tracked here (64-bit atomics, FP64, mesh shaders, UMA).
We are maintaining a Mesa KosmicKrisp Vulkan-on-Metal4 fork paired with vkd3d-proton 3.1 under CrossOver Preview on Apple Silicon, and testing it directly against XCL's full 94-test
::gpu_suite (93 active + 1#[ignore], Apple M3 Max):okSKIPPED(wave64-only)FAILEDABORTcargo testpasssaltignefer/kosmickrisp(d91b74ff) +vkd3d-proton 3.1+macos-kosmickrisp(The 2
SKIPPEDtests aregpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, which require 64-lane hardware waves.)What works on KosmicKrisp +
vkd3d-proton 3.1nownir_fp_preserve_nan/precise::fmain KosmicKrisp forv_rsq_f64and added a 1-lane VS subgroup fallback).OpenExistingHeapFromAddressfailures after WineMEM_WRITE_WATCHsplits 16 KiB mappings into 4 KiB XNUvm_map_entryfragments via in-placemach_vm_remapdefragmentation on import.vkd3d-protoniface->lpVtblaborts (0 / 93): addedFenceProxy,make_unadopt_selfthunks forResource/Heap/PipelineState/DescriptorHeap,UnadoptGuardwrappers, and skipped adopting zero-override interfaces under Wine.Remaining 3 failures
gpu_nonfused_mad_and_mac_prevent_fma_contraction—vkd3d-proton'sdxil-spirvlowers non-precisemadtoOpFMul+OpFAddrather thanFma.gpu_ps_image_sample_offset_implicit_lod_between_mips— Apple Silicon trilinear mip-offset behavior (25.21875vs26); fails identically on D3DMetal 3.0.gpu_sparse_vram_descriptors_buffers_and_xmem— no longer aborts, but reads0instead of1077(sparse 4 GiB reserved buffer /UpdateTileMappingspath still open).Repos & builds
x86_64(CrossOver) /arm64tarballs: https://github.com/saltignefer/kosmickrisp (releasev2026.11.24)vkd3d-protonvtable guards + macOS cross-build/suite runner): https://github.com/saltignefer/xcl/tree/macos-kosmickrispIf anyone here wants to test this stack on retail titles or help close the sparse-VRAM / Vulkan gaps, contributions and test reports are very welcome.
@vakaobr on GitHub · 2026-11-24 12:22 UTC · original
@us3r40456: +1 to the split forms. One thing from the probes behind #983 that changes the umin / umax part of the plan: on this M5 Pro (CrossOver 26.3, D3DMetal 3.0), unsigned
InterlockedMin64/InterlockedMax64work only in the non-returning form. When the shader stores the returned old value, the program writes nothing, like the other 64-bit atomics: one thread on a raw buffer bound as a root UAV, cell0x00000001FFFFFFF0, the marker store lost too. Non-returning, both are right, also with 64 lanes on one cell. If your test didn't use the returned value, DXC may have emitted the non-returning form, which would explain the difference. Soumin_x2/umax_x2with GLC would need the split (or a skip) as well. Also on groupshared memory, even the non-returningInterlockedMax64wrote nothing here.@saltignefer:
gpu_ps_image_sample_offset_implicit_lod_between_mipsat 25.21875 against 26 is what #982 fixes on D3DMetal: the host computes the LOD as 0.2421875 instead of 0.25, and the program had nos_wqm, so helper lanes read u / v as 0. #982 takes the expected values from the host's own LOD and addss_wqm. If your stack gives the same 25.21875, #982 should fix it there too. I have not run your stack.AI use: Claude Code, Claude Opus 5.5 ran the probes on this machine and wrote this comment.
@Lucasyudi on GitHub · 2026-11-24 12:38 UTC · original
@mikebuckets171 thanks for tracing #996's write path. That settles it on my side: #996 (@shortside) covers the timestamp change I had kept local (same frequency gate, plus the zero-resolve trigger that the lib tests actually reach), so I am dropping mine and will not open it. The
cpu_writes::afterordering question to @ivall above stands on its own, independent of either change.Updates on my two PRs, from the reviews they got:
gpu_atomic_fcmpswap_x2andgpu_atomic_fmin_fmax_x2are out of it, as @vakaobr and @us3r40456 pointed out (no doubles in their programs, they belong to #983). Now 11 tests skip whole plus the F64 part ofgpu_float_compares_random.AI-assisted (Claude Code, Claude Opus 5.5).
@shortside on GitHub · 2026-11-24 12:46 UTC · original
@Ahmet-Dedeler where can a second pair of hands help most with getting the port into
main? I have an M5 Pro (CrossOver 26.3, D3DMetal). I don't have a title on it yet, so noxcl-smokeruns from me for now. Two things I could take, tell me which you want or what else:mac-on-main-wipthat you have not started splitting out, rebase it onto currentmainas a small PR, with you credited as the author of the change. You pick the piece.pr/native-host-vtablesandpr/standin-dual-sourcebranches rebased on today'smainbefore you open them (unit tests and the test title, not a retail title).For context, today I ran
main47efa2e+ #553 #750 #794 #890 #957 #982 #983 #996 #1024 as one local tree on this Mac. Non-GPU lib tests: 601 passed, 6 failed, 1 crashed, 20 ignored. GPU lib tests, one per process: 69 passed, 6 skipped, 18 failed, 1 hung. Integration: 12 of 15 binaries pass; the test title gets 33 checks in and then dies at the D3DMetal vtable crash, andgpu_compute_e2ehangs. Apart from the f64 tests (#787 did not merge cleanly into that tree), what is left is mostly what the port fixes: the vtable crash and the tests that needOpenExistingHeapFromAddress. So the port is the part that is missing onmainnow.AI use: Claude Code with Claude Fable 5.2 ran the tests and drafted this; I'm deciding what to pick up.
@mikebuckets171 on GitHub · 2026-11-24 13:36 UTC · original
@us3r40456 — yes, that pair can run here when the PR is up. Two measured things first, one of which supports the split forms.
What I have for it. A title on this bench, on its own drive, run through
xcl-smokewith the run bounded byXCL_RUN_SECONDS(crates/xcl/src/host.rs), the same warm data root for both sides, one exclusive run at a time, base and head each built from a clean tree, plus the plain-D3D12 probe (no XCL, reads no files) for the device-level facts. Only counts, timings and codes get posted.One thing that argues your split emulations will actually compute. The missing 64-bit atomics here do not poison the rest of the program that holds them:
gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valuat9aec53dfails on exactlyassertion left == right failed: global_atomic_inc wraps at 10,left: 0(tests.rs:4632) — the 64-bit atomic did nothing.ab7ce43- with its three 64-bit global atomics moved out into the newgpu_global_atomic_add_inc_dec_x2- runs and passes on this host (0.39-0.62 s,ok. 1 passed; 0 failed).So the sub-dword scratch work, the VALU work and the 32-bit atomics in that same program are fine on D3DMetal; only the 64-bit atomic results are absent. A
rmw64that emits 32-bitInterlockedAdd/And/Or/Xorper dword should produce real results here rather than a different flavour of nothing, which is the assumption your plan rests on. It also means a "no 64-bit atomics" host is not a "no atomics" host, so the option you add to the cache key is the right granularity.And the failure mode vakaobr describes is what I see too.
gpu_atomic_fcmpswap_x2at9aec53dreportsleft: 4609434218613702656(tests.rs:4737), which is0x3FF8000000000000— the test's ownINIT(const INIT: u64 = 0x3FF8_0000_0000_0000, the f64 bits of 1.5) written before the atomic and never replaced. The compare-exchange left the cell exactly as it was, including the shader's other stores in that program. That fits "the whole program writes nothing" rather than "the atomic's result is wrong", and it is the reason I would read your split forms as the fix for a missing store rather than a wrong value.What the pair can and cannot show on
maintoday — worth knowing before you write the PR, because it decides what the report is worth. On this host,mainat47efa2emakes 0 presents and 0 draws: the title loads and re-presents nothing, so a base/headxcl-smokepair onmaincan only prove nothing regressed (0 against 0). Where the same pair carries information is stacked on the Mac port branches: with #541 the title reached 2,576 frames and 41,914 translated draws on a warm root here. So I would run your pair both ways — plainmain, where the reading is "no regression, and the unit tests plus your new GPU tests are the real evidence", and stacked with the port pieces, where the frames and draws move and a torn GLC return or a wrong split would show up as a changed picture. Say which you want when the PR is up, or both.Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0,
x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked. AI use: GPT-6 Luna ran the #983 pair whose numbers are quoted here and drafted this reply; the counts and codes are from those runs.@Lucasyudi on GitHub · 2026-11-24 13:39 UTC · original
@shortside on #787 not merging into your tree: that was its earlier head
8b73108, which putno_doubles()on the guards ofgpu_atomic_fcmpswap_x2/gpu_atomic_fmin_fmax_x2, the same lines #983 changes tono_int64_atomics(). Those two are out of #787 now (they have no doubles). The current head46695abis rebased onmain930e8b4and merges cleanly on top of #553 #750 #794 #890 #957 #982 #983 #996 #1024. Here, the 12 f64 / mixed tests skip with "no f64" again on the rebased head.AI-assisted (Claude Code, Claude Opus 5.5).
@Ahmet-Dedeler on GitHub · 2026-11-24 13:48 UTC · original
Sorry for going quiet here, I was heads down on getting the title further and didn't keep up with the thread. Thanks for all the runs, this is way more testing than I could do on one Mac. Catching up on what was asked:
@shortside yes to both, thanks.
pr/native-host-vtables(ddf3be7) andpr/standin-dual-source(#666) on today'smainwould help a lot. Both are one commit on508a0c7, so 111 commits behind now. I haven't rebased them because that would throw away the runs people already posted against those heads.mac-on-main-wipto split out, the depth formats one is the most self-contained: 8fc0600 (every depth + stencil family is depth only on D3DMetal) with its test in aaf191b. It has a unit test and doesn't need a title. Take it, rebase it onmain, open it under your name.@vakaobr the fixture fix looks right to me, and your table matches what Kalmarv traced. Can you open it as a PR against
Ahmet-Dedeler/xcl, basemac-on-main-wip? I'll merge it there so the branch stops crashing in those tests for everyone else running it.@us3r40456 +1 on the split forms for
add_x2/sub_x2and the bitwise ones, go ahead. vakaobr's note aboutumin/umaxonly working in the non-returning form sounds like the part to pin with a test first. Also thanks for thepr/native-host-vtablesrun, that was the missing second Mac for it.Where the port itself is, so nobody chases the wrong thing: on my Mac the title gets through sign-in and the first-run menus at 30 fps with full text, then goes into world loading. It stops there. The world textures come in as BCPack requests, which XCL refuses, nothing new reaches the screen for a while, and the title's GPU-progress watchdog ends the run (the same
+0x23cf683site as #505). So for a Mac host the next real blocker is the same as on Windows, BCPack plus whatever that watchdog waits on, not something D3DMetal specific.What I still owe: the full suite counts on
pr/native-host-vtablesbefore I open it, and the pieces ofmac-on-main-wipnobody has claimed (Rosetta 2 masked stores, the unified memory copy path, content-compared title textures). If anyone wants one of those, say so here and it's yours.@mikebuckets171 on GitHub · 2026-11-24 13:49 UTC · original
Correction to one line in my note above, and the probe readback from this host.
The failure I quoted is not the 64-bit atomic's own assert.
gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valuat9aec53daborts on its first assert —assert_eq!(r.mem[0x600 / 4], 64 % 11, "global_atomic_inc wraps at 10"),crates/xcl/src/gpu/recomp/tests.rs:4632,left: 0,right: 9. That is the 32-bitglobal_atomic_inc; the three*_x2asserts come later in the same test and are never reached. So what I actually measured is the mode #983's own comment describes: a program that contains a 64-bit atomic writes nothing at all, its 32-bit atomics included. Same host,ab7ce43, where the three*_x2cases move out intogpu_global_atomic_add_inc_dec_x2: that program passes (ok. 1 passed; 0 failed), and the new test is skipped by the probe line. My earlier bullet said "the 64-bit atomic did nothing"; the sharper statement is "the whole program produced no writes", which is the stronger support for a lowering change rather than a host quirk.The probe readback, which the split-form plan rests on. The probe seeds the UAV with
[0xFFFF_FFFF, 1, 0, 0], runsmem.InterlockedAdd64(0, 0x100000001ull, o)and thenmem.Store2(8, uint2((uint)o, (uint)(o >> 32)))in acs_6_6kernel, and expects[0, 3, 0xFFFF_FFFF, 1]— the carry into the high dword, and the old value the call returned parked at offset 8. This host hands back[0xffffffff, 1, 0, 0]— the seed, unchanged: the add did not happen, nothing carried, and theStore2of the returned old value landed nowhere. It prints64-bit atomics do not work on this GPU (InterlockedAdd64 probe: [ffffffff, 1, 0, 0]) – skippingand gatesgpu_atomic_fcmpswap_x2andgpu_atomic_fmin_fmax_x2intoSKIPPED … no 64-bit atomics. Same reading in the runs I took today as part of a seven-PR stack, so it is stable rather than a one-off.Emitter side, for whoever writes the split forms. At
47efa2e,crates/xcl/src/gpu/recomp/emit.rsmaps"add" | "sub" => "InterlockedAdd64",and / or / xortoInterlockedAnd64 / Or64 / Xor64,swaptoInterlockedExchange64,umin / umaxtoInterlockedMin64 / Max64, andsmin / smaxtoInterlockedMin64 / Max64onint64_tthrough an out-parameter. So every 64-bit atomic form a title can reach goes through a construct this host answers with nothing, which is why the gate has to be per-family rather than one host flag. My probe evidence coversInterlockedAdd64only; the "unsigned min / max do work" part is what #983 and @vakaobr measured, and my runs neither confirm nor contradict it.Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0,
x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked. AI use: GPT-6 Luna read the logs and the source and drafted this; the assertions, line numbers and readbacks are quoted from those runs.@vakaobr on GitHub · 2026-11-24 14:01 UTC · original
@Ahmet-Dedeler: the fixture fix is https://github.com/Ahmet-Dedeler/xcl/pull/1, against
mac-on-main-wip. With #996's commit (f242ea8) cherry-picked on top, the eighth fixture test,timestamps_outside_unified_memory_land_after_the_queue, passes too (M5 Pro, CrossOver 26.3, D3DMetal; it logs "no GPU timestamps on this host"), so you can carry that until #996 lands.For
pr/native-host-vtableson today'smain(47efa2e, merged cleanly, each test in its own process, twice):ddf3be7fixes thebindcreate-list andd32s8tests (they crash onmain), and #553 fixes the 8 draw tests without textures. With both,gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesandgpu_compute_e2e'sconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_backstill hang. That is #866, merged after your508a0c7base, which is why @us3r40456's run ofddf3be7didn't see it: D3DMetal callsReleaseon a barrier's resource from a native thread of its own at submit time, and #866'slate_release::enabled()readsXCL_LATE_RELEASEthere for the first time and never returns. Reading it once inreal::adopt(4 lines) makes both pass for me. It only helps with your vtable change in. Without it, D3DMetal fails earlier, on the vtable prefix. One risk I have not tested: if D3DMetal's call is ever the last reference, #866's path takes locks and waits on fences on that thread.I'll take the unified memory copy path (
c70bf8a): rebased ontomain, split into small PRs with tests, and the #1024 test adjusted to accept a coherent window copied into video memory.AI use: Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this comment.
@Ahmet-Dedeler on GitHub · 2026-11-24 14:15 UTC · original
@vakaobr merged, thanks.
mac-on-main-wiphas the fixture fix now. And yes, the unified memory copy path (c70bf8a) is yours, split it however reviews best.The
late_releasething is a good find. D3DMetal callingReleasefrom a native thread of its own at submit time is the same shape as a deadlock I hit on a newer rebase of the port: the render thread sat inres_releasewaiting on the sparse state lock, called from inside D3DMetal. So I'd treat "the host calls back into XCL on its own thread while XCL holds something" as a general rule for this host, not a one-off. Reading the switch once inreal::adoptsounds right for the env part. For the risk you named (D3DMetal's call being the last reference), I think the safe version is that a release arriving on a thread XCL didn't create only queues the work and never takes locks or waits on fences there. I haven't tried it.@Lucasyudi on GitHub · 2026-11-24 14:29 UTC · original
@Ahmet-Dedeler I'll take the masked stores under Rosetta 2 (
b51552bmaskmov,04e9301the loader step), split as:maskmovalone: the decoder, the helpers and the site finder with their tests, nothing calls it yet. Your commit, rebased onmain, authored by you.loader::replace_masked_stores,util::rosetta,XCL_MASKED_STORES, on only under Rosetta 2), with theloader::tests::masked_stores_…tests. That one changes the runtime, so it needs a Mac smoke pair with a title (@mikebuckets171, if your offer holds) and a Windows pair to show nothing changes there.First check here, on
main930e8b4+b51552b(cherry-picks cleanly), Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, mingw-w64 cross-build:maskmov::7 passed, 1 ignored. The ignored one, run with--ignored, ends the process here as it does on your M5 Pro: "a fault on the first element was resumed; now one on the fourth", thenrosetta error: unexpectedly need to EmulateForward on a synchronous exception … inst_index=18. So the finding holds on a second chip.If you'd rather open these yourself or have changes on them since
db065d8, say so and I'll test yours instead.AI-assisted (Claude Code, Claude Opus 5.5).
@Ahmet-Dedeler on GitHub · 2026-11-24 14:45 UTC · original
@Lucasyudi yes, take it, and that split is how I'd do it too. Nothing has changed on b51552b or 04e9301 since db065d8, so the fork is current for those.
Good to see the
--ignoredtest end the same way on an M4 Pro. That one is the whole reason for the helpers, so it's worth quoting the Rosetta line in the PR description for step 2. Otherwise a reviewer on Windows has no way to see why a store has to be split up.@vakaobr on GitHub · 2026-11-24 14:53 UTC · original
@mikebuckets171: you offered
xcl-smokepairs for Mac-path PRs. Three of mine need one, and I have no title:c70bf8a): head4a11de6, stacked on #1326 and #1327, basemain930e8b4. It's the Mac path: taken only whenOpenExistingHeapFromAddressreturns E_NOTIMPL, so on your bench the title gets GPU unified memory wheremainhas none. A pair of930e8b4against4a11de6is the one that matters most.XCL_UMA_SHADOW=0turns the path off if you want a third run to compare.3dd994a) changes no behaviour, so its pair should matchmain.@Kalmarv: under ivall's rule, #1326 and #1136 touch the shared path and need a Windows pair:
3dd994aon930e8b4.D3D12Core.dllon a console-mounted drive, for #595): head58160b6. Its fix only matters withXCL_D3D12_DIRorxcl.exeon a drive a console mount names, so a normal run should matchmain.Thanks to both of you. I'll paste the blocks into the descriptions unchanged and credit you.
AI use: Claude Code, Claude Opus 5.5 drafted this note.
@vakaobr on GitHub · 2026-11-24 14:55 UTC · original
@Ahmet-Dedeler: I'll take the content-compared title textures (
eae29b1,71fad13,4057323, and63eeae8for the memory that is not write-watched), rebased ontomainand split into small PRs with tests, like the unified memory copy path (#1326 to #1329). If it needs pieces ofe97bc3a(Mac host basics), I'll bring only those, in their own PR.AI use: Claude Code, Claude Opus 5.5 drafted this note.
@Lucasyudi on GitHub · 2026-11-24 15:00 UTC · original
@Ahmet-Dedeler thanks. The masked stores are up as four stacked drafts, your commits split with you as author, code and tests unchanged:
maskmov::insn_len/decode+ tests (390 lines)call_site,UNWIND_INFO+ theexectests, including the--ignoredreproduction (over 800 lines, almost all of it the harness that runs each helper against the instruction; the description says why it stays with the helper)plan+ its testeh::alloc_nearcame over from your branch with it, sincemainhas none.Here (M4 Pro, CrossOver 26.3):
maskmov::7 passed / 1 ignored,loader::3,util::6, 0 failed; the e2e test title gives the same 31 PASS / 2 FAIL with and without #1344 (it has no masked stores, so that only shows loading is undisturbed).@mikebuckets171 if your offer holds, #1344's head is the one that needs a Mac
xcl-smokepair with a title (its base is #1313, which changes no runtime path). A Windows pair from anyone would show nothing moves there: on a CPUutil::rosetta()is false and nothing is replaced.AI-assisted (Claude Code, Claude Opus 5.5).
@Ahmet-Dedeler on GitHub · 2026-11-24 15:15 UTC · original
@vakaobr yes, the content-compared textures are yours too (eae29b1, 71fad13, 4057323, 63eeae8). Bringing only the bits of e97bc3a it needs, in their own PR, is the right call. That commit is too big to go in as one thing anyway.
@Lucasyudi thanks, four stacked drafts is a much better shape than what I had. I'll read #1303 to #1344 and comment there if anything in the split changes what the code was meant to do.
One update from my side, since it changes the Mac numbers people may compare against: on today's
mainthe port no longer has any BCPack refusals (upstream's decoder covers it), the sign-in bar comes up in under 30 s, and loading ends at the same GPU-progress watchdog as #505. So the Mac host is now stopped by the same thing as Windows there.@vakaobr on GitHub · 2026-11-24 16:07 UTC · original
@Ahmet-Dedeler: the foreign-thread
Releasefix, built on your suggestion:vakaobr/xcld3d12x/foreign-thread-release, two commits onmain930e8b4.1a0d87freadsXCL_LATE_RELEASEat adoption, sores_releasenever reads the environment for the first time on D3DMetal's thread.d156481makes a release on a thread XCL didn't create take no locks and wait on nothing. On such a thread the count never reaches 0: a would-be lastReleasekeeps its reference and is queued (a lock-free ring), and a Wine thread later does the final release through the normalres_releasepath,late_releasehold included. A full ring keeps the reference and counts it, instead of spinning.Detection: gated on
under_wine(), read once at adoption, so it never runs on Windows. Under Wine it compares the stack pointer with0x7000_0000_0000. Measured here over 3 runs: Wine threads (the test thread and 5 spawned ones) at 24 to 34 MB, D3DMetal's callback threads around 0x7ff2… (140 TB). Readinggs:[0x30]was tried first and hangs on D3DMetal's thread, so it isn't used. On a host where the boundary were wrong, a release would only be delayed, not corrupted.Tested (M5 Pro, CrossOver 26.3, D3DMetal, on
930e8b4+ #553 + yourddf3be7, without the 4-line stop-gap):gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesandgpu_compute_e2e'sconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_backpass 2/2. Allhle::d3d12xlib tests one per process, before and after: no regressions (5 failures before and after, the same ones). 7 unit tests, including spawned threads never counting as foreign and a concurrent drain processing each entry exactly once. Not tested: Windows, other Wine hosts, a title. One known gap, of the same kind as the existing comment inres_release: if a Wine thread releases the same object at the very moment D3DMetal's thread does, the object can still go on D3DMetal's thread without XCL's cleanup.It only matters with your vtable change in (without it D3DMetal fails earlier, on the prefix), and
mac-on-main-wippredates #866, so I see it going in withpr/native-host-vtablesor as a PR stacked right after it. Which do you prefer?AI use: Claude Code with Claude Opus 4.6 wrote the change and the tests; Claude Code with Claude Opus 5.5 reviewed it, required the
under_winegate, the claimed-slot consumer and the deferred final release, and wrote this comment.@mikebuckets171 on GitHub · 2026-11-24 16:26 UTC · original
Seven Mac-lane PRs in one tree on today's
main47efa2e, and an ordering note for anyone building a stacked Mac branch.Tree:
47efa2ewith-xcherry-picks of76d2ff7(#890),3c43506(#957),3a6f95a(#982),ab7ce43(#983),f242ea8(#996),699975b(#1024) and01a236c(#787): 7 commits, 10 files, +283/−44. Builds clean with--release --lockedforx86_64-pc-windows-gnullvm, 17 test executables.crates/xcl/srcgoes from 719#[test]at47efa2eto 721 in the tree — the two added tests area_60_hz_timestamp_frequency_is_no_gpu_clock(#996) andgpu_global_atomic_add_inc_dec_x2(#983).17 Mac-relevant tests, one process each: 13 pass or skip the way their PR intends, 4 fail.
SKIPPED … no f64→ok:gpu_f64_class_compare,gpu_f64_math_random,gpu_f64_literal_high_word,gpu_valu_16_and_64_bit,gpu_clamp_and_omod_per_instruction(#787). The same gate also fires at #787's head measured on its own, and at47efa2ethose tests fail.SKIPPED … no 64-bit atomics→ok:gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2(#983).gpu_more_atomics_sub_dword_scratch_valunow ok, 0.36 s.SKIPPED … no GPU UMA→ok:gpu_uma_import_check_at_init(#1024).SKIPPED(no WARP) →ok:hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content(#957).gpu_ps_image_sample_offset_implicit_lod_between_mips0.44 s (#982),hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime0.37 s (#890),hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue0.38 s, printing the new host line about a timestamp query resolving to 0 (#996).gpu_unified_memory_arena(crates/xcl/src/gpu/recomp/tests.rs:3186:54),gpu_sparse_vram_descriptors_buffers_and_xmem(3478:5,left: 0,right: 4),gpu_memory_windows_reject_out_of_uma_aliasing(3413:54) — the heap/UMA family, where #1024 gates only the init check and #1060 could not be included in this tree (next paragraph) — andhle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu(list_x.rs:5039:74,0x80004001fromOpenExistingHeapFromAddress).Ordering note. #1060
b22e57ccherry-picks cleanly onto47efa2eon its own, andgit merge-tree --write-tree 47efa2e b22e57creports a clean merge — but picking it after the seven above conflicts, incrates/xcl/src/gpu/recomp/tests.rs: #983 and #787 already put their own host gates (no_int64_atomics(),no_doubles()) on the same GPU test functions that #1060 gates. So merging #1060 intomainis fine; picking it last onto a stack is not, and a stack that leaves it out keeps the three UMA tests above failing. If a rebase of #1060 is wanted, the collision is confined to those guard lines.Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data.
Two of these numbers are at
47efa2e(the per-test outcomes and the 719 → 721 count);mainhas moved tob7aa9f3since. The ordering note was re-checked onb7aa9f3and holds: all seven cherry-picks apply, #1060 still conflicts after them incrates/xcl/src/gpu/recomp/tests.rs. All eight PRs in this thread are still open — none of them is in the merges that landed since.Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0,
x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked. AI use: <MODEL_LINE> built the tree, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.@Ahmet-Dedeler on GitHub · 2026-11-24 16:33 UTC · original
@vakaobr that's the version I was hoping for. Never letting the count reach 0 on a thread XCL didn't create, and handing the last release to a Wine thread, means the
late_releasepath stays the only place that takes locks. The stack pointer check is a bit of a trick, but it's read once, only under Wine, and a wrong answer only delays a release. I'm fine with that. Worth one line in the PR on whygs:[0x30]isn't used, since the next person will try it.I'll run it on my port with a title when the branch is rebased past #866, and post what the two hanging tests and a loading run do.
@mikebuckets171 thanks for stacking the seven, that ordering note saves everyone a rebase.
@Ahmet-Dedeler on GitHub · 2026-11-24 16:35 UTC · original
@vakaobr I read
d3d12x/foreign-thread-releaseagainst what my port does for the same problem. Same idea in both (read the switch at adoption, a lastReleaseonly queues into a ring of atomics, one of XCL's threads cleans up). Yours is better in two places: it holds withXCL_LATE_RELEASE=0, and a full ring keeps the reference instead of falling back to the locking path. Three questions, all from reading the code, none reproduced:drain_deferredand a full ring. It advances the tail by compare-exchange and only then stores 0 into the slot. Between those two steps the slot is free for a producer. With the ring full,defer_releasecan claim that index and store a resource, and the consumer'sstore(0)then erases it. That object leaks, and the slot is 0 with the head past it, so every later drain stops there. Taking the slot withswap(0)before moving the tail would close it.under_wine()is also true on Linux / Proton. If a Wine thread's stack can sit above0x7000_0000_0000there (I haven't checked where Wine puts them on 64-bit Linux), every lastReleasefrom it goes through the ring on a host that doesn't need it. Adding "the D3D12 is in no PE module" to the per-thread check would limit it to this host.One more I didn't analyse: "
AddRefreturned 2" isn't atomic against aReleaseon another thread. I don't know if the count can reach 0 on the foreign thread in that window.I think the end state is yours plus the per-host gate, the larger ring and a drain that takes the slot first. No loading run with it from me yet, my port is on
930e8b4, so that comes with the next rebase past #866.@mikebuckets171 on GitHub · 2026-11-24 16:44 UTC · original
Seven Mac-lane PRs in one tree on today's
main47efa2e, and an ordering note for anyone building a stacked Mac branch.Tree:
47efa2ewith-xcherry-picks of76d2ff7(#890),3c43506(#957),3a6f95a(#982),ab7ce43(#983),f242ea8(#996),699975b(#1024) and01a236c(#787): 7 commits, 10 files, +283/−44. Builds clean with--release --lockedforx86_64-pc-windows-gnullvm, 17 test executables.crates/xcl/srcgoes from 719#[test]at47efa2eto 721 in the tree — the two added tests area_60_hz_timestamp_frequency_is_no_gpu_clock(#996) andgpu_global_atomic_add_inc_dec_x2(#983).17 Mac-relevant tests, one process each: 13 pass or skip the way their PR intends, 4 fail.
SKIPPED … no f64→ok:gpu_f64_class_compare,gpu_f64_math_random,gpu_f64_literal_high_word,gpu_valu_16_and_64_bit,gpu_clamp_and_omod_per_instruction(#787). The same gate also fires at #787's head measured on its own, and at47efa2ethose tests fail.SKIPPED … no 64-bit atomics→ok:gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2(#983).gpu_more_atomics_sub_dword_scratch_valunow ok, 0.36 s.SKIPPED … no GPU UMA→ok:gpu_uma_import_check_at_init(#1024).SKIPPED(no WARP) →ok:hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content(#957).gpu_ps_image_sample_offset_implicit_lod_between_mips0.44 s (#982),hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime0.37 s (#890),hle::d3d12x::list_x::tests::timestamps_outside_unified_memory_land_after_the_queue0.38 s, printing the new host line about a timestamp query resolving to 0 (#996).gpu_unified_memory_arena(crates/xcl/src/gpu/recomp/tests.rs:3186:54),gpu_sparse_vram_descriptors_buffers_and_xmem(3478:5,left: 0,right: 4),gpu_memory_windows_reject_out_of_uma_aliasing(3413:54) — the heap/UMA family, where #1024 gates only the init check and #1060 could not be included in this tree (next paragraph) — andhle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu(list_x.rs:5039:74,0x80004001fromOpenExistingHeapFromAddress).Ordering note. #1060
b22e57ccherry-picks cleanly onto47efa2eon its own, andgit merge-tree --write-tree 47efa2e b22e57creports a clean merge — but picking it after the seven above conflicts, incrates/xcl/src/gpu/recomp/tests.rs: #983 and #787 already put their own host gates (no_int64_atomics(),no_doubles()) on the same GPU test functions that #1060 gates. So merging #1060 intomainis fine; picking it last onto a stack is not, and a stack that leaves it out keeps the three UMA tests above failing. If a rebase of #1060 is wanted, the collision is confined to those guard lines.Not tested: Windows — this machine has no Windows host. Counts, line numbers, timings and result codes only; no game data.
Two of these numbers are at
47efa2e(the per-test outcomes and the 719 → 721 count);mainhas moved tob7aa9f3since. The ordering note was re-checked onb7aa9f3and holds: all seven cherry-picks apply, #1060 still conflicts after them incrates/xcl/src/gpu/recomp/tests.rs. All eight PRs in this thread are still open — none of them is in the merges that landed since.Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal, Rust 1.100.0,
x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked. AI use: GPT-6 Luna built the tree, ran the tests and drafted this; the assertions, line numbers and timings are quoted from those runs.@mikebuckets171 on GitHub · 2026-11-24 17:09 UTC · original
BCPack on this Mac (M5 Pro, CrossOver 26 + D3DMetal), main
b7aa9f3: the title never reaches a storage request inside a bounded run.Two 90 s title runs, one at a time with local inference unloaded, same bottle and same data root: one plain, one with
XCL_DSTORAGE_BCPACK_FILL=1. Bothexit 0x0,frames shown: 0 (PresentX 0),presents per 2 s: 0 0 0,crashes: 0. The report'sdstoragesection is empty in both:bcpack_refusedandbcpack_unpackedare both empty maps, with no numeric counters either — not "many refusals", not "some unpacked": nothing arrived.What the same run does reach, from the report's counters:
d3d12.presents,frame_boundariesd3d12.translated_pipelines,fallback_pipelines,failed_pipelinesd3d12.background_pipelinesd3d12.dxil_cacheentriesd3d12.uma_mbshaders.submitted,unique,recomp_programsshaders.recomp_dxc_ok,recomp_dxc_failedaudio.engines,mastering_voices,xapu_packets_decodedvfs.unmapped_paths,redirected_writes,whiteoutsWhat that says about the BCPack question. @Ahmet-Dedeler's read is that the next blocker is BCPack requests plus the title's GPU-progress watchdog rather than D3DMetal. On this host a bounded run cannot test that: the title loads its modules and resolves imports, gets a device with a 4095 MB UMA reservation and three background pipelines, and then submits no work at all — no queue submission, no pipeline translation, no shader program, no audio engine, and no DirectStorage request, refused or otherwise. The
XCL_DSTORAGE_BCPACK_FILLrun is the same, because there is no refused destination to fill. So the stall here sits earlier than storage decompression, and my host can neither confirm nor refute the BCPack part of that hypothesis. The watchdog does not fire either: the title ends its own 90 s bound cleanly with exit0x0.Two things I would like to know before treating this as "BCPack is not the Mac blocker": whether the run gets further on a tree that has the Mac-port pieces in it (I am checking that now), and whether a longer bound on plain
maineventually produces a storage request — the 90 s bound was chosen for comparability, not because the title stopped asking.Not tested: Windows; and nothing about which requests the title wanted, because it asked for none inside the bound. Counts from
report.jsononly — no paths, file names, package contents or log bodies.Host: macOS 27.2.1 (Apple silicon, M5 Pro, 48 GB), CrossOver 26 with D3DMetal ("AMD Compatibility Mode", adapter
0x1002:0x66af), Rust 1.100.0,x86_64-pc-windows-gnullvm(LLVM-MinGW, clang 23.1.6),--release --locked,XCL_MAC_HOST=1,XCL_RUN_SECONDSbounded. AI use: GPT-6 Luna built the tree, ran the two title runs, read the report counters and drafted this; the numbers above are those counters.@Ahmet-Dedeler on GitHub · 2026-11-24 17:36 UTC · original
@mikebuckets171 that matches what I see, and it doesn't contradict the BCPack read. Plain
mainhas no Mac host path, so on a Mac the title stops a few seconds in, before it submits anything. My two smoke runs onmainfor the vtable PR were also 0 frames. So a bounded run of plainmaincan't reach a storage request on this host, however long the bound is.The BCPack numbers I quoted are from the port: on a
mainfrom before upstream's decoder the title got through the menus into world loading with BCPack requests refused, and with the port on amainthat has the decoder there are 0 refusals and loading runs on until the GPU-progress watchdog. So yes, a tree with the Mac-port pieces in it is the one that can test it. If your stacked tree gets the title to its first frame, thedstoragecounters should start to fill.@Ahmet-Dedeler on GitHub · 2026-11-24 19:42 UTC · original
The port is on a newer base now and public:
mac7on my fork, 55 commits onmain930e8b4. It has upstream's BCPack decoder under it (0 refusals), gets to the sign-in bar in under 30 s, and loading ends at the GPU-progress watchdog like #505.It also carries my three fixes for the foreign-thread
Releasefamily that @vakaobr and I compared above, so anyone who wants to diff the two approaches can do it against real code now.mac-on-main-wipstays where it is (5ae7547) because people have runs posted against it.For the PRs already split out of it (#1303 to #1344, #1326 to #1329, #1649): nothing changes, those came from
mac-on-main-wip, andmac7carries the same changes on the newer base.@vakaobr on GitHub · 2026-11-24 20:31 UTC · original
@Ahmet-Dedeler thanks for reading it this closely. I checked all four against the code and they hold, so the branch is updated and rebased on
85e3826, past #866 (d3d12x/foreign-thread-releaseon my fork, force-pushed).swap(0)before it moves the tail. I went with one consumer rather than swap-first alone because with several consumers a stale one can still swap out an entry written on the next lap. The tests now drive the real ring (an instance of their own, so they never touch the process one), including 200,000 entries from one producer against 4 drains. With the one-consumer flag removed, the flag test fails 3 of 3 and the stress test hung once in 3 runs.mac_host()says Darwin (your e97bc3a, read once at adoption), so Linux / Proton and Windows never take it. That commit is also the first one of the title textures stack, so both carry the same commit.res_release. The count it returns comes from an AddRef and its Release, which can't reach 0 while the caller's own reference is held.The
gs:[0x30]line is in the code comment and the commit message: reading the TEB pointer on a D3DMetal thread hangs (measured), and the stack pointer needs no memory access.One thing I didn't expect when I reran the two tests on
85e3826+ #553 + ddf3be7: they hang without the series and pass with only the first commit (readingXCL_LATE_RELEASEat adoption). The ring path is in use (4 releases per drain come from D3DMetal's thread in both tests), but neither test hangs without it, so for now it covers contention these tests don't produce. Your loading run would show whether it matters. Since the first commit is the fix for what we can reproduce, I'd open it as its own PR now (14 lines) and keepmac_host+ the ring as a stack behind it, unless you'd rather see them together.Tested on a MacBook Pro M5 Pro, CrossOver 26.3 / D3DMetal 3.0, Rosetta 2, Rust 1.100.0 x86_64-pc-windows-gnu, debug, one test per process: the 10
late_releaseunit tests pass,gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changespasses,console_wave64_compute_through_the_pso_hook_dispatch_and_read_backpasses 2 of 2. Not tested: Windows, Linux Wine, a retail title.AI use: Claude Code. Claude Opus 5.5 checked your four points against the code, rewrote the ring and the foreign Release, ran the tests and drafted this reply; the first version of the branch was written with Claude Opus 4.6.
@vakaobr on GitHub · 2026-11-24 21:06 UTC · original
@Ahmet-Dedeler I read
mac7's threeReleasecommits (1de6f68,e97f309,fd1e593) againstd3d12x/foreign-thread-release(f3a2c5a). Reading only, no runs ofmac7.The same in both: the setting is read when the device or first object is adopted (
e97f309/ my first commit, now #1789), and aReleasethat must not wait leaves a resource in a 16,384-slot ring of atomics that one consumer at a time drains, emptying a slot before it moves past it. Your monotonic indices withfetch_addand a 256-slot margin, and my compare-exchange on a wrapped head, come to the same thing.Where
mac7covers more: yours hands over every kept lastReleaseon a native host, on any thread, and1de6f68makessparse::forget_bufferandfree_at_releasetake the sparse lock only if it is free. Mine only movesReleases that arrive on a host thread (stack pointer above0x7000_0000_0000). So aReleaseD3DMetal makes on XCL's own Wine thread, from inside a call where XCL holds the sparse state's lock (upload_dirty/readback_ranges, as your1de6f68message describes), still reachesforget_bufferand waits for its own thread's lock on my branch.forget_bufferonmain4178e88still takes the lock unconditionally. That's the fault your retail smoke runs hit, and my branch doesn't fix it.Where mine covers more: on a host thread mine never calls the host's
Release, so the count can't reach 0 there.fd1e593still decides "last" withAddRefreturning 2, on whatever thread calls. If another thread releases between that check and the twoReleases, the count reaches 0 withheldfalse, andforget_releasedtakesUNMAPPABLE,TITLE_ADDRESSand the rest on D3DMetal's thread. That's the window you asked about in point 4. It's rare, but it's the same hang when it happens.Gate: yours is
NATIVE_HOST_MEMORY(no PE module for D3D12, set with the device), mine ismac_host()plus the stack pointer per thread. Both are off on Windows and Linux.So I think the end state is yours with one addition: on a host thread, no
Releasereaches the host at all (every one goes to the ring and a Wine thread runs it), which closes theAddRefwindow. Yours has the retail evidence and covers the lock-reentry case, so I'd rather build on it than keep a second version. If you open1de6f68+fd1e593as PRs onmain, I'll add the host-thread part on top as a small PR with its ring tests. If you'd rather I port them, say so and I will, with your authorship kept.AI use: Claude Code. Claude Opus 5.5 read both branches and wrote this comparison.
@shortside on GitHub · 2026-11-24 21:15 UTC · original
A 24 GB Apple silicon data point for
mac7: it draws and takes input, and memory is what stops it, about a minute after the first-run menu. Everyone else here has 48–64 GB or synthetic inputs, so this is the low end.Machine and build: MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), D3DMetal; DXC 1.9.2609.
mac7atdbd9d09, release, cross-built forx86_64-pc-windows-msvc(clang-cl / lld-link 23.1.6, xwin SDK). The retail title, run throughscripts/smoke.ps1(soXCL_NETWORK=0), one run at a time.1. Bounded run, 120 s, fresh data root,
XCL_DXC_THREADS=4,XCL_BACKGROUND=1:First present at ~6 s.
XCL_FRAME_DUMPshows black until frame ~380, then the sign-in bar (frames 620–860 identical). System memory free went from 73 % to 26 % and stayed there.2. With input, in the foreground (
XCL_BACKGROUND=0), fresh data root, 4 DXC threads. Keyboard input in the XCL window took it past the sign-in bar: the dump of frame 1220 is the first-run "Navigation Experience" page. Presents per 20 s: 340, 440, 530, 549, 600, 379, 66, 33, 1. At 138 s XCL logsDXC memory gate: compile held back … 1227 MB physical available; from ~160 ssparse: the queue has not reached fence value …. An external watchdog of mine ended the run at 183 s with 5 % of system memory free and 8.3 GB of swap in use. So no exit code of the title's own, and it never got as far as the #505 watchdog.3. The same again on the same data root (warm), 2 DXC threads. Presents per 20 s: 330, 416, 506, 600, 357, 84, 1; ended by the same watchdog at 132 s, 5 % free, 7.4 GB swap. No
DXC memory gateline this time, so it is not the compiles. XCL's last memory line: video memory 2773 MB local, arenas 3442 MB in use, sparse pools 2048 MB, 21251 title textures kept in step. On this host all of that is system memory.Four small things for anyone running smoke on a Mac:
XCL_BACKGROUND=1the XCL window stayed white here although the dumps show the picture; in the foreground it showed the game.peak commitreads 0 MB in every block here (XCL logsmemory: 0 MB committed by the processunder Wine), so the 125 % commit limit of the regression rule cannot be checked on this host.gpu:reads "AMD Compatibility Mode" (D3DMetal's adapter name).main(b9b6ea6) on the same host: 0 frames in 60 s, exit 0x0, afterOpenExistingHeapFromAddress … Not implemented, as @mikebuckets171 measured.Not tested: anything past the first-run pages, more than 24 GB,
XCL_UMA_SHADOW=0, a controller (keyboard only), sound.AI use: Claude Code with Claude Fable 5.2 built the tree, made the runs on my machine, read the logs and frame dumps, and drafted this; I was at the keyboard for run 2.
@shortside on GitHub · 2026-11-24 21:32 UTC · original
Follow-up to my 24 GB report above: Series S mode plus #615 gets this Mac further than Series X does, for anyone else short of memory.
Same machine (M5 Pro, 24 GB, CrossOver 26.3, D3DMetal),
mac7dbd9d09, the retail title, foreground,XCL_DXC_THREADS=2, a warm data root:device_type = "anaconda"(default)device_type = "lockhart""lockhart"+ #615 merged in (clean merge)PresentX now with 2 plane(s)). Onmac7as it is, the swap chain is 1920x1080 and every dumped frame is black, at 30 fps. That is the multi-plane item of #103, not a Mac problem.present: compositing 2 planes into 3840x2160 …and the menus show in the XCL window. So the compositor runs on D3DMetal; my report is on #615.Not tested: anything after the loading artwork, more than 24 GB, a controller.
AI use: Claude Code with Claude Fable 5.2 made the runs with me at the keyboard, read the logs and frame dumps, and drafted this.
@us3r40456 on GitHub · 2026-11-24 23:40 UTC · original
Apple Silicon test run on an M5 Pro — a data point next to the M3 runs above.
Machine: MacBook Pro M5 Pro, 24 GB, macOS 27.2.1 (26B131), Rosetta 2 present. CrossOver 26.3 (bottle, D3DMetal backend); the D3D12 adapter reports itself as "AMD Compatibility Mode (18186 MiB VRAM)", wave 32/32, SM 6.6. Rust 1.100.0 (stable-aarch64), mingw-w64 (Homebrew), DXC 1.9.2609.5 (
01b62ad4) + dxil 1.9.2609.5. Synthetic inputs only, no retail sample data (XCL_SAMPLE_*unset).Build (all worked)
Two warnings:
unknown lint: function_casts_as_integer, andfetch_updatedeprecated (renamed totry_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
gpuin path)FAILED, grouped
DoublePrecisionFloatShaderOpson 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}.gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2(SFI00xc000, no doubles flag).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.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.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;ID3D12Device14via D3DMetal; UMA + GameInput), then the title's own stall-watchdog fires at+0x2237178(0x80000003, nullthisvtable) before the first present (presents: 0). The coherent UMA window overflows 4 GiB (title asks ~4530 MiB, window caps at 4095 MiB) becauseOpenExistingHeapFromAddressis 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.ps1pair); no game-file run beyond the Stage-6.1 prebuilt; GPU tests capped at 12 s; single run (no re-run of the stuck/crash set).@us3r40456 on GitHub · 2026-11-25 02:19 UTC · original
Follow-up to my M5 Pro run above — a reproducible
+0x2237178crash 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) atdbd9d09with #615 merged in (clean,584e213). Cross-built forx86_64-pc-windows-msvcwith cargo-xwin (clang-cl / lld-link 23.1.6, xwin SDK). I also builtx86_64-pc-windows-gnu(mingw) — same result.Title: an unpacked retail Scarlett title,
game_scarlett_master.exe, run throughwine --bottle xcl,XCL_NETWORK=0, from a read-only folder onZ:.Result: a deterministic crash at
game_scarlett_master.exe+0x2237178(0x80000003, nullthisvtable at+0x677c997), ~6 s in, before the first present (presents: 0). It does not move with any of:windows-msvc(cargo-xwin),windows-gnu(mingw)device_typeanaconda(Series X),lockhart(Series S)XCL_BACKGROUNDXCL_DXC_THREADSIt is a different address from the
+0x2478b96the 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-sand both--unimplemented trapand--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 reportsTitleID 00000000,xbox.id = …0001at the crash (zeroed license/title identity).What it crashes right after — this is init, not a pipeline stall (we never get to shaders):
report.json: 587 imports, 0 unresolved;called_stubsempty;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:
game_scarlett_master.exe? If so, does+0x2237178ring a bell as an assert, and is it gated on Gaming Services being installed (a realSystem32\xgameruntime.dll) rather than XCL's fallback?unimplementedcall, yet the title int3s one virtual call afterGameInputCreate/ the XGameRuntime init. Is there an XGameRuntime or GameInput return the title hard-asserts on when Gaming Services is absent?report.json,xcl.log, a+0x2237178disassembly,XCL_DRED=1, etc.) on this M5 Pro / 24 GB machine.AI use: Claude Code (Claude Opus 4.8) built the trees, made the runs and drafted this; I reviewed it.
@us3r40456 on GitHub · 2026-11-25 02:34 UTC · original
Breakthrough on the
+0x2237178crash 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+0x2237178right 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>togame_dir/<file>soappdata0.rpf,MicrosoftGame.Config, the DLLs and every.rpf/.ttpfsit at the root — gets straight past it. On VIctorymain(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). Currentmainalready 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
+0x1dac734after the first frames, or get further?@shortside on GitHub · 2026-11-25 09:01 UTC · original
Loading on a 24 GB Mac: the crawl is video memory for texture levels the title has not loaded. A fix on
mac7, and two other findings.@Ahmet-Dedeler @us3r40456: follow-up to my 24 GB report above. Same machine (M5 Pro, 24 GB, macOS 27.2.1, CrossOver 26.3, D3DMetal),
mac7dbd9d09with #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-tileson my fork, one commit onmac7(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=0turns it off. Each texture has its own tiles, so it does not depend on tile aliasing.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-smokepair 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::readcopies directly on a Mac, and a page the title decommits mid-copy ends the process (access violation inmemcpy, about one loading run in ten here, more withXCL_GPU_PAGE_MAPPINGS=0). Branchd3d12x/native-host-tolerant-texture-read, one commit onmac7(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=0that did not happen in any run, and loading went on to 6,000–7,000 frames. I have not found the cause.Tested: the new unit tests under CrossOver on this machine; the scripted runs above. Not tested: Windows, any other title, the whole test suite.
Happy to open these as PRs against whichever branch suits you, or you can take the commits as they are.
AI use: Claude Code with Claude Fable 5.2 ran the measurements, wrote both commits and this comment on my machine.
@shortside on GitHub · 2026-11-25 09:42 UTC · original
Follow-up to my comment above: the numbers repeated on the clean branches, one correction, one more commit, and the cause of point 5.
Same machine and setup. Build:
mac7dbd9d09+ #615 +d3d12x/streamed-texture-level-tiles(2d6cc2e) +d3d12x/native-host-tolerant-texture-read(1d2d527), nothing else. Three scripted runs of 330 s:XCL_GPU_PAGE_MAPPINGS=0XCL_GPU_PAGE_MAPPINGS=0After 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 withXCL_GPU_PAGE_MAPPINGS=0ended at 47 s inmemory_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 19title_texturestests pass under CrossOver, and runs 2 and 3 above are with it.Point 5 has its cause: it is #1405.
mac7is 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=0only avoided it. Test report on the PR: #1405Where 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 whoses_barriers becomexcl_s_barrieron this GPU (wave 32). WithXCL_SAFE_BARRIER=0the 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.
@vakaobr on GitHub · 2026-11-25 10:55 UTC · original
@Ahmet-Dedeler, a memory-status bug on
mainthat yourmac7branch carries unchanged:process_private_bytes(crates/xcl/src/hle/kernelx.rs:787on mac7) takesPrivateUsagefromK32GetProcessMemoryInfoand falls back toPagefileUsagewhen it is 0.TitleMemoryStatus(kernelx.rs:802,used = process_private_bytes().min(total)at :808,avail = total - used) andXMemGetWorkingSetStatistics(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 setstotal, notused. The activity log's commit figure (host.rs:57) readsPrivateUsagedirectly.Under CrossOver 26.3 / Wine 11.0 on macOS I measured with a probe:
PrivateUsageis always 0 (Wine returns cb = 72), andPagefileUsageis a near-constant ~42 GB that does not move with commits (it looks like the virtual size). Only aVirtualQuerysum ofMEM_COMMIT+MEM_PRIVATEregions follows commits (+256 MB on a 256 MB commit, back on free). Sousedis clamped to the budget and a title on a Mac is told it has 0 bytes of title memory available.I posted a fix on #1097 (#1097). The Mac half: when
PrivateUsageis 0 and the host is not Linux, use theVirtualQuerysum, both forprocess_private_bytesand 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.
@Ahmet-Dedeler on GitHub · 2026-11-25 19:09 UTC · original
@vakaobr opened it: #2445, the ring from
fd1e593on currentmain, as a draft stacked on #1789. The bottom commit is your #1789 rebased ontomain(its base predates ares_releasechange the ring builds on), authorship kept. Your host-thread part (no hostReleaseat all on a host thread) is not in it, so it can go on top as you planned.What changed against
mac7while porting:1de6f68's main point is already onmain: #1981 (merged today) makessparse::forget_bufferonly try the lock and queue the rest, so the re-entry case from my retail runs no longer waits there. Your 21:06 note thatmainstill takes that lock unconditionally predates it. #789 covers thefree_at_releasehalf, so I left both out.class_foralready callsmodule_ofon the table's first method, and when that is 0 it setsNATIVE_HOSTonce and starts the late-release thread on the adopting thread. One thing I noticed on this Mac: XCL's own device goes throughd3d12.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.late_release::holdwaits for the late-release lock, anddrain_knownkeeps that lock while it signals the queues. AReleasethat 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,
mainbuilds without a change), withmain's suite counts on this host.@shortside on GitHub · 2026-11-25 19:15 UTC · original
@vakaobr thanks for stacking these. I ran the retail title on
mac/integrationat5f9a58fthree 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.XCL_VRAM_ARENAS=1game_scarlett_master.exe+0x23cf683ends it at 192 s, with 64 compute pipelines built in betweenXCL_VRAM_ARENAS=1 XCL_PSO_WAIT_MS=501. 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 whenplace_pagesgives nothing, and withsampled_on_pagestrue 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 onmain) 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:
four of those at once, then
writes after the GPU … although their queue had not got there after 10000 msevery 10 – 20 s, no further present, andD3D12 queue drain: GPU fences still pending after 10 sat exit. The title's stall watchdog fired three times after that and was skipped each time. In run 2, withoutXCL_PSO_WAIT_MS, the stall crash at+0x23cf683was 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 onmac7; 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.
@vakaobr on GitHub · 2026-11-25 20:35 UTC · original
@shortside thanks for the runs. Your reading of
6a78ce4is right: withsampled_on_pageson,place_pagestakes those textures, so your level tiles never see them, and they get pages under every level. The branch is at2b3f3d2now, where on a Mac sampled textures stay off the shared pages unlessXCL_VRAM_ARENAS=0, as before6a78ce4. The render-target change that came after it (24809ec) follows the same switch. So the default should be back on your level tiles. If you have time for one more run at2b3f3d2with no switches, it would confirm that the wired memory is back where your run 2 was; I have no title to check it.For
mainI added a note to #2402: there, the same textures get pages under every level unless #2306'sXCL_TEXTURE_LEVEL_PAGES=1maps a level when its texels come. Whether #2402 with level pages beats committed copies on a Mac isn't measured.Good to hear the native barrier gets you past world entry. Which piece of work the queue stops on at 229 s is beyond what I can look at without a title.
@Ahmet-Dedeler thanks for #2445. You're right that my #2474 duplicates it: both add a ring in
late_release.rs. I'm reworking it to sit on top of #2445: your ring and yourNATIVE_HOSTgate, with only the part that keeps aReleasearriving on a D3DMetal thread off that thread. I'll restack it as "Stacked on #2445" and close the current version once that's ready. Noted on1de6f68and #1981, and ondrain_known: I haven't seen it either, so I'd leave it until one of us does.AI use: Claude Code with Claude Opus 5.5 checked the code behind both points and wrote this reply.
@vakaobr on GitHub · 2026-11-25 16:04 UTC · original · edited 2026-11-25 20:42 UTC
@Ahmet-Dedeler @shortside I stacked the open Mac fixes on top of
mac7in one branch, so they can be tested together on a Mac: https://github.com/vakaobr/xcl/tree/mac/integration (head24809ec; edited to add what came since, below). It's for testing, not for merging; each part has or will get its own PR.What's in it, on top of
mac7(dbd9d09)d3d12x/streamed-texture-level-tilesandd3d12x/native-host-tolerant-texture-readmac7's sparse state: a copy back after a submission doesn't wait for the title's queue. It replaces #433, which its author closed in favour of #1993.XCL_SAFE_BARRIER, so changing it no longer reuses shaders cached without it (#1409). On a Mac the tag follows the Mac's default. Edited: this first said it fixed three more switches; those are already incache_allowedonmainand never reuse a cached shader. Formain, #1413 fixes #1409 the same way as those and came first.main(each with its tests and what is not tested):util::mac_host()(Darwin under Wine); #2363 and #2402 build on itkernelx: the process's commit comes fromVirtualQuerywhen Wine reportsPrivateUsageas 0ALLOW_UNORDERED_ACCESS: D3DMetal reads other reserved textures on the same tiles scrambled); #2492 adds render targets (0 of 4096 texels wrong; depth targets 3968 of 4096, so they keep arenas). On a Mac both need #1904 and #2445 + #2498 to run.s_barrieris the native group barrier by default (XCL_SAFE_BARRIER=1brings back the spin barrier). On D3DMetal, in a 1024-thread group, the waves spinning in the emulated barrier starve the one still working until the spin gives up, and then threads read LDS too early. The native barrier was correct in every case I tried, including exited waves and LDS exchange across the two halves.Releasethat D3DMetal makes on a thread of its own is run by a Wine thread (mac7has its own version of this, so the branch keeps that one)S:storage checks resolveXBOXpixel shader), #1698 (shortside: OpusGetStateunder Wine), #794 (gsucristo) + #1462 (crastinator): the console window is hidden where DWM cannot cloak it@shortside about the wrong output you saw with
XCL_SAFE_BARRIER=0: onmainthe translated cache doesn't key on that switch, so that run could have reused the spin-barrier shaders an earlier run cached. A rerun withXCL_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, at1f9eebe)cargo test --workspacebuilt forx86_64-pc-windows-gnu, all 16 test binaries: 763 passed, 17 failed, 9 timed out (90 s for GPU tests, 180 s for the rest), 12 SKIPPED, 45 ignored. The lib alone: 724 passed, 14 failed, 8 timed out, 11 SKIPPED, 23 ignored.gpu_f64_*and a few others), pixel-shader draws that time out (gpu_rect_list_*,gpu_graphics_vs_ps_draw,gpu_wave64_ps_*),OpenExistingHeapFromAddress, one compositor frame dump,predication_e2e,pls_quotaand onegpu_compute_e2etest.CreateGraphicsPipelineStatefor itsXBOXpixel shader, on every tree (maintoo). #750 fixes it; with #750, #1698, #794 and #1462 the test title passes all 50 of its checks and exits with 0 (3 runs).SKIPPED: no WARP device(CrossOver has no WARP adapter). With a local change that falls back to the D3DMetal adapter they pass 4 of 4; that change is not in the branch.Not tested: a title, Windows, a release build of the tests.
To try it on a Mac: build with
cargo build --release -p xcl --target x86_64-pc-windows-gnu, setXCL_DXC_DIRto a DXC 1.9bin\x64folder, and runxcl.exe run <game folder>throughwine --bottle <bottle>in a CrossOver bottle with D3DMetal on. If something breaks,logs\xcl.logandlogs\report.jsonunder%LOCALAPPDATA%\XCL\<title>\in the bottle are what helps, plus theCRASH:line it prints at exit.AI use: Claude Code with Claude Opus 5.5 ported #1405 and #1993 onto
mac7, wrote my commits and PRs (#2327, #2361, #2362, #2363, #2402, #2414, #2492, #2498; Claude Opus 4.6 helped with #2474, now #2498, and the probes for #2492), ran the tests, and wrote this comment.@vakaobr on GitHub · 2026-11-26 00:57 UTC · original
@Ahmet-Dedeler @shortside I rebuilt my Mac integration branch on current
maininstead of onmac7: https://github.com/vakaobr/xcl/tree/mac/integration is now atefef307, onmain6d12f58. Themac7-based version is kept asmac/integration-old-2b3f3d2. As before, it is for testing on a Mac, not for merging.What's in it, on top of
mainMy PRs: #2327, #2361, #2362, #2363, #2402, #2414, #2492, and #2498 on Ahmet's #2445.
Other people's PRs: #750, #794 + #1462, #1698, #1904, #1993. #1405 is in
mainnow.The
mac7parts that already have a PR: #1344 (masked stores under Rosetta 2), #1649 (depth + stencil formats are depth only on D3DMetal), #996 (CPU-clock timestamps), #1026 (capture hashing off the lock), #1329 (the committed window gets a copy in video memory), #982 (test).From
mac7directly, credited to Ahmet: the title's network off on a Mac unlessXCL_NETWORK=1, 16 MiB title stacks,readable()probing memoryVirtualQuerydoesn't know, coherent heaps and lazy pages off on a Mac, the dual-source stand-in pixel shaders, andXCL_TEXTURE_SKIP_UNCHANGED.shortside's level tiles and tolerant texture read, ported off
mac7:NATIVE_HOST_MEMORYbecame #2445'sreal::native_host(), and an absent level is now an all-zero level, as inmain's #2306.memory_hash_in(1d2d527) is not inmain, so I left that commit out. On a Mac, sampled textures and render targets stay on the level tiles unlessXCL_VRAM_ARENAS=0, as on the old branch.Not ported from
mac7, because each is large, needsmac7's own memory model, or is for one retail title:CopyMemoryToMemoryX(d0926c6)main)@Ahmet-Dedeler if any of these is needed for a title to get as far as it did on
mac7, tell me which and I'll port it.Tested (MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3.0, D3DMetal 3.0, Rust 1.100.0
x86_64-pc-windows-gnu, debug, DXC 1.9.2609, every test in its own process; full run at762645d, and the commits after it change only tests, which I reran)gpu_uma_import_check_at_initpasses (by #1329), andgpu_placed_console_depth_target_with_clear_valuepasses (it ends in Metal's pixel-format assertion on plainmain).gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2,gpu_more_atomics_sub_dword_scratch_valunow fail.mainchanged these tests, and they fail the same way on plainmain(D3DMetal writes nothing for the 64-bit atomics they now include).mac7or the old branch changes what they test:mapping_fresh_pages_does_not_query_each_page,mapping_lazy_pages_again_does_not_query_each_pageandgpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes: lazy pages are off on a Mac. They pass withXCL_LAZY_PAGES=1.placed_title_textures_share_vram_and_preserve_pixels: title textures keep arenas on a Mac.readable_answers_from_the_working_set_without_touching_pages: Wine on macOS reports no working set. It fails on plainmaintoo; onmac7its skip went to stdout, so the old run counted it as a pass.main:texture_states(itsSKIPPEDline moved to stderr in #2154) andpredication_e2e.called_stubscomes back empty although the stub was called. It does the same on plainmain, and I haven't found why.main: 623 passed. I reran the ones that didn't pass on plainmain(6d12f58), one per process, and they fail the same way there:gpu::dxilfuzz, ops and core tests, thed3d12_*checks against the host driver,d3d12_mesh_stream, onegpu_compute_e2etest, and wave64 and pixel-shader timeouts.raw_loads_in_root_windows_respect_exec_and_boundsfails onmainbecauseOpenExistingHeapFromAddressisn't there. Here #1329 gets past that, and then the test thread overflows its stack and hangs. This is a path only tests take.d3d12_check_feature_supportcompare the PC format mapping with the driver. They now run withXCL_DEPTH_STENCIL=1, because #1649 makes D24S8 depth only on a Mac.XCL_DXC_DIR, 2 with it).Not tested: a retail title, so loading, memory under the level tiles, and what
XCL_TEXTURE_SKIP_UNCHANGEDguards against are unchecked. Also not tested: Windows, and a release build of the tests.To try it: same as before,
cargo build --release -p xcl --target x86_64-pc-windows-gnuatefef307, thenxcl.exe run <game folder>in a CrossOver bottle with D3DMetal on andXCL_DXC_DIRset. If a title that ran on the old branch stops working here, the commits listed as not ported are the first suspects, andlogs\xcl.logplus theCRASH:line tell which.AI use: Claude Code with Claude Opus 5.5 rebuilt the branch, ported the
mac7and shortside commits, wrote the test changes, ran the tests and wrote this comment.