macOS (Apple Silicon, CrossOver + D3DMetal): menus at 30 fps, into the world, scene mostly dark #1128

Open
opened 2026-11-26 04:20:42 +00:00 by github-bot · 11 comments
Owner

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

VIctory runs on a Mac under CrossOver, with Apple's D3DMetal as the D3D12. It gets through the menus and the intro video at about 30 fps and into the world, where the first mission's title card and opening credits draw over a scene that is still mostly dark. Posting what it took and what stops it, since I haven't seen a macOS report here and most of it is Apple specific.

Host: MacBook Pro, Apple M5 Max, 64 GB, macOS 27.3, CrossOver 26.3 (Wine + Rosetta 2 + D3DMetal). Cross-built with mingw (x86_64-pc-windows-gnu), which needed no source changes. No Windows machine or AMD / NVIDIA GPU involved.

Code: an older version of the Mac patch is public, 14 commits on 015d45b: Ahmet-Dedeler:mac-crossover. The numbers below are from a newer one, 13 commits on top of BeachesOfViceCity/VIctory-Linux at f1e94ce (main ffe310e plus their Wine/Proton commits). That one isn't published yet. I know PRs are limited to collaborators, so tell me if a branch on current main would be more useful and which parts you'd want.

How far it gets

  • First frame 2 to 3 s after start, sign-in bar in 21 to 30 s.
  • All first-run pages and the intro video at about 30 fps (33.0 to 33.3 ms per frame), in about 3 GB.
  • With the terms already accepted: loading screens with artwork, the world starts 125 to 150 s after start at about 8.5 to 8.9 GB, and the "VICE CITY, TWO YEARS AGO" title card draws.
  • In the world: a horizon line, then street and car lights with bloom, the rest black. About 6 s per frame. I played it by hand for about 15 minutes, up to the opening credits drawing over the scene. Then the title ended itself: its stall watchdog had fired 8 times (the patch skips it), and after that title threads raised a breakpoint exception at +0x63966f. I don't know yet what that site checks.

