dat: sample each case once, show every piece of each archive, type elided data - #3628
Merged
Merged
Conversation
ribbanya
commented
Oct 5, 2026
Collaborator
…der per unit Samples are now chosen across every archive by a `samples pick` step: for each type and union variant, the fewest instances that together show every case its fields take anywhere in the game (pointers null, relocated, unrelocated or -1; float and integer classes; bitfields; nonzero padding), preferring instances the walk found clean. Each archive's choice is rewritten only when it changes. Sample-mode C goes from 12,130 samples (245k lines) to 347 (13k lines), and every unit is in objdiff, samples or not. MELEE_DAT_SAMPLES_ALL still samples everything. Elided data is declared as the type the walk reached it as, spelled as the pointers to it spell it (`Mtx`, `HSD_DisplayList[n]`, `u16[n]`), instead of `UNK_T`. `MtxPtr`, `Mtx44Ptr` and `ROMtxPtr` are redeclared with `DAT_TYPE` in dat_macros.h for the DWARF build, which uses aurora's SDK headers. Every piece of each archive outside the samples is now its own symbol in the target, and the base infers each piece the walk explains on its own, instead of only public symbols and data the samples point to, each with everything it reaches. So what's inferred no longer depends on what's sampled: units without samples show all their data, and 106 units are complete in both modes. Bytes a pointer says are bytes (texels, strings, keyframes) and command scripts up to their end command count as explained. Each unit's C is now `src/<unit>.h`, declaring the archive's public symbols, its samples and what they point to, and `src/<unit>.c` only for a unit with samples, instead of a header and source per root in a folder. A unit without samples links its base object from its inferred data alone. Clippy is in the dev shell, and its warnings in dat-cli are fixed. A union member condition that can't be evaluated now stops the search instead of falling through to a later member, so `ftData_Item` uses `DAT_IF(true)` as its catch-all. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ribbanya
marked this pull request as ready for review
October 5, 2026 01:53
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.