Dashboard › opencode-lore › Distillation
Distillation
ID: f864dfae-9c63-46f1-9634-a8e8204beb6b
Generation: 0
Tokens: 694
R_compression: 5.510
C_norm: 0.000
Archived: No
Created: 2026-09-16 14:53:12
Source IDs:
["lore_tm_v1_RUesAMtkEmBhob4ApyxhVWgWWhDvMyZWT29LyUM8EPk","lore_tm_v1_UrOY59pO14dWpIBsRcJkGKPC6STIzxp1l-UJVTe2CU0","lore_tm_v1_U9VB1VuaSFRMwTbA9ZpceH2PPX9O9VoM0qmsV1GRRts"]
Observations
Date: September 16, 2026
- 🔴 (13:25) User stated the WASM heap never shrinks: after the first oversized allocation grows the heap, every smaller retry in the same worker also fails; real recovery requires replacing or respawning the worker.
- 🔴 (13:25) User stated native ONNX Runtime load-error classification must be narrowly scoped so an unrelated resolution error, such as a missing model file, is never misclassified.
- 🔴 (13:25) User stated formatted-input objects and other later arguments in model errors never match the relevant classifier patterns; classification must inspect only the leading string.
- 🔴 (13:25) User stated indiscriminately treating model parse failures as corruption can cause a
purge→redownload→fail→purge loop that never converges and hammers the Hugging Face Hub.
- 🔴 (13:25) User stated the SEA path uses native ONNX Runtime via
__LORE_ORT_BINDING_PATH__ and never sets WorkerInitData.forceWasm; forceWasm is set by the main thread only when respawning after a native worker posts init-needs-wasm.
- 🔴 (13:25) User documented native-to-WASM fallback behavior across
packages/core/src/embedding-worker.ts, packages/core/src/embedding-worker-types.ts, and packages/core/src/embedding/local.ts: forceWasm defaults to false, a native worker can post { type: "init-needs-wasm", error: msg }, the main thread sets this.forceWasm = true, and respawnForWasm() starts a fresh worker/module graph that skips native ONNX Runtime.
- 🔴 (13:25) User stated
embedding-worker-types.ts is imported by both worker and main-thread sides and must remain free of runtime dependencies; error predicates are canonical there but inlined in packages/core/src/embedding-worker.ts to keep the worker self-contained.
- 🔴 (13:25) User documented that the main thread must reject and remove the pending request before
respawnForWasm() re-submits work, preventing pending requests from being lost or duplicated during the native-to-WASM transition.
- 🔴 (13:25) User stated corruption healing should purge the cached model and retry download only once, only when the model is not vendored and on-disk validation indicates genuine corruption; an intact model with a native-binding parse failure should be retried without purging or should trigger WASM fallback.
- 🔴 (13:25) User documented ONNX file validation: a candidate file is considered structurally plausible only when
sizeBytes >= MIN_ONNX_FILE_BYTES and its first byte is 0x08, the leading ONNX/protobuf header byte; the expected intact model is approximately 137 MB.
- 🔴 (13:25) User stated native ONNX Runtime inference threads are selected on the main thread via
nativeIntraOpThreads() and passed to the raw-TypeScript worker as WorkerInitData.intraOpThreads.
- 🔴 (13:25) User documented embedding-worker queue behavior: high-priority work is inserted after the last existing high-priority item, preserving FIFO order within the high-priority class; queued requests are processed one at a time because ONNX inference is synchronous.