Skip to content

feat: run the music server on macOS (Metal, unified memory) - #51

Merged
timoncool merged 13 commits into
timoncool:mainfrom
stalexxx:macos-support
Oct 9, 2026
Merged

timoncool merged 13 commits into
timoncool:mainfrom
stalexxx:macos-support

Conversation

@stalexxx

@stalexxx stalexxx commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Non-Windows builds skip the VC++ runtime check (nothing to fetch).
  • macOS hardware detection: chip name from system_profiler (sppci_model), unified memory reported as total RAM.
  • Auto backend on macOS lets the engine pick its device (Metal), never Vulkan; falls back to CPU if that start fails.
  • Windows-only tests gated with #[cfg(windows)]; device_chain test is platform-aware.

Windows behaviour is unchanged.

Test plan

  • cargo test -p music-server --lib on macOS (281 passed, 4 ignored)
  • Windows CI / regression check

🤖 Generated with Claude Code

stalexxx and others added 4 commits October 6, 2026 14:23
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…data)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@stalexxx

stalexxx commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Besides the macOS support in music-server, this PR now includes the engine and app builds for macOS (Apple Silicon):

  • scripts/build-yue-runtime.sh + a macos entry in engines/yue2-cpp-source.json: builds the pinned yue2.cpp commit with Metal (see README, "Building from source").
  • scripts/build-release-macos.sh: builds an ad-hoc-signed .dmg with the engine bundled. The engine is looked up in Contents/Resources, data goes to ~/Library/Application Support/YuE2 Studio.

Built from scratch on Apple Silicon: the engine builds and starts, the dmg builds (53 MB), its signature verifies, and cargo test -p music-server --lib passes (281). The dmg was installed and run on an M2 Max: the engine from Contents/Resources starts, engine.log shows the Metal device (MTL0 (Apple M2 Max), unified memory), and a song was generated end to end (39.4 s of audio in 108.6 s) and saved to the library.

Audio to MIDI (ace-midi) is built with Metal by scripts/build-midi-runtime.sh and bundled in the dmg; transcribing a generated song on the M2 Max works (476 notes in ~30 s).

Not verified: Windows (behaviour unchanged by design).

stalexxx and others added 3 commits October 6, 2026 15:25
…ndows .exe)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r for child tools

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… snapshots

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
stalexxx and others added 2 commits October 7, 2026 17:34
Same change as the macos-quit-confirm branch (PR timoncool#53).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…are offered back

- Stopping a song marks its job cancelled when the engine accepts the stop,
  instead of leaving it "running" until the engine reaches a checkpoint, so
  every window drops its card.
- Requests the engine has taken are kept in music-jobs.json until their job
  ends. What is left at the next start is shown as an "Interrupted" card with
  Make again / Remove; nothing starts on its own.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s again

Replaces music-jobs.json and the /v1/music/interrupted routes. A job is saved
to the library database as soon as the engine takes it and its status is
written when it ends. At the next start, jobs still queued or running were cut
off by the studio closing: each is marked cancelled (its message names the job
that replaced it) and started again, oldest first, at most 3 times.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@stalexxx

stalexxx commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Если кратко, то этот пр позволяет запустить код на маке, но не сломал ли я что-то в винде, я проверить не могу

stalexxx and others added 3 commits October 7, 2026 18:03
A stopped or failed job was kept in the database but only the cut-off ones
were read back, so after a restart the others answered "not found". Their
message is now stored too, and the newest 200 are loaded at start.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GET /v1/music/jobs/ended lists them (they survive restarts, kept in the
library); DELETE /v1/music/jobs/{id} removes one for good.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…service asks first

The second press of the button ("Reset GPU") stopped every job the service
had, including another window's and an agent's, with no question. Cancel All
now stops only this window's songs, found by the mark each request carries.
The second press is "Stop all on the server" and says how many jobs it
will stop before it does.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@timoncool timoncool mentioned this pull request Oct 8, 2026
@timoncool
timoncool merged commit 04f547b into timoncool:main Oct 9, 2026
@timoncool

Copy link
Copy Markdown
Owner

Спасибо! Windows не сломался: PR вошёл в 3.5.0, я проверил на установленной Windows-сборке - «Отменить генерацию» останавливает песню сразу, при закрытии студии посреди генерации она спрашивает, песня, на которой студию закрыли, при следующем запуске стартует заново, а движок завершается вместе со студией. Сборка для macOS (Apple Silicon) из твоего PR теперь выходит в каждом релизе рядом с Windows и Linux.

telesoho pushed a commit to telesoho/YuE2-Studio that referenced this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants