VKNN 1.3.0
1.3.0 — engine memory-safety & robustness hardening
No new models or UI: this release rebuilds the on-device engine with a full memory-safety and robustness pass and re-verifies every model class on-device. Every change is behaviour-preserving for valid inputs — the new guards fire only on malformed / corrupt / error paths, or fix an alignment/UB issue that leaves the computed value unchanged — so existing model outputs are unchanged.
Hardening (#33)
A whole-engine audit (Vulkan + CPU backends, core runtime, ONNX import, DMA-BUF examples) for memory leaks and Coverity-class defects, fixing 16 confirmed issues at the root:
- Out-of-bounds / overflow: an unaligned fp16 weight decode (undefined behaviour, a fault on strict-alignment targets); an int64 overflow in the ONNX external-data range check; a memcpy sized by a negative element count; unchecked lengths in the ONNX wire reader; an out-of-range ScatterND write/read; unbounded allocation from untrusted
.vxmcount fields; and out-of-range quantized side-tensor / bias / slope copies. - Vulkan handle lifetime: fail fast on a device without
VK_KHR_push_descriptorinstead of a null call; free command buffers on the exception path and on segment teardown; rewrite the tuning cache via a temp file + atomic rename with a checked write. - DMA-BUF examples: normalise
MAP_FAILEDand clean up fds/mmaps on every error path.
Verification
Re-verified on-device on two phone-class GPUs:
- CNNs (ResNet-50, MobileNetV2, EfficientNet-B0, DenseNet-121, MNASNet, ShuffleNet V2): cosine ≥ 0.9999 vs golden, PSNR 61–83 dB, 0 CPU fallback.
- YoNoSplat 8-view encoder: all six 3D-Gaussian outputs cosine ≥ 0.9999, PSNR 65–81 dB, 0 fallback.
- Qwen2.5-Coder 0.5B (int8): clean on-GPU decode, 0 fallback.
- Host unit tests pass; the memory-leak detector and the Address/UndefinedBehaviour sanitizers are clean (the previously-reported misaligned-load UB is gone).
Test output is also quiet by default now (#34): the negative-path diagnostics no longer bury the test log — run vknn_tests --vknn-log to see them when diagnosing a failure.
APK: vknn-demo-1.3.0.apk (arm64, debug-signed).