Skip to main content
← Lab

trycatchgap

confirmedupstream bugC++ · llama.cppInference & servingJuly 13, 2026

the question

Does llama_state_seq_set_data_ext honor its documented return-0-on-failure contract under the ON_DEVICE flag?

what came out

No. Under ON_DEVICE the pre-flight validation (a magic read and a GGML_ASSERT on the seq id) runs outside the try that returns 0, so a short, wrong-magic, or unknown-seq blob aborts the process with SIGABRT. The identical bytes with flags=0 return 0 gracefully; only the flag bit toggles abort versus graceful.

method & receipts

  • Result: confirmed
  • Pre-registered the prediction was written down and committed before the run.
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/trycatchgap