What stops it

  1. The scene stays dark even with indirect draws running. The argument clamp (#170) builds here with dxcompiler.dll and dxil.dll next to the exe (#178's route). After that 0 indirect executions are dropped for a missing clamp and 2,100 to 2,900 draws reach the host per frame, but the picture is the same. Still dropped per world frame in one 140 s run: 445 to 911 where the compute shader doesn't translate (same as Windows), 255 indirect draws with "prepare failed" although the pipeline exists, 124 to 151 compute pipelines that need 64-lane waves, 60 to 81 where the mesh shader doesn't translate, 43 for a pixel shader. I haven't worked out which of these keeps the lit scene from showing.
  2. Metal's mesh output limit. A mesh pipeline whose outputs go over 32,768 bytes (as Metal counts them) is created by D3DMetal without an error and never finishes when used. 340 of the title's mesh shaders are over it. The patch doesn't create those pipelines and drops their draws.
  3. 64-lane compute. D3DMetal only runs 32-lane waves and turns a WaveSize(64) compute pipeline into a no-op, silently. That is 321 of the 1,685 translated compute shaders. I have a 32-lane translation written (off by default), checked with Apple's IR verifier only. None of it has run on the GPU.
  4. No write tracking of title memory on this host, so everything a draw can read is copied again every frame, 7 to 8.7 GB per world frame. That is a big part of the 6 s.
  5. GPU hang on plain main. On ffe310e plus the same patch the world ends about 40 s in: macOS logs kIOGPUCommandBufferCallbackErrorHang and the runtime reports "the host GPU did not finish a submission of 26 lists in 12 s". With VIctory-Linux's bounded one-view tables for root SRVs / UAVs it didn't happen in the runs I made. I haven't isolated the cause.

Things about Apple's stack that may save someone time

  • Apple's DXIL converter merges the per-channel stores of one mesh output element into a single vector write, placed at the first store. If a channel's value is computed between two stores (an f16 conversion in our case), the vector uses a value defined after it. The Apple GPU compiler service then crashes in register allocation, the pipeline becomes a no-op and later compiles fail. 4,693 of 8,191 translated mesh shaders hit this. Fix: compute all of an export's channels before emitting any of its stores. After that, 0.
  • A no-op pipeline is silent, and fatal later. D3DMetal reports success for a pipeline Metal refused, and a submission that uses it never signals its fence. So the runtime has to decide whether a pipeline can exist on this host and drop its draws.
  • D3DMetal signals fences early, before the GPU has finished, so a fence wait can't tell you which submission hung.
  • The console's 10-bit float formats have no equivalent here. Half floats work as a stand-in.
  • Rosetta 2 needs the usual instruction handling (CLWB sites retired after the first trap, and so on).

Not tested

  • VIctory's own test suite on this host.
  • Gameplay, and audio (muted in these runs).
  • No frame was compared against a console capture.
  • Frame times are from a machine that was also running other builds for part of the session, so the idle figure could be better than 6 s.

The title's network is blocked on every run, and the terms page was accepted by hand.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 16:01 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128) VIctory runs on a Mac under CrossOver, with Apple's D3DMetal as the D3D12. It gets through the menus and the intro video at about 30 fps and into the world, where the first mission's title card and opening credits draw over a scene that is still mostly dark. Posting what it took and what stops it, since I haven't seen a macOS report here and most of it is Apple specific. **Host:** MacBook Pro, Apple M5 Max, 64 GB, macOS 27.3, CrossOver 26.3 (Wine + Rosetta 2 + D3DMetal). Cross-built with mingw (`x86_64-pc-windows-gnu`), which needed no source changes. No Windows machine or AMD / NVIDIA GPU involved. **Code:** an older version of the Mac patch is public, 14 commits on `015d45b`: [Ahmet-Dedeler:mac-crossover](https://github.com/Ahmet-Dedeler/VIctory/tree/mac-crossover). The numbers below are from a newer one, 13 commits on top of `BeachesOfViceCity/VIctory-Linux` at `f1e94ce` (`main` `ffe310e` plus their Wine/Proton commits). That one isn't published yet. I know PRs are limited to collaborators, so tell me if a branch on current `main` would be more useful and which parts you'd want. ### How far it gets - First frame 2 to 3 s after start, sign-in bar in 21 to 30 s. - All first-run pages and the intro video at about 30 fps (33.0 to 33.3 ms per frame), in about 3 GB. - With the terms already accepted: loading screens with artwork, the world starts 125 to 150 s after start at about 8.5 to 8.9 GB, and the "VICE CITY, TWO YEARS AGO" title card draws. - In the world: a horizon line, then street and car lights with bloom, the rest black. About 6 s per frame. I played it by hand for about 15 minutes, up to the opening credits drawing over the scene. Then the title ended itself: its stall watchdog had fired 8 times (the patch skips it), and after that title threads raised a breakpoint exception at `+0x63966f`. I don't know yet what that site checks. ### What stops it 1. **The scene stays dark even with indirect draws running.** The argument clamp (#170) builds here with `dxcompiler.dll` and `dxil.dll` next to the exe (#178's route). After that 0 indirect executions are dropped for a missing clamp and 2,100 to 2,900 draws reach the host per frame, but the picture is the same. Still dropped per world frame in one 140 s run: 445 to 911 where the compute shader doesn't translate (same as Windows), 255 indirect draws with "prepare failed" although the pipeline exists, 124 to 151 compute pipelines that need 64-lane waves, 60 to 81 where the mesh shader doesn't translate, 43 for a pixel shader. I haven't worked out which of these keeps the lit scene from showing. 2. **Metal's mesh output limit.** A mesh pipeline whose outputs go over 32,768 bytes (as Metal counts them) is created by D3DMetal without an error and never finishes when used. 340 of the title's mesh shaders are over it. The patch doesn't create those pipelines and drops their draws. 3. **64-lane compute.** D3DMetal only runs 32-lane waves and turns a `WaveSize(64)` compute pipeline into a no-op, silently. That is 321 of the 1,685 translated compute shaders. I have a 32-lane translation written (off by default), checked with Apple's IR verifier only. None of it has run on the GPU. 4. **No write tracking of title memory on this host**, so everything a draw can read is copied again every frame, 7 to 8.7 GB per world frame. That is a big part of the 6 s. 5. **GPU hang on plain `main`.** On `ffe310e` plus the same patch the world ends about 40 s in: macOS logs `kIOGPUCommandBufferCallbackErrorHang` and the runtime reports "the host GPU did not finish a submission of 26 lists in 12 s". With VIctory-Linux's bounded one-view tables for root SRVs / UAVs it didn't happen in the runs I made. I haven't isolated the cause. ### Things about Apple's stack that may save someone time - **Apple's DXIL converter merges the per-channel stores of one mesh output element into a single vector write, placed at the first store.** If a channel's value is computed between two stores (an f16 conversion in our case), the vector uses a value defined after it. The Apple GPU compiler service then crashes in register allocation, the pipeline becomes a no-op and later compiles fail. 4,693 of 8,191 translated mesh shaders hit this. Fix: compute all of an export's channels before emitting any of its stores. After that, 0. - **A no-op pipeline is silent, and fatal later.** D3DMetal reports success for a pipeline Metal refused, and a submission that uses it never signals its fence. So the runtime has to decide whether a pipeline can exist on this host and drop its draws. - **D3DMetal signals fences early**, before the GPU has finished, so a fence wait can't tell you which submission hung. - The console's 10-bit float formats have no equivalent here. Half floats work as a stand-in. - Rosetta 2 needs the usual instruction handling (CLWB sites retired after the first trap, and so on). ### Not tested - VIctory's own test suite on this host. - Gameplay, and audio (muted in these runs). - No frame was compared against a console capture. - Frame times are from a machine that was also running other builds for part of the session, so the idle figure could be better than 6 s. The title's network is blocked on every run, and the terms page was accepted by hand.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:20:42 +00:00
Author
Owner

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

Sibling-runtime hypothesis for the dark scene, cheap to falsify on exactly this host. D3DMetal is an impedance shim over Metal, and Metal's SIMD-group is hard 32 lanes — yet a DXGI/D3D12 shim is free to advertise whatever max wave size it wants. If your runtime believes a 64 from D3DMetal and legalizes wave64 without remap, every cross-lane compute result is wrong on an otherwise perfectly healthy GPU — which is the exact silent class your #1086 row 2 documents for NVIDIA native Wave32, arriving here through a third driver. Dark-scene-with-working-menus also matches your #1062/#1085/#1119 dropped-pipeline family, so two suspects, one test:\n\n1. Log what wave range the runtime receives from the D3DMetal device (the same diagnostic we standardized on in xcl#1407 — the line should say the received range, not just the decision).\n2. One forced run with wave64 emulation on regardless of what was advertised. If the scene changes (lighting appears, artifacts move, or it hangs elsewhere), the shim lied about lanes and this issue becomes platform-policy: Apple must be assumed wave32-capable-at-best, never trust the reported max — the same fail-safe direction our side takes for unknown ranges ("assume split").\n\nNote for cohort triage: xcl today trusts a reported device wave range for compute (split is forced only when the range includes/equals 32 or is unknown) — so a lying shim is a live risk on our side too on this platform, and your run is the first data point we have. If ① shows a reported 64 on Apple Silicon, we will add a D3DMetal-specific fail-safe rather than debate the general default.

**@⁠pickles976** on GitHub · 2026-11-24 16:03 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7137046837) Sibling-runtime hypothesis for the dark scene, cheap to falsify on exactly this host. D3DMetal is an impedance shim over Metal, and Metal's SIMD-group is **hard 32 lanes** — yet a DXGI/D3D12 shim is free to advertise whatever max wave size it wants. If your runtime believes a 64 from D3DMetal and legalizes wave64 without remap, every cross-lane compute result is wrong **on an otherwise perfectly healthy GPU** — which is the exact silent class your #1086 row 2 documents for NVIDIA native Wave32, arriving here through a third driver. Dark-scene-with-working-menus also matches your #1062/#1085/#1119 dropped-pipeline family, so two suspects, one test:\n\n1. **Log what wave range the runtime receives from the D3DMetal device** (the same diagnostic we standardized on in xcl#1407 — the line should say the received range, not just the decision).\n2. **One forced run** with wave64 emulation on regardless of what was advertised. If the scene changes (lighting appears, artifacts move, or it hangs elsewhere), the shim lied about lanes and this issue becomes platform-policy: Apple must be assumed wave32-capable-at-best, never trust the reported max — the same fail-safe direction our side takes for unknown ranges ("assume split").\n\nNote for cohort triage: xcl today **trusts** a reported device wave range for compute (split is forced only when the range includes/equals 32 or is unknown) — so a lying shim is a live risk on our side too on this platform, and your run is the first data point we have. If ① shows a reported 64 on Apple Silicon, we will add a D3DMetal-specific fail-safe rather than debate the general default.
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 16:12 UTC · original

For comparison, the same-frame captures in #841 showed a lit 2560×1440 world target alongside a zero 3840×2160 target and zero presented frames on an RTX 3090. Your horizon, lights, title card and credits establish that some world-frame content reaches the display on the Mac. A capture from one of those frames showing the internal scene target and the actual presentation source, with their sizes or resource IDs, would help locate where the dark regions first appear.

One detail for interpreting the 255 indirect drops: in the public draw path, prepare failed can also occur when the indirect command expects a different pipeline kind. The full indirect kind N: prepare failed (compute X, mesh Y) line, plus any descriptor-allocation message for that operation, would help distinguish a kind mismatch from a table that could not be bound. Which of those paths the measured Mac build took remains open.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 16:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7137298559) For comparison, the same-frame captures in #841 showed a lit 2560×1440 world target alongside a zero 3840×2160 target and zero presented frames on an RTX 3090. Your horizon, lights, title card and credits establish that some world-frame content reaches the display on the Mac. A capture from one of those frames showing the internal scene target and the actual presentation source, with their sizes or resource IDs, would help locate where the dark regions first appear. One detail for interpreting the 255 indirect drops: in the public draw path, `prepare failed` can also occur when the indirect command expects a different pipeline kind. The full `indirect kind N: prepare failed (compute X, mesh Y)` line, plus any descriptor-allocation message for that operation, would help distinguish a kind mismatch from a table that could not be bound. Which of those paths the measured Mac build took remains open.
Author
Owner

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

