Make the macOS app launch through Metal 4 #13

Manually merged
github merged 3 commits from gh-pr/13/head into gh-pr/13/base 2026-11-26 20:03:05 +00:00
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 18:35 UTC · original
maple-quartz18:feature/global-mtl4 → master · +11910 −2458 · 32 files · 3 commits · merged 2026-11-22 21:05 UTC

Summary

  • Add an opt-in native Metal 4 renderer for macOS; runtime-select it only on macOS 26+ with a Metal 4-capable GPU and otherwise fall back to WGPU.
  • Keep the macOS deployment minimum at 11.0 and leave Metal 4 disabled in standard builds.
  • Upgrade the GUI renderer to wgpu 30 and eframe/egui 0.36.2.
  • Use the published metal-rust 1.0.0 crates as the baseline with a pinned, documented fork patch; no binding source is vendored in this repository.

Validation

  • cargo test --release --locked (62 core tests and 12 GUI tests passed; 1 ignored)
  • cargo test -p sixng-gui --features metal4-poc --locked (18 GUI tests passed; 1 ignored)
  • Windows GNU cross-target check with metal4-poc and all targets passed.
  • GitHub Actions passed on macOS, Ubuntu, and Windows.
**@⁠maple-quartz18** on GitHub · 2026-11-22 18:35 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13) `maple-quartz18:feature/global-mtl4` → `master` · +11910 −2458 · 32 files · 3 commits · merged 2026-11-22 21:05 UTC ## Summary - Add an opt-in native Metal 4 renderer for macOS; runtime-select it only on macOS 26+ with a Metal 4-capable GPU and otherwise fall back to WGPU. - Keep the macOS deployment minimum at 11.0 and leave Metal 4 disabled in standard builds. - Upgrade the GUI renderer to wgpu 30 and eframe/egui 0.36.2. - Use the published metal-rust 1.0.0 crates as the baseline with a pinned, documented fork patch; no binding source is vendored in this repository. ## Validation - cargo test --release --locked (62 core tests and 12 GUI tests passed; 1 ignored) - cargo test -p sixng-gui --features metal4-poc --locked (18 GUI tests passed; 1 ignored) - Windows GNU cross-target check with metal4-poc and all targets passed. - GitHub Actions passed on macOS, Ubuntu, and Windows.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:03:04 +00:00
github manually merged commit afd7dc2776 into gh-pr/13/base 2026-11-26 20:03:05 +00:00
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 18:56 UTC · original

As a first-time contributor, I can't trigger CI on this fork PR. Could you approve the workflows? It brings native Metal 4 rendering to Apple Silicon (M5 Pro / M6) and benefits all Mac users. Thanks!

**@⁠maple-quartz18** on GitHub · 2026-11-22 18:56 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7083984038) As a first-time contributor, I can't trigger CI on this fork PR. Could you approve the workflows? It brings native Metal 4 rendering to Apple Silicon (M5 Pro / M6) and benefits all Mac users. Thanks!
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-22 19:17 UTC · original

Thanks for this. It can't be merged as it stands: it conflicts with master and no CI ran on it. Could you rebase it onto the current master? It would also help to say where the vendored bindings under vendor/metal-rust-ffi and vendor/metal-rust come from and under which licence, or to pull them in as a crate dependency rather than vendoring about 239k lines.

**@⁠holdmysocks** on GitHub · 2026-11-22 19:17 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7084266040) Thanks for this. It can't be merged as it stands: it conflicts with master and no CI ran on it. Could you rebase it onto the current master? It would also help to say where the vendored bindings under vendor/metal-rust-ffi and vendor/metal-rust come from and under which licence, or to pull them in as a crate dependency rather than vendoring about 239k lines.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 20:12 UTC · original

Thanks for this. It can't be merged as it stands: it conflicts with master and no CI ran on it. Could you rebase it onto the current master? It would also help to say where the vendored bindings under vendor/metal-rust-ffi and vendor/metal-rust come from and under which licence, or to pull them in as a crate dependency rather than vendoring about 239k lines.

Thanks for the feedback. I’ll rebase the PR onto the latest master and resolve the conflicts, make sure CI runs, and document the source and license for the vendored Metal bindings (or replace them with crate dependencies if appropriate). I’ll update the PR once these items are addressed.

**@⁠maple-quartz18** on GitHub · 2026-11-22 20:12 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085039845) > Thanks for this. It can't be merged as it stands: it conflicts with master and no CI ran on it. Could you rebase it onto the current master? It would also help to say where the vendored bindings under vendor/metal-rust-ffi and vendor/metal-rust come from and under which licence, or to pull them in as a crate dependency rather than vendoring about 239k lines. Thanks for the feedback. I’ll rebase the PR onto the latest master and resolve the conflicts, make sure CI runs, and document the source and license for the vendored Metal bindings (or replace them with crate dependencies if appropriate). I’ll update the PR once these items are addressed.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-22 20:18 UTC · original · review (dismissed)

