Skip to content

Testing

Raul Cardenas Montoya edited this page Sep 17, 2026 · 3 revisions

Testing

Wiki hero

cargo test --all-features

Integration tests

Test What it covers
tests/gguf_smoke.rs Builds synthetic GGUF bytes in memory (no external files): magic/metadata parse, stacked expert slices (3 experts, gate/up/down values, stacked_slice), per-expert tensors, rejects_bad_magicUnsupportedFormat, expert_out_of_rangeExpertOutOfRange
tests/safetensors_smoke.rs --features safetensors: header parse, manifest generation, MoE discovery
tests/mmap_gguf.rs --features mmap: load_gguf_mmap reader parity
tests/real_gguf.rs Path-gated real-file pilots (T1 large MoE pilots): #[ignore]d in CI; point at multi-GB weights on disk via ENGRAM_GGUF / ENGRAM_MODEL_DIR. ENGRAM_EXPECT_MOE=1 hard-fails when no MoE experts are discovered; ENGRAM_MOE_SAMPLES controls expert sampling

Unit tests

In-module coverage for cursor/layout helpers where present; 49 test functions in src/safetensors/tests.rs.

Example

examples/inspect_gguf.rs — CLI-style inspection of a real file when run with a path.


Last updated: September 16, 2026 Updated by: KAI Package tip reference: 3dea2c3 (main)

Clone this wiki locally