[bug] Metal residency sets keep all of title memory + host textures resident, then command buffers time out after the world load #79

Open
opened 2026-11-26 13:43:58 +00:00 by AeroUp · 18 comments
AeroUp commented 2026-11-26 13:43:58 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AeroUp on 2026-11-26T13:43:58Z.


Labels: bug, urgent — written here because this account has no label permission on the repository.

Summary

On the native macOS host, heap residency goes through one MTLResidencySet per heap. A set never forgets an allocation, so after the world load the set holds all of title memory (about 6.7 GB on a Series S profile) plus every texture copy the host made, resident for the whole process. On this Mac that ends in kIOGPUCommandBufferCallbackErrorTimeout (and, with ~5 GB of host texture copies, kIOGPUCommandBufferCallbackErrorOutOfMemory), then the known 0xc0000005 at image+0x55e56f8.

Switching the default to per-encoder useResource (the existing fallback) fixed it here: frames pass 4200 where they used to stop at ~1950, and the boot logo and story loading art render correctly.

Evidence (M3 Pro, 18 GB, macOS 27.2.1, Series S profile, 1920x1080 layer)

The process is x86_64 because it executes the game's x86_64 code in-process; Rosetta translates the CPU side only, and the Metal backend is native (no D3D12 or Wine translation of API calls). The DXIL converter is D3DMetal's libmetalirconverter because Apple's Metal Shader Converter is not installed on this machine.

With sets (before):

metal: command buffer failed: … kIOGPUCommandBufferCallbackErrorTimeout
work held for a wait that does not hold: ["fence …: signal of 3366 queued 20.7s ago, GPU at 3364"]
VIctory: unhandled exception 0xc0000005 at image+0x55e56f8

