#!/usr/bin/env python3 """Independent pinned Python pack oracle versus the native Rust CLI, CPU only.""" import contextlib import hashlib import io import json import os from pathlib import Path import struct import subprocess import sys import tempfile REPO = Path(__file__).resolve().parents[1] sys.path.insert(0, str(REPO / 'engine/strata/tools')) import iq_pack # Existing oracle, unchanged; numpy is test-only. def string(s): b = s.encode() return struct.pack('']), ('tokenizer.ggml.merges', ['a b'])]: fields.append((k, 9, struct.pack('': 3} assert (output / 'tokenizer/merges.txt').read_text() == 'a b' assert [p.read_bytes() for p in paths] == source_before before = (output / 'dense.bin').read_bytes() run(paths, output, ok=False) assert (output / 'dense.bin').read_bytes() == before # Failed preparation must publish no output, even after partial dense writes. source = root / 'failure.gguf' cases = [] t = fixtures(); t[0] = (*t[0][:3], struct.pack('