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.
This should (hopefully!) be the last iteration of the cartridge format until stable release. For the previous iteration I was thinking of adding streaming support in LJT, but that turned out to make the format too complicated for my taste (LJT works better with small messages, just like Protobufs), so I'm backtracking on that and just making the format composed of blocks that are handled outside of LJT.
The new format has a rarely-changing statically-sized header which provides slices for the metadata and cartridge data portions, as well as the minimum kernel version required to decode it (this is useful to provide better error messages). It also includes signature blocks for the upcoming signed cartridges work. Decoding metadata can then be made fairly cheap by only reading the necessary amount of bytes in memory. And decoding files can be made memory friendly by not requiring the entire cartridge to be loaded in memory at once. Neither of those memory optimisations are done in this patch—they'll be a follow up work before stable release.
Cartridge v4 is still supported, but deprecated. Kart tooling is not going to be generating it anymore, but older cartridges will still be able to be loaded in the console.