@⁠pickles976 good guess on the class of bug, but the shim doesn't lie about lanes here. D3DMetal's adapter reports 32-lane waves, and the runtime believes it. The catch is one step later: a compute pipeline that declares WaveSize(64) is accepted and then does nothing, with no error. That's blocker 3 above, 321 of the 1,685 translated compute shaders, and 124 to 151 dropped dispatches per world frame.

So the test you describe is the right one, just for a different reason. I have the 32-lane translation of those programs written and off by default, and it has never run on the GPU. Turning it on for one world run and seeing if the lighting changes is the next thing I'll try. I'll post what the picture does either way.

@⁠MichaelSmithAI both fair asks. I don't have a same-frame capture of the internal scene target next to what gets presented yet, I'll add one from a world frame with sizes. And I'll paste the full indirect kind N: prepare failed (compute X, mesh Y) lines for the 255, with any descriptor allocation message next to them. My note said "suspected rectangle lists", which was a guess, so a pipeline kind mismatch is just as likely until I look.

One number above is already out of date. The 6 s per frame was mostly not the GPU: the title clears memory with clzero one 64-byte line at a time in every worker job, and under Rosetta 2 each one was an emulated instruction at about 110 µs. With those sites rewritten into calls of ordinary code, the world is at 0.6 to 0.9 s per frame in the quiet first minute and 1.3 to 3.6 s once the credits run. Loading screens went from under 3 fps to 24 to 30. The picture is the same.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 16:33 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7137845601) @⁠pickles976 good guess on the class of bug, but the shim doesn't lie about lanes here. D3DMetal's adapter reports 32-lane waves, and the runtime believes it. The catch is one step later: a compute pipeline that declares `WaveSize(64)` is accepted and then does nothing, with no error. That's blocker 3 above, 321 of the 1,685 translated compute shaders, and 124 to 151 dropped dispatches per world frame. So the test you describe is the right one, just for a different reason. I have the 32-lane translation of those programs written and off by default, and it has never run on the GPU. Turning it on for one world run and seeing if the lighting changes is the next thing I'll try. I'll post what the picture does either way. @⁠MichaelSmithAI both fair asks. I don't have a same-frame capture of the internal scene target next to what gets presented yet, I'll add one from a world frame with sizes. And I'll paste the full `indirect kind N: prepare failed (compute X, mesh Y)` lines for the 255, with any descriptor allocation message next to them. My note said "suspected rectangle lists", which was a guess, so a pipeline kind mismatch is just as likely until I look. One number above is already out of date. The 6 s per frame was mostly not the GPU: the title clears memory with `clzero` one 64-byte line at a time in every worker job, and under Rosetta 2 each one was an emulated instruction at about 110 µs. With those sites rewritten into calls of ordinary code, the world is at 0.6 to 0.9 s per frame in the quiet first minute and 1.3 to 3.6 s once the credits run. Loading screens went from under 3 fps to 24 to 30. The picture is the same.
Author
Owner

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

