Skip to main content

Crate hurray_inspect

Crate hurray_inspect 

Source
Expand description

hurray-inspect — CLI tool for inspecting Hurray files.

§Usage

hurray-inspect [--data[=hex|numpy]] <file>
hurray-inspect -                           # read from stdin

Auto-detects the file type:

  • HRRYFILE container (magic HRRYFILE): displays the file header, trailer, index, KV metadata section, and each tensor’s descriptor.
  • Raw tensor descriptor (magic HRRY): displays the descriptor fields.

With --data (or --data=numpy), tensor buffer values are printed after each descriptor in NumPy-style nested bracket notation. With --data=hex, the raw buffer bytes are printed as a hex table. For raw descriptors the buffer bytes must immediately follow the descriptor in the same file.

Macros§

read_le 🔒
Decode a fixed-width little-endian integer at element index idx.

Structs§

FReader 🔒
Sequential byte reader that tracks absolute file offsets.
Reader 🔒
Cursor over a byte slice bounded to limit bytes.
Row 🔒
A single row in the output hex table.

Enums§

DataMode 🔒
Error 🔒

Constants§

FILE_HEADER_SIZE 🔒
FILE_MAGIC 🔒
FLAG_HAS_INDEX_CRC32C 🔒
FLAG_HAS_KV_METADATA 🔒
FLAG_SORTED_INDEX 🔒
NUMPY_THRESHOLD 🔒
Maximum number of elements shown before truncation (matches NumPy default).
TRAILER_SIZE 🔒

Functions§

append_data_rows 🔒
Append rows displaying the tensor buffer buf in the chosen DataMode.
e8m0 🔒
Decodes a float8_e8m0 byte (power-of-two scale; 0x00/0xFF reserved → NaN).
file_flags_display 🔒
format_float 🔒
Format a single float as a string, adding a trailing . when the value has no fractional part (matching NumPy’s display convention).
format_numpy 🔒
Format tensor data as a NumPy-style nested-bracket string.
format_numpy_dim 🔒
Recursively build nested-bracket notation for dimension depth.
format_scalar 🔒
Decode and format the element at logical index idx from data.
hex_chunks 🔒
Split bytes into groups of at most per_line bytes and format each as a space-separated hex string.
hex_str 🔒
Format a byte slice as space-separated uppercase hex pairs (e.g. "48 52 52 59").
inspect 🔒
inspect_hrryfile 🔒
inspect_hrryfile_inner 🔒
kv_tag_name 🔒
layout_rows 🔒
layout_tag_name 🔒
le_f64 🔒
le_i64 🔒
le_u8 🔒
le_u16 🔒
le_u32 🔒
le_u64 🔒
main 🔒
micro_float 🔒
Decodes an OCP micro-float code (sign|exponent|mantissa, LSB→MSB) to f64.
parse_args 🔒
parse_kv_scalar 🔒
parse_kv_section 🔒
print_table 🔒
Print the 3-column hex table for rows to stdout.
quant_rows 🔒
Renders the decoded quantization descriptor: the 4-byte header plus the per-scheme fields (byte-accurate to quantization/*.md).
quant_scheme_name 🔒
read_f6_code 🔒
Extracts a 6-bit code at element idx from the 4-elements-per-3-bytes LSB-first packing (element-types.md § 6-bit packing).
read_pow2_code 🔒
Extracts a power-of-two sub-byte code (bits ∈ {1, 2, 4}) at element idx, LSB-first.
rows_from_descriptor 🔒
Build rows for a tensor descriptor.
run 🔒
section_row 🔒
sign_extend 🔒
Sign-extends a bits-wide two’s-complement code to i64.
tiled_rows 🔒

Type Aliases§

Result 🔒