Expand dat coverage and verify types with objdiff samples - #3588
Merged
Merged
Conversation
See tools/dat-cli/README.md. The walk now reads every archive, including the packed Pl??AJ.dat animation files, and types 99.5% of their public symbols. Symbols the loaders don't record, because their names are built at runtime, are typed by name patterns in config/GALE01/dat_symbols.txt (fighter animations, the HSD exporter's *_joint/*_matanim_joint/... names, textures and palettes as byte arrays, SISLib text, stage parameters, scenes and Kirby's copy abilities). New annotations cover what C types can't: DAT_NULLTERM lists (also on typedefs, for nested ones like the envelope lists), DAT_SCRIPT command streams (fighter action scripts, with lengths from the game's own table), DAT_EXTENT on pointers, and DAT_TYPE on typedefs. `melee-dat symbols coverage` reports how many relocations the walk explains (91.5%) and classifies the rest: gaps where a type is missing or wrong, data trailing a typed object where nothing points, and data nothing references at all. It can group them by archive, by the object they follow or by untyped field, and writes JSON shaped like objdiff's report.json. `melee-dat samples` checks the types themselves. It picks one instance of each type, and of each variant its tagged unions choose, then writes the instance's bytes as a target object and C initializers generated from the current types, compiled with the game's MWCC command. objdiff compares them, so a pointer typed as an integer, data in padding or a layout MWCC disagrees with shows up as a mismatch. Everything is generated under build/GALE01/dat, which is an objdiff project. All HSD and SDK samples match; one item type doesn't yet. The DWARF build now compiles aurora's headers in their console layout rather than TARGET_PC, which had made GXBool an int and grown GXTexObj and GXTlutObj. dat_macros.h fills in the GX vertex functions aurora's console branch lacks, until they're upstreamed. Fixed along the way: stage touch-line callbacks return hitbox data (lbColl_80008D30_arg1), not DynamicsDesc; Kirby's copy table is one entry per FighterKind, so every hats[] read was a fighter off, and each copy now has a struct; ftData_x20.x0 is the shield's root joint; FigaTrack has a byte at +7; HSD_RObjDesc_u lists a pointer member first so C initializers can hold every variant. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ribbanya
marked this pull request as ready for review
September 30, 2026 13:27
ribbanya
added a commit
to ribbanya/melee
that referenced
this pull request
Sep 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
See
tools/dat-cli/README.md.The walk now reads every archive, including the packed
Pl??AJ.datanimation files, and types 99.5% of their public symbols. Symbols the loaders don't record, because their names are built at runtime, are typed by name patterns inconfig/GALE01/dat_symbols.txt(fighter animations, the HSD exporter's*_joint/*_matanim_joint/... names, textures and palettes as byte arrays, SISLib text, stage parameters, scenes and Kirby's copy abilities). New annotations cover what C types can't:DAT_NULLTERMlists (also on typedefs, for nested ones like the envelope lists),DAT_SCRIPTcommand streams (fighter action scripts, with lengths from the game's own table),DAT_EXTENTon pointers, andDAT_TYPEon typedefs.melee-dat symbols coveragereports how many relocations the walk explains (91.5%) and classifies the rest: gaps where a type is missing or wrong, data trailing a typed object where nothing points, and data nothing references at all. It can group them by archive, by the object they follow or by untyped field, and writes JSON shaped like objdiff'sreport.jsonor Markdown tables like this one:DbEfGmGrIfIrItLbMnNtPdPlSdSmTmTyVimelee-dat sampleschecks the types themselves. It picks one instance of each type, and of each variant its tagged unions choose, then writes the instance's bytes as a target object and C initializers generated from the current types, compiled with the game's MWCC command. objdiff compares them, so a pointer typed as an integer, data in padding or a layout MWCC disagrees with shows up as a mismatch. Everything is generated underbuild/GALE01/dat, which is an objdiff project. All HSD and SDK samples match; one item type doesn't yet.The DWARF build now compiles aurora's headers in their console layout rather than
TARGET_PC, which had madeGXBoolanintand grownGXTexObjandGXTlutObj.dat_macros.hfills in the GX vertex functions aurora's console branch lacks, until they're upstreamed.Fixed along the way: stage touch-line callbacks return hitbox data (
lbColl_80008D30_arg1), notDynamicsDesc; Kirby's copy table is one entry perFighterKind, so everyhats[]read was a fighter off, and each copy now has a struct;ftData_x20.x0is the shield's root joint;FigaTrackhas a byte at+7;HSD_RObjDesc_ulists a pointer member first so C initializers can hold every variant.