Repository navigation
docs(openspec): plan #1928 Rank the benchmark with numpy and pytrec_eval - #5422
Conversation
713337a to
0c4acff
Compare
|
Bottom line: Head Checks on the pushed head
|
| Point | Status |
|---|---|
other at group 2: rank_corpus returns only the ranked indices, but score_retrieval needs the pair scores for the margins, the separation and the target scores |
Resolved in this revision. rank_corpus returns the score matrix and the ranked indices. score_retrieval takes both, with the target and the category of each query. It reads the margins and the separation from the score matrix. The run that it gives pytrec_eval holds a score that falls as the rank goes up, so trec_eval does not sort equal scores by document identifier. The scenario "Ranking matches pairwise cosine" names both return values, and a new case asserts the margins and the separation. |
other at group 3: test_embedding_benchmark.py keeps its import of cosine_similarity from the runner |
Resolved at 713337a: task 3.2 changes that import in all three test files. |
other and spec_delta_wrong: fractions in the scenario, percentages in group 2 |
Resolved at 713337a: the scenario asserts 100/3 and 200/3 percent, and the design returns percentages. |
verify_form at group 1: the verify passes on the base |
Resolved at 713337a: the verify is the new tests/invariants/test_declared_dependencies.py, which reads pyproject.toml, uv.lock and the stub. |
false_premise at references: the qdrant fake |
Resolved at 713337a: "Unchanged references" says that the fake has its own _cosine_similarity (tests/support/fakes/qdrant.py:25, :194). |
other at specs and criterion_dropped at group 1: a wheel for numpy only |
Resolved at 713337a: the requirement and the invariant test assert a linux x86_64 wheel for each of the two libraries. |
missing_path at group 5: release.yml and the parity test |
Resolved at 713337a: group 5 changes ci.yml, release.yml and tests/commands/test_ci.py, and its verify runs tests/commands/test_ci.py. |
other at feasibility: ci.yml:471, :472, :497 |
Resolved at 713337a: the plan does not cite those lines. It cites the probe at ci.yml:489 and release.yml:388. |
One more change: task 2.2 tells the implement step to import the new module inside each test function. The runner of the closed plan #5140 needed one repair round for this fault.
Before the push
kubectl get jobs -n devops: no active Job.- Record of refactor(ai): rank the benchmark with numpy and pytrec-eval #1928:
stage.pendingis empty and there is nofix_plan.*field. - Loki: no stage line for refactor(ai): rank the benchmark with numpy and pytrec-eval #1928 in the 30 minutes before the push.
- The push used
--force-with-leaseagainst713337a.
Note: the record of #1928 still holds implement.job devops-cli-runner-20261112-163430-77e5 with the state failed. That Job was the runner of #5140, and it does not exist now. The row stage_ready skips an item whose record holds implement.job, so the Service does not read this draft.
The issue proves the removal of compute_ndcg_at_k with a search of src and tests that finds no match. The plan named the helper in a guard test, so that search could not pass. The plan now runs the negative search in group 3 and names the helper in no test. rank_corpus also returns the score matrix, because score_retrieval needs the pair scores for the margins and the separation.
0c4acff to
db99ac2
Compare
|
Bottom line: every review finding is resolved at db99ac2. All checks pass. I remove Revision db99ac2 (rebased onto
Checks on db99ac2:
|
Plans #1928
The embedding benchmark ranks every query against every chunk with one cosine_similarity call per pair and its own recall, MRR and nDCG code. This plan replaces that loop with one numpy matrix product over row-normalized vectors and takes recall at 1, 3 and 5, MRR and nDCG at 5 from pytrec_eval. It deletes compute_ndcg_at_k and the C901 marker, declares numpy and pytrec-eval-terrier in pyproject.toml and uv.lock, and types pytrec_eval with a stub under typings, so no mypy override and no higher suppression ceiling are needed. A new invariant test asserts a resolved entry and a linux x86_64 wheel of each library in the lock. The Service Image smoke probe of both workflows imports both libraries. Corpus embedding still dominates a run.
Change:
openspec/changes/1928-rank-the-benchmark-with-numpy-and/