Thanks for the update. Before this can go in:

  1. Keep the macOS minimum at 11.0. Please revert MACOSX_DEPLOYMENT_TARGET=27.0 and LSMinimumSystemVersion 27.0 in scripts/macos-app.sh and the README line. The app has to keep launching on older macOS. Metal 4 should be used only when it is available at runtime (check the OS version / MTL4 availability and fall back to the existing wgpu window otherwise), not raise the minimum for everyone.
  2. Metal 4 not on by default at build time. Please drop default = ["metal4-poc"], so a plain cargo build on every platform builds what it does today. The Metal 4 path can be opt-in (--features metal4-poc) until it is at parity (screenshots and the other wgpu-only views).
  3. Split the wgpu 24 → 30 / eframe 0.31 → 0.36 upgrade into its own PR. It changes every GUI file on Windows and Linux too, and should be reviewed and tested on its own.
  4. Rebase onto current master. It still conflicts, so GitHub cannot run CI on it.
  5. Vendored metal-rust: thanks for the notice. Please keep only the changed files as a small patch, or depend on the published 1.0.0 crate plus a minimal fork, instead of vendoring ~227k lines, and list what the fork changes.
**@⁠holdmysocks** on GitHub · 2026-11-22 20:18 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#pullrequestreview-6014303537) · **review (dismissed)** Thanks for the update. Before this can go in: 1. **Keep the macOS minimum at 11.0.** Please revert `MACOSX_DEPLOYMENT_TARGET=27.0` and `LSMinimumSystemVersion 27.0` in `scripts/macos-app.sh` and the README line. The app has to keep launching on older macOS. Metal 4 should be used only when it is available at runtime (check the OS version / MTL4 availability and fall back to the existing wgpu window otherwise), not raise the minimum for everyone. 2. **Metal 4 not on by default at build time.** Please drop `default = ["metal4-poc"]`, so a plain `cargo build` on every platform builds what it does today. The Metal 4 path can be opt-in (`--features metal4-poc`) until it is at parity (screenshots and the other wgpu-only views). 3. **Split the wgpu 24 → 30 / eframe 0.31 → 0.36 upgrade** into its own PR. It changes every GUI file on Windows and Linux too, and should be reviewed and tested on its own. 4. **Rebase onto current master.** It still conflicts, so GitHub cannot run CI on it. 5. **Vendored metal-rust:** thanks for the notice. Please keep only the changed files as a small patch, or depend on the published 1.0.0 crate plus a minimal fork, instead of vendoring ~227k lines, and list what the fork changes.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 20:22 UTC · original

Thanks for the review. I rebased the PR onto the latest master, replaced the vendored Metal bindings with a pinned Git dependency, and documented the upstream source, fork revision, and Apache-2.0 license in THIRD_PARTY_NOTICES.md. Local release build and tests pass. The new GitHub Actions run is marked action_required; could you approve the workflows so CI can run?

**@⁠maple-quartz18** on GitHub · 2026-11-22 20:22 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085193829) Thanks for the review. I rebased the PR onto the latest master, replaced the vendored Metal bindings with a pinned Git dependency, and documented the upstream source, fork revision, and Apache-2.0 license in THIRD_PARTY_NOTICES.md. Local release build and tests pass. The new GitHub Actions run is marked action_required; could you approve the workflows so CI can run?
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-22 20:22 UTC · original

CI ran on 18f31dd: macOS passes, but Windows and Ubuntu fail at cargo test with cannot find module or crate metal_rust. The Metal 4 code is used outside a macOS-only #[cfg(target_os = "macos")] guard while the crate is only a macOS dependency. Please gate those modules and their uses so the other platforms build.

**@⁠holdmysocks** on GitHub · 2026-11-22 20:22 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085203977) CI ran on 18f31dd: macOS passes, but Windows and Ubuntu fail at `cargo test` with `cannot find module or crate metal_rust`. The Metal 4 code is used outside a macOS-only `#[cfg(target_os = "macos")]` guard while the crate is only a macOS dependency. Please gate those modules and their uses so the other platforms build.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 20:30 UTC · original

I also formatted the PR-touched GUI files in fbbd8ac; their targeted rustfmt check and the release tests pass. GitHub marked the CI run for this latest commit as action_required again. Could you approve this run so the updated commit gets CI coverage?

**@⁠maple-quartz18** on GitHub · 2026-11-22 20:30 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085330170) I also formatted the PR-touched GUI files in fbbd8ac; their targeted rustfmt check and the release tests pass. GitHub marked the CI run for this latest commit as action_required again. Could you approve this run so the updated commit gets CI coverage?
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 20:34 UTC · original

Thanks for the detailed review. I’ll keep the macOS minimum at 11.0 and gate Metal 4 on runtime OS/GPU availability with a WGPU fallback; make metal4-poc opt-in; separate the wgpu/eframe upgrade from the Metal 4 work; rebase onto current master; and replace the full vendored bindings with the published 1.0.0 crates plus a minimal, documented fork/patch. I’ll also ensure all Metal 4 modules and uses are macOS-gated so Windows and Linux builds remain unaffected.