With sets off:

  • menus 30.00 fps (the title's own cap), GPU 2.5 ms
  • story loading art 8–17 fps, GPU 37–55 ms at 4K
  • Metal memory ~9.4 GB instead of 12+ GB, no OOM
  • boot logo, Jason/Lucia loading art all correct at 1920x1080

Proposal

PR #76 flips the default to per-encoder useResource and keeps the set path behind VICTORY_METAL_RESIDENCY_SETS=1. The better long-term fix is to prune the set (remove a replaced entry's old allocation, remove targets), which docs/metal-backend.md lists as not done.

Not claimed

The 4K world's first frames still stall about 20 s and the title's own watchdog then takes the process down (the crash log says Unsignaled CrossQueueBarrier in some runs and nothing in others). This issue is only the residency/OOM/timeout chain.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6627966073 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79). Originally posted by [AeroUp](https://github.com/AeroUp) on 2026-11-26T13:43:58Z. --- Labels: `bug`, `urgent` — written here because this account has no label permission on the repository. ## Summary On the native macOS host, heap residency goes through one `MTLResidencySet` per heap. A set never forgets an allocation, so after the world load the set holds **all of title memory (about 6.7 GB on a Series S profile) plus every texture copy the host made, resident for the whole process**. On this Mac that ends in `kIOGPUCommandBufferCallbackErrorTimeout` (and, with ~5 GB of host texture copies, `kIOGPUCommandBufferCallbackErrorOutOfMemory`), then the known `0xc0000005 at image+0x55e56f8`. Switching the default to per-encoder `useResource` (the existing fallback) fixed it here: frames pass 4200 where they used to stop at ~1950, and the boot logo and story loading art render correctly. ## Evidence (M3 Pro, 18 GB, macOS 27.2.1, Series S profile, 1920x1080 layer) The process is x86_64 because it executes the game's x86_64 code in-process; Rosetta translates the CPU side only, and the Metal backend is native (no D3D12 or Wine translation of API calls). The DXIL converter is D3DMetal's `libmetalirconverter` because Apple's Metal Shader Converter is not installed on this machine. With sets (before): ``` metal: command buffer failed: … kIOGPUCommandBufferCallbackErrorTimeout work held for a wait that does not hold: ["fence …: signal of 3366 queued 20.7s ago, GPU at 3364"] VIctory: unhandled exception 0xc0000005 at image+0x55e56f8 ``` With sets off: - menus 30.00 fps (the title's own cap), GPU 2.5 ms - story loading art 8–17 fps, GPU 37–55 ms at 4K - Metal memory ~9.4 GB instead of 12+ GB, no OOM - boot logo, Jason/Lucia loading art all correct at 1920x1080 ## Proposal PR #76 flips the default to per-encoder `useResource` and keeps the set path behind `VICTORY_METAL_RESIDENCY_SETS=1`. The better long-term fix is to prune the set (remove a replaced entry's old allocation, remove targets), which `docs/metal-backend.md` lists as not done. ## Not claimed The 4K world's first frames still stall about 20 s and the title's own watchdog then takes the process down (the crash log says `Unsignaled CrossQueueBarrier` in some runs and nothing in others). This issue is only the residency/OOM/timeout chain.
LakshanSivakumar commented 2026-11-26 15:56:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T15:56:44Z.


Status: PR #76 (per-encoder residency by default) is open with changes requested, not merged. Needed: updated #76, then a run on a 16 GB Mac (see #8) to confirm the command-buffer timeouts go away.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7196964775 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7196964775). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T15:56:44Z. --- Status: PR #76 (per-encoder residency by default) is open with changes requested, not merged. Needed: updated #76, then a run on a 16 GB Mac (see #8) to confirm the command-buffer timeouts go away.
LakshanSivakumar commented 2026-11-26 22:52:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T22:52:57Z.


Update: the heap residency set is on main (3009640b), and since 0133b82e released textures leave it. It's on by default on 32 GB and up. 16–24 GB testers: please try VICTORY_METAL_RESIDENCY_SETS=heap on current main and report the heap_set_mb lines and any command-buffer errors.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7205065643 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7205065643). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T22:52:57Z. --- Update: the heap residency set is on main (3009640b), and since 0133b82e released textures leave it. It's on by default on 32 GB and up. 16–24 GB testers: please try `VICTORY_METAL_RESIDENCY_SETS=heap` on current main and report the `heap_set_mb` lines and any command-buffer errors.
Sandile-0511 commented 2026-11-27 05:40:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sandile-0511 on 2026-11-27T05:40:13Z.


A data point from a 24 GB Mac, since the README asks for one: VICTORY_METAL_RESIDENCY_SETS=heap gets this machine past the title's 30 s watchdog at the first world frame, which the default (per-encoder useResource) does not. It is not clean: one of three runs had four out-of-memory command buffers.

Machine: MacBook Pro, Apple M5 (base), 24 GB, macOS 26.5.1, Series S profile (title_memory_mib=7776, recommended_working_set_mib=18186). Commit 76c001a unless noted. Warm shader cache in every run below.

Default: per-encoder useResource

  • Without VICTORY_HOLD_BYTE: the watchdog fault (image+0x23cf683, then image+0x55e56f8) 31 s after the first world frame.
  • With VICTORY_HOLD_BYTE=1471b6330:1: 9 frames in the 123 s after the world frame. With VICTORY_TRACE_GPU_FAILS=1, 93 slow command buffer lines after the world frame (the 100-line cap nearly reached), the longest with 5.1 s between GPU start and end.
  • That time is not shader execution. With a local diagnostic that commits each pass in a command buffer of its own, the GPU time of all passes after the world frame came to 1.6 s over 123 s of wall time. A lower VICTORY_SHADER_LOOP_LIMIT (64, diagnostics build) changed nothing either. This matches the note in docs/native-host.md about the kernel's time per pass for the useResource list.

VICTORY_METAL_RESIDENCY_SETS=heap

Run Watchdog held After the world frame Command buffers failed
1 yes 70 frames in 140 s; 2 slow command buffer lines 0
2 no no watchdog fault; 28 frames in 152 s, until my timer ended the run 4, all kIOGPUCommandBufferCallbackErrorOutOfMemory
3 (2a3b03d + #260) no no watchdog fault; closed by hand 88 s after the world frame 0
  • Run 1's last counter line: heap_set_mb=17862 heap_allocations=68040.
  • Run 2's failures: the first 100 s after the world frame, three more 147 to 150 s after it. Each was followed by a command buffer failed; paid 0 fence signals and N value writes on the CPU (N = 4, 8, 20, 8), and the title went on. No timeout errors.
  • The world is still black in all of them (#182), so I can only speak for frames advancing and the log, not for what is drawn.

Memory

Sampled once during a default run and once during run 1: about 21.7 GB wired in both, 5% free, swap 7.0 to 7.4 GB of 8.2 GB in use, with the kernel compressing and decompressing about 3 GB a second in the default run. So this Mac is at its limit in either mode; the sets remove the per-pass cost but not the pressure.

What I did not check

  • One run per row; frame counts between runs differ for other reasons too (the world frame came at 82 to 102 s).
  • Whether the out-of-memory failures in run 2 cost anything visible, since nothing is visible yet.
  • A 16 or 18 GB Mac, where the report above has it ending in timeouts.

I can attach logs from any of these runs, or rerun with other switches, if that helps.

AI-assisted: runs and log summary done with Claude Code on my own machine; I reviewed the text.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7210835114 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7210835114). Originally posted by [Sandile-0511](https://github.com/Sandile-0511) on 2026-11-27T05:40:13Z. --- A data point from a 24 GB Mac, since the README asks for one: `VICTORY_METAL_RESIDENCY_SETS=heap` gets this machine past the title's 30 s watchdog at the first world frame, which the default (per-encoder `useResource`) does not. It is not clean: one of three runs had four out-of-memory command buffers. **Machine:** MacBook Pro, Apple M5 (base), 24 GB, macOS 26.5.1, Series S profile (`title_memory_mib=7776`, `recommended_working_set_mib=18186`). Commit `76c001a` unless noted. Warm shader cache in every run below. ### Default: per-encoder `useResource` - Without `VICTORY_HOLD_BYTE`: the watchdog fault (`image+0x23cf683`, then `image+0x55e56f8`) 31 s after the first world frame. - With `VICTORY_HOLD_BYTE=1471b6330:1`: 9 frames in the 123 s after the world frame. With `VICTORY_TRACE_GPU_FAILS=1`, 93 `slow command buffer` lines after the world frame (the 100-line cap nearly reached), the longest with 5.1 s between GPU start and end. - That time is not shader execution. With a local diagnostic that commits each pass in a command buffer of its own, the GPU time of all passes after the world frame came to 1.6 s over 123 s of wall time. A lower `VICTORY_SHADER_LOOP_LIMIT` (64, diagnostics build) changed nothing either. This matches the note in `docs/native-host.md` about the kernel's time per pass for the `useResource` list. ### `VICTORY_METAL_RESIDENCY_SETS=heap` | Run | Watchdog held | After the world frame | Command buffers failed | |---|---|---|---| | 1 | yes | 70 frames in 140 s; 2 `slow command buffer` lines | 0 | | 2 | no | no watchdog fault; 28 frames in 152 s, until my timer ended the run | 4, all `kIOGPUCommandBufferCallbackErrorOutOfMemory` | | 3 (`2a3b03d` + #260) | no | no watchdog fault; closed by hand 88 s after the world frame | 0 | - Run 1's last counter line: `heap_set_mb=17862 heap_allocations=68040`. - Run 2's failures: the first 100 s after the world frame, three more 147 to 150 s after it. Each was followed by `a command buffer failed; paid 0 fence signals and N value writes on the CPU` (N = 4, 8, 20, 8), and the title went on. No timeout errors. - The world is still black in all of them (#182), so I can only speak for frames advancing and the log, not for what is drawn. ### Memory Sampled once during a default run and once during run 1: about 21.7 GB wired in both, 5% free, swap 7.0 to 7.4 GB of 8.2 GB in use, with the kernel compressing and decompressing about 3 GB a second in the default run. So this Mac is at its limit in either mode; the sets remove the per-pass cost but not the pressure. ### What I did not check - One run per row; frame counts between runs differ for other reasons too (the world frame came at 82 to 102 s). - Whether the out-of-memory failures in run 2 cost anything visible, since nothing is visible yet. - A 16 or 18 GB Mac, where the report above has it ending in timeouts. I can attach logs from any of these runs, or rerun with other switches, if that helps. *AI-assisted: runs and log summary done with Claude Code on my own machine; I reviewed the text.*
Olima34 commented 2026-11-27 06:46:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T06:46:15Z.


Some data for this issue, from an Apple M5 Pro with 48 GB, Series S, windowed, on main 2a3b03d1.

48 GB isn't spared. In every world run the Mac reaches its memory limit:

  • ~38–40 GB wired out of 48;
  • kern.memorystatus_level down to 6–8%;
  • 2.6–4.5 GB of swap;
  • game RSS 15–17 GB, and heap_set_mb 17.3–18.7 GB.

Under extra load (target tracing), 2 of 3 runs hit a command buffer that never completes, with the "this is what running out of memory looks like" message. The stuck buffers of the two traced hangs share no shader. Kernel time is far above GPU time in the slow buffers just before (e.g. 1.37 s total, 0.013 s GPU, 0.475 s kernel), which is the same pattern as the 24 GB measurements above. The latest 5 untraced runs all lived to 300 s.

VICTORY_METAL_RESIDENCY_SETS=1 survived 3 of 3 runs. But the frame rate after the world was 5x lower (~0.3 fps vs ~1.6) and the memory pressure was unchanged, so it isn't a fix.

Is evicting idle heap-set allocations a lever? No. A local diagnostic counted each underlying allocation in the heap sets once, with the last time a bound table named it, over a warm 300 s run (world frames 2176–2496):

In the set Size
Textures ~30,300 allocations, 9.2 GB
Buffers 13 (the title's pools), 7.6 GB
Named by a table, then idle for 300 frames 0 MB
Never named by any bound table ~29,600 textures, 8.3 GB (90% of texture bytes), plus 7 buffers, 0.7 GB

So time-based eviction would save nothing in the world. The never-named textures are most likely the materials shaders reach by indexing the heap themselves, which the host doesn't see, so evicting them would break bindless reads. The remaining levers look like:

  • not keeping each sampled texture twice (the title's tiled copy plus the host's detiled one), which is a large change;
  • a fidelity switch that drops the top mips, as in the #15 experiment.
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7211830106 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7211830106). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T06:46:15Z. --- Some data for this issue, from an Apple M5 Pro with 48 GB, Series S, windowed, on main 2a3b03d1. **48 GB isn't spared.** In every world run the Mac reaches its memory limit: - ~38–40 GB wired out of 48; - `kern.memorystatus_level` down to 6–8%; - 2.6–4.5 GB of swap; - game RSS 15–17 GB, and `heap_set_mb` 17.3–18.7 GB. Under extra load (target tracing), 2 of 3 runs hit a command buffer that never completes, with the "this is what running out of memory looks like" message. The stuck buffers of the two traced hangs share no shader. Kernel time is far above GPU time in the slow buffers just before (e.g. 1.37 s total, 0.013 s GPU, 0.475 s kernel), which is the same pattern as the 24 GB measurements above. The latest 5 untraced runs all lived to 300 s. `VICTORY_METAL_RESIDENCY_SETS=1` survived 3 of 3 runs. But the frame rate after the world was 5x lower (~0.3 fps vs ~1.6) and the memory pressure was unchanged, so it isn't a fix. **Is evicting idle heap-set allocations a lever? No.** A local diagnostic counted each underlying allocation in the heap sets once, with the last time a bound table named it, over a warm 300 s run (world frames 2176–2496): | In the set | Size | |---|---| | Textures | ~30,300 allocations, 9.2 GB | | Buffers | 13 (the title's pools), 7.6 GB | | Named by a table, then idle for 300 frames | **0 MB** | | Never named by any bound table | ~29,600 textures, **8.3 GB** (90% of texture bytes), plus 7 buffers, 0.7 GB | So time-based eviction would save nothing in the world. The never-named textures are most likely the materials shaders reach by indexing the heap themselves, which the host doesn't see, so evicting them would break bindless reads. The remaining levers look like: - not keeping each sampled texture twice (the title's tiled copy plus the host's detiled one), which is a large change; - a fidelity switch that drops the top mips, as in the #15 experiment.
LakshanSivakumar commented 2026-11-27 06:48:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T06:48:19Z.


Thank you for the careful runs. This is the first data point I have for a 24 GB Mac with the heap residency set, and the table is clear about what each run did and did not show.

Yes please, attach the log of run 2. I would like to see the lines before the first failed command buffer and the counter lines around it. I have not checked whether those failures are tied to the world load or only to later frames.

I have also not checked a 16 or 18 GB Mac. If someone has one, a run with VICTORY_METAL_RESIDENCY_SETS=heap and the same counters would help.

Your pull request #260 gets its own review.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7211862592 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7211862592). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T06:48:19Z. --- Thank you for the careful runs. This is the first data point I have for a 24 GB Mac with the heap residency set, and the table is clear about what each run did and did not show. Yes please, attach the log of run 2. I would like to see the lines before the first failed command buffer and the counter lines around it. I have not checked whether those failures are tied to the world load or only to later frames. I have also not checked a 16 or 18 GB Mac. If someone has one, a run with `VICTORY_METAL_RESIDENCY_SETS=heap` and the same counters would help. Your pull request #260 gets its own review.
Sandile-0511 commented 2026-11-27 07:46:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Sandile-0511 on 2026-11-27T07:46:54Z.


The log of run 2 is here: https://gist.github.com/Sandile-0511/fca19a0bc62954beec486f1e3dcb380f. Colour codes are removed, and my home path and the Mac's network name are replaced (~, REDACTED-HOST); nothing else is changed. It is 76c001a, VICTORY_METAL_RESIDENCY_SETS=heap, no other switch.

Where to look:

  • The world frame's first binds are at 05:05:12 to 05:05:26 (1,746 of them at frame 2,307).
  • The first failed command buffer is at line 7,526, 05:06:52, about 100 s after the first of them; the other three are at lines 7,718 to 7,724 (05:07:39 to 05:07:42). Each is followed by a command buffer failed; paid 0 fence signals and N value writes on the CPU.
  • There is no native draws so far counter line between the world frame and the failures: the world advanced 28 frames in those 152 s, fewer than the 64 a counter line takes.
  • The six lines before the first failure are a descriptor was not mirrored ... is not in a mapped pool, among them 0x247e0000+0xae00000 and 0xd08d40000+0x3200000: the two sizes #258 is about.

So in this run the failures come well after the world load, not at it. I have not looked at what the failing buffers held; the run had no VICTORY_TRACE_GPU_FAILS.

AI-assisted: log summary done with Claude Code on my own machine; I reviewed the text.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7212811951 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7212811951). Originally posted by [Sandile-0511](https://github.com/Sandile-0511) on 2026-11-27T07:46:54Z. --- The log of run 2 is here: https://gist.github.com/Sandile-0511/fca19a0bc62954beec486f1e3dcb380f. Colour codes are removed, and my home path and the Mac's network name are replaced (`~`, `REDACTED-HOST`); nothing else is changed. It is `76c001a`, `VICTORY_METAL_RESIDENCY_SETS=heap`, no other switch. Where to look: - The world frame's first binds are at 05:05:12 to 05:05:26 (1,746 of them at frame 2,307). - The first failed command buffer is at line 7,526, 05:06:52, about 100 s after the first of them; the other three are at lines 7,718 to 7,724 (05:07:39 to 05:07:42). Each is followed by `a command buffer failed; paid 0 fence signals and N value writes on the CPU`. - There is no `native draws so far` counter line between the world frame and the failures: the world advanced 28 frames in those 152 s, fewer than the 64 a counter line takes. - The six lines before the first failure are `a descriptor was not mirrored ... is not in a mapped pool`, among them `0x247e0000+0xae00000` and `0xd08d40000+0x3200000`: the two sizes #258 is about. So in this run the failures come well after the world load, not at it. I have not looked at what the failing buffers held; the run had no `VICTORY_TRACE_GPU_FAILS`. *AI-assisted: log summary done with Claude Code on my own machine; I reviewed the text.*
LakshanSivakumar commented 2026-11-27 08:08:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T08:08:01Z.


Thank you. This is the most useful memory data I have: a 48 GB Mac is not spared, and the table shows why time-based eviction would save nothing, because the 8.3 GB the world never names through a bound table is most likely what the shaders reach by indexing the heap themselves.

So the two levers you name are the ones left: not keeping each sampled texture twice, and a switch that drops the top mips. I agree the first is a large change, and I will not start it without a measurement of how much of the 9.2 GB is the second copy.

One request. Could the diagnostic that counts each allocation once, with the last time a bound table named it, go in as a pull request behind a switch, off by default? Then others can send the same table from 16 and 24 GB Macs, which is what we lack.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213186364 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7213186364). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T08:08:01Z. --- Thank you. This is the most useful memory data I have: a 48 GB Mac is not spared, and the table shows why time-based eviction would save nothing, because the 8.3 GB the world never names through a bound table is most likely what the shaders reach by indexing the heap themselves. So the two levers you name are the ones left: not keeping each sampled texture twice, and a switch that drops the top mips. I agree the first is a large change, and I will not start it without a measurement of how much of the 9.2 GB is the second copy. One request. Could the diagnostic that counts each allocation once, with the last time a bound table named it, go in as a pull request behind a switch, off by default? Then others can send the same table from 16 and 24 GB Macs, which is what we lack.
LakshanSivakumar commented 2026-11-27 08:08:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T08:08:03Z.


Thank you for the log, for removing the colour codes and the host name, and for the line numbers.

What I take from your reading: the failures come about 100 seconds after the world load, not at it, and the world moved only 28 frames in 152 seconds, so the Mac was already starved before the first failed command buffer. I have not read the log myself yet; I am relying on your reading.

The two sizes before the first failure are the two in #258: 0xae00000 is the 174 MiB view and 0x3200000 is 50 MiB, which matches entry 9936. If #267 and #264 land, those lines may change; I have not checked.

If you run it once more, please add VICTORY_TRACE_GPU_FAILS=1 so we see what the failing buffers held. The 16 and 18 GB Macs are still missing.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7213186938 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7213186938). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T08:08:03Z. --- Thank you for the log, for removing the colour codes and the host name, and for the line numbers. What I take from your reading: the failures come about 100 seconds after the world load, not at it, and the world moved only 28 frames in 152 seconds, so the Mac was already starved before the first failed command buffer. I have not read the log myself yet; I am relying on your reading. The two sizes before the first failure are the two in #258: `0xae00000` is the 174 MiB view and `0x3200000` is 50 MiB, which matches entry 9936. If #267 and #264 land, those lines may change; I have not checked. If you run it once more, please add `VICTORY_TRACE_GPU_FAILS=1` so we see what the failing buffers held. The 16 and 18 GB Macs are still missing.
Olima34 commented 2026-11-27 09:04:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T09:04:35Z.


Yes. The diagnostic will come as a pull request behind a switch (VICTORY_TRACE_HEAP_SET=<frames>, off by default, documented, with its Metal test), so 16 and 24 GB Macs can send the same table. For each heap set, it counts every underlying allocation once and splits textures from buffers, with the last time a bound table named each one.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7214251016 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7214251016). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T09:04:35Z. --- Yes. The diagnostic will come as a pull request behind a switch (`VICTORY_TRACE_HEAP_SET=<frames>`, off by default, documented, with its Metal test), so 16 and 24 GB Macs can send the same table. For each heap set, it counts every underlying allocation once and splits textures from buffers, with the last time a bound table named each one.
Tarraga commented 2026-11-27 09:16:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Tarraga on 2026-11-27T09:16:08Z.


/claim the command-buffer time-out piece only: a submission's passes go in command buffers of at most N passes (VICTORY_PASSES_PER_BUFFER), each piece with the heaps' residency sets attached again. Not the residency pruning or the memory side.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7214479038 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7214479038). Originally posted by [Tarraga](https://github.com/Tarraga) on 2026-11-27T09:16:08Z. --- /claim the command-buffer time-out piece only: a submission's passes go in command buffers of at most N passes (`VICTORY_PASSES_PER_BUFFER`), each piece with the heaps' residency sets attached again. Not the residency pruning or the memory side.
github-actions[bot] commented 2026-11-27 09:16:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T09:16:20Z.


Claimed by @Tarraga. Open a draft pull request with Refs #79 in its description within 24 hours, or the claim expires.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7214483037 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7214483037). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T09:16:20Z. --- Claimed by @Tarraga. Open a draft pull request with `Refs #79` in its description within 24 hours, or the claim expires.
alexballvideos-netizen commented 2026-11-27 13:48:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alexballvideos-netizen on 2026-11-27T13:48:59Z.


A data point from a 36 GB Mac on the Series X profile: wired memory climbs to the Metal recommended working set, then command buffers time out.

Setup. M3 Max, 36 GB, macOS 27.2.1, main 86786a72, run-native.sh --seconds 300, windowed. Defaults throughout: console Series X (title_memory_mib=13824), residency mode="a set per heap" memory_gb=36 switch="unset". Warm shader cache. Only the game and one other app were open. System memory was sampled every 5 s (vm_stat, memory_pressure, kern.memorystatus_vm_pressure_level, the process RSS).

Time Phase Wired Free RSS Pressure level
0 s before start 2.8 GB 89% – normal
30–60 s menus, story load at +44 s 17.9–18.3 GB 45% 4.8–6.0 GB normal
74 s world entry
91–121 s world 27.0–27.7 GB 11–12% 16.9–18.9 GB normal
~150 s world 27.1 GB 11% 19.5 GB (peak) warn from here on (13 samples)
~170 s first kIOGPUCommandBufferCallbackErrorTimeout (20 in all)
207 s title access violation image+0x55e56f8, end of run 28.25 GB (peak) 7% (min) warn
after exit 2.7 GB 83% – normal
  • The host logs recommended_working_set_mib=28753 (28.1 GB). Peak wired, 28.25 GB, was at that limit when the time-outs ended the run.
  • The largest heap_set_mb on the frame lines was 24,944.
  • Before the crash: 5 command buffers were never reported on by the GPU (the first unreported for 22.1s).
  • Swap did not grow (1.59 GB before and after). Compressed memory went from 0.8 to 4.0 GB.
  • Wired memory was released at exit. I did not need a reboot, unlike the reports of 20 to 40 GB kept after exit.

Even with 36 GB and the heap sets on by default, the world reaches the working-set limit within about 1.5 minutes. Then the GPU stops reporting and the title dies. This matches the description here: the sets hold the world's heap resident, about 25 GB on its own.

Happy to repeat with VICTORY_METAL_RESIDENCY_SETS=0 or --console series-s for comparison if that helps. Counts only.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7219978904 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7219978904). Originally posted by [alexballvideos-netizen](https://github.com/alexballvideos-netizen) on 2026-11-27T13:48:59Z. --- A data point from a 36 GB Mac on the Series X profile: wired memory climbs to the Metal recommended working set, then command buffers time out. **Setup.** M3 Max, 36 GB, macOS 27.2.1, main `86786a72`, `run-native.sh --seconds 300`, windowed. Defaults throughout: console Series X (`title_memory_mib=13824`), residency `mode="a set per heap" memory_gb=36 switch="unset"`. Warm shader cache. Only the game and one other app were open. System memory was sampled every 5 s (`vm_stat`, `memory_pressure`, `kern.memorystatus_vm_pressure_level`, the process RSS). | Time | Phase | Wired | Free | RSS | Pressure level | | --- | --- | --- | --- | --- | --- | | 0 s | before start | 2.8 GB | 89% | – | normal | | 30–60 s | menus, story load at +44 s | 17.9–18.3 GB | 45% | 4.8–6.0 GB | normal | | 74 s | world entry | | | | | | 91–121 s | world | 27.0–27.7 GB | 11–12% | 16.9–18.9 GB | normal | | ~150 s | world | 27.1 GB | 11% | 19.5 GB (peak) | **warn** from here on (13 samples) | | ~170 s | first `kIOGPUCommandBufferCallbackErrorTimeout` (20 in all) | | | | | | 207 s | title access violation `image+0x55e56f8`, end of run | **28.25 GB (peak)** | **7% (min)** | | warn | | after exit | | 2.7 GB | 83% | – | normal | - The host logs `recommended_working_set_mib=28753` (28.1 GB). Peak wired, 28.25 GB, was at that limit when the time-outs ended the run. - The largest `heap_set_mb` on the frame lines was 24,944. - Before the crash: `5 command buffers were never reported on by the GPU (the first unreported for 22.1s)`. - Swap did not grow (1.59 GB before and after). Compressed memory went from 0.8 to 4.0 GB. - Wired memory was released at exit. I did not need a reboot, unlike the reports of 20 to 40 GB kept after exit. Even with 36 GB and the heap sets on by default, the world reaches the working-set limit within about 1.5 minutes. Then the GPU stops reporting and the title dies. This matches the description here: the sets hold the world's heap resident, about 25 GB on its own. Happy to repeat with `VICTORY_METAL_RESIDENCY_SETS=0` or `--console series-s` for comparison if that helps. Counts only.
LakshanSivakumar commented 2026-11-27 14:10:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T14:10:02Z.


Numbers from tonight on my Mac (recommended working set 38,338 MiB, "a set per heap", heap set about 19,000 MB, Series S, headless unless said):

build switch result
b639c175 none time-out at t=154 (buffer with 54 passes), then the watchdog crash at image+0x55e56f8
b639c175 none clean, 240 s
60baf130 + pixel input enables none time-out at t=258
b639c175 VICTORY_PASSES_PER_BUFFER=1 time-out at t=250, 90 failed buffers
02ecf394 VICTORY_METAL_RESIDENCY_SETS=0 no failure in 330 s, but world frames take 12 to 14 s
aa43c491, windowed none clean, 365 s
  • The slow buffers just before a failure show almost no GPU time (gpu 0.002s) while the buffer takes 1.1 to 1.8 s, and many of them have 0 passes. So the queue stalls; it is not one shader running long. Translated loops are capped anyway.
  • The buffer that times out holds the same per-frame compute chain in both failing runs, and that chain also runs every frame in the clean runs.
  • So on this Mac it is residency: with the sets on, the queue stalls on some runs; with them off, every frame pays for naming each resource.

I am looking at a middle design (keep resident only what a buffer's passes name, or cap the host copies). If anyone has a run with VICTORY_METAL_RESIDENCY_SETS=0 that is NOT slow, please post the Mac and the fps.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7220430910 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7220430910). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T14:10:02Z. --- Numbers from tonight on my Mac (recommended working set 38,338 MiB, "a set per heap", heap set about 19,000 MB, Series S, headless unless said): | build | switch | result | |---|---|---| | b639c175 | none | time-out at t=154 (buffer with 54 passes), then the watchdog crash at image+0x55e56f8 | | b639c175 | none | clean, 240 s | | 60baf130 + pixel input enables | none | time-out at t=258 | | b639c175 | `VICTORY_PASSES_PER_BUFFER=1` | time-out at t=250, 90 failed buffers | | 02ecf394 | `VICTORY_METAL_RESIDENCY_SETS=0` | no failure in 330 s, but world frames take 12 to 14 s | | aa43c491, windowed | none | clean, 365 s | - The slow buffers just before a failure show almost no GPU time (`gpu 0.002s`) while the buffer takes 1.1 to 1.8 s, and many of them have 0 passes. So the queue stalls; it is not one shader running long. Translated loops are capped anyway. - The buffer that times out holds the same per-frame compute chain in both failing runs, and that chain also runs every frame in the clean runs. - So on this Mac it is residency: with the sets on, the queue stalls on some runs; with them off, every frame pays for naming each resource. I am looking at a middle design (keep resident only what a buffer's passes name, or cap the host copies). If anyone has a run with `VICTORY_METAL_RESIDENCY_SETS=0` that is NOT slow, please post the Mac and the fps.
Olima34 commented 2026-11-27 14:28:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T14:28:37Z.


A measured cause for the stall that ends world runs (2–4 min), on main 905e7aad: M5 Pro 48 GB, Series S, 5 headless runs, with the GPU memory released after each one.

  • It isn't one long command buffer, and it isn't memory. At the stall, 48–50% of memory is free, there's no swap, and 22 GB is wired. 5 s after each stall the kernel logs IOGPUFamily Cmd queue sleep port_name … value … timed out!. The buffer that times out is the next one in the queue, waiting on the ordering (or piece) event of the buffer before it. That earlier buffer never completes ("never reported on").
  • The buffer that never completes holds an ExecuteIndirect dispatch with absurd group counts. We read the record back on the GPU, with a local addition to VICTORY_TRACE_GPU_FAILS. Compute 0af6bb55… gets [510, 1182027346, 1314076063] groups. Word 0 looks sane and GPU-written; words 1 and 2 are stale float bits. Two other records of the same pass sit 4 bytes apart.
  • Suspect, not yet proven: the console indirect signature "type 105", which docs/native-host.md marks as a guess ("three group counts"). If its record holds one word, y and z are noise.
  • Not a fix: VICTORY_PASSES_PER_BUFFER=1 hits the same stall at +110–190 s.

We're checking the signature now, and a fix with a test will follow. That's why the queue stops, and probably why the kernel kept GPU memory and froze WindowServer on our Mac several times today.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7220830854 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7220830854). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T14:28:37Z. --- A measured cause for the stall that ends world runs (2–4 min), on main 905e7aad: M5 Pro 48 GB, Series S, 5 headless runs, with the GPU memory released after each one. - **It isn't one long command buffer, and it isn't memory.** At the stall, 48–50% of memory is free, there's no swap, and 22 GB is wired. 5 s after each stall the kernel logs `IOGPUFamily Cmd queue sleep port_name … value … timed out!`. The buffer that times out is the *next* one in the queue, waiting on the ordering (or piece) event of the buffer before it. That earlier buffer never completes ("never reported on"). - **The buffer that never completes holds an ExecuteIndirect dispatch with absurd group counts.** We read the record back on the GPU, with a local addition to `VICTORY_TRACE_GPU_FAILS`. Compute `0af6bb55…` gets **[510, 1182027346, 1314076063]** groups. Word 0 looks sane and GPU-written; words 1 and 2 are stale float bits. Two other records of the same pass sit 4 bytes apart. - **Suspect, not yet proven:** the console indirect signature "type 105", which `docs/native-host.md` marks as a guess ("three group counts"). If its record holds one word, y and z are noise. - **Not a fix:** `VICTORY_PASSES_PER_BUFFER=1` hits the same stall at +110–190 s. We're checking the signature now, and a fix with a test will follow. That's why the queue stops, and probably why the kernel kept GPU memory and froze WindowServer on our Mac several times today.
alexballvideos-netizen commented 2026-11-27 14:37:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by alexballvideos-netizen on 2026-11-27T14:37:11Z.


