Skip to main content

Module lazy_entries_v3

Module lazy_entries_v3 

Source
Expand description

§Lazy Entry Loading — entries.bin v3 (MKE3)

v3 upgrades feature_len from u16 to u32, removing the 65535-byte feature-string limit present in v2.

§Format

[Header — 24 bytes]
  magic:        [u8; 4]  = "MKE3"
  version:      u32 (LE) = 3
  count:        u32 (LE)
  flags:        u16 (LE)  bit 0 = FEATURE_U32 (always set)
  reserved:     u16 (LE) = 0
  index_offset: u64 (LE)

[Entry Records — variable length]
  left_id:      u16 (LE)
  right_id:     u16 (LE)
  cost:         i16 (LE)
  surface_len:  u16 (LE)
  feature_len:  u32 (LE)   ← upgraded from u16
  surface:      [u8; surface_len]
  feature:      [u8; feature_len]

[Index Table — count × 8 bytes]
  offset_N: u64 (LE)

Structs§

LazyEntriesV3
Lazy-loading entry store backed by an MKE3 memory-mapped file.

Enums§

EntriesFormat
Detected entries.bin format version.

Constants§

ENTRIES_V3_MAGIC
Magic bytes identifying an MKE3 file.
ENTRIES_V3_VERSION
Format version stored in the header.
FEATURE_U32
Header flag bit: feature_len field is u32. Always set in v3.
HEADER_V3_SIZE
Size of the MKE3 file header in bytes.

Functions§

detect_entries_format
Read the first 4 bytes of a file and return the format.
migrate_v2_to_v3
Migrate an entries.bin file from v2 (MKE2) format to v3 (MKE3).
save_entries_v3
Write entries as an MKE3 file at path.