Root cause: parser.parse(code.encode()) returns byte offsets, but code[node.start_byte:node.end_byte] indexed into a Python string (character offsets). Non-ASCII chars caused cumulative drift → truncated symbols. Fix: store code_bytes = code.encode(), index into that, decode only final text. Impact: - Zod: 653 truncated symbols → 0 - RAGSAK: 653 truncated symbols → 0 - RAGSAK grammars: 8 → 27 (3.4×) - FastAPI grammars: 33 → 111 (3.4×) - Malformed: 6 → 2 (RAGSAK), 0 (FastAPI/Flask) Also removed sanitize_symbol() (dead code after fix) and call_only parameter. |
||
|---|---|---|
| .. | ||
| results | ||
| coarsen_eval.py | ||
| context_eval.py | ||
| EXPERIMENT_LOG.md | ||
| freq_eval.py | ||
| gbnf_eval.py | ||
| RESULTS.md | ||