VICTORY_METAL_RESIDENCY_SETS=0 on the M3 Max, 36 GB, Series X: stable, but slow, and slower than on your Mac.

Setup. a3b26747 (main 728845d1 plus #373, a shader-only change), macOS 27.2.1, --console series-x, headless, 300 s, warm cache. Host line: mode="useResource per encoder" memory_gb=36 switch="0". System memory sampled every 5 s.

  • Menus: 30 fps. Story load at +44 s; world draws (mesh>0) from frame ~1472 at +84 s.
  • World: the first ~25 frames run in a few seconds each. From frame 1496 on, every frame takes 20 to 24 s (1497 → 1498 → 1499 → 1500 → 1504 over about 3.5 minutes). Overall 18 fps over frames 1..1472, and only 32 more frames after that.
  • 0 kIOGPUCommandBufferCallbackErrorTimeout, no crash, ran to the timer.
  • Memory: peak wired 27.7 GB, min free 11%, pressure level normal for all 63 samples. With the sets on (#79 comment above, same Mac), it reached 28.25 GB and 7% free, with "warn" from about 150 s, and timed out.

So it isn't a "not slow" run: on this Mac, per-encoder naming costs 20 to 24 s a world frame, against your 12 to 14. It does confirm the trade-off: no queue stall and no memory pressure without the sets. Counts only.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7221012736 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7221012736). Originally posted by [alexballvideos-netizen](https://github.com/alexballvideos-netizen) on 2026-11-27T14:37:11Z. --- `VICTORY_METAL_RESIDENCY_SETS=0` on the M3 Max, 36 GB, Series X: stable, but slow, and slower than on your Mac. **Setup.** a3b26747 (main 728845d1 plus #373, a shader-only change), macOS 27.2.1, `--console series-x`, headless, 300 s, warm cache. Host line: `mode="useResource per encoder" memory_gb=36 switch="0"`. System memory sampled every 5 s. - Menus: 30 fps. Story load at +44 s; world draws (`mesh>0`) from frame ~1472 at +84 s. - World: the first ~25 frames run in a few seconds each. From frame 1496 on, every frame takes **20 to 24 s** (1497 → 1498 → 1499 → 1500 → 1504 over about 3.5 minutes). Overall 18 fps over frames 1..1472, and only 32 more frames after that. - **0** `kIOGPUCommandBufferCallbackErrorTimeout`, no crash, ran to the timer. - Memory: peak wired 27.7 GB, min free 11%, pressure level **normal for all 63 samples**. With the sets on (#79 comment above, same Mac), it reached 28.25 GB and 7% free, with "warn" from about 150 s, and timed out. So it isn't a "not slow" run: on this Mac, per-encoder naming costs 20 to 24 s a world frame, against your 12 to 14. It does confirm the trade-off: no queue stall and no memory pressure without the sets. Counts only.
Olima34 commented 2026-11-27 15:05:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T15:05:01Z.


An update to my comment above, correcting the suspect. The console signature "type 105" is not the cause: its records do hold [x,1,1]. The record the GPU reads as [510, 1182027346, 1314076063] is a standard 12-byte dispatch record, and its y and z are never written.

The fix being tested: an indirect dispatch record with more than 65,535 groups in any dimension (the D3D12 limit) launches nothing, and is logged. Without it, 5 of 5 world runs froze at +110–190 s. With it, 4 runs went 170–300 s with no GPU error. A fifth froze at +126 s with sane counts, which points to a second cause, still being checked: a compute retry loop around buffer_atomic_cmpswap that may never exit. A PR with a Metal test will follow.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7221601492 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7221601492). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T15:05:01Z. --- An update to my comment above, correcting the suspect. The console signature "type 105" is **not** the cause: its records do hold [x,1,1]. The record the GPU reads as [510, 1182027346, 1314076063] is a standard 12-byte dispatch record, and its y and z are never written. **The fix being tested:** an indirect dispatch record with more than 65,535 groups in any dimension (the D3D12 limit) launches nothing, and is logged. Without it, 5 of 5 world runs froze at +110–190 s. With it, 4 runs went 170–300 s with no GPU error. A fifth froze at +126 s with sane counts, which points to a second cause, still being checked: a compute retry loop around `buffer_atomic_cmpswap` that may never exit. A PR with a Metal test will follow.
derz92 commented 2026-11-27 15:05:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T15:05:14Z.


Two world-entry runs from an M5 Max, 36 GB, macOS 26.5 (--console series-s, main 728845d1 plus #335, #341, #342 and #358), A/B on the residency mode:

VICTORY_METAL_RESIDENCY_SETS World End
0 (per encoder) reached, about 13 s per frame, presented image black 240 s world cap reached; no GPU error; memory returned after exit
unset → a set per heap (the 36 GB default) at world entry, about 89 s in: kIOGPUCommandBufferCallbackErrorHang (code 3), then …InnocentVictim stopped at the first failure; the GPU driver kept 19.7 GB "In use system memory" after exit, owned by no process, until a reboot (#357)

Free system memory was about 20–25% during the world in both. Earlier today a heap-set run reached the world and then hit kIOGPUCommandBufferCallbackErrorTimeout at about 180 s, and it also stranded about 20 GB. So on this Mac the per-heap sets hang or time out around the world load, while per-encoder residency survives but is far too slow.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7221606075 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7221606075). Originally posted by [derz92](https://github.com/derz92) on 2026-11-27T15:05:14Z. --- Two world-entry runs from an M5 Max, 36 GB, macOS 26.5 (`--console series-s`, main 728845d1 plus #335, #341, #342 and #358), A/B on the residency mode: | `VICTORY_METAL_RESIDENCY_SETS` | World | End | |---|---|---| | `0` (per encoder) | reached, about **13 s per frame**, presented image black | 240 s world cap reached; no GPU error; memory returned after exit | | unset → `a set per heap` (the 36 GB default) | at world entry, about 89 s in: `kIOGPUCommandBufferCallbackErrorHang` (code 3), then `…InnocentVictim` | stopped at the first failure; **the GPU driver kept 19.7 GB "In use system memory" after exit**, owned by no process, until a reboot (#357) | Free system memory was about 20–25% during the world in both. Earlier today a heap-set run reached the world and then hit `kIOGPUCommandBufferCallbackErrorTimeout` at about 180 s, and it also stranded about 20 GB. So on this Mac the per-heap sets hang or time out around the world load, while per-encoder residency survives but is far too slow.
maaalrey commented 2026-11-27 20:52:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by maaalrey on 2026-11-27T20:52:01Z.


A data point from an M4 Max, 128 GB, macOS 27.2.1: after a run of stops at the first Metal error, the GPU stayed hung for WindowServer with no game running, until a restart. Windowed, default per-heap residency sets (memory_gb=128).

My runner stops the game at the first IOGPUMetalError in the system log: SIGTERM, then SIGKILL 3 s later. Over 99 minutes it did that eight times, always in a world run. About a dozen other runs in between ended another way: most on my timer (also a SIGTERM, in the world, with no Metal error and no trouble afterwards), two at the title's own fault.

minutes after the first stop build console
0, 5 86786a7 Series X
59, 63 60baf130 Series X
72 c1b9587 Series S (about 380 s into the world)
88, 95 b639c175 Series X
99 b639c175, VICTORY_PASSES_PER_BUFFER=1 Series X

In the first seven, the game's own log has one work held for a wait that does not hold warning and no failed command buffer; the error was only in the system log. The eighth has 25 command buffer failed lines with kIOGPUCommandBufferCallbackErrorTimeout.

37 s after the eighth stop the watchdog killed WindowServer ("40 seconds since last successful checkin"). A WindowServer report was then written about every 50 s for 20 minutes, and hang reports at intervals for hours, until the Mac was restarted. No game process was running in that time.

  • In the watchdog's sample, WindowServer's main thread sits in one wait for all 12 samples: SkyLight, QuartzCore, Metal, then a kernel wait.
  • It does not look like memory: the kernel's compressor threads had not run for 11 hours in that sample.
  • I did not read the driver's counters before the restart, so I cannot say whether memory was stranded as in #357. After the restart "In use system memory" is about 1 GB.

So after the eighth the GPU was unusable for every later client. The time-out came before my stop, so I cannot tell which of the two did it. The first seven left no sign I noticed.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7227914598 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/79#issuecomment-7227914598). Originally posted by [maaalrey](https://github.com/maaalrey) on 2026-11-27T20:52:01Z. --- A data point from an M4 Max, 128 GB, macOS 27.2.1: after a run of stops at the first Metal error, the GPU stayed hung for WindowServer with no game running, until a restart. Windowed, default per-heap residency sets (`memory_gb=128`). My runner stops the game at the first `IOGPUMetalError` in the system log: SIGTERM, then SIGKILL 3 s later. Over 99 minutes it did that eight times, always in a world run. About a dozen other runs in between ended another way: most on my timer (also a SIGTERM, in the world, with no Metal error and no trouble afterwards), two at the title's own fault. | minutes after the first stop | build | console | |---|---|---| | 0, 5 | 86786a7 | Series X | | 59, 63 | 60baf130 | Series X | | 72 | c1b9587 | Series S (about 380 s into the world) | | 88, 95 | b639c175 | Series X | | 99 | b639c175, `VICTORY_PASSES_PER_BUFFER=1` | Series X | In the first seven, the game's own log has one `work held for a wait that does not hold` warning and no failed command buffer; the error was only in the system log. The eighth has 25 `command buffer failed` lines with `kIOGPUCommandBufferCallbackErrorTimeout`. 37 s after the eighth stop the watchdog killed WindowServer ("40 seconds since last successful checkin"). A WindowServer report was then written about every 50 s for 20 minutes, and hang reports at intervals for hours, until the Mac was restarted. No game process was running in that time. - In the watchdog's sample, WindowServer's main thread sits in one wait for all 12 samples: SkyLight, QuartzCore, Metal, then a kernel wait. - It does not look like memory: the kernel's compressor threads had not run for 11 hours in that sample. - I did not read the driver's counters before the restart, so I cannot say whether memory was stranded as in #357. After the restart "In use system memory" is about 1 GB. So after the eighth the GPU was unusable for every later client. The time-out came before my stop, so I cannot tell which of the two did it. The first seven left no sign I noticed.
Sign in to join this conversation.
No labels
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.

Reference
LakshanSivakumar/Native-Victory-macOS#79
No description provided.