#203 as submitted stopped the shader split of Tears of the Kingdom with a TypeError: its 1,202 Cave/.../C.crbin.<hash>/*.quad files are a 4-byte hash (the one in their folder name), then a zstd frame, so they pass the gate, and on the length mismatch the error path took len() of None. The PR checked Wonder and Yoshi only; of the RomFS of 39 games on hand, only those files have a frame at +4. - unsized: a frame whose header records a size other than the prefix is not such a container and is read as it is, without decompressing it (frame_size). A frame that records none (Kirby's LZ4 frames) must decompress to exactly the prefix's size: the whole output is compared, where the PR's max_length cut a longer frame at the prefix and let it pass. - The dictionary handling is shared with unzs (zs_dict_id, unzs_dict). A dictionary ZDICTS does not have is still reported, not fatal, as in the PR: the ID may be any bytes after a magic at +4. - unityfs.text_assets: an object shorter than the two length fields, or one whose name padding leaves no room for the script's length, is left out instead of reading past its end (struct.error, which stopped the split). Checked: - Kirby and the Forgotten Land (base and update 1.1.0): 121 shaders before, 27,288 after (27,302 with the update), no [RED] line. 5,121 zstd frames record their size, equal to the prefix; 2,080 + 354 LZ4 frames record none and decompress to the prefix's size. The PR's "383 in lyt/" is 378. - Tears of the Kingdom: the full split exits 1 with #203 alone; with this commit its package and tables are byte-identical to main's, no [RED] line. - main's split and this branch's give byte-identical packages and tables on Monster Train 2, Ace Attorney Investigations Collection, AI: THE SOMNIUM FILES, nirvanA Initiative, BALL x PIT, Advance Wars 1+2, Brain Memory Training Academy (Unity 2017.4 to 6000) and Super Mario Bros. Wonder. - New test_size_prefixed_frames.py; test_unity_text_glslc.py covers short objects (fails on #238's unityfs.py). All of dm/tools/tests pass. - Not checked here: FINAL FANTASY CRYSTAL CHRONICLES (#238's game) is not on hand; Kirby has not been run.
Subsystem references
How the host meets each part of a Switch game, and every failure met so far, one entry per mechanism: symptom, cause, fix (file and function), the games it was found on (linked to their notes in dm/games/<id>/README.md). Start from the symptom index when you have a log line or a visible result; the workflows that lead here are in docs/agents.
| File | Covers |
|---|---|
| packing.md | NSP script, compressed inputs and build artifacts |
| rewriter.md | The NSO rewriter patch_nso.py: jump tables, exclusive windows, patch area reach, cuts and observation gates, functions without unwind entries, stack and system registers, relocations |
| memory.md | Guest layout, heap and application pool, virtual address memory and the alias region (the SDK's node area), engine allocators, mapping SVCs, running out of memory |
| threads.md | Thread creation and cores, address arbitration, yields and spin waits, events |
| services.md | SDK calls and system services: sm connections, names that changed between SDKs, file system and saves, add-on content, input, keyboard and applets, display and operation mode, accounts and network, settings and fonts, C library and time, modules |
| movies.md | The SDK's movie library: decoder lifecycle, output slots, native-texture output, demuxers and codecs, game movie players |
| audio.md | The audio renderer and its command lists by SDK, AudioOut and devices, codecs, timing |
| frame-rate.md | The host's frame step, engine frame limiters, present intervals and display rates, CPU cost |
| nvn-objects.md | NVN object sizes, memory pools, command memory, queues and syncs, CPU-written textures, NVN entry points |
| rendering.md | The replay on Metal: textures, passes and clears, blend / depth / stencil, vertex input, uniforms and ordering, conditional rendering; the Vulkan and OpenGL layers |
| shaders.md | Shader containers by engine, control sections and code, translation, bindings and handles, shaders compiled at run time, pipelines and caches |
| game-state.md | Saves, scripted state, and game behaviour that looks like a host bug but is not |
A new general finding goes into the file and section it belongs to, in the same form, with a line in the symptom index; a fact about one game goes into that game's note.