qsa_select: signed -- a ranking for indexers whose scores can be negative

qsa_select ranks max(score, 0) and treats a score at or below -1e30 as dead: QSA's block scores
are sums of relus, so the clamp changes nothing there. GLM-5.3's DSA indexer weights its heads by
signed gates, and its block scores can be negative; ranked through the clamp, every negative block
ties at zero and the selection is wrong. `signed` 1 ranks finite scores as they are (-0 tying +0)
and treats nonfinite ones as dead; absent or 0 is the ranking as it was. libref, libavx and libr4d
take it together, since the three declare one schema. docs/OPS.md; tests/r4d_emu/test_qsa.cpp
runs both rankings against the reference.
This commit is contained in:
John McDonough authored and StillDeadcode committed 2026-10-19 20:13:47 +02:00
1 parent 9e0e28315d
commit c8311068d0
8 files changed
+197 -69

No files matched your search

+1 -1
View File
@@ -381,7 +381,7 @@ static const RadParamSpec pQsaScore[] = { P_INT("M"), P_INT("n"), P_INT("heads")
static const RadOperandSpec oQsaScore[] = { OPD("q"), OPD("bk"), OPD("bt"), OPD("cu"), OPD("nc"),
OUT("score") };
static const RadParamSpec pQsaSelect[] = { P_INT("M"), P_INT("blocks"), P_INT("topk"),
P_INT("ratio"), P_INT("seqs") };
P_INT("ratio"), P_INT("seqs"), P_INTO("signed") };
static const RadOperandSpec oQsaSelect[] = { OPD("score"), OPD("bt"), OPD("nc"), OPD("pos"),
OPD("cu"), OUT("sel"), OUT("nsel"), OUT("seqused") };
static const RadParamSpec pQsaTailStore[] = { P_INT("M"), P_INT("n"), P_INT("ratio"), P_INT("ring"),