[GH-ISSUE #1161] Add MacOS X64 Support #306

Closed
opened 2026-11-02 15:38:03 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1161

Originally assigned to: @mac1010z on GitHub.

Idea: Add x64 MacOS Support together with ARM64 MacOs
Why:

  1. MacBook Pro/Air 2020
  2. nullmoth/1401 (Hackintosh)

Reported on Discord by shellpark in #horizon-ideas · Discord thread
Tags: launcher, other

👍 **4** on Discord

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1161 Originally assigned to: @mac1010z on GitHub. > Idea: Add x64 MacOS Support together with ARM64 MacOs > Why: > 1) MacBook Pro/Air 2020 > 2) nullmoth/1401 (Hackintosh) Reported on Discord by **shellpark** in #horizon-ideas · [Discord thread](https://discord.com/channels/1559227979002028052/1562688416154517544) Tags: launcher, other <!-- kira:votes -->👍 **4** on Discord <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:38:03 +07:00
Author
Owner

@ludovic111 commented on GitHub (Oct 22, 2026):

🤖 Agent: Intel Mac builds are in #1171: the game (horizon-macos-x64.zip) and the launcher (horizon-launcher-macos-x64.dmg/.zip), built beside Apple Silicon. The launcher picks the build for its processor. They were checked under Rosetta 2 on Ludovic's Apple Silicon Mac mini: the release smoke test passes and the frames match the native build. They have not run on a real Intel Mac yet, so its GPU is untested. @shellpark, once a release includes it (releases are paused right now), could you try it on your 2020 MacBook and say how it runs?

<!-- gh-comment-id:6334313377 --> @ludovic111 commented on GitHub (Oct 22, 2026): 🤖 Agent: Intel Mac builds are in #1171: the game (`horizon-macos-x64.zip`) and the launcher (`horizon-launcher-macos-x64.dmg`/`.zip`), built beside Apple Silicon. The launcher picks the build for its processor. They were checked under Rosetta 2 on Ludovic's Apple Silicon Mac mini: the release smoke test passes and the frames match the native build. They have not run on a real Intel Mac yet, so its GPU is untested. @shellpark, once a release includes it (releases are paused right now), could you try it on your 2020 MacBook and say how it runs?
Author
Owner

@rdbtCVS commented on GitHub (Oct 26, 2026):

🤖 Agent: rdbtCVS’s AI agent (OpenAI Codex), triage follow-up. #1792 requests the same Intel Mac/macOS x86_64 support. Recommend retaining this older issue as the main tracking issue and closing #1792 as a duplicate. PR #1171 is still open; keep this issue open until builds are available and checked.

<!-- gh-comment-id:6418379821 --> @rdbtCVS commented on GitHub (Oct 26, 2026): 🤖 Agent: rdbtCVS’s AI agent (OpenAI Codex), triage follow-up. #1792 requests the same Intel Mac/macOS x86_64 support. Recommend retaining this older issue as the main tracking issue and closing #1792 as a duplicate. PR #1171 is still open; keep this issue open until builds are available and checked.
Author
Owner

@ersh0ff commented on GitHub (Oct 29, 2026):

Horizon on a real Intel Mac: what breaks on its GPU, and workarounds that run it

Re #1161 and #1171, and related to #3529. #1171 says the Intel builds have only run under Rosetta 2 so far. This is a run on real Intel hardware, built from source at d203ca0 for x86_64-apple-darwin. Two GPU problems showed up. With workarounds for both it renders correctly at its 60 FPS cap; vanilla 26.3 gets 18 FPS on this machine.

Machine: MacBook Pro 15" Late 2013, i7-4850HQ (4 cores, 8 threads), Intel Iris Pro 5200 (Haswell), 16 GB. macOS 14.8.2 through OpenCore Legacy Patcher, so the Metal driver is Monterey's Haswell driver (AppleIntelHD5000GraphicsMTLDriver). An unsupported setup, but an old Intel GPU like it is what many Intel Mac owners have.

1. Compute pipelines fail: "Compiler encountered an internal error"

Flatten section draws panics and animated sprites fall back to the CPU. MTLCompilerService aborts (SIGABRT). The crash reports show two separate causes in the Intel compiler plugin, both triggered by naga's MSL:

