Commit c7375a6
quantcpp 0.8.1 hotfix: kv_compress=0 default + skip dylib cross-heap free
Two real bugs found via end-user simulation testing on PyPI 0.8.0:
1. **kv_compress=1 default aborts on Llama models.** quant.h's UNIFORM_4B
KV path is broken for Llama-3.x and SmolLM2 (Apr-6 snapshot). Default
changed to kv_compress=0; non-zero values warn and fall back. Real fix
waits on a fresh quant.h regen against the v0.8.0+ multi-file source
(tracked as v0.8.2 / WASM SIMD un-stub work).
2. **libc.free(ptr) on quant_ask result aborts.** The string is allocated
inside libquant.dylib's malloc heap; calling ctypes.CDLL(None).free on
it crashes on macOS arm64 because Python's libc handle resolves to a
different malloc zone than the dylib. Hotfix: skip the free, accept a
~65 KB leak per ask() call (released by quant_free_ctx). Tracked: add
quant_free_string(void*) wrapper to quant.h in v0.8.2.
Verification: clean venv `pip install dist/quantcpp-0.8.1.tar.gz` →
Model("smollm2.gguf").ask("Hello") returns a real string and exits
cleanly. Zero abort.
PyPI 0.8.0 will be yanked since the most common usage path
(Model("file.gguf").ask("question")) was broken.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent b49820d commit c7375a6
2 files changed
Lines changed: 30 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| |||
139 | 159 | | |
140 | 160 | | |
141 | 161 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
148 | 169 | | |
149 | 170 | | |
150 | 171 | | |
| |||
0 commit comments