Commit cc8c92f
feat(inf-001): GGUF Parser — load any GGUF model, 20 tests
gguf_parser.zig (1162 lines):
- GGUF v3 binary format parser with ByteReader safe bounds checking
- All 13 GGUF value types: UINT8-FLOAT64, STRING, ARRAY
- GGMLType enum with block/type size for 30+ quantization formats
- Tensor info: name, dims, type, offset, element count, byte size
- Dequantization: Q4_0 (4-bit) and Q8_0 (8-bit) with f16-to-f32 scale
- Model config extraction from arch-prefixed metadata keys
- GGUFBuilder for constructing valid test buffers (round-trip)
- 20 tests: magic, sizes, bytes, reader, header, metadata, tensors, dequant
- build.zig wired: test-gguf-parser step
- Tech tree 48/56 (86%)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent dbaffc5 commit cc8c92f
3 files changed
Lines changed: 1179 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1869 | 1869 | | |
1870 | 1870 | | |
1871 | 1871 | | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
1872 | 1885 | | |
0 commit comments