Skip to content

2026-10-26 nx-kernel: kernel / thread / input / service rows from the nxnative review

Branch claude/nx-kernel-2026-10-26-nx (Mac, session cut short by the user: wrapped up early).

Done (tested = host/unit test passes; verified = ran)

Row Result
K3 same-core handoff Was different (the caller ran on until its next svc, racing the woken thread). Fixed: waking/starting a better-priority thread pinned to the caller's core reserves that core for it and the caller yields it at its svc exit (core_handoff_note, g_core_resv in threads.c). Tested: runtime/tests/host/test_kernel_sched.c (better-priority peer finishes its work before SignalToAddress returns; equal-priority peer does not).
K4 yield Not needed: ours has no back-off (hands the core to an equal-priority waiter, else sched_yield). Tested: 20000 yields in ~4 ms; equal-priority handoff. ACNH load time on the ac-render build not measured.
K5 SleepThread Fixed: 3/4-of-remaining steps. Measured SleepThread(33 ms) mean 33.01 ms vs 35.84 ms with the old path (same test, same Mac). 30 Hz title pacing itself not measured.
K6 FreeThreadCount 96 minus live threads (threads_live_count). Tested.
K8 ideal core -3 Decision: kept ideal moves into the new mask (lowest set bit) instead of InvalidCombination (nxnative docs: Horizon moves it). Explicit ideal outside mask still InvalidCombination. Tested.
K7 stale doc Not done (docs/runtime-services.md untouched).
K2 Not verified: WaitForAddress type 3 is absent in this base (threads.c still rejects type 3); ac-render's branch is said to own it. K1 (SignalToAddress type 2 writes value-1, nxnative says value-2) also still present; not changed.
S6 HID rings now start full of idle entries with consecutive sampling numbers (hid_shm.c); napple_input_shake() added (3 cycles of 5 Hz, 4 G on player 1); tests updated/added. No key bound to shake (frontend not mine). Six-axis per controller already existed.
S5 Per-title NPDM services with no host implementation (script on NPDM vs registered names): LAS and SMO: banana bsdcfg htc htc:tenv htcs nfc:mf:u ntc pcm (+ nim:eca for LAS); ACNH 3.0.3 adds mnpp:app ngct:u nim:eca notif:a npns:u. Added offline stand-ins for npns:u, notif:a, mnpp:app, ngct:u, nim:eca (services/push.c, command ids are a generous range, unverified). 60-70 s headless runs of LAS, SMO and ACNH 3.0.3 hit no refusals other than the optional vi:s/vi:m/pctl:* (expected), strict and NAPPLE_IPC_LENIENT=1 alike. MK8D not run.
S9 60 s headless NAPPLE_PERF_LOG=1: LAS fps min 46.8 / mean 50.7 / max 53.8; SMO min 41.7 / mean 50.2 / max 51.3 (11 samples each; maxgap includes load). MK8D not measured; timescale.c not changed or compared with nxnative's frame-rate doc.
## Not done
S3 (device vs account save with MK8D), R7 memory budget table, K7 doc, MK8D runs, K2/K1 (see above).
## Gates
make -C runtime test test-services 34/34 suites ok (run before the S5 commit; test_svc_push passes alone); make -C runtime test-host all ok; make -C input test ok; LAS and SMO 45 s headless exit 0, 0 crash (re-run for 60 s after the K-changes: same). make -C gfx test and cargo test --workspace not run (paths untouched). Not re-run after the S5 commit: full runtime test suite and the LAS/SMO boots.