Skip to content

refactor: split benchmarks.py into themed modules - #5689

Open
CatOn60Hz wants to merge 2 commits into
embeddings-benchmark:mainfrom
CatOn60Hz:refactor/split-benchmarks-module
Open

CatOn60Hz wants to merge 2 commits into
embeddings-benchmark:mainfrom
CatOn60Hz:refactor/split-benchmarks-module

Conversation

@CatOn60Hz

@CatOn60Hz CatOn60Hz commented Oct 17, 2026 •

Copy link
Copy Markdown

What

Splits the 3,956-line mteb/benchmarks/benchmarks/benchmarks.py into themed submodules by modality/domain:

Module Contents
text_language.py per-language MTEB(eng/fra/deu/...) + regional ports (C_MTEB, FA_MTEB, VN_MTEB, JMTEB), BEIR-NL/PL, Encodechka
text_multilingual.py MTEB(Multilingual) v1/v2, MINERS bitext, HUME
code.py MTEB(Code), CoIR, CodeRAG, CoREB
retrieval.py BEIR, BRIGHT*, NanoBEIR*, LongEmbed, LMEB, FollowIR, RAR-b
image.py MIEB*, ViDoRe*, JinaVDR, KoViDoRe, VisRAG
audio_video.py MAEB*, MVEB*
domain.py ChemTEB*, BuiltBench, Law, Medical, R2MED
_citations.py shared MMTEB_CITATION, _MAEB_CITATION

__init__.py re-exports the identical public set, so the namespace-scan registry in get_benchmark is untouched. rteb_benchmarks.py is unchanged.

Verification

Compared the live registry against main:

  • registry names identical — 78 benchmarks
  • aliases identical — 42
  • per-benchmark task sets identical across all 78
  • ruff format/check clean; benchmark test suite: 643 passed, 71 skipped

Notes for reviewers

  • Pure move; no definitions changed. Behavior preservation is verified, not assumed.
  • Preserved exactly: 5 benchmarks defined but never imported in __init__.py (and thus unregistered) on main — MTEB_AFRICA, MTEB_AFRICA_LITE, IFIR, BEIR_PL, VISRAG_RETRIEVAL. VISRAG_RETRIEVAL looks intentional-but-forgotten; happy to export it in a follow-up if desired.
  • Judgment calls open to reshuffle: HUME→multilingual, JMTEB→text_language, R2MED/BuiltBench/Law/Medical→domain.

_This was done with the help of AI and verified by me

@CatOn60Hz
CatOn60Hz marked this pull request as ready for review October 17, 2026 08:35

@KennethEnevoldsen KennethEnevoldsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally looks good

@CatOn60Hz

Copy link
Copy Markdown
Author

@KennethEnevoldsen can u run the test now ??

CatOn60Hz and others added 2 commits October 21, 2026 15:23
The 3,956-line benchmarks.py is split into modality/domain modules
(text_language, text_multilingual, code, retrieval, image, audio_video,
domain) plus _citations.py for shared citation constants. __init__.py
re-exports the identical public set, so the namespace-scan registry in
get_benchmark is unchanged.

Verified against main: registry names (78), aliases (42) and per-benchmark
task sets are all identical; ruff and the benchmark test suite pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address review feedback: drop _citations.py and move the citation
constants to where they are used. _MAEB_CITATION is only used by the
audio benchmarks, so it lives in audio_video.py; MMTEB_CITATION is
defined in text_language.py (its primary users) and imported by the
code and multilingual modules.

Registry names (78), aliases (42), task sets and citations remain
identical to main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CatOn60Hz
CatOn60Hz force-pushed the refactor/split-benchmarks-module branch from d6bb023 to 5cfa9d6 Compare October 21, 2026 09:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants