Skip to content

[Tests] Seatbelt probes: tell a host audio refusal from a profile one; retry a refused archive - #72

Merged
xnetcat merged 2 commits into
mainfrom
fix/sandbox-probe-audio-archive
Dec 3, 2026
Merged

xnetcat merged 2 commits into
mainfrom
fix/sandbox-probe-audio-archive

Conversation

@xnetcat

@xnetcat xnetcat commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Before submitting

Please read our contribution guidelines before opening a pull request:

➡️ CONTRIBUTING.md

By opening this pull request, you confirm that you have read and agree to follow the contribution guidelines.

What this changes

Two changes to SeatbeltSandboxProbeTests. Neither changes product behaviour.

  1. Guest probe, audio.coreaudio fails with AudioOutputUnitStart OSStatus 2003329396 ('what'). This is not the sandbox profile. The same AudioUnit start fails unsandboxed at the same moment (a small native control, arm64 and x64), and coreaudiod logs HALB_SharedBuffer::Lock: mlock failed ... errno 35: the Mac is at vm.global_user_wire_limit (19.7-20.7 GB wired of 24 GB, 19.59 GB limit) and coreaudiod cannot wire its IO buffers. No sandbox denial was logged. The CLI gets --sandbox-probe --audio-control (the same audio step without the profile). When the sandboxed step fails, the test runs the control and, if the control starts, a second sandboxed attempt. Each outcome fails with its own message and the host's wired memory: "host audio cannot start outside the sandbox either", "intermittent", or "the profile refused it". The test passes only when the sandboxed start works. Games already log [LOADER][WARN] AudioOut host backend unavailable: ... when the start fails.
  2. GPU host probe, metal.binary-archive fails on CI with "The binary archive contains no items eligible to be serialized" (push run 46791992478, macos-26-arm64). Metal refused, not the sandbox (a plain write beside it worked). Each attempt now compiles a kernel unique to it, so no cache can serve it, and a refused first attempt is retried once with a new archive. Both outcomes and the device name are printed. The probe still needs an archive file Metal wrote, so a profile that blocks the write still fails. Why Metal refuses is not known. Apple's docs and forums don't explain it, and it doesn't reproduce on this Mac.

Testing

Tests and the probe only; no game was run. Local, arm64 Release on an M4:

  • Probe class while the Mac was over the wired limit: 3 of 3 failed with "host audio cannot start outside the sandbox either" (before: failed blaming the profile line). With wired memory below the limit, the class passed 2 of 2.
  • Full dotnet test SharpEmu.slnx -c Release: 11 suites, only failure the guest probe above, with the host-audio message (Libs 12629 passed, 1 failed, 162 skipped).
  • uvx reuse lint compliant.
  • Unverified: the archive retry against a real "no eligible items" refusal (needs CI); x64 test host runs of the class.

Checklist

By submitting this pull request, you confirm that:

  • I have read and followed CONTRIBUTING.md.
  • I tested my changes or marked the testing section as N/A.
  • I wrote this pull request description myself and did not paste AI-generated explanations.
  • I listed the game(s) I tested (or marked the testing section as N/A).

…try, both outcomes printed

CI (push run 46791992478, macos-26-arm64 runner) refused the probe archive with
MTLBinaryArchiveDomain Code=1 "contains no items eligible to be serialized" although
addComputePipelineFunctions returned YES and a plain write beside it worked: Metal
refused, not the sandbox. Each attempt now compiles a kernel unique to it, so nothing
can come from Metal's caches or the probe's earlier compile of the same source, and a
refused first attempt gets one more with a new archive. Passing still requires an
archive file Metal wrote, so a profile that blocks the write still fails; both
outcomes and the device name are printed.
…e one

audio.coreaudio failed locally with AudioOutputUnitStart 'what' (2003329396). The same
start fails unsandboxed at the same moment (native AudioUnit control, arm64 and x64),
and coreaudiod logs HALB_SharedBuffer::Lock mlock errno 35: the host is at
vm.global_user_wire_limit (about 19.7-20.7 GB wired of 24 GB) and coreaudiod cannot wire
its IO buffers. No sandbox denial. Not a profile bug.

The CLI gets --sandbox-probe --audio-control, the same audio step without the profile.
When the sandboxed step fails the test runs it at once: a failing control fails the
test as "host audio cannot start outside the sandbox either"; near the limit the host
flips within seconds, so a starting control is followed by a second sandboxed attempt,
and only a repeated sandboxed refusal while the control starts blames the profile.
Every non-ok outcome still fails, with the host's wired memory in the message.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

📦 Build artifacts — 9c52c8c

Platform Download
macOS (osx-x64) sharpemu-osx-x64-0208c8c
macOS app bundle (osx-x64) sharpemu-osx-x64-app-0208c8c

From build run #554. Downloads require a GitHub login and expire after 90 days.

@xnetcat
xnetcat merged commit b9e0e94 into main Dec 3, 2026
8 checks passed
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.

1 participant