Release 0.5.0#32
Conversation
…mallestEnclosing as dormant infra
…ccessors (cleanup; bench-neutral)
…ceSpan via primitives in emitted CST construction
…> (bytes -2%)" This reverts commit 2ad2674.
…ference, -8% self-host)
…20% on both fixtures)
…fixtures, parse_Stmt 27k→<3k bytes)
…nce, -8% self-host wallclock)
…ock, -75% gc.count)
…hot (-12% reference, -8% selfhost wallclock; -6% / -7% alloc)
….6% wallclock, -3.8%/-1.4% alloc)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (111)
📝 WalkthroughWalkthroughThis PR delivers version 0.5.0, a major incremental-parsing architecture overhaul accompanied by throughput-engine performance optimizations. Core changes include: splitting session cursor state into a separate ChangesIncremental Architecture & Session Refactoring (Phase 1.x Execution)
Performance Optimization & Throughput Engine (Tier 1)
Documentation & Release Metadata
Build & Version Management
Sequence DiagramsequenceDiagram
participant Editor as Editor / Client
participant IP as IncrementalParser
participant SI as Session +<br/>Cursor
participant NI as NodeIndex
participant IGN as IdGenerator
participant PegEng as PegEngine
Editor->>IP: initialize(text, offset)
activate IP
IP->>IGN: new PerSessionCounter()
IP->>PegEng: parseFull(text, idGen)
activate PegEng
PegEng->>NI: build(root)
PegEng-->>IP: Result<CstNode>
deactivate PegEng
IP-->>Editor: InitialSession(session, cursor)
deactivate IP
rect rgba(100, 150, 200, 0.5)
Note over Editor,SI: Edit Loop
Editor->>SI: edit(cursor, Edit)
activate SI
SI->>NI: smallestEnclosing(editStart, editEnd)
SI->>PegEng: parseRuleAt(ruleId, newText, offset, idGen)
activate PegEng
PegEng-->>SI: PartialParse
deactivate PegEng
SI->>NI: applyIncremental(newRoot, oldPath, newPath)
SI-->>Editor: EditOutcome(newSession, newCursor)
deactivate SI
end
rect rgba(150, 200, 100, 0.5)
Note over Editor,SI: Full Reparse Fallback
Editor->>SI: reparseAll(cursor)
activate SI
SI->>PegEng: parseFull(text, idGen)
activate PegEng
PegEng->>NI: build(root)
PegEng-->>SI: Result<CstNode>
deactivate PegEng
SI-->>Editor: ReparseOutcome(newSession, newCursor)
deactivate SI
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes This is a sweeping architectural refactor spanning incremental-session control flow (outcome-based returns), node ID stability mechanics, index internals (id→node mapping), parser generator extensions (FIRST-set analysis, packrat auto-skip), performance-flag defaults, and comprehensive test/benchmark updates. The changes are heterogeneous: core refactoring across multiple interdependent systems, new public APIs with breaking changes, performance-flag re-tuning, and extensive parity/bench updates. Understanding the interaction between stable IDs, Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
Summary
Release 0.5.0 of peglib — incremental engine architectural rework + throughput engine Tier 1 perf arc + Move B post-mortem + post-rollback wins. 46 commits past main.
Headline numbers
Incremental engine (1900-LOC Java fixture, Regime B cursor-moved-to-edit):
Throughput engine (variant
phase1_allStructural_mutableResult_autoSkipPackrat):What shipped
CstNoderecords gainlong idfirst record component (BREAKING). Path D stable-id ancestor preservation +LongLongMapNodeIndex. 96-604× speedup on flat-tree mid-buffer edits. Lever D Cursor split.selfhostJMH fixture catches regressions the small bench misses.4763251): -12.1% reference / -8.2% selfhost wallclockmatchCharClassCst(38b6a8e): -3.95% reference / -4.59% selfhost wallclockTest counts
Breaking changes
CstNoderecords gainlong idfirst record component on all 4 variants (Terminal,NonTerminal,Token,Error).equals/hashCodeexcludeidper spec §7 R1 — structural equality preserved. Downstream pattern-matchers oncase CstNode.Terminal(String text, ...)need to add the leadinglong idcomponent.Test plan
mvn installgreen — local m2 reflects 0.5.0 artifactsDocs
docs/HANDOVER.md§11 — current branch state + post-rollback wins + reoriented next movesdocs/incremental/THROUGHPUT-ENGINE-MOVE-B.md§11 — Move B post-mortemCHANGELOG.md[0.5.0] section — full release notesdocs/archive/— historical specs (V2.5 spike NO-GO, original SPEC.md, etc.)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Performance
Breaking Changes
long idfield