Build dat samples in their own clang pipeline - #3590
Merged
Merged
Conversation
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
marked this pull request as ready for review
September 30, 2026 18:51
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.
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, inbuild/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 projectwritesobjdiff.jsonlast.compile_commands.jsongives clangd the same flags.MELEE_VERSION).types exportwrites a compact, deduplicated types file (postcard, 1.8 MB), so each step loads the types in milliseconds instead of reading the 160 MB ELF.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.configure.py, the root objdiff project andmelee-dtkknow nothing of dats;config/GALE01/dat.ymlloses its samples section.melee-dat-samplesis the CMake DWARF build with the samples on.HSD_RObjDesc_uis 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.