Crash site Triggered by
IGILErrorMessageHandlers::reportUnsupportedMaxWorkGroupSizeMetadataError (Processor_AIR_CL_1_0::processKernelFunction) [[max_total_threads_per_threadgroup(N)]] on the kernel. Firefox's GPU process crashed there too on this Mac (its WebGPU is also wgpu).
assertion in MetadataParser::parseArgument, called from AirEmulateArgumentBuffers::emulateIndirectArgumentBuffers a kernel argument that is a reference to a runtime-sized array of structs or atomics: device type_N const& x [[buffer(n)]] with typedef Range type_N[1];

These were isolated with minimal kernels: a hand-written kernel that compiles, plus one naga feature at a time (each check in its own process):

Kernel Result
base (pointers, atomics, threadgroup memory, barrier) compiles
+ max_total_threads_per_threadgroup(64) crashes
+ reference to an array of uint, read or written compiles
+ reference to an array of atomic_uint crashes
+ reference to an array of structs (Range) crashes
+ constant struct, struct pointer, texture2d_array write, thread_position_in_grid, threadgroup variable as a parameter each compiles
naga's flatten, flatten_seen, animate, mark with the attribute removed and array references turned into element pointers all compile

Integer division, loop bounding, bounds checks and the MSL version (down to 2.0) are not involved.

Workaround (legacy-intel.patch, gated by HORIZON_METAL_LEGACY_INTEL): for compute stages, wgpu-hal rewrites the MSL after naga. It removes the attribute and turns device T const& x / device T& x into device Elem const* x / device Elem* x for every typedef Elem T[1];. Indexing reads the same through a pointer. With it, the flatten pass and the animated sprites run on the GPU.

2. Terrain sections drawn in the wrong place: same symptom as #3529

Slabs of terrain float in the air, with holes and black faces where they belong. It shows from the first frames, in old and new worlds alike.

What was ruled out:

  • The CPU side. horizon-ctl status reported pending_chunks 0, every streaming stage at 0 and dirty_light 0. light and blocks around the player returned correct sky light and blocks. The game's own screenshot shows the same breakage.
  • API misuse. MTL_DEBUG_LAYER=1 reports nothing.
  • Machine state. A reboot and a cleared Metal shader cache change nothing.
  • Single settings. Turning occlusion culling, flat draws or animated textures off, or changing VSync or the resolution scale, doesn't fix it.

Bisection (basic-mode.patch). HORIZON_METAL_BASIC makes the Metal adapter hide capabilities that OpenGL 4.1 lacks, which is the level vanilla's renderer draws correctly at on this Mac. Its value names the ones to keep. Horizon then takes its own fallback paths:

Kept Section draws Result
nothing per section, draw_indexed with first_instance clean, 59 to 60 FPS (60 FPS cap)
indirect indirect multi-draw broken
compute (animated sprites on the GPU) per section clean, 60 FPS
indirect, vertex-storage, fragment-storage (occlusion culling on) indirect multi-draw broken

So the breakage follows the indirect draws. On Metal, wgpu replays multi_draw_indexed_indirect as one drawIndexedPrimitives(..., indirectBuffer:) per entry, and this driver seems to misread the entry's baseInstance (or baseVertex), so the instance-step origin is wrong. That is the mechanism found in #3529 on Ice Lake with Mesa. One difference: here the direct per-section draw_indexed with a non-zero first_instance is clean, while in #3529 it is broken too.

The flat path couldn't be isolated in this mode: it needs INDIRECT buffers, so hiding indirect makes it fail validation. Earlier runs with flat draws on gave mixed results, so I can't say whether flat avoids the problem here the way it does in #3529.

Numbers (render distance 8, 1280x720 window at 2x, Horizon at 50% resolution scale)

Same world and spot:

FPS Integrated server
vanilla 26.3 (OpenGL 4.1, naive) 18 116 ms per tick
Horizon, compute workaround only (flat draws on) 46 13.8 ms per tick

With the basic mode as well, play runs at 59 to 60 FPS against a 60 FPS cap. From --benchmark forest, run before the basic mode existed: median frame 11.4 ms, but p95 44 ms and 1% lows of 9 FPS. Chunk generation ran at 7.6 chunks/s, CPU-bound: sample shows all 7 worldgen workers near 100% on 4 cores, while the client's meshing workers got about 10% each.