**@⁠maple-quartz18** on GitHub · 2026-11-22 20:34 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085377793) Thanks for the detailed review. I’ll keep the macOS minimum at 11.0 and gate Metal 4 on runtime OS/GPU availability with a WGPU fallback; make metal4-poc opt-in; separate the wgpu/eframe upgrade from the Metal 4 work; rebase onto current master; and replace the full vendored bindings with the published 1.0.0 crates plus a minimal, documented fork/patch. I’ll also ensure all Metal 4 modules and uses are macOS-gated so Windows and Linux builds remain unaffected.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-22 20:34 UTC · original

Thanks for the rebase and for dropping the vendored crates. CI ran on 9b36013: macOS passes; Windows and Ubuntu still fail at cargo test with cannot find module or crate metal_rust (the Metal 4 modules and their uses need #[cfg(target_os = "macos")] guards, e.g. the test that touches them).

Still open from the review:

  1. The macOS minimum is still raised to 27.0 (scripts/macos-app.sh and the README). Please keep 11.0 and pick Metal 4 at runtime only when it is available, falling back to the wgpu window.
  2. default = ["metal4-poc"] is still set. Please make Metal 4 opt-in.
  3. The wgpu 24 → 30 / eframe 0.31 → 0.36 upgrade is still part of this PR. Please split it out.
  4. Small: the README still says the fork is "under vendor/", and .gitignore still has /vendor/*/target/. Both can go now.
**@⁠holdmysocks** on GitHub · 2026-11-22 20:34 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085381109) Thanks for the rebase and for dropping the vendored crates. CI ran on 9b36013: macOS passes; Windows and Ubuntu still fail at `cargo test` with `cannot find module or crate metal_rust` (the Metal 4 modules and their uses need `#[cfg(target_os = "macos")]` guards, e.g. the test that touches them). Still open from the review: 1. The macOS minimum is still raised to 27.0 (`scripts/macos-app.sh` and the README). Please keep 11.0 and pick Metal 4 at runtime only when it is available, falling back to the wgpu window. 2. `default = ["metal4-poc"]` is still set. Please make Metal 4 opt-in. 3. The wgpu 24 → 30 / eframe 0.31 → 0.36 upgrade is still part of this PR. Please split it out. 4. Small: the README still says the fork is "under `vendor/`", and `.gitignore` still has `/vendor/*/target/`. Both can go now.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 20:39 UTC · original

Thanks for the follow-up. I’m addressing the remaining items now: keep macOS 11.0 with runtime Metal 4 detection and WGPU fallback, make the feature opt-in, gate Metal 4 code and tests on macOS, and remove the stale vendor wording and ignore rule. I’ll also separate the wgpu/eframe upgrade from the Metal 4 changes and report back with the resulting PRs and CI status.

**@⁠maple-quartz18** on GitHub · 2026-11-22 20:39 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085450087) Thanks for the follow-up. I’m addressing the remaining items now: keep macOS 11.0 with runtime Metal 4 detection and WGPU fallback, make the feature opt-in, gate Metal 4 code and tests on macOS, and remove the stale vendor wording and ignore rule. I’ll also separate the wgpu/eframe upgrade from the Metal 4 changes and report back with the resulting PRs and CI status.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 20:53 UTC · original

The latest head is rebased onto master a4063d3. I have restored the 11.0 minimum, made Metal 4 opt-in with runtime OS/GPU detection and WGPU fallback, gated the example and Metal code for non-macOS targets, and removed stale vendor references/rules. Release tests and a Windows GNU cross-target check pass. The wgpu/eframe migration is the remaining item to extract into a separate PR; the latest Actions run is action_required, so CI still needs workflow approval.

**@⁠maple-quartz18** on GitHub · 2026-11-22 20:53 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085620012) The latest head is rebased onto master a4063d3. I have restored the 11.0 minimum, made Metal 4 opt-in with runtime OS/GPU detection and WGPU fallback, gated the example and Metal code for non-macOS targets, and removed stale vendor references/rules. Release tests and a Windows GNU cross-target check pass. The wgpu/eframe migration is the remaining item to extract into a separate PR; the latest Actions run is action_required, so CI still needs workflow approval.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-22 21:05 UTC · original

Thanks! Squash-merged as d2dbb28.

**@⁠holdmysocks** on GitHub · 2026-11-22 21:05 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7085780916) Thanks! Squash-merged as d2dbb28.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-11-22 21:35 UTC · original

Thanks again for the thoughtful review and for helping get this into SixNG. Your guidance on the macOS minimum, runtime fallback, opt-in feature, cross-platform guards, and dependency handling made the result much stronger. I appreciate the time you put into maintaining the project.

**@⁠maple-quartz18** on GitHub · 2026-11-22 21:35 UTC · [original](https://github.com/holdmysocks/SixNG/pull/13#issuecomment-7086170913) Thanks again for the thoughtful review and for helping get this into SixNG. Your guidance on the macOS minimum, runtime fallback, opt-in feature, cross-platform guards, and dependency handling made the result much stronger. I appreciate the time you put into maintaining the project.
This discussion has been locked. Commenting is limited to contributors.
No description provided.