Repository navigation
Conversation
A definition's properties buffer was sized for its docstring, variants and variant_key only; every other field had to share the remaining 2 KB. Fields that do not fit are dropped whole, so a long signature, decorator list or parameter list silently squeezed out the MinHash fingerprint (fp), the structural profile (sp) and the body tokens (bt) appended behind them. Those definitions got no SIMILAR_TO edge and fewer SEMANTICALLY_RELATED edges, and any newly added property (route_path, route_method) pushed more of them out. pd_props_buf and pp_props_buf (twins, kept in lockstep) now count the fixed metrics prefix plus the whole serialized form of every field build_def_props appends, including the reserve the fp/sp/bt room checks use. Definitions that fit keep the stack buffer. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
…every-field Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
…every-field Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This branch has not been deployed
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.
What
build_def_props(inpass_definitions.cand its twin inpass_parallel.c) appends a definition's fields atomically: a field that does not fit is dropped whole. The buffer was sized only for the docstring,variantsandvariant_key, and every other field shared the remaining 2 KB.On wide definitions (long signatures, decorator lists, parameter lists), that left no room for the three fields appended last:
fp: the MinHash fingerprint;sp: the structural profile;bt: the body tokens.They were dropped silently. Such definitions got no
SIMILAR_TOedge and fewerSEMANTICALLY_RELATEDedges. Any newly added property pushed more of them out; #1692'sroute_path/route_methoddroppedfpon 12 long-docstring jellyfin controller actions and cost 34SIMILAR_TOedges.pd_props_buf/pp_props_buf(twins, kept in lockstep) now count:build_def_propsappends;fp/sp/btroom checks use.Definitions that fit keep the stack buffer. The field order is unchanged, so definitions that already fit produce byte-identical properties.
Consumers of these properties are
pass_similarity,pass_semantic_edgesand semantic search; MCP'ssearch_graphalready filtersfp/sp/btout of agent output. None of them depends on the fields being absent, so this is not an index format change.Evidence
Corpus run against current main (354ccec), all PHP and C# corpus repos (PHP 27 par / 26 seq, C# 29 par / 29 seq; the heavy roslyn/runtime pair excluded):
SIMILAR_TOedges are displacements under the per-node edge cap: one endpoint gained a better-ranked neighbour once more definitions carried a fingerprint. The remaining one fits the LSH candidate cap.SEMANTICALLY_RELATEDis TF-IDF with corpus-wide document frequencies plus a threshold. Recovered body tokens shift IDF across the repo, so some near-threshold pairs cross either way.Test:
parallel_wide_definition_keeps_fp_sp_bt_f14, both resolvers.fp,spandbtwithout the fix (props 1,904 B) and keeps all three with it (2,600 B).small, has all three either way (1,026 B, unchanged).Suites run locally:
parallel,pipeline(+ conventions / frozen / semantic-manifest),semantic,incremental,store_search: 819 passed. cppcheck 2.20 (the CI version) and clang-format are clean on the changed files.