Results for the three things asked above. Same host, tree is VIctory-Linux f1e94ce plus the Mac commits, every run is 295 s from boot into the opening of the world. D3DMetal reports WaveLaneCountMin/Max = 32/32.

1. Wave-64 programs on a 32-lane host (@⁠pickles976)

run tree distinct compute pipelines dropped in one world frame picture
G01 no 32-lane translation, wave-64 programs refused at pipeline creation 149 to 151, 74 of them for the wave size black, horizon lights only
G02 #189 in its Wave32 mode 155 (it takes 19 of the 74) unchanged, no hang, no GPU error
G03 / G04 #439 (console flow) kept beside the fork's LDS-barrier plan 80 to 90 (it takes 70 of the 74) G-buffer fills, presented frame unchanged, no hang, no artifacts

So turning it on does change what the GPU does, but not the presented picture yet. With #439 the culling passes (CS_Prop_BatchCull, CS_Tree_BatchCull), depth_pyramid:*, the tiled lighting setup (CS_GenerateMaterialMasks, CS_MaterialTilesInitial, CS_ClusterLightsWorldSpace) and shader_binning_utils:* now execute. Before, about 89% of the mesh indirect draws had zero group counts because their culling pass was one of the refused ones, and depth varied on 1 to 3% of the pixels. After, the G-buffer holds props, a fence, signs and a low-detail character, with depth varying on up to 29% of the pixels in one captured frame. Lighting still doesn't appear, that's a later stage (see 3).

Offline over the shader archive with --host-lanes 32-32, compute programs usable on a 32-lane host go from 2,180 to 2,434 with #439 (+254, none lost), and all 254 pass Apple's Metal shader converter. The 4 of the 74 that are left are groups of more than 64 threads and whole-wave sections.

Dropped dispatches per frame is not a stable number (one untranslated pipeline can be dispatched 30+ times in one frame and not at all in the next), so the table counts distinct pipelines.

2. The ~255 "prepare failed" indirect draws (@⁠MichaelSmithAI)

They are rectangle lists. My first guess was right, and it's not a kind mismatch or a table that couldn't be bound.

The full line: dropped 256.0/frame without a host pipeline: indirect kind 0: prepare failed (compute false, mesh false). Kind 0 is a non-indexed draw and the bound pipeline is a graphics pipeline that is neither compute nor mesh, so the kinds agree. No descriptor allocation or heap message next to them.

Per draw in one world frame: 180 are VS_TiledLighting + TL_PS_<material> (the deferred lighting, one pair per material), 64 are VS_TiledWeathering, 12 are VS_TiledLighting + PS_SSSResolve. All have topology 17, no vertex buffer, records like [720, 1, 0, 0] (240 tiles of 3 vertices). The draw path refuses indirect rectangle lists because its rectangle expansion rewrites vertex buffers, and these have none, the corners come from SV_VertexID.

With a geometry-shader variant of the pipeline written from the vertex shader's output signature (what #1020 does), used for indexed draws too, the count goes from 256 per frame to 0. D3DMetal does run these geometry shaders: a diagnostic that makes the variants write one colour fills whole targets.

3. Scene target next to what is presented, same frame

The scene target itself is dark. Nothing is lost at composite or present, and there's no size mismatch like in #841.

what size, format contents
presented plane (the only one) 3840x2160 R10G10B10A2 values 0 to 7 of 1023 (dither)
upscaled scene 3840x2160 R11G11B10F max 0.0014 (dither)
temporal resolve outputs 2560x1440 R11G11B10F max 0.0005
scene colour (target of the lighting draws) 2560x1440 R16G16B16A16F zero
G-buffer, depth 2560x1440 geometry on 2.4% of the pixels in this frame

A read-back recorded into the title's own list just before a pass shows the scene colour target all zero before the first tiled-lighting draw, all zero after the last one, and holding only the horizon lights (0.9% of the pixels) before the coronas are drawn. So the first dark stage is the tiled deferred lighting.

