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]>
53 lines
6.1 KiB
JSON
53 lines
6.1 KiB
JSON
{
|
|
"grant": {
|
|
"id_hex": "3b1a5a9cbb781514cf751ba007e077e8083977b4f07b104d36ee904d928998c4",
|
|
"issuer": "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX",
|
|
"signature_hex": "69a2767b437d72fe525efe5cfbcba4868ec881165c977aada53b0f6537ad3d36fc26be24cb62eb5f8d14f786bdbcc068bbef74529613bba1e418cb0527683d0d",
|
|
"subject": "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH"
|
|
},
|
|
"receipts": [
|
|
{
|
|
"envelope_hex": "d284581fa201270458196469643a6578616d706c653a6a63702d7265666572656e6365a05901d2ae65747275737467636f6e74726f6c66616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a181e677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f38715642697948677665726469637465616c6c6f77686772616e745f6964784033623161356139636262373831353134636637353162613030376530373765383038333937376234663037623130346433366565393034643932383939386334687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a18646a6672616d655f6b696e6469746f6f6c2d63616c6c6b6a63705f72656365697074656a63702f3171656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a184658405a7be56b33956c069d4e23127baa7b090e5028b9704dff6ca5ac46da546534e667151f80d7d7a605bcc31ea2bb33ec971e3e8b8794f7248a18b34c33bc438509",
|
|
"signed_core_hex": "ae65747275737467636f6e74726f6c66616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a181e677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f38715642697948677665726469637465616c6c6f77686772616e745f6964784033623161356139636262373831353134636637353162613030376530373765383038333937376234663037623130346433366565393034643932383939386334687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a18646a6672616d655f6b696e6469746f6f6c2d63616c6c6b6a63705f72656365697074656a63702f3171656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a1846",
|
|
"verdict": "allow",
|
|
"wire": {
|
|
"action": "read",
|
|
"budget_remaining_uj": 70,
|
|
"budget_uj": 100,
|
|
"cost_uj": 30,
|
|
"energy_provenance": "HwShunt",
|
|
"frame_kind": "tool-call",
|
|
"grant_id": "3b1a5a9cbb781514cf751ba007e077e8083977b4f07b104d36ee904d928998c4",
|
|
"issuer": "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX",
|
|
"jcp_receipt": "jcp/1",
|
|
"resource": "0f7fb55cee93ab9777829608e851fa31e68e12db9dfc0a8026ad298314cf3f92",
|
|
"steward": "did:example:jcp-reference",
|
|
"subject": "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH",
|
|
"trust": "control",
|
|
"verdict": "allow"
|
|
}
|
|
},
|
|
{
|
|
"envelope_hex": "d284581fa201270458196469643a6578616d706c653a6a63702d7265666572656e6365a05901ebaf657472757374646461746166616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a01677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f3871564269794867766572646963746464656e79686772616e745f6964784033623161356139636262373831353134636637353162613030376530373765383038333937376234663037623130346433366565393034643932383939386334687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a18646a6672616d655f6b696e6469746f6f6c2d63616c6c6b64656e795f726561736f6e71756e747275737465642d636f6e74726f6c6b6a63705f72656365697074656a63702f3171656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a18465840f9f2fbdebec820c75f9257575f9c0c512d122aa52ce1cdcc7510a69282d327d59decf6f282542ad4f8e050670e1104e33ba4175b812900a90eee27ca1b110c0c",
|
|
"signed_core_hex": "af657472757374646461746166616374696f6e64726561646669737375657278386469643a6b65793a7a364d6b6f6e334e656364364e6b6b79666f476f48786964327a6e476335394c55334b376d756261526346624c664c5867636f73745f756a01677374657761726478196469643a6578616d706c653a6a63702d7265666572656e6365677375626a65637478386469643a6b65793a7a364d6b6f39685467674d776a535445614a615055664536747163793278765536426e4e713365336f3871564269794867766572646963746464656e79686772616e745f6964784033623161356139636262373831353134636637353162613030376530373765383038333937376234663037623130346433366565393034643932383939386334687265736f75726365784030663766623535636565393361623937373738323936303865383531666133316536386531326462396466633061383032366164323938333134636633663932696275646765745f756a18646a6672616d655f6b696e6469746f6f6c2d63616c6c6b64656e795f726561736f6e71756e747275737465642d636f6e74726f6c6b6a63705f72656365697074656a63702f3171656e657267795f70726f76656e616e63656748775368756e74736275646765745f72656d61696e696e675f756a1846",
|
|
"verdict": "deny",
|
|
"wire": {
|
|
"action": "read",
|
|
"budget_remaining_uj": 70,
|
|
"budget_uj": 100,
|
|
"cost_uj": 1,
|
|
"deny_reason": "untrusted-control",
|
|
"energy_provenance": "HwShunt",
|
|
"frame_kind": "tool-call",
|
|
"grant_id": "3b1a5a9cbb781514cf751ba007e077e8083977b4f07b104d36ee904d928998c4",
|
|
"issuer": "did:key:z6Mkon3Necd6NkkyfoGoHxid2znGc59LU3K7mubaRcFbLfLX",
|
|
"jcp_receipt": "jcp/1",
|
|
"resource": "0f7fb55cee93ab9777829608e851fa31e68e12db9dfc0a8026ad298314cf3f92",
|
|
"steward": "did:example:jcp-reference",
|
|
"subject": "did:key:z6Mko9hTggMwjSTEaJaPUfE6tqcy2xvU6BnNq3e3o8qVBiyH",
|
|
"trust": "data",
|
|
"verdict": "deny"
|
|
}
|
|
}
|
|
]
|
|
}
|