Vixen
02b45cc4
csharp
public static class CompiledLibraryFormat

The .rvnlib container: a magic number, a version, a payload length, and the whole library as JSON.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

All JSON, unlike .rvnfx, and for the same reason that format keeps its header in JSON: a shipped artefact should be inspectable without a bespoke viewer, and the schema will grow fields. .rvnfx appends its modules raw because SPIR-V is already compact binary and base64 would cost a third of its size for nothing. A library has no such payload — its bodies are structure, not bytes — so there is nothing to keep out of the JSON, and a diffable artefact is worth more than the space.

The length prefix is not redundant with "JSON runs to the end of the file". It is what makes a truncation report itself as a truncation rather than as a parse error a few thousand lines in, which is the same treatment .rvnfx gives a short module.

Every integer is little-endian, matching .rvnfx and SPIR-V.

Fields and properties (3)

  • public static ReadOnlySpan<byte> Magic

    Magic number: RVNLIB followed by 0x1A.

  • public const int Version

    Format version. Bump on any change a previous reader would misread; the reader rejects anything it does not know rather than guessing.

  • public const string Extension

    The conventional extension, so callers do not spell it themselves.

Used by (5)

  • CompileDriverVixen.Raven.Cli
  • CompiledLibraryReaderVixen.Raven
  • CompiledLibraryTestsVixen.Raven.Tests
  • CompiledLibraryWriterVixen.Raven
  • LibraryTreeTestsVixen.Raven.Tests