What I found broken on the way to it:

  • Material masks. CS_GenerateMaterialMasks and CS_MaterialTilesInitial write a material number per pixel into the depth plane (R16 view) and the stencil plane (R8_UINT view) of a 16-bit depth target with stencil, through unordered access views. D3DMetal refuses unordered access to a depth target, so both planes stayed zero. The lighting draws then test depth "equal" against that plane, one draw per material with z = number / 65535. Same refusal for shadowSmartBlit:CS_DepthCopy (5 per frame into 16-bit shadow maps) and for R32_FLOAT views of two 2560x1440 D32S8 targets. #469 (a twin texture) covers the depth-only cases. The targets with stencil need a twin per plane, and "equal" at 16 bits needs a 16-bit host depth, since 24-bit depth with stencil rounds.
  • With those fixed, the lighting draws run and still write nothing, even with a one-colour pixel shader and the depth test off. That's where it stands.
  • The lighting's inputs that are still all zero in the same frame: the shadow masks (CS_GenerateShadowMasks_* run and write zero), the per-tile directional light texture (CS_ShadowRevealTiles, so the directional variant of each material draws no tile, which #1020's author also saw on NVIDIA), and the indirect light (indirect_light_probes:* don't translate).

Only statistics and resource numbers from my own captures here, no game data.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 17:36 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7139443921) Results for the three things asked above. Same host, tree is VIctory-Linux f1e94ce plus the Mac commits, every run is 295 s from boot into the opening of the world. D3DMetal reports `WaveLaneCountMin/Max = 32/32`. ### 1. Wave-64 programs on a 32-lane host (@⁠pickles976) | run | tree | distinct compute pipelines dropped in one world frame | picture | |---|---|---|---| | G01 | no 32-lane translation, wave-64 programs refused at pipeline creation | 149 to 151, 74 of them for the wave size | black, horizon lights only | | G02 | #189 in its Wave32 mode | 155 (it takes 19 of the 74) | unchanged, no hang, no GPU error | | G03 / G04 | #439 (console flow) kept beside the fork's LDS-barrier plan | 80 to 90 (it takes 70 of the 74) | G-buffer fills, presented frame unchanged, no hang, no artifacts | So turning it on does change what the GPU does, but not the presented picture yet. With #439 the culling passes (`CS_Prop_BatchCull`, `CS_Tree_BatchCull`), `depth_pyramid:*`, the tiled lighting setup (`CS_GenerateMaterialMasks`, `CS_MaterialTilesInitial`, `CS_ClusterLightsWorldSpace`) and `shader_binning_utils:*` now execute. Before, about 89% of the mesh indirect draws had zero group counts because their culling pass was one of the refused ones, and depth varied on 1 to 3% of the pixels. After, the G-buffer holds props, a fence, signs and a low-detail character, with depth varying on up to 29% of the pixels in one captured frame. Lighting still doesn't appear, that's a later stage (see 3). Offline over the shader archive with `--host-lanes 32-32`, compute programs usable on a 32-lane host go from 2,180 to 2,434 with #439 (+254, none lost), and all 254 pass Apple's Metal shader converter. The 4 of the 74 that are left are groups of more than 64 threads and whole-wave sections. Dropped dispatches per frame is not a stable number (one untranslated pipeline can be dispatched 30+ times in one frame and not at all in the next), so the table counts distinct pipelines. ### 2. The ~255 "prepare failed" indirect draws (@⁠MichaelSmithAI) They are rectangle lists. My first guess was right, and it's not a kind mismatch or a table that couldn't be bound. The full line: `dropped 256.0/frame without a host pipeline: indirect kind 0: prepare failed (compute false, mesh false)`. Kind 0 is a non-indexed draw and the bound pipeline is a graphics pipeline that is neither compute nor mesh, so the kinds agree. No descriptor allocation or heap message next to them. Per draw in one world frame: 180 are `VS_TiledLighting` + `TL_PS_<material>` (the deferred lighting, one pair per material), 64 are `VS_TiledWeathering`, 12 are `VS_TiledLighting` + `PS_SSSResolve`. All have topology 17, no vertex buffer, records like `[720, 1, 0, 0]` (240 tiles of 3 vertices). The draw path refuses indirect rectangle lists because its rectangle expansion rewrites vertex buffers, and these have none, the corners come from `SV_VertexID`. With a geometry-shader variant of the pipeline written from the vertex shader's output signature (what #1020 does), used for indexed draws too, the count goes from 256 per frame to 0. D3DMetal does run these geometry shaders: a diagnostic that makes the variants write one colour fills whole targets. ### 3. Scene target next to what is presented, same frame The scene target itself is dark. Nothing is lost at composite or present, and there's no size mismatch like in #841. | what | size, format | contents | |---|---|---| | presented plane (the only one) | 3840x2160 R10G10B10A2 | values 0 to 7 of 1023 (dither) | | upscaled scene | 3840x2160 R11G11B10F | max 0.0014 (dither) | | temporal resolve outputs | 2560x1440 R11G11B10F | max 0.0005 | | scene colour (target of the lighting draws) | 2560x1440 R16G16B16A16F | zero | | G-buffer, depth | 2560x1440 | geometry on 2.4% of the pixels in this frame | A read-back recorded into the title's own list just before a pass shows the scene colour target all zero before the first tiled-lighting draw, all zero after the last one, and holding only the horizon lights (0.9% of the pixels) before the coronas are drawn. So the first dark stage is the tiled deferred lighting. What I found broken on the way to it: - **Material masks.** `CS_GenerateMaterialMasks` and `CS_MaterialTilesInitial` write a material number per pixel into the depth plane (R16 view) and the stencil plane (R8_UINT view) of a 16-bit depth target with stencil, through unordered access views. D3DMetal refuses unordered access to a depth target, so both planes stayed zero. The lighting draws then test depth "equal" against that plane, one draw per material with z = number / 65535. Same refusal for `shadowSmartBlit:CS_DepthCopy` (5 per frame into 16-bit shadow maps) and for R32_FLOAT views of two 2560x1440 D32S8 targets. #469 (a twin texture) covers the depth-only cases. The targets with stencil need a twin per plane, and "equal" at 16 bits needs a 16-bit host depth, since 24-bit depth with stencil rounds. - **With those fixed, the lighting draws run and still write nothing**, even with a one-colour pixel shader and the depth test off. That's where it stands. - The lighting's inputs that are still all zero in the same frame: the shadow masks (`CS_GenerateShadowMasks_*` run and write zero), the per-tile directional light texture (`CS_ShadowRevealTiles`, so the directional variant of each material draws no tile, which #1020's author also saw on NVIDIA), and the indirect light (`indirect_light_probes:*` don't translate). Only statistics and resource numbers from my own captures here, no game data.
Author
Owner

@⁠dylanliuh2o on GitHub · 2026-11-24 18:12 UTC · original

Amazing!👍

**@⁠dylanliuh2o** on GitHub · 2026-11-24 18:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7140319839) Amazing!👍
Author
Owner

@⁠pedrofort on GitHub · 2026-11-24 18:25 UTC · original

Hey @⁠Ahmet-Dedeler!

Great progress on Apple Silicon. I've been working on
the same platform using an M5 MacBook Pro with 16 GB RAM.

My experimental unified integration is available in #1007,
now updated to commit 631fff9.

It integrates several complementary areas:

  • Wave64 compute emulation on Wave32 hosts.
  • Constant and dynamic EXEC mask lowering.
  • Texture sampling and gather.
  • Indirect argument clamping and mesh dispatch.
  • Shadow memory pooling.
  • Experimental queue scheduling and fence handling.

Your finding that D3DMetal can accept native Wave64
pipelines without executing them correctly is particularly
interesting, because we independently encountered unexpected
native Wave64 PSO acceptance.

