Dashboard › opencode-lore › Distillation
da117d65-5f75-44c4-812a-a4d883fd0162["lore_tm_v1_kKu9delW6OcNSWiRKGvexkJ9Vj1grqBtMASrAjDTyQg","lore_tm_v1_EZES84UMUqRXtuxrBBX1ZLIb81uEupP7fWsg2S7MD4Y","lore_tm_v1_Dy3kHnDeVP39opb0B1XMt5o3z2jkPCGdmG_qEInHGwY","lore_tm_v1_F1cayWk-ZZzfbX56Ex-_ZXGVKhSKxdYDo0Ymn8QiXRg","lore_tm_v1_5GfM67m93Tnd_sudE75T6hcjf1bQO6hM8CFtZW_4U4g","lore_tm_v1_y5G0AOuwAffMBX0CJznJXVN6qLc3JSzVLuGYmq5gzZ8","lore_tm_v1_5maObj6Lvmso9Y9qZ_sk3a2nfSztL1BmK5rKxUcZ_O8","lore_tm_v1_hEXP-XCL4Nq5bhoEgSHyPahoPDfdDOAOohhE7YsaRUo","lore_tm_v1_j3gNCZPoyNkimZDtkoqRlJ-Wg9yU_RROa5h99YyQC34"]
Date: Sep 17, 2026
resolveMemoryHeadroom always accepts finite Node headroom without a hard limit, including resolveMemoryHeadroom(0, undefined, 7 * GB) === 7 * GB and finite 7 * GB Node headroom when host/cgroup inputs are Number.NaN.clampFreeToContainerLimit never raises the figure; it is monotonic and can only reduce memory use.NaN or Infinity.memoryModelEmbedCap never returns a value outside [MIN_EMBED_TOKENS, MODEL_MAX_TOKENS].6.72 GiB under a 12 GiB cgroup cap returns host free memory unchanged.resolveMemoryHeadroom tests include resolveMemoryHeadroom(12 * GB, 7 * GB, 23 * MB) === 23 * MB and resolveMemoryHeadroom(1 * GB, undefined, 2 * GB) === 1 * GB.4948, rather than MODEL_MAX_TOKENS (8192).1.43× (cap / 0.7) when memory permits, never steps downward, never exceeds the WASM ceiling, and never reaches or exceeds a known-bad cap.knownBad - 1 as a hard upper bound; knownBad only caps and never raises a trusted lower learned cap, while knownBad = 0 means none has been learned.desiredEmbedPoolSize to return 1 when free memory cannot fit a second worker budget, return DEFAULT_MAX_EMBED_POOL for 64 * GB, cap desiredEmbedPoolSize(1024 * GB, 100) at EMBED_POOL_ABS_MAX, and honor an explicit ceiling of 1 for desiredEmbedPoolSize(1024 * GB, 1).2 failed | 122 passed (124) across 3 test files: packages/core/test/embedding-cap.test.ts failed 1 of 62 tests, and packages/core/test/embedding-pool-memory.test.ts failed 1 of 5 tests.packages/core/test/embedding-cap.test.ts:102 failed because resolveMemoryHeadroom(0, undefined, 7 * GB) returned undefined instead of 7516192768 (7 * GB), violating the test "always accepts finite Node headroom without a hard limit".packages/core/test/embedding-pool-memory.test.ts:176 failed because the unreadable-soft-pressure scenario posted maxTokens = 4948 instead of MIN_EMBED_TOKENS = 256.OwnedRetirements<Owner> implementation in packages/core/src/owned-retirements.ts tracks active retirement promises in Set<Promise<void>>, deduplicates owners with WeakSet<Owner>, accumulates failures in errors: unknown[], and exposes active count through size.OwnedRetirements.track() records rejected-operation errors without allowing them to escape from the tracked wrapper, removes settled wrappers from active in .finally(), and returns the original operation promise.OwnedRetirements.retireOnce() starts at most one retirement per owner, converts synchronous throws from retire() into rejected promises, and returns null when that owner was already retired.OwnedRetirements.settle() supports optional timeoutMs and timeoutMessage, repeatedly waits until all active operations settle, uses an unref’d timeout, defaults the timeout error to "owned retirement did not settle before shutdown deadline", and throws AggregateError(this.errors, options.failureMessage) after settlement if failures were recorded.OwnedRetirements.reset() clears stored failures only when no operations are active; otherwise it throws "cannot reset owned retirements while active".packages/core/src/embedding-worker.ts sets maxTokens = init.maxTokens ?? 2048; the main thread owns this cap, every batch is truncated before inference, and OOM recovery lowers it by ×0.7 before respawning with a fresh heap.truncateTexts(texts, maxTokens) in packages/core/src/embedding-worker.ts skips tokenizer work for strings whose character length is at most maxTokens, encodes longer strings with { add_special_tokens: false }, and decodes only ids.slice(0, maxTokens) with { skip_special_tokens: true }."An error occurred during model execution:" or "Inputs given to model:"; all other console.error calls pass through, and the original logger is restored in finally.21K token values at the 8192-token cap; logSeverityLevel: 4 does not suppress this because the output comes from transformers.js rather than the ORT C++ logger.runInference() calls the pipeline with { pooling: "mean", truncation: true }, then applies Nomic post-processing in order: 1. layer normalization over the full hidden dimension (768 for Nomic v1.5), 2. Matryoshka truncation to target dimensions when needed, 3. L2 normalization.processEmbed() uses per-request req.maxTokens in preference to the worker default, truncates before a single inference attempt, and deliberately avoids in-process OOM retries because WASM linear memory does not shrink and may remain exhausted or fragmented.EMBED_OOM_EXIT_CODE = 75 without first posting a request error, allowing the main thread to respawn a fresh worker at a lower cap and resubmit the pending request.packages/core/test/embedding-pool-memory.test.ts documents the pool OOM regression from Onur’s report: the pool grew to N workers and each independently sized its token cap from roughly half of total free memory, causing aggregate host exhaustion; native ONNX OOM can result in an uncatchable SIGKILL, so ×0.7 backoff cannot protect against initial over-allocation.free / ceiling; 2. each request re-clamps the cap against current free memory rather than only construction-time memory.12 * GB constrained memory and Number.NaN available memory) to use MIN_EMBED_TOKENS, and also require unreadable cgroup soft-pressure accounting without a hard limit (constrainedMemory = 0, available memory Number.NaN) to use MIN_EMBED_TOKENS.memoryModelEmbedCap(6 * GB) to memoryModelEmbedCap(2 * GB) when free memory drops between the first and second requests.16 * GB, drops current free memory to 2 * GB, emits worker exit code EMBED_OOM_EXIT_CODE, and requires the fresh worker’s resubmitted request to preserve the original request ID while using memoryModelEmbedCap(2 * GB), which must be less than backoffEmbedCap(first.maxTokens).