Skip to content

dat: per-archive rebuilds, complete flags, hoist dat types to TU headers - #3594

Merged
ribbanya merged 1 commit into
doldecomp:masterfrom
ribbanya:pr/dat
Sep 30, 2026
Merged

ribbanya merged 1 commit into
doldecomp:masterfrom
ribbanya:pr/dat

Conversation

@ribbanya

@ribbanya ribbanya commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator
  • Per-archive type dependencies: samples types hashes the types each archive's roots reach and rewrites the hash only when it changes, so a header change rebuilds only the archives that use it (a stage type: the 71 Gr units, in 13 s).
  • objdiff complete for units whose types explain the whole file: every relocation, every public symbol, no walk issues (49 of 765).
  • Dat types declared in .c files are hoisted into their TU headers, so their data can be sampled; types unhoisted lists what's left (none). ftLoadCommonData, plLoadCommonData and the menu data tables are struct tags, since each shares its name with its archive symbol.
  • Coverage: scene and stage model-group animation/light lists are DAT_NULLTERM, the stage model group's fields are named, and the debug and sound test name tables are sized (91.5% -> 95.0% of relocations explained).
  • types duplicates finds records defined twice; ftData_x38 is merged into AbsorbDesc.
  • Archive externs: named slots Melee's loader sets to NULL. The walk counts them as pointers, and the samples relocate them to their names.
  • Generated headers group declarations as Samples, Externs and Elided; data that isn't written as C is a sized DatBlob array.

13564 of 13566 samples match, as before; the DOL still matches.

- Per-archive type dependencies: `samples types` hashes the types each
  archive's roots reach and rewrites the hash only when it changes, so a
  header change rebuilds only the archives that use it (a stage type: the
  71 Gr units, in 13 s).
- objdiff `complete` for units whose types explain the whole file: every
  relocation, every public symbol, no walk issues (49 of 765).
- Dat types declared in .c files are hoisted into their TU headers, so
  their data can be sampled; `types unhoisted` lists what's left (none).
  ftLoadCommonData, plLoadCommonData and the menu data tables are struct
  tags, since each shares its name with its archive symbol.
- Coverage: scene and stage model-group animation/light lists are
  DAT_NULLTERM, the stage model group's fields are named, and the debug
  and sound test name tables are sized (91.5% -> 95.0% of relocations
  explained).
- `types duplicates` finds records defined twice; ftData_x38 is merged
  into AbsorbDesc.
- Archive externs: named slots Melee's loader sets to NULL. The walk
  counts them as pointers, and the samples relocate them to their names.
- Generated headers group declarations as Samples, Externs and Elided;
  data that isn't written as C is a sized `DatBlob` array.

13564 of 13566 samples match, as before; the DOL still matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ribbanya ribbanya added tooling ai-assisted Utilizes a LLM to do the heavy lifting portability Improves non-matching builds labels Sep 30, 2026
@ribbanya
ribbanya marked this pull request as ready for review September 30, 2026 22:53
@ribbanya
ribbanya merged commit 772e531 into doldecomp:master Sep 30, 2026
10 checks passed
@ribbanya
ribbanya deleted the pr/dat branch September 30, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Utilizes a LLM to do the heavy lifting portability Improves non-matching builds tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant