open-standards/jcp/LICENSE-SPEC
Transaction Science 7a72be5cd7 loader-gguf wave 39: Intel OpenVINO IR (.xml + .bin)
OpenVINO ships models as two sibling files:

  model.xml   topology + per-tensor (offset, size, dtype, shape)
  model.bin   raw weight blob; each Const layer's data
              lives at the offset+size declared in the XML.

This is the cleanest tensor-archive format of all the
ones the substrate has ingested so far — "raw bytes at
offset+size in a sibling file."

SCOPE — what wave 39 does

  Parse `.xml` streaming via quick-xml (already a
  workspace dep). Extract every `<layer type="Const">`'s
  `name` + `<data element_type=, shape=, offset=, size=/>`
  attributes. mmap the sibling `.bin`. Surface as:

    OvModel {
        xml_path, bin_path,
        net_name, ir_version,
        tensors:  Vec<OvTensorInfo>,
        bin_mmap,
    }

  OvTensorInfo { id, name, dtype, shape, bin_offset, bin_size }

  read_openvino_ir(path/to/model.xml) auto-resolves the
  sibling .bin (same basename + .bin extension). On load
  every Const layer's (offset, size) is bounds-checked
  against the .bin file length, so corrupt XML refusing
  to fit triggers OvError::BinOutOfBounds at parse time
  rather than at first slice.

  tensor_bytes(&t) returns Some(&[u8]) into the .bin
  mmap. The substrate primitive.

DTYPE COVERAGE

  All documented OpenVINO IR element types:
    f64 f32 f16 bf16
    i64 i32 i16 i8 i4
    u64 u32 u16 u8 u4 u1
    boolean string
    f8e4m3 f8e5m2 f8e8m0 f4e2m1
    nf4

  Case-insensitive parse. Unknown values pass through as
  Unknown(String) — same forward-compat strategy as the
  other readers.

SCOPE — what wave 39 does NOT do

  No operator graph execution. No edge / port traversal.
  No reshape / fuse pattern matching. JouleClaw has its
  own kernel suite.

NEW FILES

  crates/jouleclaw-loader-gguf/src/openvino.rs
  crates/jouleclaw-loader-gguf/examples/load_openvino.rs

  lib.rs: + pub mod openvino;
  Cargo.toml: + quick-xml workspace dep

TESTS (7 new)

  dtype_parse_round_trip                f32/F32/bf16/nf4/u1/f8e4m3/unknown
  dtype_element_sizes                   sub-byte sentinels
  synthetic_ir_round_trip               full XML→bin walk, 2 tensors
  missing_bin_sibling_returns_error     .xml without .bin
  out_of_bounds_offset_detected         .bin too small for declared size
  ir_with_no_const_layers_loads         empty model edge case
  malformed_shape_attribute_errors      "2,abc,3" rejected

  loader-gguf: 193 → 200 tests.

NEXT — Wave 40: document why TensorRT engines can't be
substrate-ingested (opaque NVIDIA binary, version-locked
to driver + arch).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-06-09 11:07:50 -04:00

30 lines
1.3 KiB
Text

Creative Commons Attribution 4.0 International
Copyright (c) 2026 Transaction Science, Inc.
This specification text and accompanying documents are licensed under the
Creative Commons Attribution 4.0 International License (CC BY 4.0).
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose,
even commercially
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the
license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor
endorses you or your use.
No additional restrictions — You may not apply legal terms or technological
measures that legally restrict others from doing anything the license
permits.
Full licence text: https://creativecommons.org/licenses/by/4.0/legalcode
────────────────────────────────────────────────────────────────────────
Reference implementations and software accompanying this specification, if
and when published in this directory, may be released under a separate
licence (typically Apache-2.0). Refer to the licence file alongside each
artefact.