Repository navigation
shader_split: read compressed Camelot NARC shader archives - #1155
Closed
thehobbit85 wants to merge 2 commits into
Closed
thehobbit85 wants to merge 2 commits into
thehobbit85 wants to merge 2 commits into
Conversation
Address the archive-reader portion of seedds#1131 using the contributed format description. Preserve shader pairs, validate compressed members and bound nested decoding with synthetic regression coverage. Co-authored-by: PikaMan80 <140806311+PikaMan80@users.noreply.github.com>
thehobbit85
force-pushed
the
codex/camelot-narc-reader
branch
from
November 4, 2026 06:49
9adb59a to
7d50c24
Compare
Owner
|
Thanks for this. I'm closing it because main gained its own NARC reader in b6dbb85, right after this branch's base, and the remaining gap turned out to be one condition in the split's prefilter, now on main as 4447be1. Your archive fixtures are adapted in Landed on top of that reader, this branch's check would run first and take every NARC. On synthetic archives, it found no shaders in members using The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Addresses the NARC archive-reader portion (part 2) of #1131. The issue stays open for vertex-stage ViewportMaskNV lowering and game validation; the movie decoder constructors are already on main.
Camelot archives store shader banks behind per-member compression, so scanning the stored bytes misses those shaders. Read BTAF/BTNF/GMIF sections and decode zlib, raw deflate, Camelot LZSS, stored and LZ4 members before using the existing shader readers. Preserve shader keys and vertex/pixel pairs, identify archives by magic rather than extension, and skip recognized texture/vertex-buffer payloads. Reject invalid ranges, truncated streams and inconsistent lengths; bound decoded bytes and nested archive work.
Adapted from PikaMan80's format description and decoder in the issue's supplied patch, with co-author credit. Synthetic regressions cover all eight codec tags, overlapping/extended LZSS references, corrupt archives, shared byte budgets, nested discovery and identical CLI outputs for compressed versus plain members. No game profile or generated game tables are included.
Checked
The latest validated head is
7d50c24fa46045d53c7f80bda4d1576a91f69952, rebased onto main019a822d. This update also carries the exact synthetic scheduler-test prerequisite from #1170 (3b4fcabb), which corrects the service-request fixture's host-dispatch timing assumption without changing production scheduling. The nullable-regex and Xcode fixture fixes are already on main (e556f7a1); obsolete #1157/#1164 prerequisite patches are not carried. The NARC feature patch and its co-author credit are preserved.Fresh validation on this integration:
make -C dm/host/tests GAME=010015100B514000 B=<scratch> preemptpasses both scheduling modes (98 PASS results); the same target withSAN="-g -fsanitize=thread -fno-inline"also passes both modes, with no TSan diagnostics. The native code and dependencies are byte-identical before and after the final issue-labeling-only main update.git diff --checkpasses. Stable patch IDs confirm the original NARC feature and Make service-request scheduler tests deterministic #1170 prerequisite are unchanged, and the difference from the CI agent's prepared tree is exactly the intervening upstream commits.These are local results; the replacement head still requires remote CI. No gameplay or full-game regression claim is added.
Initial NARC validation and remaining game/toolchain limitations
75e5ddd8:python3 -m unittest dm.tools.tests.test_split_narc dm.tools.tests.test_split_gzip dm.tools.tests.test_split_nesting dm.tools.tests.test_docs dm.tools.tests.test_nsp_chain dm.tools.tests.test_nsp_mac_app dm.gfx.tests.test_gfpak— 97 tests pass.test_xcode_workflow.pyfail because their fixtureSimpleNamespacelacksmodules_in; the same three failures reproduce in an exported copy of pinned main1d4b8e82.lint_python.pywith pinned ruff 0.17.2 and pyright 1.1.414: 392 findings against 391 recorded, with the same single finding on pinned main (dmsh_meshstage.py:101, optional regex result subscript). No additional finding from this diff; the baseline was not changed.[RED]rejections, no unexpected exceptions.make -C dm/gfx/tests GAME=010015100B514000 -j3 runbuilt the native test targets but stopped atcheck_t_alpha: the installed Xcode cannot execute its Metal compiler component. The broad gfx Python suite is likewise blocked (283 tests, 41 failing compiler checks, one compiler error, 56 skips).xcrun metal --versionindependently reports the missing component. No toolchain was installed for this change.git diff --check origin/main..HEADpasses. All PR states, issue links/comments, and patches of 27 potentially overlapping open PRs were checked before publication; no existing NARC solution was found.Games and limitations: no game/system files are available; no gameplay, full shader build or iOS-device validation is claimed. Mario Tennis Aces (
0100BDE00862A000) is directly affected and has no registered profile on this base. The new branch is selected only by NARC magic, so the game check was scoped to that title.scripts/regress.py check --games 0100BDE00862A000cannot run withoutREGRESS_ROOTandREGRESS_GAMES. Other games remain unchecked. Existing BNSH, GFPAK, SARC/Yaz0 and gzip paths have synthetic coverage above.regress.py impact origin/main..HEADreports:The broad rows come from the shared splitter rule; they are not gameplay results.
Docs
docs/reference/shaders.md(Compressed shader banks in Camelot NARC archives), linked issue [PATCH] Mario Tennis Aces (0100BDE00862A000): fix movie::Decoder C2 constructor hook, Camelot NARC shader extraction, and VS ViewportMaskNV lowering #1131, and regenerated the symptom index.docs/development.mdwith archive detection and extraction behavior.test_nsp_chainconfirms the existing chain header is current.