Suggestions

  1. For Intel GPUs on Metal, prefer the per-section direct draws over indirect multi-draw (that fallback is already there), or avoid per-instance origins in indirect draws.
  2. Old Intel Metal drivers (no Metal 3 family) need naga's compute MSL without max_total_threads_per_threadgroup and without references to arrays of structs or atomics. That probably belongs upstream in naga/wgpu as well. Until then, a capability check could send these GPUs to the CPU paths.
  3. One thing that cost time while diagnosing: wgpu-hal's Metal fence counts MTLCommandBufferStatus::Error as completed and logs nothing. Logging command buffer errors would help any GPU report like this one.

The three patches (env-gated, written to diagnose rather than to merge) are attached: metal-compat.patch, legacy-intel.patch and basic-mode.patch. I'm glad to run builds from #1171 or test patches on this machine.

basic-mode.patch
legacy-intel.patch
metal-compat.patch

<!-- gh-comment-id:6501640356 --> @ersh0ff commented on GitHub (Oct 29, 2026): ## Horizon on a real Intel Mac: what breaks on its GPU, and workarounds that run it Re #1161 and #1171, and related to #3529. #1171 says the Intel builds have only run under Rosetta 2 so far. This is a run on real Intel hardware, built from source at `d203ca0` for `x86_64-apple-darwin`. Two GPU problems showed up. With workarounds for both it renders correctly at its 60 FPS cap; vanilla 26.3 gets 18 FPS on this machine. **Machine:** MacBook Pro 15" Late 2013, i7-4850HQ (4 cores, 8 threads), Intel Iris Pro 5200 (Haswell), 16 GB. macOS 14.8.2 through OpenCore Legacy Patcher, so the Metal driver is Monterey's Haswell driver (`AppleIntelHD5000GraphicsMTLDriver`). An unsupported setup, but an old Intel GPU like it is what many Intel Mac owners have. ### 1. Compute pipelines fail: "Compiler encountered an internal error" `Flatten section draws` panics and animated sprites fall back to the CPU. `MTLCompilerService` aborts (`SIGABRT`). The crash reports show two separate causes in the Intel compiler plugin, both triggered by naga's MSL: | Crash site | Triggered by | |---|---| | `IGILErrorMessageHandlers::reportUnsupportedMaxWorkGroupSizeMetadataError` (`Processor_AIR_CL_1_0::processKernelFunction`) | `[[max_total_threads_per_threadgroup(N)]]` on the kernel. Firefox's GPU process crashed there too on this Mac (its WebGPU is also wgpu). | | assertion in `MetadataParser::parseArgument`, called from `AirEmulateArgumentBuffers::emulateIndirectArgumentBuffers` | a kernel argument that is a reference to a runtime-sized array of **structs or atomics**: `device type_N const& x [[buffer(n)]]` with `typedef Range type_N[1];` | These were isolated with minimal kernels: a hand-written kernel that compiles, plus one naga feature at a time (each check in its own process): | Kernel | Result | |---|---| | base (pointers, atomics, threadgroup memory, barrier) | compiles | | + `max_total_threads_per_threadgroup(64)` | **crashes** | | + reference to an array of `uint`, read or written | compiles | | + reference to an array of `atomic_uint` | **crashes** | | + reference to an array of structs (`Range`) | **crashes** | | + `constant` struct, struct pointer, `texture2d_array` write, `thread_position_in_grid`, threadgroup variable as a parameter | each compiles | | naga's `flatten`, `flatten_seen`, `animate`, `mark` with the attribute removed and array references turned into element pointers | all compile | Integer division, loop bounding, bounds checks and the MSL version (down to 2.0) are not involved. **Workaround** (`legacy-intel.patch`, gated by `HORIZON_METAL_LEGACY_INTEL`): for compute stages, wgpu-hal rewrites the MSL after naga. It removes the attribute and turns `device T const& x` / `device T& x` into `device Elem const* x` / `device Elem* x` for every `typedef Elem T[1];`. Indexing reads the same through a pointer. With it, the flatten pass and the animated sprites run on the GPU. ### 2. Terrain sections drawn in the wrong place: same symptom as #3529 Slabs of terrain float in the air, with holes and black faces where they belong. It shows from the first frames, in old and new worlds alike. What was ruled out: - **The CPU side.** `horizon-ctl status` reported `pending_chunks 0`, every streaming stage at 0 and `dirty_light 0`. `light` and `blocks` around the player returned correct sky light and blocks. The game's own `screenshot` shows the same breakage. - **API misuse.** `MTL_DEBUG_LAYER=1` reports nothing. - **Machine state.** A reboot and a cleared Metal shader cache change nothing. - **Single settings.** Turning occlusion culling, flat draws or animated textures off, or changing VSync or the resolution scale, doesn't fix it. **Bisection** (`basic-mode.patch`). `HORIZON_METAL_BASIC` makes the Metal adapter hide capabilities that OpenGL 4.1 lacks, which is the level vanilla's renderer draws correctly at on this Mac. Its value names the ones to keep. Horizon then takes its own fallback paths: | Kept | Section draws | Result | |---|---|---| | nothing | per section, `draw_indexed` with `first_instance` | **clean**, 59 to 60 FPS (60 FPS cap) | | `indirect` | indirect multi-draw | **broken** | | `compute` (animated sprites on the GPU) | per section | clean, 60 FPS | | `indirect`, `vertex-storage`, `fragment-storage` (occlusion culling on) | indirect multi-draw | **broken** | So the breakage follows the **indirect** draws. On Metal, wgpu replays `multi_draw_indexed_indirect` as one `drawIndexedPrimitives(..., indirectBuffer:)` per entry, and this driver seems to misread the entry's `baseInstance` (or `baseVertex`), so the instance-step origin is wrong. That is the mechanism found in #3529 on Ice Lake with Mesa. One difference: here the direct per-section `draw_indexed` with a non-zero `first_instance` is clean, while in #3529 it is broken too. The flat path couldn't be isolated in this mode: it needs `INDIRECT` buffers, so hiding `indirect` makes it fail validation. Earlier runs with flat draws on gave mixed results, so I can't say whether flat avoids the problem here the way it does in #3529. ### Numbers (render distance 8, 1280x720 window at 2x, Horizon at 50% resolution scale) Same world and spot: | | FPS | Integrated server | |---|---|---| | vanilla 26.3 (OpenGL 4.1, `naive`) | 18 | 116 ms per tick | | Horizon, compute workaround only (flat draws on) | 46 | 13.8 ms per tick | With the basic mode as well, play runs at 59 to 60 FPS against a 60 FPS cap. From `--benchmark forest`, run before the basic mode existed: median frame 11.4 ms, but p95 44 ms and 1% lows of 9 FPS. Chunk generation ran at 7.6 chunks/s, CPU-bound: `sample` shows all 7 worldgen workers near 100% on 4 cores, while the client's meshing workers got about 10% each. ### Suggestions 1. For Intel GPUs on Metal, prefer the per-section direct draws over indirect multi-draw (that fallback is already there), or avoid per-instance origins in indirect draws. 2. Old Intel Metal drivers (no Metal 3 family) need naga's compute MSL without `max_total_threads_per_threadgroup` and without references to arrays of structs or atomics. That probably belongs upstream in naga/wgpu as well. Until then, a capability check could send these GPUs to the CPU paths. 3. One thing that cost time while diagnosing: wgpu-hal's Metal fence counts `MTLCommandBufferStatus::Error` as completed and logs nothing. Logging command buffer errors would help any GPU report like this one. The three patches (env-gated, written to diagnose rather than to merge) are attached: `metal-compat.patch`, `legacy-intel.patch` and `basic-mode.patch`. I'm glad to run builds from #1171 or test patches on this machine. [basic-mode.patch](https://github.com/user-attachments/files/34141292/basic-mode.patch) [legacy-intel.patch](https://github.com/user-attachments/files/34141290/legacy-intel.patch) [metal-compat.patch](https://github.com/user-attachments/files/34141291/metal-compat.patch)
Author
Owner

@mac1010z commented on GitHub (Oct 30, 2026):

/claim

<!-- gh-comment-id:6511851063 --> @mac1010z commented on GitHub (Oct 30, 2026): /claim
Sign in to join this conversation.
No milestone
No project
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
horizon-rust/horizon#306
No description provided.