Skip to main content

Module format

Module format 

Source
Expand description

GPU tile format: header, tile, index, and footer structures

§File Layout

Offset 0:           GpuFileHeader (64 bytes)
Offset 64:          Tile 0 — TileHeader (32 bytes) + payload (padded to 128-byte boundary)
...                 Tile N-1
Offset X:           TileIndexHeader (8 bytes)
Offset X+8:         TileIndexEntry[0..N] (24 bytes each)
Offset X+8+24N:     GpuFileFooter (24 bytes)  ← last 24 bytes of file

Structs§

EngineVersion
Packed 8-byte semantic version of the producing engine.
GpuFileFlags
Bitfield flags stored in the GPU file header.
GpuFileFooter
Fixed 24-byte record at the very end of every GPU archive.
GpuFileHeader
Fixed 64-byte header at the start of every GPU-compressed archive.
TileFlags
Per-tile bitfield flags stored in the tile header.
TileHeader
Fixed 32-byte header preceding each compressed tile’s payload.
TileIndexEntry
One entry per tile in the trailing index.
TileIndexHeader
8-byte header immediately before the tile index entries.

Constants§

CGPU_MAGIC
CGPU magic bytes: ASCII “CGPU”
DEFAULT_SUB_STREAM_COUNT
Default sub-stream count: 32 (matches GPU warp width)
DEFAULT_TILE_SIZE
Default tile size: 64KB (65536 bytes)
ENGINE_VERSION_STR
Current engine semantic version (set at build time).
FORMAT_VERSION
Current format version. Files with a different version are rejected. Version 2: GDeflate encoding (replaces v1 LZ77).
TILE_ALIGNMENT
Alignment boundary for tile payloads (128 bytes for GPU memory coalescing)

Functions§

padding_to_alignment
Compute padding needed to align a size to the tile alignment boundary.