I honestly think the kernel interface is by far the easiest part of building a MacOS compat layer. The userland is gigantic, super complex, and totally closed source. That's the hard part.
AFAIK all macos software only talks to the kernel via userland APIs - so there's no particular benefit to basing ravynOS on XNU anyway. (Just the opinion of a layman.)
The Mach APIs are available to userland applications, if you used a different kernel you’d have to implement them somehow
But do real apps actually use them directly? Or only through the userland libraries?
Just FYI, the https://www.darlinghq.org project is doing MacOS app compat on Linux - i.e. building the userland libraries.
Yes, real apps use Mach messaging directly. i.e.: https://source.chromium.org/chromium/chromium/src/+/main:ipc...
Chrome is an outlier to how most apps will do things.
The illustration that Chrome uses Mach ports is a counterexample to an (implied) insinuation that nothing in running in macOS user space uses Mach ports. Outlier or not, the fact there is at least one (albeit also very useful and very popular) application that uses them ties back to the conversation about how they're a kernel feature worth having for Mac compatibility.