After a model loads, stateLoadFile on a path that does not exist aborts the Wasm core instead of rejecting:
await bridge.stateLoadFile('/does_not_exist.bin', 512);
// main thread: RuntimeError: Aborted(undefined). Build with -sASSERTIONS for more info.
// worker: Error with the same text, and the bridge moves to the main thread for the session
It behaves the same on v0.1.44 and v0.1.47, in main-thread and worker modes, on wasm32 and wasm64.
llamadart_webgpu_state_load_file (src/llama_webgpu_core.cpp:1652 at 64ba825) passes the path straight to llama_state_load_file. Its own failure branch, which returns -5 with "Failed to load llama.cpp state file…", is never reached.
This matters because Web state paths are virtual and do not survive a page reload. So loading a path saved before a reload hits this.
Expected: a missing file rejects with an error, for example by checking that it exists first and returning a new code, and leaves the runtime usable.
Found while validating the bridge pin bump in leehack/llamadart#620.
After a model loads,
stateLoadFileon a path that does not exist aborts the Wasm core instead of rejecting:It behaves the same on
v0.1.44andv0.1.47, in main-thread and worker modes, on wasm32 and wasm64.llamadart_webgpu_state_load_file(src/llama_webgpu_core.cpp:1652at 64ba825) passes the path straight tollama_state_load_file. Its own failure branch, which returns -5 with "Failed to load llama.cpp state file…", is never reached.This matters because Web state paths are virtual and do not survive a page reload. So loading a path saved before a reload hits this.
Expected: a missing file rejects with an error, for example by checking that it exists first and returning a new code, and leaves the runtime usable.
Found while validating the bridge pin bump in leehack/llamadart#620.