b8467
📦 llama-cppView on GitHub →
✨ 1 features🐛 3 fixes🔧 1 symbols
Summary
This release focuses heavily on stabilizing grammar parsing by fixing stack overflows and hangs caused by complex or nullable symbol loops, primarily by converting recursive logic to an iterative approach and adding repetition thresholds.
✨ New Features
- Introduced cycle detection using visited stacks in grammar parsing to prevent stack overflow when processing grammars with nullable symbols leading to infinite derivations of empty strings.
🐛 Bug Fixes
- Fixed grammar parsing issues that could lead to stack overflow or hangs, particularly with patterns like `( [x]* )*`.
- Fixed a potential stack overflow in `llama_grammar_advance_stack` by converting the function from recursive to iterative approach using explicit stacks.
- Added a maximum repetition threshold check during grammar parsing to prevent excessive rule expansion and hangs for patterns like `{m,n}`.