Repository navigation
sampling: a reasoning budget of 0 bounds the think; a prefilled token cannot consume the forced end - #95
Conversation
… cannot consume the forced end With budget 0, the generation prompt's prefilled `<think>` moves the budget sampler from IDLE to FORCING, then the prefilled newline was accepted IN FORCING and advanced force_pos, so the sampler reached DONE without ever sampling the end tag and the model thought to its cap. Measured on 0d7dda6 (Qwen3.5-0.8B Q4_K_M, 2026-11-06): reasoning_budget_tokens 0 thought 400 of 400 tokens with empty content, with or without a json_schema; 1 was bounded. FORCING now advances only on the forced token, and a natural end tag accepted while forcing (a prefilled `<think></think>`) ends it, so a closed think is never forced a second time. Tests: the realistic budget-0 case (start, then the forced end) and the budget-exhausted case now feed the forced tokens as sampled; a new test covers budget 0 with the prefilled start and newline (end tag alone; message then end tag), a prefill that already closed the think, and budgets 1 and 3. Reverting the fix aborts the suite at 'activate immediately budget=0'. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
PASS on the logic at 6ad0dcb. Scope: Verified by reading:
Before merge, one receipt: please re-run your |
|
Full PASS at 6ad0dcb, with the live receipt I asked for. Cormac's probe on the IntelMac (Qwen3.5-0.8B): on 0d7dda6, budget 0 thinks to the cap with empty content; on 1782249 plus the fix, budget 0 gives empty reasoning and 94-token schema JSON, |
gguf.cpp:996 logs strerror(errno) but never included <cerrno>; it compiled only while another header pulled it in transitively. The WASM WebGPU build (emscripten) no longer does: ubuntu-webgpu failed on #95 with "use of undeclared identifier 'errno'" (it passed on #94, 2026-11-04). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
PASS carries to 46c6ee2. I verified the delta via |
…ger provides them transitively ubuntu-webgpu (emscripten) failed on #95 at gguf.cpp (errno), then at llama-graph.h:103 (getenv/atoi undeclared): the same build passed on #94 (2026-11-04), so the toolchain stopped pulling these headers in through others. Upstream ggml-org/llama.cpp master already includes them; this adds exactly the ones upstream has and the fork lacked (diffed per file over src/, common/, ggml/src, ggml/include): llama-graph.h, llama-mmap.cpp, llama-vocab.cpp <cstdlib>; llama-adapter.cpp <cerrno> <cstring>; common/jinja/value.cpp <cstdio> <cstdlib> <cstring>; common/common.h and common/build-info.h <cstdio>. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
|
PASS carries to d273091. I verified the delta via |
…ed runner exists Its runner is [self-hosted, Linux], which exists only upstream. In this fork it sat queued for 24 h on every PR and was cancelled, and a merge gate reads a cancelled check as a failure (#94, #95, #96). The fork's four self-hosted workflows (CI, Server, UI, UI Build) are disabled in the repo settings for the same reason; this job is called from the CPU workflow, so it gets a job condition instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…n line (#95 merged to the stale master) (#96) * sampling: a reasoning budget of 0 bounds the think; a prefilled token cannot consume the forced end With budget 0, the generation prompt's prefilled `<think>` moves the budget sampler from IDLE to FORCING, then the prefilled newline was accepted IN FORCING and advanced force_pos, so the sampler reached DONE without ever sampling the end tag and the model thought to its cap. Measured on 0d7dda6 (Qwen3.5-0.8B Q4_K_M, 2026-11-06): reasoning_budget_tokens 0 thought 400 of 400 tokens with empty content, with or without a json_schema; 1 was bounded. FORCING now advances only on the forced token, and a natural end tag accepted while forcing (a prefilled `<think></think>`) ends it, so a closed think is never forced a second time. Tests: the realistic budget-0 case (start, then the forced end) and the budget-exhausted case now feed the forced tokens as sampled; a new test covers budget 0 with the prefilled start and newline (end tag alone; message then end tag), a prefill that already closed the think, and budgets 1 and 3. Reverting the fix aborts the suite at 'activate immediately budget=0'. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * gguf: include <cerrno> for the errno the open-failure log reads gguf.cpp:996 logs strerror(errno) but never included <cerrno>; it compiled only while another header pulled it in transitively. The WASM WebGPU build (emscripten) no longer does: ubuntu-webgpu failed on #95 with "use of undeclared identifier 'errno'" (it passed on #94, 2026-11-04). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * include the libc headers upstream includes: the WASM toolchain no longer provides them transitively ubuntu-webgpu (emscripten) failed on #95 at gguf.cpp (errno), then at llama-graph.h:103 (getenv/atoi undeclared): the same build passed on #94 (2026-11-04), so the toolchain stopped pulling these headers in through others. Upstream ggml-org/llama.cpp master already includes them; this adds exactly the ones upstream has and the fork lacked (diffed per file over src/, common/, ggml/src, ggml/include): llama-graph.h, llama-mmap.cpp, llama-vocab.cpp <cstdlib>; llama-adapter.cpp <cerrno> <cstring>; common/jinja/value.cpp <cstdio> <cstdlib> <cstring>; common/common.h and common/build-info.h <cstdio>. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE * ci: build-cmake-pkg runs only in ggml-org's repo, where its self-hosted runner exists Its runner is [self-hosted, Linux], which exists only upstream. In this fork it sat queued for 24 h on every PR and was cancelled, and a merge gate reads a cancelled check as a failure (#94, #95, #96). The fork's four self-hosted workflows (CI, Server, UI, UI Build) are disabled in the repo settings for the same reason; this job is called from the CPU workflow, so it gets a job condition instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With budget 0, the generation prompt's prefilled
<think>moves the budget sampler fromIDLE to FORCING, then the prefilled newline was accepted IN FORCING and advanced force_pos,
so the sampler reached DONE without ever sampling the end tag and the model thought to its
cap. Measured on 0d7dda6 (Qwen3.5-0.8B Q4_K_M, 2026-11-06): reasoning_budget_tokens 0
thought 400 of 400 tokens with empty content, with or without a json_schema; 1 was bounded.
FORCING now advances only on the forced token, and a natural end tag accepted while forcing
(a prefilled
<think></think>) ends it, so a closed think is never forced a second time.Tests: the realistic budget-0 case (start, then the forced end) and the budget-exhausted case
now feed the forced tokens as sampled; a new test covers budget 0 with the prefilled start and
newline (end tag alone; message then end tag), a prefill that already closed the think, and
budgets 1 and 3. Reverting the fix aborts the suite at 'activate immediately budget=0'.
Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE