Repository navigation
fix(pipeline): size definition properties for every field - #2687
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 <[email protected]>
…every-field Signed-off-by: Martin Vogel <[email protected]>
…every-field Signed-off-by: Martin Vogel <[email protected]>
|
Post-merge audit note (clean builds of This PR was measured on PHP and C#, where only
So the change is a correctness fix for Java routes too. One side effect: those artifact edges had been linking callers whose HTTP method is unknown (they land on the Method: bisect with clean builds at every merge point between |
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.