Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The patch avoids repeated scans of unclosed TeX math in Markdown parsing. Its caches are tokenizer-local, with no changes to product defaults, stored content, or external systems. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by Verified in a real dev environmentRan Composer (the path this PR speeds up). I typed
Typed text was kept in both versions (composer ends with Recordings, trimmed to start once the page is loaded: Shared parser, same code the app imports (
Neighboring behavior on the PR:
CI on Not verified
|





Repeated unclosed TeX math openers make typing and Markdown rendering rescan the remaining text from each opener. This is a small, focused fix for an obvious performance bug in the existing tokenizer; it changes no math syntax or product behavior.
Cache only failed scans whose end proves there is no closer: text scans stop at their existing EOF/backtick/single-line boundary, and flow scans cache only EOF failures. Keep text caches separate by delimiter and single-line mode, sharing the owning event array across GFM's speculative contexts. Weak keys limit their lifetime to parsing. Content-dependent citation failures and lazy flow boundaries remain uncached.
Proof on upstream main
d2c25950b4d9183ea342d5d5fc14c326b9e0172aand this fix:vp run check:changedpassed: unused patches, formatting, lint, both knip checks, affected-package typechecks, and focused tests (61).Duplicate check: inspected current upstream source and open PRs #30658 (single-dollar composer precheck), #32110 (forge math dialect), and #27866 (web rendering parser replacement). None fixes the shared composer tokenizer's repeated failed TeX scans; #27866 leaves that shared parser in place. Keyword searches for math, TeX, micromark, unclosed delimiters, and quadratic parsing found no exact duplicate. These were targeted searches, not an exhaustive review of every open PR.
Scope: the patched dependency serves web/desktop rendering and shared composer parsing, including mobile's composer callers. No provider, protocol, permission, or connection-mode changes. Native mobile, Electron shell, relay/tunnel, and production-build performance were not exercised. Overall Markdown parsing still has other costs; this bounds the failed TeX scan work. The scenario guide explicitly excludes performance proof, so
scenarios:provewas not used to substitute a timing threshold for the operation-count regression.Reviewed with review-loop: 1 round with gpt-6.1-sol on xhigh. Reviewer verdict: approved, no findings.
Created with OpenAI gpt-6.1-sol (xhigh) in the Codex harness through T3 Code.