Repository navigation
Conversation
Implement opt-in native IPv4 sockets and NIFM configuration for LAN play. Translate Horizon socket errors and descriptor flags, support unprivileged ICMP echo, and map explicit peers onto a shared virtual subnet. Relay LAN discovery broadcasts as unicast over existing routes without changing VPN or router configuration. Keep upstream's offline SDK 21 polling behavior. Add a Mac LAN launcher and portable runtime ZIP packager. Both players can use the same launcher, select their existing build and peer IP, and choose a locally remembered nickname through DM_NICK. Reuse the regular app save, validated graphics settings and the current Mac's pipeline archive. Keep personal settings, game files, keys and GPU-specific archives out of kits. Fall back to the Python process architecture when sysctl cannot identify Apple silicon. Add socket, launcher, packaging and architecture tests, and document setup, frontend controls and the experimental LAN limitations. Validation after updating to upstream 95f9a6a: the Mac host builds; host tests and 64 focused Python tests pass; the LAN test passes under ASan and UBSan; Python lint has no new findings; changed host files have no C lint findings. Shell syntax and documentation checks pass. Mario Kart World multiplayer was previously confirmed by Max over several rounds between an M4 Pro and M1 Pro through a routed site-to-site VPN. A quick game regression passed before this upstream update. Two-Mac gameplay and a full game regression have not been rerun on the new upstream shader chain; post-launcher-fix performance on the M1 Pro remains unmeasured. Changes by Max Vincent Goldgamer. GPT-6.1-Sol was used for research and the creation of a summary. Front-ends: new: offer opt-in Mac LAN peer selection and account nicknames through scripts/run_mac_lan.py; package a matching host and shader runtime with scripts/package_mac_lan.py.
2 of 3 tasks
Owner
|
Thanks for testing several actual Mario Kart World rounds between the M4 Pro and M1 Pro over a site-to-site VPN. The smaller host IPv4 transport is now under review in #3324, following the split discussed in #2589. I’ll leave this experiment open for the routed discovery result. #3324 covers the shared socket transport and leaves the peer relay and portable launcher kit outside its scope. The VPN rounds here are useful evidence for evaluating a smaller discovery follow-up once the transport is settled. |
Author
|
That is fantastic! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Very experimental WIP. This PR is for discussion and testing and is not ready to merge. Help is appreciated.
This adds opt-in LAN multiplayer support on macOS, initially tested with Mario Kart World. Several multiplayer rounds worked successfully between an M4 Pro and an M1 Pro on different local subnets connected through a site-to-site VPN.
The existing offline socket implementation prevented LAN initialization. Native sockets also require translation between Horizon and Darwin error codes and descriptor flags. Routed networks need additional discovery handling because LAN broadcasts do not normally cross subnet boundaries.
This change adds native IPv4 socket support, unprivileged ICMP echo, NIFM configuration, and discovery relay to explicitly configured peers. Socket addresses are mapped onto a shared virtual subnet while traffic follows existing routes. No router or VPN configuration changes are required.
The accompanying launcher selects the peer and existing game build, supports a locally remembered in-game username, and reuses the regular app’s save, graphics settings, and local pipeline archive. A packager creates a portable kit containing the matching host and shader runtime. The change also fixes Apple-silicon detection when
sysctlis restricted.For additional testing, I recommend trying ZeroTier as an alternative to an existing site-to-site VPN.
Known limitations:
Please review the scope and implementation before this moves toward merge. Feedback on splitting the contribution, networking correctness, performance, and additional test coverage would be especially helpful.
Implementation findings and limitations are documented in:
Checked
95f9a6a9:make -C dm/host/tests GAME=0400C3F00006E000 -j3 runmake -C dm/gfx/tests GAME=0400C3F00006E000 -j3 rungit diff --check.0400C3F00006E000, package versionv917504, SDK 21.4.0. Several multiplayer rounds completed over a routed site-to-site VPNPrevious quick regression report — before the upstream update
Baseline
02c91cd4cc7abd86d7e2e28b81e98fa19d76b2ec, candidate working tree with LAN changes; Apple M4 Pro, macOS 27.2, Xcode 27.2; 173.4 seconds.One shader failed in both baseline and candidate. No shaders newly built. First frame: 3.6 seconds → 3.0 seconds. FPS and frame-time percentiles were not recorded. This was a boot check, not a multiplayer or performance comparison.
Front ends
Front-ends: new: offer opt-in Mac LAN peer selection and account nicknames through scripts/run_mac_lan.py; package a matching host and shader runtime with scripts/package_mac_lan.py.
Docs
python3 dm/tools/docs_symptoms.pywas run.Changes by Max Vincent Goldgamer. GPT-6.1-Sol was used for research and summary creation.