Host functions that return Result<Array<Float64>, String> (or any float array) currently have no WASM memory allocation helper to do so. The existing helpers are:
_alloc_result_ok_string — allocates a Result<String, String> Ok on the WASM heap
_alloc_result_err_string — allocates a Result<String, String> Err on the WASM heap
A parallel _alloc_result_ok_float_array helper is needed that:
- Allocates a float array header + payload on the WASM heap via the
alloc export
- Writes each
f64 element at the correct 8-byte-aligned offset
- Wraps it in a
Result Ok variant and returns the pointer
Blocked by this
- #371 —
Inference.embed returning vector embeddings as Result<Array<Float64>, String>
Scope
The helper lives in vera/codegen/api.py alongside the existing string allocators. The browser runtime (vera/browser/runtime.mjs) needs a matching JS implementation.
Host functions that return
Result<Array<Float64>, String>(or any float array) currently have no WASM memory allocation helper to do so. The existing helpers are:_alloc_result_ok_string— allocates aResult<String, String>Ok on the WASM heap_alloc_result_err_string— allocates aResult<String, String>Err on the WASM heapA parallel
_alloc_result_ok_float_arrayhelper is needed that:allocexportf64element at the correct 8-byte-aligned offsetResultOk variant and returns the pointerBlocked by this
Inference.embedreturning vector embeddings asResult<Array<Float64>, String>Scope
The helper lives in
vera/codegen/api.pyalongside the existing string allocators. The browser runtime (vera/browser/runtime.mjs) needs a matching JS implementation.