You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(openspec): plan #1928 Rank the embedding benchmark with numpy - #5140
Replace the pairwise cosine loop of the embedding benchmark with one numpy matrix product over row-normalized vectors, and take recall at 1, 3 and 5, MRR and nDCG at 5 from pytrec_eval. Remove compute_ndcg_at_k and the C901 suppression. Declare numpy and pytrec-eval-terrier, and import both in the Service Image smoke test on linux/amd64. On the #481 fixture the ranking falls from 57 seconds to under one second; corpus embedding still dominates a full run.
Closed with no merge: the typing decision of the plan breaks a quality ceiling.
Task 1.2 adds a second [[tool.mypy.overrides]] entry (module pytrec_eval.*) to pyproject.toml. The ceiling is 1 (tests/invariants/test_architectural_invariants.py:143). CI fails only test_suppressions_stay_under_their_ceilings with "[[tool.mypy.overrides]]: 2 > ceiling 1 in [pyproject.toml]" (job 131340584400, Tests & Coverage shard 3 of 4; job 131342060289, Service Image Tests shard 3 of 6). All other checks pass. A higher ceiling lowers a quality threshold, and only the owner can allow that.
The fix is a stub, not an override. Add typings/pytrec_eval.pyi, as typings/jq.pyi does for jq (pyproject.toml sets mypy_path = "typings"). Name the stub in group 1, and add no [[tool.mypy.overrides]] entry. Also add the requirement "Dependencies declared" of the issue to the spec delta: declare numpy and pytrec-eval-terrier in pyproject.toml and resolve both in uv.lock.
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
scope/openspecOpenSpec changes, specs and their checkstype/docsType docs: a change to the documents
1 participant
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.
Plans #1928
Replace the pairwise cosine loop of the embedding benchmark with one numpy matrix product over row-normalized vectors, and take recall at 1, 3 and 5, MRR and nDCG at 5 from pytrec_eval. Remove compute_ndcg_at_k and the C901 suppression. Declare numpy and pytrec-eval-terrier, and import both in the Service Image smoke test on linux/amd64. On the #481 fixture the ranking falls from 57 seconds to under one second; corpus embedding still dominates a full run.
Change:
openspec/changes/1928-rank-the-benchmark-with-numpy-and/