Skip to content

Build dat samples in their own clang pipeline - #3590

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

Copy link
Copy Markdown
Collaborator

The dat samples no longer go through dtk, the DOL or MWCC: the archives weren't built with MWCC, so matching them only needs a pipeline that compiles to the same bytes. They now build in their own CMake preset, dat, in build/GALE01/dat, which is also their objdiff project.

  • cmake/Dat.cmake: per archive, four ninja steps: slice the archive into a target object (samples slice), generate C from it (samples codegen), format it with the repository's .clang-format, and compile it with the DWARF build's flags. samples project writes objdiff.json last. compile_commands.json gives clangd the same flags.
  • The DWARF build is per game version (MELEE_VERSION).
  • types export writes a compact, deduplicated types file (postcard, 1.8 MB), so each step loads the types in milliseconds instead of reading the 160 MB ELF.
  • Samples are per archive and named as the archive names them (its public symbol, else x<OFFSET>). The generated C is a directory per archive with a header and source per root; a unit file includes the sources. Pointers between roots go through the headers' extern declarations.
  • Union objects are declared as the member their tag chose; generated comments are Doxygen.
  • configure.py, the root objdiff project and melee-dtk know nothing of dats; config/GALE01/dat.yml loses its samples section.
  • nix: melee-dat-samples is the CMake DWARF build with the samples on.
  • HSD_RObjDesc_u is back in its original member order: designated initializers don't need a pointer member first.

11237 of 11239 samples match; the two that don't are in TODO.md.

The dat samples no longer go through dtk, the DOL or MWCC: the archives
weren't built with MWCC, so matching them only needs a pipeline that
compiles to the same bytes. They now build in their own CMake preset,
`dat`, in `build/GALE01/dat`, which is also their objdiff project.

- `cmake/Dat.cmake`: per archive, four ninja steps: slice the archive into
  a target object (`samples slice`), generate C from it (`samples
  codegen`), format it with the repository's `.clang-format`, and compile
  it with the DWARF build's flags. `samples project` writes `objdiff.json`
  last. `compile_commands.json` gives clangd the same flags.
- The DWARF build is per game version (`MELEE_VERSION`).
- `types export` writes a compact, deduplicated types file (postcard,
  1.8 MB), so each step loads the types in milliseconds instead of reading
  the 160 MB ELF.
- Samples are per archive and named as the archive names them (its public
  symbol, else `x<OFFSET>`). The generated C is a directory per archive
  with a header and source per root; a unit file includes the sources.
  Pointers between roots go through the headers' extern declarations.
- Union objects are declared as the member their tag chose; generated
  comments are Doxygen.
- `configure.py`, the root objdiff project and `melee-dtk` know nothing of
  dats; `config/GALE01/dat.yml` loses its samples section.
- nix: `melee-dat-samples` is the CMake DWARF build with the samples on.
- `HSD_RObjDesc_u` is back in its original member order: designated
  initializers don't need a pointer member first.

11237 of 11239 samples match; the two that don't are in TODO.md.

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 18:51
@ribbanya
ribbanya merged commit 0e0e413 into doldecomp:master Sep 30, 2026
10 checks passed
@ribbanya
ribbanya deleted the pr/dat branch September 30, 2026 18:52
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