Skip to main content

Module layout_codec

Module layout_codec 

Source
Expand description

Per-layout-tag encode/decode dispatch for the layout-specific fields section.

Wire formats per layout tag (spec § Layout-Specific Fields):

  • 0x01 (RowMajor), 0x02 (ColMajor): no payload
  • 0x03 (Strided): strides int64[rank]
  • 0x04 (Tiled): tile_shape u64[rank], outer_layout u8, inner_layout u8, _reserved u8[2], then conditionally outer_strides / inner_strides / inner_tiled
  • 0x05 (Morton): morton_bits u32[rank]
  • 0x06 (COO): nnz u64, is_sorted u8, _reserved u8[7]
  • 0x07 (CSR): nnz u64, _reserved u8[8]
  • 0x08 (CSC): nnz u64, _reserved u8[8]
  • 0x09 (CSF): nnz u64, mode_order u32[rank], _reserved u8[8]
  • 0x0A (BlockPaged): see § BlockPaged field table below
  • 0x0B (Composite): composition_rule u8, combine_op u8, _reserved u8[2], member_count u32
  • 0x40 (Hilbert): hilbert_order u32, hilbert_rank u32
  • 0xF0–0xFE (PrivateExtension): extension_layout_id u64, extension_data_length u32, extension_data bytes[len]