### Name and Version latest ### Operating systems _No response_ ### Which llama.cpp modules do you know to be affected? libllama (core library) ### Command line ```shell llama-cli -hf bartowski/DeepSeek-R1-Distill-Llama-8B-GGUF:Q4_K_M --grammar 'root ::= "{"' -p hey -no-cnv ``` ### Problem description & steps to reproduce With the following extremely simple grammar somehow at the time we reach the grammar sampler, there's only 1 candidate (`@`) and it hard crashes. ### First Bad Commit cc/ @ggerganov could this be related to any recent refactoring? (~~https://github.com/ggerganov/llama.cpp/pull/10803 maybe?~~ I'll try and bissect) ### Relevant log output ```shell hey/tmp/llama.cpp-20250131-5280-k2rjfn/src/llama-grammar.cpp:1216: GGML_ASSERT(!grammar.stacks.empty()) failed ```