Our earlier graphics candidate recorded 84 verified GPU
executions and 8,064 verified output words using synthetic
fixtures. These are historical component-level results,
not results from the current integrated commit.

The current draft passes 116 native shader tests, and
the updated GPU harness supports numerical readback
validation. Integrated GPU verification remains in progress.

Would you be interested in collaborating?

Your real-title execution results and our synthetic GPU
conformance work could complement each other. Comparing
our implementations against a common upstream revision
might help address Wave64, indirect execution, memory
and synchronization bottlenecks.

I'd be happy to exchange synthetic tests and coordinate
development while preserving all contributors' authorship.

#1007

AI-assisted development with ChatGPT. No commercial game
assets are included in our submitted work.

**@⁠pedrofort** on GitHub · 2026-11-24 18:25 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7140634339) Hey @⁠Ahmet-Dedeler! Great progress on Apple Silicon. I've been working on the same platform using an M5 MacBook Pro with 16 GB RAM. My experimental unified integration is available in #1007, now updated to commit 631fff9. It integrates several complementary areas: - Wave64 compute emulation on Wave32 hosts. - Constant and dynamic EXEC mask lowering. - Texture sampling and gather. - Indirect argument clamping and mesh dispatch. - Shadow memory pooling. - Experimental queue scheduling and fence handling. Your finding that D3DMetal can accept native Wave64 pipelines without executing them correctly is particularly interesting, because we independently encountered unexpected native Wave64 PSO acceptance. Our earlier graphics candidate recorded 84 verified GPU executions and 8,064 verified output words using synthetic fixtures. These are historical component-level results, not results from the current integrated commit. The current draft passes 116 native shader tests, and the updated GPU harness supports numerical readback validation. Integrated GPU verification remains in progress. Would you be interested in collaborating? Your real-title execution results and our synthetic GPU conformance work could complement each other. Comparing our implementations against a common upstream revision might help address Wave64, indirect execution, memory and synchronization bottlenecks. I'd be happy to exchange synthetic tests and coordinate development while preserving all contributors' authorship. https://git.gtahub.st/github/Marvisak--VIctory/pulls/1007 AI-assisted development with ChatGPT. No commercial game assets are included in our submitted work.
Author
Owner

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

@⁠pedrofort hey, yes, happy to compare notes. Nice to see someone else on this host.

I think the two sides fit like this. I have a title running into the world on D3DMetal but almost no synthetic coverage: my 32-lane work was only checked with Apple's IR verifier until today. You have a GPU harness with numerical readback and no title run yet. So the most useful thing you have for me is that readback harness for wave-64 programs on D3DMetal. And what I can give you is which programs the real title needs first, so your suite can go after those instead of guessing. From today's runs that list starts with InstanceCulling:CS_Prop_BatchCull / CS_Tree_BatchCull, depth_pyramid:* and the tiled_lighting:CS_* setup passes. Nothing in the world draws properly until those run.

Two things from my runs that may save you time in #1007:

  • On the same tree, #189 in its Wave32 mode took 19 of the 74 wave-64 pipelines the world frame needs and #439 took 70. Your snapshot carries #189, so it's worth trying #439's console flow.
  • The native Wave64 PSO acceptance you saw is what I meant: D3DMetal creates the pipeline, reports success and then the dispatch does nothing. A submission that uses a pipeline Metal refused may also never signal its fence. So I refuse those at creation on the runtime's side now.

I'll read #1007 properly. A common upstream revision to compare on makes sense. My tree is on VIctory-Linux f1e94ce right now because plain main hangs the Apple GPU about 40 s into the world for me (blocker 5 above), so that's the first thing I'd want to know about yours: does it get into the world, and on which base?

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 18:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7140675223) @⁠pedrofort hey, yes, happy to compare notes. Nice to see someone else on this host. I think the two sides fit like this. I have a title running into the world on D3DMetal but almost no synthetic coverage: my 32-lane work was only checked with Apple's IR verifier until today. You have a GPU harness with numerical readback and no title run yet. So the most useful thing you have for me is that readback harness for wave-64 programs on D3DMetal. And what I can give you is which programs the real title needs first, so your suite can go after those instead of guessing. From today's runs that list starts with `InstanceCulling:CS_Prop_BatchCull` / `CS_Tree_BatchCull`, `depth_pyramid:*` and the `tiled_lighting:CS_*` setup passes. Nothing in the world draws properly until those run. Two things from my runs that may save you time in #1007: - On the same tree, #189 in its Wave32 mode took 19 of the 74 wave-64 pipelines the world frame needs and #439 took 70. Your snapshot carries #189, so it's worth trying #439's console flow. - The native Wave64 PSO acceptance you saw is what I meant: D3DMetal creates the pipeline, reports success and then the dispatch does nothing. A submission that uses a pipeline Metal refused may also never signal its fence. So I refuse those at creation on the runtime's side now. I'll read #1007 properly. A common upstream revision to compare on makes sense. My tree is on `VIctory-Linux` f1e94ce right now because plain `main` hangs the Apple GPU about 40 s into the world for me (blocker 5 above), so that's the first thing I'd want to know about yours: does it get into the world, and on which base?
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-24 18:40 UTC · original · edited 2026-11-24 19:14 UTC

Follow-up on "the lighting draws run and still write nothing" from my results above. It's narrowed down to the indirect path, but not yet to whose fault it is.

The tiled lighting draws are non-indexed ExecuteIndirect calls on a pipeline that has a geometry shader (the rectangle variant). Nothing is drawn for that combination here. Measured with three diagnostic switches on the rectangle variants (one colour instead of the pixel shader, depth test off, the first rectangle of a draw covering the whole target):

  • as they are, the scene target is all zero after the lighting draws
  • the same pipelines and the same records run as direct draws: the whole target has the colour
  • the frame's indexed indirect rectangle draw (PS_CompositeIndirectDrawBlend, 14,580 instances) also fills the target

