Repository navigation
fix(highlight): stop a JavaScript line from pinning a core forever - #1007
Merged
Merged
Conversation
tontinton
enabled auto-merge (rebase)
September 12, 2026 14:47
tontinton
force-pushed
the
fix-syntect-bug
branch
2 times, most recently
from
September 12, 2026 14:55
868e24c to
b4eeb57
Compare
Opening a session sent a core to 100% and kept it there until maki was killed, and nothing in the transcript looked unusual. The thread named `highlight` was stuck inside a single `ParseState::parse_line` call on a 20 line JavaScript snippet, and the minimal case turned out to be `x /*`: two rules in the JavaScript syntax `bat` ships both match empty at the byte after the identifier and `set` each other's context back, forever, because syntect's loop guard only watches a push followed by a pop, and a `set` is neither. Flat memory the whole time, so it is a real cycle rather than backtracking, and the queue in `maki-highlight/src/pool.rs` is a single thread with no deadline, so that one line also starved every highlight job that came after it. Pins syntect to a `v5.3.0` backport of trishume/syntect#706, which remembers the `(byte, context stack)` a non-consuming `set` was taken from and advances a character on the second visit, exactly what the push/pop guard already does; both syntest baselines are unchanged upstream.
tontinton
force-pushed
the
fix-syntect-bug
branch
from
September 12, 2026 14:55
b4eeb57 to
9d6656f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening a session sent a core to 100% and kept it there until maki was killed, and nothing in the transcript looked unusual.
The thread named
highlightwas stuck inside a singleParseState::parse_linecall on a 20 line JavaScript snippet, and the minimal case turned out to bex /*: two rules in the JavaScript syntaxbatships both match empty at the byte after the identifier andseteach other's context back, forever, because syntect's loop guard only watches a push followed by a pop, and asetis neither.Flat memory the whole time, so it is a real cycle rather than backtracking, and the queue in
maki-highlight/src/pool.rsis a single thread with no deadline, so that one line also starved every highlight job that came after it.Pins syntect to a
v5.3.0backport of trishume/syntect#706, which remembers the(byte, context stack)a non-consumingsetwas taken from and advances a character on the second visit, exactly what the push/pop guard already does; both syntest baselines are unchanged upstream.