Repository navigation
Edit: find the readings past a point from the tree and the line index (no-flush PR2) - #522
DongyuZhao wants to merge 315 commits into
Conversation
…t openers A formula scanner asks how many `$` openers are unmatched to read a `$` as a closer. An opener that an emphasis pair around it takes away still counted at those scans, so a reading from past the emphasis, without the opener, could read a later `$` as an opener instead. The core now notes the rules whose scanners ask that count, and the start of a removed opener of such a rule is an undecided start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The wire's markdown_core_wire_session_edit answers an edit's document as a step's message. Swift's MarkdownSession.edit(from:to:with:), and Kotlin's and ECMAScript's edit(start, end, text), replace the text between two cursors in the session's unit and return the parse of the new text. An edit before the flush throws the new code sessionStreaming (SESSION_STREAMING); one out of bounds or backwards throws outOfBounds and leaves the context. Each binding sweeps an insertion and its undo over every cursor of a text and checks each document against a fresh parse, and checks that a node the edit did not reach is the old node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
…s for Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Document.content holds existential markup, which == cannot compare. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
…step E3) didOpen parses the text into the document's session and flushes it, each didChange content change is one session edit, and completion locates the session at its cursor. The server holds no copy of the text: the new markdown_core_session_source lends the session's. A change whose scope is backwards is refused before any edit applies; an edit that cannot allocate closes the document. The sync oracle now compares the session's document with a fresh parse of its text after every change. Reading the session's exact-sized text showed a context query reading one byte past the text at a destination the text's end opens, such as `[a](`; it now reads only the text, with a facade test on an exact-sized buffer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
…p 4b) MarkdownCoreLSP.Server wraps markdown-core-lsp: initialize, shutdown, phase, open, update, close and complete, with the protocol's Position, Scope and Change, Capabilities, Completions and ServerError. The C engine builds from source as the MarkdownCoreLSPC target. The conformance tests replay specs/lsp/transcripts through the server, bundled by the resource plugin, and the release manifest, source archive and product build carry the second product. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Kotlin's com.nouprax.markdown.core.lsp.Server and the ECMAScript entry point @nouprax/es-markdown-core/lsp join MarkdownCoreLSP.Server: one method per protocol method of markdown-core-lsp, with Position, Scope, Edit, Capabilities, Completions and an error carrying the protocol's code. Kotlin's JNI library and cinterop definition link the engine, whose natives register on the parser's JNI holder; the WebAssembly module compiles and exports it. A content change is now an Edit in Swift too, by the naming rule. Each binding's tests replay specs/lsp/transcripts in process: Kotlin from a generated common-test source, ECMAScript from the bundled conformance fixtures. The source-list and public-surface audits, the JVM surface record, the ABI dumps and the npm packaging test know the new sources and entry point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
A new benchmark job, "Measure - completion latency", runs the stream benchmark's edit scripts through the language engine as a client typing them would: completion_runner opens a server on the document and sends each edit as didChange, and a measured request is one edit followed by a completion at the end of its text, both inside bench_request. The driver, scripts/benchmark/completion.mjs, reads each request's inclusive Ir from the callgrind call graph, split into the edit and the completion, and groups the requests by document size (grammar corpus, shapes at 16, 64 and 256 KiB) next to the plan's proposed budget. Report only (D5). A script is measured at up to 16 evenly spaced edits; a shape larger than 16 KiB is cut to its first 16 edits and measured at 4. Scripts whose edit splits a \r\n are skipped, since no protocol position names that place. The runner checks that the session ends in the script's text. The PR comment shows the size table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Callgrind now starts with instrumentation off, and the completion runner turns it on around each measured request only, so the edits between run at valgrind's uninstrumented speed. That removes the cut of large shapes to their first 16 edits: every script, at every size, is measured at up to 8 evenly spaced edits over the whole script (about 40 minutes on four cores). A script is also skipped when an edit leaves its cursor between a \r and a \n, as an inserted \r before a \n does, since no protocol position names that place and the request would measure a different cursor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
A session edit used to read the whole text again whenever the labels the text from the rest point declares changed, which typing in any heading does. Now the edit takes the keys that the declarations of the re-read range hold and those of the old text it replaced do not, or the other way round (markdown_core_parser_altered_labels), and a byte filter over the kept text finds each `[`, `[^` and `@` whose following run may name one. Each block that holds a hit is read again as an edit of nothing just past the opener reads it, and the edit reports the union of what it read. The hard definition cases now end in plain paragraphs and bound what an edit reads again, and two cases are new: a definition added before the one a use resolves to, and a definition written over with the reading resuming before its use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
A label that a line break splits may go on past a container's prefix, which the lookup strips and the byte filter sees, so the filter now takes such a run to name the label. The new hard case quoted-label renames a definition whose use in a block quote breaks after its bracket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The filter compared each opener with every altered label and folded its run once a label; it now folds the run once and looks its prefixes up among the altered first words, sorted. The places it finds were read in one transaction each; they are now read in at most eight, parted at the widest gaps, each an edit of nothing just past its first place that takes no old child back before its last (a new `past` bound on the reopen), so nodes keep their identity. Inserting 4,000 definitions before 4,000 unrelated uses took 743 ms and takes 4 ms; renaming a definition 4,000 paragraphs use took 1,478 ms and takes 9 ms, as reading the text once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
When the word index, the list of places or a rest point could not have its storage, the edit answered ALLOCATION_FAILED with the definition changed and its uses not read again, and a later edit published them as they were. The edit now lets the document go on any failed refresh, as it does when the altered labels cannot be collected. The api test refuses each allocation of a rename in turn and checks the next edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
A table cell takes `\|` to `|` before the inline parse looks the label up, so the bytes the filter folds are not the label the lookup sees. A run that holds a backslash now may name any label. The new hard case table-label renames a definition a table cell uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The block replaces a NUL before the inline parse looks the label up, so a run that holds one now may name any label, as one that holds a backslash does. The api test renames a definition whose label holds a NUL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The first leaf of a tree starts at eight entries and doubles to a full leaf while it is the only one, taken anew and copied so small blocks come from the allocator's caches. Definition tables search the leaf of the front's last entry directly, the uses flush walks runs, and withdraw skips tables whose front ends before the root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
A first leaf that grows from eight entries costs every small document its growth in the parse stage; the leaf is taken at its full size, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Line places, the dropped facts and a leap's places step through the line records leaf by leaf, forward with markdown_core_tree_run and back with the new markdown_core_tree_back, instead of finding each line by rank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The snapshot and the locate's look begin, read and end through the same S_look_begin, S_look_read and S_look_end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
record_nest records the nodes of a reopened definition's old bodies, and each record owns its node from then on; the body itself was never released. Two edits of a definition list that drop a body (a blank line removed before a term, then put back) left its node, and its slab, alive past the session's close. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
A session that still streams, and a document, locate through a session of their whole text, flushed, whose look reads at the cursor (THE LOOK OF A TEXT AS A WHOLE): the parse of the text before the cursor, with labels seeded from the whole document, is gone, and context_at always has a locus. A flushed session with an empty root reads its look with no window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
An edit on the line right after a paragraph's last line -- typing the first character of a new line at the paragraph's end -- rested at the paragraph's start and read it again whole, so every new line of a long paragraph cost as much as the paragraph. The edit now rests in the paragraph from its last line (THE LEAP), as an edit of one of its own lines does, and the reading decides whether the edited line goes on with it. Typing at the end of a 200-line paragraph: 180k -> 76k Ir per edit, the same as at 100 lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
An edit at a paragraph's end now parses its inline content from as late as a snapshot does, instead of from a seam two lines back. - The seam margin is 0: a seam may lie at the rest line's start. When the content no longer reaches past the picked seam (a delimiter row took its head, an underline, an interrupting line), S_seam_shrink falls back to the last seam the content still reaches past instead of reading the paragraph whole. - Settle starts inside the content's last line are INNER seams. They stand only for an edit from where the old content ended on, and only while the new content keeps all of the old (S_seam_holds), the same condition the snapshot's settle point relies on. - A paragraph carrying an element flag (a table's TABLE_VISITED) no longer leaps: its reopened node kept the flag the old reading set on a later line, so a line edited into a valid delimiter row made no table. This was wrong on main too. Test: a paragraph typed at its end, and lines written at its end, dump as a full parse after every edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Every reach record now ends past the last byte its reading read, and one that met the text's end ends past it: - a block's close ends past the line ending of the line that closed it (markdown_core_parser_read_past); the splice notes its closes on the old line it resumes at (S_close_on, S_line_past); - every lookahead is noted, the one that read only the next line too; - link definitions, block identifiers, the properties envelope and the definition list term's peek note their true ends. Records are of two kinds. A span is a block's reading held open across a point: closes, and a paragraph open from before its definitions. A look read ahead and decided. One rest rule for edits and locates: a reading from before the rest point that crosses it stands only when it is a look that ended no later than the edit's start or the cursor, or a span of a block of the chain. The splice resumes on a line no reading read past. The paragraph +1 and first-child +1 rules, and the cut-front special case, go: what they covered is in the reach now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
…the text's end Readings track whether they met the input's end; only those reach past it. Audit fix: the reach ends ask markdown_core_parser_input_text for the size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The reread expectations of hard-type-in-middle-paragraph and the new quote-lookahead case are written by scripts/benchmark/workloads.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
…line Only a reading that met or waits at the input's end reaches past it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
A reading from before the line that stopped inside it was the opener of the line's first block (a list's variant from the list before); one that read the line whole, a lookahead or a close, decided its own line's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Every reach record now also lands on the tree: a node keeps how far past its start its opener read (`look`), and the spans its parse took in and closed (`opened`, `closed`), all relative to `place.start`. A look that begins on a line where no block starts (a blank line, a leaf's later line) lands on that line's entry in the line index instead, so typing inside an unclosed comment keeps its rest point. The reach log still drives the edit; a debug check (MARKDOWN_CORE_READS_CHECK, test incremental_reads) asserts that the node and line attributes cover every record it holds. Nodes grow by 12 bytes, line entries from 16 to 20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The ES package builds the sources with emcc outside CMake and without NDEBUG; its standalone module then imported the WASI environment for the check's getenv, which the packed consumer does not provide. The check now needs MARKDOWN_CORE_READS_CHECK, which CMake defines when it builds the tests, and reads the environment on each rest instead of caching it in a static. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The check walks the tree through the session allocator. A walk that failed compared a part of the tree against the reach log and asserted a miss; now it fails the rest as storage the operation could not have, so the operation reports the allocation failure (regression_strict_oom with MARKDOWN_CORE_READS_CHECK set). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
… a resume Three ways a look a reading noted went missing from the tree while the reach log kept it (Codex, incremental_fuzz with the reads check): - a snapshot ended the held line and gave its waiting look to a view the take-back let go; the mark now keeps the waiting look and the rollback puts it back; - a candidate's decision went back before the waiting look's line and the settle dropped it; a look from a line before the one in hand now goes to that line at once, and a waiting one settles wherever the reading stands, unless its line is gone from the input; - the resume test read from the line that ended and the splice took the reading over before that look settled; it settles after the test. incremental_fuzz now runs with MARKDOWN_CORE_READS_CHECK set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
The node grew to 192 bytes and its slot to a size 96 does not divide; the last block's size became a runtime value and each of its copies a call to memcpy, which made markdown_core_node_swap 4.6 times its cost and the streaming session 5% dearer (prose 16k: 114.4M -> 120.4M Ir). Whole blocks and the rest now have constant sizes: 115.3M. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
…to claude/project-thread-raxrtq
The rest of an edit and of a locate asks whether a reading that began before a point read past it. That was answered from the reach log (markdown_core_parser_crossed); it is now answered from the node attributes (opened, closed, look) and the line looks alone: - the line index gets an end op (start + look) and a raise, so the first line whose look reads past a byte is a prefix query; - each widths entry keeps the reach of its child's subtree and a cover link to the nearest later sibling whose reading began before it (a paragraph its definitions were cut from); - session_crossed walks down the blocks that hold the point, finds the siblings before it by their reach, and follows the cover links from the child at the point. To make the attributes exact: - a lookahead that notes no reach (S_carries) now notes nothing at all; - a gone block's readings go only to children the reading made, never to a kept child whose place is stale; - `opened` counts spans only; a restarted node hands its look to the line it began on; - node_reach and the past walk are iterative, with no depth limit. markdown_core_parser_crossed is deleted. A differential run against it over every incremental family showed no difference before deletion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b2009fef0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * further, as far as it now does. */ | ||
| if (first) { | ||
| session_width *before = width_tree_at(tree, first - 1); | ||
| const uint32_t reach = before->start + node_reach(session, holder->children[first - 1], 0, true); |
There was a problem hiding this comment.
Reuse the cached reach of the retained sibling's subtree
When a large blockquote precedes several small paragraphs, editing the second paragraph repeatedly traverses the entire untouched blockquote here. Its nest is not retained by session_mend_nests, so node_reach falls back to visiting every descendant on every edit, making a constant-sized edit linear in an unrelated prefix. In a Release build, 50 such edits took approximately 1.2 ms with 1,000 quoted paragraphs versus 74 ms with 50,000, although each edit reread only 10 bytes. Preserve the cached descendant reach and incorporate any growth in the retained node's own readings rather than rescanning its unchanged subtree.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in b3f8d3e. The only readings that change on the kept previous sibling are its own: S_reads_pass writes to the node itself. So the mend now raises the entry's reach by start + node_own(kept). The full node_reach walk runs only when the sibling is the chain's block, and in that case its nest was just mended, so the walk reads the nest root's furthest value instead of the subtree. The debug nest_check still compares every mended entry, cover included, with a fresh build. The incremental, api, context and LSP suites all pass with that check on.
Generated by Claude Code
BenchmarkCommit: Benchmark is required when CI inputs require execution. This ordinary PR comment does not create a review thread to resolve. Parse stagesBaseline:
Totals sum this finite workload; they are not elapsed time or a general speedup claim. Parser creation and release are not parsing and are in no figure here. Stage budget (+2% per document and stage): 1,584/1,584 passed, 0 exceeded. Required when CI inputs require execution. Largest stage ratios (up to 10 document stages)
Corpus: Grammar-equivalent reference comparisonsA = Core on dialect input; B = Core on common input; R = cmark/cmark-gfm on common input. Ir covers the two parse stages. Whole means the declared language; local excludes the unmatched host. Each input is measured once. No AST equivalence or equal native output cost is asserted.
Rejection of constructs only Core implementsNo reference implements these constructs, so none is measured. B = Core on the common input; C = Core on its control, the same input with the rejected construct's trigger bytes replaced by letters of the same width.
Attribute grammar
Core / lexbor instructions on the same recovered attributes: ASCII 0.7064×, UTF-8 0.7571×. StreamsSubjects: Stream regressions (+2% per workload and subject in p95, max and total, against
Bindings' C side (B): the MCB3 encode of each document an S window publishes and the release of its message, without building the platform values; no gate.
Edits: Ir per window of edits, R counting the two parse stages of the
Completion latencyCallgrind Ir per completion request: the didChange of one edit and the completion at the end of its text. At most 8 requests a script, at evenly spaced edits. The budget is the plan's proposed p95 wall time on a device, not compared with these counts; no gate.
|
The widths of the root's children, the nests below it, the reach of a
node and the readings-past query move from elements/session.c to
core/index.{h,c} (markdown_core_index). The session keeps the index in
its edit state and only calls it: make, mend, mend the chain's nests,
find a nest, its fold marks, and crossed. The walk check of the root's
children stays in the session, as the walk is the AST's.
The kept child before an edit's first now adds its own readings to its
reach rather than walking its whole subtree again: only its own grew,
unless it is the chain's, whose nest is mended (an edit after a long
blockquote no longer costs the blockquote).
Also formats parser.h, and lists index.c for the Swift, Kotlin and ES
builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj
Step 2 of docs/plans/no-flush.md §10.7, done as §10.10 describes. The PR has two commits:
markdown_core_parser_crossedis deleted. "Did a reading that began beforepointread pastpast?" is now answered from the node attributes (opened,closed,look) and the line looks.core/index.{h,c}(markdown_core_index): the widths, the nests, the reach of a node and the crossed query.session.cnow only calls it.What changes
endop (start + look).markdown_core_tree_raiseis a new generic op: an entry that grows in place raises its ancestors' furthest value. A new query,markdown_core_parser_line_looked, usestree_pastover the lines.{start, end, reach, cover}:reachis how far the child's subtree read.coverlinks to the nearest later sibling whose reading began before this child (a paragraph its definitions were cut from).markdown_core_index_crossed. It walks down the blocks that hold the point:tree_paston reach;S_carries) truncated the reach but still wrote a look into a line. It now notes nothing (edit->quiet).S_reads_pass) could go to a kept child whoseplaceis stale. They now go only to children the reading made (S_reads_kept).openedcounts spans only.markdown_core_node_restarttakes the parser and hands the node's look to the line it began on.index.cis added to Package.swift, Package.release.swift, the Kotlin Android CMake list and the ES build script.Verification
MARKDOWN_CORE_READS_CHECKrun reported no record missed on lines, hard and declarations. On random, undo and typing it stopped at the 2-hour time limit without finishing, with no misses up to then.The reach log itself goes in PR3.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AvzArumvqU8RFP8mWYPXpj