Viewport and scissor are the full 2560x1440, the list's indirect budget isn't spent, and no two of the 340 textures the frame's draws name share title memory at one address, so same-address aliasing isn't behind this stage here.

Edit: I first wrote that this is D3DMetal's. That was too strong. What isn't separated yet is whether D3DMetal drops a non-indexed indirect draw with a geometry stage, or the runtime's copy of the indirect record is wrong for this case. Both fit the three measurements above. I'll post which one it is.

Separately, the lighting vertex shader places no tile even as a direct draw, and the lighting's other inputs are still all zero in the same frame (shadow masks, the per-tile directional light texture, indirect light probes). So fixing the indirect path alone won't light the scene.

For the record, the PR heads my runs above were built from: #189 at b472733, #439 at c153b21. Both have newer pushes since.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 18:40 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7140970869) · edited 2026-11-24 19:14 UTC Follow-up on "the lighting draws run and still write nothing" from my results above. It's narrowed down to the indirect path, but not yet to whose fault it is. The tiled lighting draws are non-indexed `ExecuteIndirect` calls on a pipeline that has a geometry shader (the rectangle variant). Nothing is drawn for that combination here. Measured with three diagnostic switches on the rectangle variants (one colour instead of the pixel shader, depth test off, the first rectangle of a draw covering the whole target): - as they are, the scene target is all zero after the lighting draws - the same pipelines and the same records run as direct draws: the whole target has the colour - the frame's indexed indirect rectangle draw (`PS_CompositeIndirectDrawBlend`, 14,580 instances) also fills the target Viewport and scissor are the full 2560x1440, the list's indirect budget isn't spent, and no two of the 340 textures the frame's draws name share title memory at one address, so same-address aliasing isn't behind this stage here. **Edit:** I first wrote that this is D3DMetal's. That was too strong. What isn't separated yet is whether D3DMetal drops a non-indexed indirect draw with a geometry stage, or the runtime's copy of the indirect record is wrong for this case. Both fit the three measurements above. I'll post which one it is. Separately, the lighting vertex shader places no tile even as a direct draw, and the lighting's other inputs are still all zero in the same frame (shadow masks, the per-tile directional light texture, indirect light probes). So fixing the indirect path alone won't light the scene. For the record, the PR heads my runs above were built from: #189 at b472733, #439 at c153b21. Both have newer pushes since.
Author
Owner

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

End of day update. The code is public now, and I'm taking back one more thing I said about the lighting.

Branches on Ahmet-Dedeler/VIctory:

  • mac-on-latest: the Mac host commits on main ffe310e (9 commits). The one to read if you want to know what a Mac host needs.
  • mac-on-linux-fork: the same on BeachesOfViceCity/VIctory-Linux f1e94ce (17 commits).
  • mac-perf: plus the frame-time work (41 commits in all). This is what I play. World is 0.7 to 0.8 s per frame median on this Mac.
  • mac-lit: mac-perf plus 21 commits of the dark-scene work: trial applications of #439, #469, #1020 and some shader PRs, the per-plane depth twin, the rectangle variants, diagnostics. Its picture is black. It's there as evidence for what I wrote above, not as a build to run.
  • mac-crossover is the old one from last night.

Lighting, corrected again. A probe outside the title, same process and bottle: one triangle over an 8x8 target, through a pipeline without and with a geometry shader, drawn directly, by non-indexed ExecuteIndirect from a CPU-mapped buffer, the same after the argument clamp ran over the record, from a plain GPU buffer, and indexed. All ten cases cover 64 of 64 pixels. So D3DMetal does run a non-indexed indirect draw through a geometry-shader pipeline, and the suspicion I posted earlier is withdrawn. The earlier run that seemed to blame the indirect path used SV_PrimitiveID in the diagnostic geometry shader and couldn't separate that from the vertex shader placing nothing.

What fails for the lighting draws is something in the runtime's own path for them, or in the shader. Not separated yet.

