Repository navigation
An NDSR pack's record table is read one word at a time: a constant-data pair between two shaders' pairs hid every other shader of Ocarina of Time's agl_ndsr_vr.pck - #1388
Conversation
|
Thanks for this. I compared it with #1353, which fixes the same walk by reading the table as single 8-byte entries. Read only, on Ocarina of Time v131072's agl resource archive, running each branch's
The two sets are identical, shader by shader (same pack, offset, stage, code length, and a hash of the control section plus code), and neither drops a shader main has. Four entries are new: three distinct programs, one of them in both variable-ratio packs. Your description says 21 to 24 shaders in So the two PRs do the same thing for this game, and one of them can close; either is fine with me. I did not run a game, and I did not run the other games' NDSR packs (Donkey Kong Bananza, Splatoon Raiders, Star Fox). |
The entries of agl's NDSR packs are {offset, length << 4 | type} pairs, a shader's control pair followed by its code pair. ndsr_shaders read them as 16-byte records from +0x10 or +0x14, which holds for Donkey Kong Bananza's and Splatoon Raiders' packs. In The Legend of Zelda: Ocarina of Time (Switch 2, SDK 22.2.8) agl_ndsr_vr.pck puts one constant-data pair after each shader, so every other control pair started in the middle of a record and the walk read 21 of the pack's 24 shaders. The walk now moves one 4-byte word at a time: a word that points at an NVN2 control section and is followed by a control-typed length starts a shader's two pairs, any other word is stepped over. The aligned packs read the same as before (test_split_ndsr_pairs.py builds both shapes), and the reference entry on the pack's record start says what changed.
9c6194c to
c8aeba8
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qteK29T18U8p1c9LsVY8g
…ee NDSR keys and facts from the corrected split. The splitter algorithm remains behind DM
|
Thank you for tracking this down. The NDSR pack's shaders are all read on main now, so I'm closing this. Final checks on the rebased tree (full shader build, walks, regression) are still running, so please report anything you see. |
|
Thanks for the comparison. Your per-pack counts are the right ones: my 21 → 24 came from the split's totals (42,321 → 42,324 keys, which dedupe the program shared by the two variable-ratio packs), not from one pack. #1353 came first and reads the same four entries, so this one can close in its favour. For whoever merges either: the |
What and why
A small, general change to
shader_split.py'sndsr_shaders, found while bringing up The Legend of Zelda: Ocarina of Time (Switch 2,0400486024DEC000, update v131072, SDK 22.2.8) on a Mac. It is independent of #1299, which carries the game's profile; it does not touch the chain.Symptom: the split read 21 of the 24 shaders of the game's
agl_ndsr_vr.pck(inLib/agl/agl_resource.Nin_Ounce_NVN2.release.sarc.zs), with no red line.Cause: the pack's table is
{offset, length << 4 | type}pairs: a shader's control pair, then its code pair.ndsr_shadersread them as 16-byte records from +0x10 or +0x14, which holds for Donkey Kong Bananza's and Splatoon Raiders' packs. This pack puts one constant-data pair (type 9) after each shader, so every other control pair started in the middle of a record and was skipped.Change: the walk moves one 4-byte word at a time from +0x10. A word that points at an NVN2 control section and is followed by a control-typed length (type 0, 3 or 6, at least 0x48 bytes) starts a shader's two pairs; any other word is stepped over. A pack whose shaders' pairs start every record reads exactly as before, from either header size.
Reference entry: the existing The NDSR pack's record start says what changed and names the pack.
Checked
python3 -m unittest dm/tools/tests/test_split_ndsr_pairs.py(new: both pack shapes, the vertex / pixel pairing of the upscaler's graphics programs) anddm/tools/tests/test_docs.pypass.agl_ndsr.pckgives the same 43 as before,agl_ndsr_vr.pck24 instead of 21. Each new control section's+0x44code length matches the code the record names._vrpack there), so no picture or timing difference is claimed. Apple M3 Pro (18 GB), macOS 27.0.1, Xcode 27.2.scripts/regress.py: not run (no other local game builds on this Mac). Donkey Kong Bananza (040074A01BF12000), Splatoon Raiders (0400380020056000) and Star Fox (0400E88025B1A000) read NDSR packs: their packs' records start every 16 bytes, so their tables should split to the same keys, but a check by their owners before merging would be welcome.lint_python.py(no lint venv on this Mac).Docs
docs/reference/shaders.mdentry;python3 dm/tools/docs_symptoms.pywas run (the symptom line is unchanged, so the index did not change)