tree-sitter.tree-sitter/docs
Will Lillis 65e8b25413
wip(generate): emit 3-way per-state parse table layout (plan B)
Replace the per-grammar CSR-vs-hybrid choice with a per-state picker
that places each state in the smallest of dense / CSR / small. State
ids are partitioned into contiguous tiers [Dense | CSR | Small] driven
by `large_state_count` and a new `csr_state_count` field on
TSLanguage. The runtime dispatches on two range checks; the rest of
the lookup logic per tier is unchanged.

States 0 (error) and 1 (start state) are pinned to the Dense tier so
they remain at indices 0 and 1, matching the runtime's hard-coded
expectations. Cost is bounded at ~2 * SYMBOL_COUNT * 2 bytes per
grammar.

Cleanup: drop --table-fmt CLI, OptLevel::ForceHybridTable /
ForceCompressedTable, RenderError::ConflictingParseTableFlags,
heuristic_should_compress, and use_compressed_tables since the free
picker provably picks the smallest representation per state.

Tests pass against the regenerated fixtures. The size savings are
measured in a follow-up corpus run.
2026-05-19 18:18:20 -04:00
..
src wip(generate): emit 3-way per-state parse table layout (plan B) 2026-05-19 18:18:20 -04:00
theme docs: add favicon and logo 2024-12-25 21:23:36 -05:00
.gitignore docs: migrate to mdbook 2024-12-24 20:54:59 -05:00
book.toml treewide: add taplo config and reformat toml files 2026-02-18 00:59:34 -05:00
package.nix refactor: rework nix flake 2025-09-09 03:03:35 -04:00