Repository navigation
fix(pipeline): decode persisted LSP arrays linearly - #4
Merged
Merged
Conversation
ngallodev
commented
Sep 29, 2026
ngallodev
left a comment
Owner
Author
There was a problem hiding this comment.
Reviewed, no issues found.
Checked by reading the PR head of src/pipeline/lsp_surface.c:
- yyjson_arr_iter yields the same elements in the same order as yyjson_arr_get(i) for i in [0, size). Duplicates and nulls are preserved, and the iterator count matches yyjson_arr_size, so the i index never passes the allocated count. It cannot overrun the items/defs allocations.
- Empty and missing arrays behave as before: an empty lsp array returns 0 early, and an empty spt array gives count 0.
- Non-string items still map to "?". Null-terminator placement (items[count]) is unchanged.
- Error paths are unchanged. The arena owns the allocations, and the doc is freed on every early return. Allocation-failure handling (NULL from cbm_arena_strdup) is the same as the old code.
- The test covers order, null receiver, null param item and the empty array. It checks behavior only and cannot detect a regression back to O(n^2). Fine for a perf-only fix; a large-input timing check would be the only way to cover that.
Tests and builds not run by me.
3 of 4 tasks
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.
Summary
yyjson_arr_iterto avoid repeated scans of non-flat arrays.d7eba5a7for the CLI fork.Review and validation
CBM_NO_CCACHE=1 scripts/build-dev.shpassed.ASAN_OPTIONS=detect_leaks=0 CBM_NO_CCACHE=1 scripts/test.sh --suites pipelinepassed: 274 tests. This validation ran before the request to stop running tests; no tests were run after that instruction.git diff origin/main...HEAD --checkpassed.This PR does not claim Agent-Workflow evaluation, acceptance, or merge approval.