The current candidate, found offline and not yet run in the world: the translated VS_TiledLighting holds WaveReadLaneFirst (the console's v_readfirstlane_b32 of a reciprocal it divides the vertex number by), and Apple's Metal shader converter turns that into simd_broadcast_first inside a vertex function. 493 of the 2,165 translated vertex programs in the shader archive hold it. A change that lowers it to the vertex's own value in vertex programs is on mac-lit. Untested on the picture.

The crash after about 15 minutes (+0x63966f): it's a fixed pool of 25,000 placement elements running out. They're returned when a map section unloads. It also happens at 5 times the frame rate, so slow frames aren't the cause. The actual cause isn't proven yet.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-24 19:42 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7142471166) End of day update. The code is public now, and I'm taking back one more thing I said about the lighting. **Branches** on [Ahmet-Dedeler/VIctory](https://github.com/Ahmet-Dedeler/VIctory/branches): - `mac-on-latest`: the Mac host commits on `main` ffe310e (9 commits). The one to read if you want to know what a Mac host needs. - `mac-on-linux-fork`: the same on `BeachesOfViceCity/VIctory-Linux` f1e94ce (17 commits). - `mac-perf`: plus the frame-time work (41 commits in all). This is what I play. World is 0.7 to 0.8 s per frame median on this Mac. - `mac-lit`: `mac-perf` plus 21 commits of the dark-scene work: trial applications of #439, #469, #1020 and some shader PRs, the per-plane depth twin, the rectangle variants, diagnostics. Its picture is black. It's there as evidence for what I wrote above, not as a build to run. - `mac-crossover` is the old one from last night. **Lighting, corrected again.** A probe outside the title, same process and bottle: one triangle over an 8x8 target, through a pipeline without and with a geometry shader, drawn directly, by non-indexed `ExecuteIndirect` from a CPU-mapped buffer, the same after the argument clamp ran over the record, from a plain GPU buffer, and indexed. All ten cases cover 64 of 64 pixels. So D3DMetal does run a non-indexed indirect draw through a geometry-shader pipeline, and the suspicion I posted earlier is withdrawn. The earlier run that seemed to blame the indirect path used `SV_PrimitiveID` in the diagnostic geometry shader and couldn't separate that from the vertex shader placing nothing. What fails for the lighting draws is something in the runtime's own path for them, or in the shader. Not separated yet. The current candidate, found offline and not yet run in the world: the translated `VS_TiledLighting` holds `WaveReadLaneFirst` (the console's `v_readfirstlane_b32` of a reciprocal it divides the vertex number by), and Apple's Metal shader converter turns that into `simd_broadcast_first` inside a vertex function. 493 of the 2,165 translated vertex programs in the shader archive hold it. A change that lowers it to the vertex's own value in vertex programs is on `mac-lit`. Untested on the picture. **The crash after about 15 minutes** (`+0x63966f`): it's a fixed pool of 25,000 placement elements running out. They're returned when a map section unloads. It also happens at 5 times the frame rate, so slow frames aren't the cause. The actual cause isn't proven yet.
Author
Owner

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

Thanks @⁠Ahmet-Dedeler! Your new branches and measurements
are extremely helpful.

Our latest #1007 commit is 9f2177c, based on upstream
ffe310eb20.

We have not yet established a successful real-title world
run on this integration.

The latest synthetic validation on Apple M5, 16 GB RAM:

  • 116 native shader tests passed.
  • 23 Wave64 GPU tests passed.
  • 44 hardware dispatch readbacks verified.
  • 5,504 output words matched expected results.
  • 44 DXIL validations passed.
  • Wave32 and Emulate modes covered.

One important caveat: MoltenVK appears in the startup logs,
so we are investigating the actual D3D12 backend before
attributing those results specifically to D3DMetal.

Your #439 versus #189 comparison is particularly useful.
We are examining the console-flow implementation alongside
our existing coverage, including dynamic EXEC masks and
64/128/256-thread synthetic cases.

The culling, depth-pyramid and tiled-lighting workloads
you identified give us concrete priorities for new
synthetic regression tests.

We'll compare mac-perf and mac-lit against our integration
without blindly merging incompatible translator changes.

Thanks for publishing your work. We'll preserve attribution
and share reproducible results as we obtain them.

AI-assisted development and analysis with ChatGPT.

**@⁠pedrofort** on GitHub · 2026-11-24 20:09 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7143131675) Thanks @⁠Ahmet-Dedeler! Your new branches and measurements are extremely helpful. Our latest #1007 commit is 9f2177c, based on upstream ffe310eb2098e52169f4c44db5ffdabf43a72622. We have not yet established a successful real-title world run on this integration. The latest synthetic validation on Apple M5, 16 GB RAM: - 116 native shader tests passed. - 23 Wave64 GPU tests passed. - 44 hardware dispatch readbacks verified. - 5,504 output words matched expected results. - 44 DXIL validations passed. - Wave32 and Emulate modes covered. One important caveat: MoltenVK appears in the startup logs, so we are investigating the actual D3D12 backend before attributing those results specifically to D3DMetal. Your #439 versus #189 comparison is particularly useful. We are examining the console-flow implementation alongside our existing coverage, including dynamic EXEC masks and 64/128/256-thread synthetic cases. The culling, depth-pyramid and tiled-lighting workloads you identified give us concrete priorities for new synthetic regression tests. We'll compare mac-perf and mac-lit against our integration without blindly merging incompatible translator changes. Thanks for publishing your work. We'll preserve attribution and share reproducible results as we obtain them. AI-assisted development and analysis with ChatGPT.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:05 UTC · original

Automated triage for the maintainers.

Thanks for the detailed write-up. VIctory targets Windows hosts. A macOS host (CrossOver, D3DMetal, Rosetta 2) needs its own patch set, and most of the blockers here are specific to Apple's stack: the mesh output limit, wave64 pipelines that silently do nothing, store merging in Metal's DXIL converter, no unordered access to depth targets, and fences that signal early. A port to another platform is out of scope for this tracker.

Some findings also apply on Windows, and where they still matter on current main they belong in Windows reports or pull requests (open to everyone now):

  • Indirect rectangle-list draws ("prepare failed", topology 17) are fixed in main by 683ad7a, which landed after ffe310e. execute_indirect in crates/victory-gpu/src/draw.rs runs them when the pipeline has the generated geometry shader (see #255).
  • The NVIDIA black world is discussed in #1317 and #71. Wave64 compute on 32-lane hosts is handled in #189, #439 and #1929.

Proposed close: out of scope (macOS port). This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:05 UTC · [original](https://github.com/Marvisak/VIctory/issues/1128#issuecomment-7159217984) <!-- victory-issue-triage v1 verdict=proposed-close seen=2026-11-24T20:09:55Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. Thanks for the detailed write-up. VIctory targets Windows hosts. A macOS host (CrossOver, D3DMetal, Rosetta 2) needs its own patch set, and most of the blockers here are specific to Apple's stack: the mesh output limit, wave64 pipelines that silently do nothing, store merging in Metal's DXIL converter, no unordered access to depth targets, and fences that signal early. A port to another platform is out of scope for this tracker. Some findings also apply on Windows, and where they still matter on current `main` they belong in Windows reports or pull requests (open to everyone now): - Indirect rectangle-list draws ("prepare failed", topology 17) are fixed in `main` by `683ad7a`, which landed after `ffe310e`. `execute_indirect` in `crates/victory-gpu/src/draw.rs` runs them when the pipeline has the generated geometry shader (see #255). - The NVIDIA black world is discussed in #1317 and #71. Wave64 compute on 32-lane hosts is handled in #189, #439 and #1929. Proposed close: out of scope (macOS port). This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#1128
No description provided.