Cloud session: Rust workspace off macOS, rewriter fixes, gfx proposals¶
Status: done in a Linux cloud container (no Xcode, Metal, codesign or game files). The Rust changes were tested there; everything under gfx/ and runtime/ was only checked by reading the code and still needs a build and a game run on a Mac.
1. Tested here (cargo test, whole workspace green)¶
napple-buildcompiles off macOS: errno viastd::io::Error::last_os_error()(waslibc::__error, macOS only);clonefile(2)declared only on macOS, plain copy elsewhere. Behaviour on macOS is unchanged.e2e::keep_cache_allows_resumewas flaky (about 1 run in 4): it took any RomFS cache for the test title in the shared temp dir, and parallel tests delete theirs. It now looks only at its own cache dir (pipeline::cache_dir_name). 30 consecutive runs pass.- Rewriter,
windows.rs:a64::direct_targetmatchesbltoo, so ablinside an ldxr/stxr window was retargeted to an exit stub; the callee would have returned into the window copy with the scratch registers already restored. Now refused (the module is reported unhandled instead of silently wrong). Regression testcall_inside_exclusive_window_is_refused. - Rewriter,
rewrite.rs: a site that failed after emittingbr x18landing pads left them in the pad cache after rollback; a later site using the same table would branch into overwritten patch code. The cache is now pruned on rollback. - Build outputs untracked and ignored:
gfx/build-disp/,audio|input|frontend/lib*.a,*.o,*.dSYM.
2. Proposed, needs a Mac (build + run)¶
- Pipeline-build hang (
gfx/src/mtl_shader.m,gfx/src/mtl_priv.h). Shader builds get their own queue; background pipeline builds run on a serial queue; a pipeline is claimed before it is built, so a draw needing one still queued for prewarm builds it itself. Check:make -C gfx test; a cold start with a largepipelines.bin(LAS after a long session) reaches the title with no hang, and thepipeline_wait_uscounter stays low. Compare first-room load time against the previous binary. - Controller applet player counts (
runtime/src/services/applet.c). Check the new log linescontroller support: input storage N size ...in a game that shows the applet: one storage should be about 0x21C or larger, andgame askedshould then show the real counts (before:1..0). Open question, not changed: libnx reads the result as 0xC bytes (player_count,selected_id,result); the runtime returns 8. If a game reads 0xC, the storage read fails or returns garbage. (applet.cusesstrlcpy, so it only builds against macOS libc; that is fine for this project.)
3. Review notes on macOS-only code (not changed; for you to judge)¶
bundle::codesignuses--deep, which Apple deprecated for signing. It works for ad-hoc signing; signing the nested executables explicitly (runtime, then launcher, then the bundle) is the supported way if it ever starts failing.bundle::find_tooltakes a prebuiltnapple-runtimefrom the checkout without checking it is newer than its sources, so a stale runtime can be packaged.runtime/Makefilealso links../frontend|input|audio/lib*.awithout building them: runmake -C input,-C audio,-C frontendfirst on a fresh clone (these libraries are no longer in git).util::clean_stale_stagingtreats any live process with the same pid as the owner. Harmless (a stale directory is kept until later).Info.plisthas noNSMicrophoneUsageDescription. The games requestaudin:u; if the runtime ever opens the microphone, macOS will deny it.