You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Highlights
All 206 of 206 built-in grammars now parse by default through ccore, the
C-faithful parser core (up from 34 in v0.58.0, covering 50/50 top-50, 100/100
top-100, and 30/30 Tier 1 grammars), with 206/206 incremental reuse, 141/206 included-range parsing, 163/206 error-tree incremental reuse,
and 11/206 native ambiguity forest parsing.
Runtime, query, and Swift throughput improved across multiple passes: core
optimizations cut Go full-parse latency by 16.13% (#1860), 13.79%
(#1906), and 29.23% (#1907) and single-byte incremental edit latency by 27.27% (#1906) and 7.18% (#1907); routing public queries and highlighters
through internal/query cut latency by 4.04× geomean and Highlight
allocations by 6,145× (92,172 → 15, #1863); Swift 0.7.4 on ccore cut a
27 KB SplitArgumentTests.swift parse from 4.95 s (HasError=true) on
v0.58.0 to 3.7 ms (HasError=false) and an ~824-file Swift repo from 6m 00s to 1.09 s (#1859, #1877, #1915).
Retired the frozen compact scheduler (#1858, deleting 165,918 lines across
594 files including 172 root Go files) and moved 20 upstream-blocked grammars
to canonical in-repo Go DSL ownership built by grammargen
(internal/tablebuild, #1911–#1914), bringing owned grammars to 24.
Upgrade notes
Certified default trees across all 206 grammars: Trees for the 172 newly
certified grammars can change where v0.58.0's legacy engine differed from
the C tree-sitter runtime, particularly on syntax errors and included
ranges; they now match C. Registry helpers (LangEntry.Parse, ParseContext, ParseStrict, grammars.ParseFile, ParseFilePooled, LangEntry.NewHighlighter, and ParseIncrementalWithTokenSource with
registered factories) also route through ccore by default, including C, C++,
Java, and Authzed via the table-v1 scan provider (#1730, #1787). To keep
the legacy engine for one parser, call parser.SetAdmissionCandidateRoute(false)
(takes effect on the next parse; ClearAdmissionCandidateRoute() restores the
default).
Go grammar and GoExternalScanner: Go now ships tables built from
upstream tree-sitter-go (2346a3ab: 1,442 states, 214 symbols) via internal/tablebuild and parses through ccore by default (#1816). GoExternalScanner is no longer registered for the default Go blob and serves
only the frozen artifact in internal/frozengo.
Swift 0.7.4 grammar and highlight query: Swift is pinned to alex-pinkus/tree-sitter-swift 0.7.4 (171fa3bc: 11,522 states, 567 symbols,
222 tokens) and parses through ccore by default (#1859). The 0.7.4 grammar
adds unsafe expressions, copy, and fixed-size array types ([3 of Int]),
allows spaces or tabs before closing /# in multiline regex literals, drops
the "nil" token (update custom queries to use (nil_literal)), reports
parse errors on incomplete inputs like let x = and let x = 1 + to match
C, and serializes C's 4-byte scanner checkpoint instead of the old 9-byte
format. The bundled highlight query is now upstream's queries/highlights.scm,
which renames captures such as @function → @function.call / @function.method, @property → @variable.member, @string.regex → @string.regexp, and adds @boolean, @keyword.conditional, @keyword.repeat, @keyword.return, @keyword.import, and @keyword.modifier.
Nginx scanner checkpoint format: Nginx scanner serialization changed from
the old 2-byte format to match pinned C; callers that persisted Nginx scanner
snapshots must reparse source to regenerate them (#1837).
Query match order, captures, work budgets, and SetValues: Public Query, QueryCursor, and Highlighter now execute through internal/query
(#1863): queries return each contiguous sibling
run, emit matches in completion order, drop matches whose captures are covered
by longer matches, and apply explicit work budgets to the whole cursor run on
eligible trees. QueryMatch.SetValues now returns the last #set! directive
for a key when set more than once instead of the first (#1764).
Parse stops, work limits, and changed ranges: On certified routes, early
parse stops (deadline, cancellation, progress callback stop, memory budget,
hard memory ceiling, conversion depth, or SetParseWorkLimits iteration/node
limits) now return an empty stopped ERROR tree (HasError() == true, ParseStoppedEarly() == true, original ParseStopReason()) instead of
falling back to the legacy engine (#1877). DiffChangedRanges on legacy-engine
trees now reports only the span between unchanged leading and trailing
children instead of the full parent (#1812); ParseIncremental and Tree.ChangedRanges documentation now notes that certified core trees share
no *Node with their old tree and carry no recorded edits on the new tree.
Compact scheduler retirement: internal/parsercorephase0/, the "candidate" ledger route, compact-scheduler build tags
(gts_parsercorephase0), and 59 deprecated compact-scheduler diagnostic and
table-analysis symbols are removed (#1858). Non-deprecated admission switch
APIs and counters remain as fail-closed stubs until v1.0.
Planned API removals for v1.0: The following APIs remain available in
v0.59.0 (served or bridged on ccore) and are scheduled for removal in v1.0
(see docs/roadmap.md): SetGLRTrace (use SetLogger / SetProgressCallback), SetAmbiguityProfile
(moving to internal/diag), ParseForestExperimental (forest parsing stays
internal to ccore), ParseWorkLimits.StackDepthLimit (use memory,
iteration, or node limits), and GOT_PARSE_PROGRESS (replaced by Parser.SetProgressCallback).
Added
Add internal/query, a pure-Go tree-sitter query compiler,
parse-table pattern analyzer, and zero-alloc ccore.NodeReader cursor, wired
behind public Query, QueryCursor, and Highlighter (#1856, #1863).
Add Parser.SetProgressCallback on both ccore and legacy routes, reporting
byte offset and error state and returning the cancelled parse result when the
callback stops the parse (#1840).
Serve parse stops, SetParseWorkLimits (iteration and node limits), SetLogger, and observers directly on ccore for certified grammars (#1827, #1877).
Add certified included-range parsing (Ranges, now 141/206 grammars),
error-tree incremental reuse (ErrReuse, now 163/206 grammars), native
ambiguity forest parsing (Forest, 11/206 grammars), table-v1 scan
providers for registry token-source routes (authzed, c, cpp, java),
and the opt-in single-line length-changing leaf shortcut
(ShortcutTokenStableLength / Parser.SetLengthShortcut, #1730, #1739, #1747, #1758, #1820, #1823, #1910).
Add internal/tablebuild, a pure-Go tree-sitter table
generator (prepared grammar, LR(1) construction, state merging, and lexer
tables), and move 20 upstream-blocked grammars to canonical Go DSL ownership
alongside Go and Swift (#1772, #1773, #1777, #1778, #1782, #1790, #1816, #1859, #1911, #1912, #1913, #1914).
Add the CI-checked 206-grammar status dashboard (cmd/grammardashboard, docs/grammar-dashboard.md), the 79/79 C recovery parity ratchet
(TestParityRecoveryBoard), route reachability goldens
(roottest/admission/testdata/route_reachability.golden), ts2go blob
freshness checks, and perfcounterledger -stale (#1785, #1792, #1814, #1857).
Add grep.CompilePattern per-grammar snippet contexts (e.g. Go wraps patterns
in package p; func f() { $$ } so call patterns such as fmt.Println($X)
match calls; grammars without a context parse the bare pattern as before, #1816).
Add opt-in ECMAScript constructor call facts, declaration header ranges,
heritage expressions and ranges, source ranges for Python and ECMAScript
import items, and local named export items for JavaScript and TypeScript
(#1712, #1713, #1741, #1742, 865c658e).
Changed
Serve the remaining 172 built-in grammars through ccore by default,
bringing certified coverage from 34 to 206 of 206 (50/50 top-50, 100/100
top-100, 30/30 Tier 1; 206/206 parser_parse served by core; 118/118 external
scanners registered and bound). Newly certified grammars by pull request:
Scala #1835, CMake, Haskell, Svelte, and Vue #1836, Nginx and Nim #1837, GLSL, Jinja2, LLVM IR, and Verilog #1839, Git Rebase, Prisma, Scheme, and Twig #1850, MATLAB #1851, Gleam and Racket #1852, Perl #1854, and Swift #1859;
Owned Go DSL cohorts: HEEx, HTTP, Liquid, and Robot #1911; Fish, F#, Hurl, and jq #1912; COBOL, Disassembly, Earthfile, Jsonnet, Nickel, and reStructuredText (rst) #1913; DOT, GN, Properties, Requirements, Squirrel, and Uxntal #1914.
Route C registry helpers (LangEntry.Parse, ParseContext, ParseStrict, grammars.ParseFile, ParseFilePooled, LangEntry.NewHighlighter, and ParseIncrementalWithTokenSource with the registered factory) through ccore
using the table-v1 scan provider, and count declined registry requests with
their reason in the route counters (#1787).
Retire the compact scheduler (internal/parsercorephase0/), removing 165,918
lines across 594 files (172 root Go files; rootBudget tightened from 621 to
449), and relocate 29 admission and parse test files to roottest/ (#1762, #1763, #1858).
Optimize internal/ccore memory layout, table lookup, lexing, and incremental
reuse across four passes: shrink stack nodes from 224 B to 48 B with flat
tables and inline single-head reductions (#1860), grow publish stacks on demand
and use allocation-log mark clearing in findMultiWalk (#1900), specialize
prepared action/goto lookups and in-place repeat reductions (#1906), and add
bounded 768 KiB flat parse tables with pre-decoded ActionEntry fast kinds
(#1907); also reduce view-edit conversion and summary-walk overhead (#1765, #1767, b1334ed9).
Upgrade Swift to alex-pinkus/tree-sitter-swift 0.7.4 (171fa3bc) with
upstream queries/highlights.scm, bump F# to b576ecf7ced0, ship yaml-core
tables for YAML, and build Go from upstream tree-sitter-go (2346a3ab) with internal/tablebuild (#1769, #1775, #1816, #1859).
Split CI into a light PR tier and a heavy nightly/release tier
(ci [tier: heavy]) with split matrix guard, build, and vet jobs (#1771, #1802, #1826).
Fixed
Accept trailing non-ASCII Unicode whitespace skipped by the grammar and extend
root spans to the end of parsed input (#1885, closes #1866).
Narrow DiffChangedRanges on legacy-engine trees to the span between
unchanged leading and trailing children (pasting a 42-byte function into a
20 KB Go file dropped from 20,346 bytes reported to 91 bytes) and use ccore
for public syntax changed ranges (#1744, #1812).
Make QueryMatch.SetValues last-wins for repeated #set! keys, compile
quote-led query groups as siblings, return every alternation match in C order,
decode escaped \? punctuation tokens in the core query adapter, and route
ranged queries on materialized core trees through internal/query (#1734, #1753, #1764, #1882).
Keep table flattening in bounds, align missing-token placement in excluded
ranges, honor end tokens and adjacent boundaries in included ranges, and
preserve lookahead on ordinary EOF reductions in repairNoLookaheadLexModes
(#1888, #1895, #1903).
Accept complete final Go type, var, and const declarations without a
trailing newline through the grammar file APIs (#1855).
Keep a bare & as JSX text in both TSX and JavaScript scanners (#1709, #1797).
Align Go external scanner ports with pinned C and eliminate hangs, crashes,
and state or race defects across the fleet (including COBOL, Disassembly,
Earthfile, Jsonnet, Nickel, reStructuredText, Fish, F#, Hurl, jq, Pug,
Properties, ReScript, Nginx, Nim, Scala, PHP, SQL, C++, C#, Less, D, and
earlier scanner waves; #1715, #1717, #1725, #1728, #1729, #1731, #1746, #1750, #1756, #1757, #1835, #1837, #1882, #1909, #1912, #1913).
Fix ts2go end-of-input lexer edges and NUL token names, preserve lexer
metadata when incremental reuse sidecars grow, count bytes in shared lexer
cursor columns, exclude impossible patterns from inferred tag queries, and
keep selected trailing trivia in deferred result roots (#1710, #1740, #1748, #1751, #1785, #1793).
Raw graduation gate logs, 200,000-call scandiff runs, and 20-seed paired benchstat archives are published on the evidence release,
including the public query/highlighter routing benchmark
(query-public-routing-bench-e1e99b870.tar.gz)
and the internal/ccore optimization passes (#1860, #1906, #1907).
Recovery parity is ratcheted in CI at 79 of 79 matching trees and 79 of 79HasError agreement with the C reference runtime (TestParityRecoveryBoard, #1857); knownCOracleDifferences dropped from 20 to 9.
The exact candidate ci [tier: heavy] run and randomized release benchmark
receipt are recorded with the release receipt at publication time.