From e6aedafb4ecf39f88461e605d94a3e27d5ed9414 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 06:26:47 +0000 Subject: [PATCH 1/2] Initial plan From 104fc667383e05e338d92b4af677050c271b13e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 06:31:08 +0000 Subject: [PATCH 2/2] fix: add seqLen < 1 and hiddenDim < 1 guards to quantiseAndSend Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com> Agent-Logs-Url: https://github.com/devlux76/q2/sessions/6abf842b-add1-42e8-b3f7-5a6e525a3b75 --- src/worker.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/worker.ts b/src/worker.ts index 4a86999..1107337 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -281,6 +281,14 @@ async function quantiseAndSend( hiddenDim: number, dtype: EmbeddingMsg['dtype'], ): Promise { + if (seqLen < 1) { + workerLog('warn', 'quantiseAndSend: seqLen < 1; skipping Q² quantisation', { seqLen }); + return; + } + if (hiddenDim < 1) { + workerLog('warn', 'quantiseAndSend: hiddenDim < 1; skipping Q² quantisation', { hiddenDim }); + return; + } const n = hiddenDim; const dtypeId = DTYPE_TO_Q2[dtype] ?? Q2_DTYPE_FP32; try {