LSP Ranking Model¶
How dsdld orders the results it returns — which completion comes first, which symbol match wins —
and which signals feed that ordering.
Scope¶
This model is used by dsdld for:
textDocument/completionrerankingworkspace/symbolreranking
It is implemented in:
include/llvmdsdl/LSP/Ranking.hlib/LSP/Ranking.cpp
Feature Set¶
Each candidate gets an explainable score breakdown:
lexical_base: retrieval-stage lexical scorematch_quality: exact/prefix/contains boostsfuzzy_boost: subsequence-match boostfrequency_boost: exposure/selection usage boostrecency_boost: exponential-decay recency boostkind_boost: candidate-kind biaslength_penalty: small name-length penalty
Final score:
total_score = lexical_base + match_quality + fuzzy_boost + frequency_boost + recency_boost + kind_boost + length_penalty
Adaptive Signals¶
Signals are tracked per ranking key:
- exposure count
- selection count
- last update tick
Persistence:
- JSON file in index cache directory:
ranking-signals.json - bounded size (default max entries: 4096)
- least-recent entries are pruned when full
Explainability Endpoint¶
dsdld/debug/scoreExplain
Params:
kind:completionorworkspaceSymbolquery: optional query textlimit: optional row count- for
completion:uri,line,character
Returns a row list containing candidate identity + full score breakdown.