Tests and reference provenance

3ds_ipc executes real sessions/handlers against checked memory on both models, including forged PID replacement, PXI buffer directions, the handle limit, stub lists and moved handles on success and on refusal, malformed counts/descriptors, read-only, unmapped/misaligned/MMIO TLS, stale/duplicate handles, endpoint/handle exhaustion, rollback and non-resumable waits. ctr_swipc_dispatch is a generator-only ISO C fixture with deliberately test-local resource accounting; it checks declaration order, 64-bit/byte/PID layout, reply packing and failed-output rollback. ctr_swipc_validation rejects unsupported schemas, checks full-envelope bounds and pins unchanged legacy default output. Synthetic CIA pipelines execute real SVC/TLS request and blocked-wait paths through offline native AOT.

The optional supplied-title test preserves both earlier CPU reference boundaries and a third before APT:S lookup handling, then executes the genuine main path. The post-HLE comparisons script selected HLE and IPC effects: they validate CPU behavior, not independently hardware-correct kernel/service semantics. The runtime executes actual C handlers, never that script or a CPU interpreter. 3ds_services tests both models, APT state/buffer preflight, real resources, quotas/rollback, and PTM/HID/FS boundaries. 3ds_threads tests context/TLS preservation, waiter ownership, event/mutex/ arbiter wakeups, wait-all and no-peer blocking. A native synthetic CIA requires its worker to write shared RAM and signal main before main can exit successfully. A separate native CIA resolves and verifies a real extracted file through FSFILE. 3ds_filesystem independently decodes CTR metadata/UTF-16/hash chains, compares contents, forces on-demand IO and checks failed-read atomicity, unavailable resources, EOF/permissions/MMIO, handle/object caps and duplicate/close ownership. The unchanged NX tree/service/raw-image fixtures also run in CTR-only builds.

Reference facts: Azahar 68202bc4ff7edf9d7280ec0dcd6572b7cd1ae26e (and 987f18405073960622e1043bb44005989135c6e1 for F1's translation, stubs and GSP), core/hle/ipc.h, kernel/hle_ipc.cpp, kernel/svc.cpp, service/sm/{srv.cpp,sm.h}, service/fs/fs_user.cpp, service/apt/, service/hid/, kernel/{mutex,event,thread}.cpp (GPL-2.0-or-later), and libctru's APT startup protocol (see its own license). Service policy is a bounded HLE personality, not an independently hardware-validated full implementation. New C transport/services and generator extension are independent project code under GPL-3.0-or-later, retaining the shared SwIPC tool's provenance. No Azahar runtime/build dependency or title assets are included.


Made from docs/platforms/3ds/ipc.md at 69237645142c. GPL-3.0-or-later.