release(v0.49.0): finalize parser recovery and performance ratchet - #666
Merged
Conversation
- Check the parse deadline every 64 materialization checkpoints instead of every checkpoint. - Continue to check cancellation flags and sticky stops at every checkpoint. - Reduce timed Swift recovery by 3.70% and timed Elixir recovery by 3.52% in 20-seed combined benchmarks. - Include the optional single-file recovery lane in randomized comparisons.
- Add cNodeErrorCostAndVisibleSubtreeCount to compute both C subtree aggregates in one walk - Update recovery and prefix aggregate call sites to use the combined function - Prevent duplicate tree traversals when the recovery stack requires both values - Add test to verify combined results match independent walks and cache correctly
Replace the two multiplication-based mix steps with two XOR folds. Use the node alignment to discard constant address bits.
- Move clean-zero error cache from scratch-local map to on-node state to reduce allocations and improve locality - Track cost and visibility validity independently with an aggValid bitmask on GSS nodes - Check primary cache way before set-associative slot in cNodeMemo lookups to reduce indirection - Terminate clean-zero traversal on cycles by tracking visiting state on nodes
- Set cleanZeroState to gssCleanZeroUnknown in setExtraLink and appendExtraLink so extra-link writes discard the stale all-links cleanliness result - Prevent gssNodesCanMerge from reading a cached clean-zero answer after an extra-link rewrite changes the link set - Add a test assertion that confirms the clean-zero cache entry is absent after setExtraLink replaces a link
- Skip callback polls when no timeout or cancellation is active - Keep the common stop path direct for the parser loop callback - Inline the deadline check and remove the checkDeadline parameter - Make materialization self-contained with throttled wall-clock reads - Add tests for unbudgeted parser and between-budget cancellation paths
odvcencio
marked this pull request as ready for review
August 10, 2026 00:44
- Promote the error stack to the graph-structured stack before reduction forks. - Share the immutable prefix across deep recovery branches instead of copying each deep linear stack. - Reduce Swift recovery time by 9.96%, bytes by 59.65%, and peak RSS by 22.09%.
- Replace heap-allocated map with fixed-size scratch buffer for tracking repeated hidden fields. - Pool scratch buffer in nodeArena to eliminate allocation overhead between parses. - Track field repetitions using inline begin/record/end methods instead of map lookups. - Update materializeHiddenNodeForAlias to reuse pooled scratch for consistent memory usage. - Lower B/op and allocs/op metrics by removing temporary allocations from the hot path.
- Change depth field in cStackSummaryEntry from int to uint8. - Update all comparisons and assignments to handle the narrower type. - Add a struct size test to prevent future growth. - Save memory per stack entry during GLR recovery.
Owner
Author
|
Validation update for This change packs Validation:
The Swift diagnostic differences remain the existing |
- Add Node.HasErrorOrMissing() to detect trees with ERROR or MISSING nodes. - Run forest fallback when DFA parse recovers partial trees. - Update grammargen --strict flag and JSON output to reject MISSING nodes. - Add regression and parity tests for C enum parsing across all paths. - Gate forest fallback on preprocessor presence to avoid invalid guesses. Refs #667
- Move untracked improvements to the v0.49.0 section - Add release notes for enum list and error node fixes - Clarify release status and consolidation goals in roadmap
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.
Release candidate: v0.49.0
This PR completes the parser performance ratchet and fixes the C enum recovery regression.
What changes
ERRORorMISSINGnode.Node.HasErrorOrMissingfor strict parse-health checks.grammargen parse -strictreject both recovery node forms.Correctness evidence
Performance evidence
The accepted performance bundle compares
e1ce651with94a628bon a C2 Spot worker.The final candidate adds recovery-only work. Clean benchmark inputs do not take that path.
A paired final randomized C2 measurement is pending a Cloud credential refresh. The existing 20-seed receipt remains attached below.
Release path
Merge this PR into
main. Run hosted CI on the exact merge commit. Publish through the governed v0.49.0 workflow after its required soak.Fixes #667