parallax-bench 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. parallax_bench-0.0.1/.github/workflows/ci.yml +50 -0
  2. parallax_bench-0.0.1/.github/workflows/release.yml +38 -0
  3. parallax_bench-0.0.1/.gitignore +11 -0
  4. parallax_bench-0.0.1/CHANGELOG.md +18 -0
  5. parallax_bench-0.0.1/CITATION.cff +16 -0
  6. parallax_bench-0.0.1/LICENSE +202 -0
  7. parallax_bench-0.0.1/PKG-INFO +144 -0
  8. parallax_bench-0.0.1/README.md +108 -0
  9. parallax_bench-0.0.1/benchmark/DATASHEET.md +57 -0
  10. parallax_bench-0.0.1/benchmark/LICENSE-DATA +396 -0
  11. parallax_bench-0.0.1/benchmark/build/fetch_corpus.py +35 -0
  12. parallax_bench-0.0.1/benchmark/build/make_queries.py +171 -0
  13. parallax_bench-0.0.1/benchmark/build/make_smoke.py +79 -0
  14. parallax_bench-0.0.1/benchmark/build/make_smoke_queries.py +152 -0
  15. parallax_bench-0.0.1/benchmark/smoke/docs/cs/31985L0374.txt +243 -0
  16. parallax_bench-0.0.1/benchmark/smoke/docs/cs/31993L0013.txt +233 -0
  17. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32000L0031.txt +679 -0
  18. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32001L0029.txt +457 -0
  19. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32002L0058.txt +392 -0
  20. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32005L0029.txt +1479 -0
  21. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32006L0114.txt +848 -0
  22. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32011L0083.txt +2430 -0
  23. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32019L1024.txt +2047 -0
  24. parallax_bench-0.0.1/benchmark/smoke/docs/cs/32019R1150.txt +1172 -0
  25. parallax_bench-0.0.1/benchmark/smoke/docs/de/31985L0374.txt +247 -0
  26. parallax_bench-0.0.1/benchmark/smoke/docs/de/31993L0013.txt +240 -0
  27. parallax_bench-0.0.1/benchmark/smoke/docs/de/32000L0031.txt +709 -0
  28. parallax_bench-0.0.1/benchmark/smoke/docs/de/32001L0029.txt +473 -0
  29. parallax_bench-0.0.1/benchmark/smoke/docs/de/32002L0058.txt +415 -0
  30. parallax_bench-0.0.1/benchmark/smoke/docs/de/32005L0029.txt +1479 -0
  31. parallax_bench-0.0.1/benchmark/smoke/docs/de/32006L0114.txt +848 -0
  32. parallax_bench-0.0.1/benchmark/smoke/docs/de/32011L0083.txt +2433 -0
  33. parallax_bench-0.0.1/benchmark/smoke/docs/de/32019L1024.txt +2053 -0
  34. parallax_bench-0.0.1/benchmark/smoke/docs/de/32019R1150.txt +1172 -0
  35. parallax_bench-0.0.1/benchmark/smoke/docs/en/31985L0374.txt +243 -0
  36. parallax_bench-0.0.1/benchmark/smoke/docs/en/31993L0013.txt +415 -0
  37. parallax_bench-0.0.1/benchmark/smoke/docs/en/32000L0031.txt +709 -0
  38. parallax_bench-0.0.1/benchmark/smoke/docs/en/32001L0029.txt +477 -0
  39. parallax_bench-0.0.1/benchmark/smoke/docs/en/32002L0058.txt +415 -0
  40. parallax_bench-0.0.1/benchmark/smoke/docs/en/32005L0029.txt +1486 -0
  41. parallax_bench-0.0.1/benchmark/smoke/docs/en/32006L0114.txt +848 -0
  42. parallax_bench-0.0.1/benchmark/smoke/docs/en/32011L0083.txt +2433 -0
  43. parallax_bench-0.0.1/benchmark/smoke/docs/en/32019L1024.txt +2047 -0
  44. parallax_bench-0.0.1/benchmark/smoke/docs/en/32019R1150.txt +1172 -0
  45. parallax_bench-0.0.1/benchmark/smoke/generation.md +14 -0
  46. parallax_bench-0.0.1/benchmark/smoke/manifest.jsonl +30 -0
  47. parallax_bench-0.0.1/benchmark/smoke/qrels.txt +60 -0
  48. parallax_bench-0.0.1/benchmark/smoke/queries.jsonl +60 -0
  49. parallax_bench-0.0.1/benchmark/v1/generation.md +22 -0
  50. parallax_bench-0.0.1/deploy/heroku/Procfile +1 -0
  51. parallax_bench-0.0.1/deploy/heroku/app.json +37 -0
  52. parallax_bench-0.0.1/docs/adding-a-system.md +74 -0
  53. parallax_bench-0.0.1/docs/data-format.md +132 -0
  54. parallax_bench-0.0.1/docs/limitations.md +74 -0
  55. parallax_bench-0.0.1/docs/methodology.md +86 -0
  56. parallax_bench-0.0.1/docs/releasing.md +83 -0
  57. parallax_bench-0.0.1/pyproject.toml +74 -0
  58. parallax_bench-0.0.1/runs/2026-08-26-smoke-baseline-local-retrieval-9c2cebe99dc7/README.md +8 -0
  59. parallax_bench-0.0.1/runs/2026-08-26-smoke-baseline-local-retrieval-9c2cebe99dc7/config.json +16 -0
  60. parallax_bench-0.0.1/runs/2026-08-26-smoke-baseline-local-retrieval-9c2cebe99dc7/manifest.lock +30 -0
  61. parallax_bench-0.0.1/runs/2026-08-26-smoke-baseline-local-retrieval-9c2cebe99dc7/metrics.csv +46 -0
  62. parallax_bench-0.0.1/runs/2026-08-26-smoke-baseline-local-retrieval-9c2cebe99dc7/per_query.csv +901 -0
  63. parallax_bench-0.0.1/runs/2026-08-26-smoke-baseline-local-retrieval-9c2cebe99dc7/stats.csv +11 -0
  64. parallax_bench-0.0.1/runs/2026-08-26-smoke-baseline-local-retrieval-9c2cebe99dc7/system.json +16 -0
  65. parallax_bench-0.0.1/runs/README.md +20 -0
  66. parallax_bench-0.0.1/src/parallax_bench/__init__.py +8 -0
  67. parallax_bench-0.0.1/src/parallax_bench/adapters/__init__.py +3 -0
  68. parallax_bench-0.0.1/src/parallax_bench/adapters/base.py +72 -0
  69. parallax_bench-0.0.1/src/parallax_bench/adapters/baseline_local.py +262 -0
  70. parallax_bench-0.0.1/src/parallax_bench/adapters/edge_ant.py +257 -0
  71. parallax_bench-0.0.1/src/parallax_bench/cli.py +348 -0
  72. parallax_bench-0.0.1/src/parallax_bench/config.py +131 -0
  73. parallax_bench-0.0.1/src/parallax_bench/data.py +362 -0
  74. parallax_bench-0.0.1/src/parallax_bench/fetch.py +184 -0
  75. parallax_bench-0.0.1/src/parallax_bench/metrics/__init__.py +0 -0
  76. parallax_bench-0.0.1/src/parallax_bench/metrics/generation.py +145 -0
  77. parallax_bench-0.0.1/src/parallax_bench/metrics/retrieval.py +84 -0
  78. parallax_bench-0.0.1/src/parallax_bench/metrics/stats.py +87 -0
  79. parallax_bench-0.0.1/src/parallax_bench/runner/__init__.py +0 -0
  80. parallax_bench-0.0.1/src/parallax_bench/runner/generation.py +53 -0
  81. parallax_bench-0.0.1/src/parallax_bench/runner/ingest.py +125 -0
  82. parallax_bench-0.0.1/src/parallax_bench/runner/plan.py +75 -0
  83. parallax_bench-0.0.1/src/parallax_bench/runner/queue.py +229 -0
  84. parallax_bench-0.0.1/src/parallax_bench/runner/retrieval.py +45 -0
  85. parallax_bench-0.0.1/src/parallax_bench/scoring.py +233 -0
  86. parallax_bench-0.0.1/systems.example.toml +24 -0
  87. parallax_bench-0.0.1/tests/test_baseline_local.py +56 -0
  88. parallax_bench-0.0.1/tests/test_cli_smoke.py +90 -0
  89. parallax_bench-0.0.1/tests/test_data.py +98 -0
  90. parallax_bench-0.0.1/tests/test_edge_ant.py +109 -0
  91. parallax_bench-0.0.1/tests/test_metrics_retrieval.py +66 -0
  92. parallax_bench-0.0.1/tests/test_queue.py +80 -0
  93. parallax_bench-0.0.1/tests/test_reproducibility.py +67 -0
  94. parallax_bench-0.0.1/tests/test_stats.py +45 -0
  95. parallax_bench-0.0.1/tests/test_third_party_adapter.py +45 -0
@@ -0,0 +1,50 @@
1
+ name: ci
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.12", "3.13"]
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with: { fetch-depth: 0 }
17
+ - uses: actions/setup-python@v5
18
+ with: { python-version: "${{ matrix.python-version }}" }
19
+ - run: pip install -e ".[dev]"
20
+
21
+ # 1. dataset integrity
22
+ - run: parallax-bench validate
23
+
24
+ # 2. the quickstart contract — offline, no GPU, under two minutes
25
+ - name: smoke end-to-end
26
+ run: |
27
+ timeout 120 parallax-bench run --system baseline-local --subset smoke
28
+ parallax-bench score
29
+ parallax-bench report
30
+
31
+ # 3. hygiene
32
+ - run: ruff check src tests benchmark/build
33
+ - run: mypy src/parallax_bench
34
+ - run: pytest -q
35
+
36
+ secrets:
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ with: { fetch-depth: 0 }
41
+ - name: gitleaks (full history)
42
+ run: |
43
+ curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.24.3/gitleaks_8.24.3_linux_x64.tar.gz | tar xz gitleaks
44
+ ./gitleaks git --no-banner --redact --exit-code 1 .
45
+ - name: no production hostnames or instance topology
46
+ run: |
47
+ ! grep -rEn "edgeant\.cz|instances\.conf|JWT_SECRET_KEY *= *[^$ ]" \
48
+ --include="*.py" --include="*.toml" --include="*.md" --include="*.json" \
49
+ --exclude-dir=.git . \
50
+ || { echo "::error::production identifier or secret in the diff"; exit 1; }
@@ -0,0 +1,38 @@
1
+ name: release
2
+ on:
3
+ release:
4
+ types: [published]
5
+ # manual re-publish of an existing tag (e.g. the release event got lost):
6
+ # gh workflow run release.yml --ref v0.1.0
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: refuse manual runs that are not on a tag
14
+ if: github.event_name == 'workflow_dispatch' && !startsWith(github.ref, 'refs/tags/')
15
+ run: |
16
+ echo "::error::hatch-vcs derives the version from the tag — a run on a branch would publish a dev version. Use: gh workflow run release.yml --ref vX.Y.Z"
17
+ exit 1
18
+ - uses: actions/checkout@v4
19
+ with: { fetch-depth: 0 } # hatch-vcs needs tags
20
+ - uses: actions/setup-python@v5
21
+ with: { python-version: "3.12" }
22
+ - run: pipx run build
23
+ - run: pipx run twine check dist/*
24
+ - name: verify bundled data made it into the wheel
25
+ run: python -m zipfile -l dist/parallax_bench-*.whl | grep -q "_data/smoke/queries.jsonl"
26
+ - uses: actions/upload-artifact@v4
27
+ with: { name: dist, path: dist/ }
28
+
29
+ publish:
30
+ needs: build
31
+ runs-on: ubuntu-latest
32
+ environment: pypi
33
+ permissions:
34
+ id-token: write # OIDC — the whole trick
35
+ steps:
36
+ - uses: actions/download-artifact@v4
37
+ with: { name: dist, path: dist/ }
38
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,11 @@
1
+ .idea
2
+ .venv
3
+ __pycache__/
4
+ *.pyc
5
+ .pytest_cache/
6
+ .mypy_cache/
7
+ .ruff_cache/
8
+ dist/
9
+ *.egg-info/
10
+ corpus-store/
11
+ .parallax/
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ - Data format (`queries.jsonl`, `qrels.txt`, `manifest.jsonl`) and
6
+ `parallax-bench validate`
7
+ - Adapter protocol (`describe` / `index` / `search` / `generate`) with two
8
+ adapters: `baseline_local` (built-in BM25 + optional dense) and `edge_ant`
9
+ - Retrieval metrics (nDCG, Recall, MRR, Success@1) verified against
10
+ `pytrec_eval`; bootstrap CIs, paired Wilcoxon, Holm correction
11
+ - Mechanical generation metrics: citation accuracy, response language
12
+ correctness
13
+ - Resumable DB-backed runner (SQLite/Postgres), `run` / `score` / `report`
14
+ - `smoke` subset: 10 documents × 3 languages with texts, offline quickstart
15
+ - Reproducibility level 1+2: two-hash manifest (`sha256_source` informative,
16
+ `sha256_text` binding, versioned extractor), frozen text normalization,
17
+ content-addressed `corpus-store/`, network-free verified ingest, per-run
18
+ `manifest.lock`, redacted resolved `config.json`, `verify` drift report
@@ -0,0 +1,16 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use parallax-bench, please cite it as below."
3
+ title: "parallax-bench: Measuring language-induced retrieval displacement in RAG systems using parallel corpora"
4
+ type: software
5
+ authors:
6
+ - family-names: "Brůha"
7
+ given-names: "Ondřej"
8
+ email: "ondrej.bruha@alphacodes.eu"
9
+ repository-code: "https://github.com/ondrejbruha/parallax-bench"
10
+ license: Apache-2.0
11
+ keywords:
12
+ - retrieval-augmented generation
13
+ - multilingual retrieval
14
+ - benchmark
15
+ - parallel corpora
16
+ - Czech
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.5
2
+ Name: parallax-bench
3
+ Version: 0.0.1
4
+ Summary: Measuring language-induced retrieval displacement in RAG systems using parallel corpora
5
+ Project-URL: Homepage, https://github.com/ondrejbruha/parallax-bench
6
+ Project-URL: Repository, https://github.com/ondrejbruha/parallax-bench
7
+ Author-email: Ondřej Brůha <ondrej.bruha@alphacodes.eu>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: benchmark,czech,evaluation,multilingual,rag,retrieval
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Requires-Python: >=3.12
18
+ Requires-Dist: httpx[http2]>=0.27
19
+ Requires-Dist: pandas>=2.2
20
+ Requires-Dist: pydantic>=2.7
21
+ Requires-Dist: scipy>=1.13
22
+ Requires-Dist: sqlalchemy>=2.0
23
+ Requires-Dist: tenacity>=8.3
24
+ Requires-Dist: typer>=0.12
25
+ Provides-Extra: baseline
26
+ Requires-Dist: sentence-transformers; extra == 'baseline'
27
+ Provides-Extra: dev
28
+ Requires-Dist: mypy; extra == 'dev'
29
+ Requires-Dist: pytest; extra == 'dev'
30
+ Requires-Dist: pytrec-eval-terrier; extra == 'dev'
31
+ Requires-Dist: ruff; extra == 'dev'
32
+ Provides-Extra: web
33
+ Requires-Dist: fastapi; extra == 'web'
34
+ Requires-Dist: uvicorn; extra == 'web'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # parallax-bench
38
+
39
+ *Measuring language-induced retrieval displacement in RAG systems using
40
+ parallel corpora.*
41
+
42
+ Parallax is the effect where **the same object appears at a different position
43
+ when viewed from a different vantage point**. This benchmark measures that
44
+ **the same document lands at a different rank when you ask about it in a
45
+ different language** — with everything else (content, models, configuration,
46
+ hardware) held constant.
47
+
48
+ The PARALLAX benchmark uses parallel EU legislative corpora: the same document
49
+ exists in many languages under a stable CELEX identifier. Ingesting each
50
+ language into its own index and running every query variant against every
51
+ index yields a fully controlled X×X matrix:
52
+
53
+ - **diagonal** — monolingual RAG (query language = document language)
54
+ - **off-diagonal** — cross-lingual retrieval
55
+ - **all indexes at once** — MultiRAG
56
+
57
+ Because ground truth is at *document* level and the document keeps the same ID
58
+ across languages, **a single TREC-format qrels file is valid for every cell of
59
+ the matrix** — monolingual and cross-lingual runs are scored by identical code
60
+ over identical judgements.
61
+
62
+ ## Quickstart (two minutes, offline)
63
+
64
+ ```bash
65
+ pip install parallax-bench
66
+ parallax-bench run --system baseline-local --subset smoke
67
+ parallax-bench score
68
+ parallax-bench report
69
+ ```
70
+
71
+ No GPU, no API key, no server, no Postgres — the `smoke` subset ships with
72
+ document texts and the local baseline (BM25, optionally + dense via
73
+ `pip install 'parallax-bench[baseline]'`) runs anywhere. CI runs exactly these
74
+ commands on every PR.
75
+
76
+ ## Benchmarking a real system
77
+
78
+ ```bash
79
+ pip install parallax-bench
80
+ parallax-bench fetch --data-version v1 # download ONCE into corpus-store/, verify sha256_text
81
+ parallax-bench ingest --system my-system # reads only the frozen snapshot — never the network
82
+ parallax-bench run --system my-system --phase retrieval
83
+ parallax-bench run --system my-system --phase generation
84
+ parallax-bench score --run <run_id>
85
+ parallax-bench report --run <run_id>
86
+ parallax-bench verify --data-version v1 # measure source drift; fixes nothing
87
+ ```
88
+
89
+ Systems are defined in `systems.toml` (see `systems.example.toml`) as an
90
+ adapter class plus configuration. Ablations are expressed as two configured
91
+ instances of the same adapter — never as extra protocol parameters. The
92
+ adapter protocol has exactly four methods (`describe`, `index`, `search`,
93
+ `generate`); see [docs/adding-a-system.md](docs/adding-a-system.md).
94
+
95
+ `run` is resumable: the task queue lives in a database (SQLite by default,
96
+ any SQLAlchemy URL — e.g. Heroku Postgres — via `--db` or `$DATABASE_URL`).
97
+ Interrupt at any point; `run --resume <id>` picks up where it stopped.
98
+ `score` is separate from `run`, so metrics can be recomputed under different
99
+ definitions without repeating a forty-hour collection.
100
+
101
+ ## Results & reproducibility
102
+
103
+ Aggregated metrics for our runs live in [`runs/`](runs/) as small, diffable
104
+ CSVs; raw rankings are attached to GitHub releases. Every run directory
105
+ carries full provenance: `config.json` (resolved configuration, secrets
106
+ visibly redacted), `system.json` (read from the running system, never
107
+ assumed), and `manifest.lock` (the binding `sha256_text` of every document
108
+ that went into the index).
109
+
110
+ Results are **verifiable**: every published number carries the full
111
+ provenance needed to check it (`runs/<id>/`). The corpus snapshot used for
112
+ these runs is **not yet publicly archived**, so third-party re-execution on
113
+ the identical documents is not possible at this time. The manifest records
114
+ `sha256_text` for every document, so an archive published later can be
115
+ verified against the numbers already reported. Rebuilding the corpus from
116
+ EUR-Lex is best-effort; `parallax-bench verify` measures source drift
117
+ rather than assuming its absence.
118
+
119
+ To add your own system's results, open a PR adding a `runs/<id>/` directory —
120
+ CI validates the schema. There is no submission leaderboard by design.
121
+
122
+ ## Dataset
123
+
124
+ `benchmark/v1/` contains queries, TREC qrels and a corpus **manifest** —
125
+ `(celex, lang) → URL + sha256`. Document texts are **not redistributed**
126
+ (licensing, size, and trust: it is immediately visible that nobody touched
127
+ the documents). `parallax-bench fetch` downloads them from EUR-Lex and
128
+ verifies checksums; if a source document changes, the run fails loudly.
129
+
130
+ The single exception is `benchmark/smoke/` (10 documents × 3 languages,
131
+ including texts) which exists so the quickstart works offline.
132
+
133
+ ## Licensing
134
+
135
+ Dual-licensed on purpose: **code** (`src/`, `tests/`, `benchmark/build/`)
136
+ under [Apache-2.0](LICENSE); **queries + qrels** (`benchmark/*/`) under
137
+ [CC BY 4.0](benchmark/LICENSE-DATA). Corpus documents are not redistributed;
138
+ EUR-Lex content is reusable under Decision 2011/833/EU with attribution.
139
+
140
+ ## Citation
141
+
142
+ See [CITATION.cff](CITATION.cff). Code versions follow semver; dataset
143
+ versions (`v1`, `v2`, …) are independent, each with its own Zenodo DOI, and a
144
+ released dataset version is never modified in place.
@@ -0,0 +1,108 @@
1
+ # parallax-bench
2
+
3
+ *Measuring language-induced retrieval displacement in RAG systems using
4
+ parallel corpora.*
5
+
6
+ Parallax is the effect where **the same object appears at a different position
7
+ when viewed from a different vantage point**. This benchmark measures that
8
+ **the same document lands at a different rank when you ask about it in a
9
+ different language** — with everything else (content, models, configuration,
10
+ hardware) held constant.
11
+
12
+ The PARALLAX benchmark uses parallel EU legislative corpora: the same document
13
+ exists in many languages under a stable CELEX identifier. Ingesting each
14
+ language into its own index and running every query variant against every
15
+ index yields a fully controlled X×X matrix:
16
+
17
+ - **diagonal** — monolingual RAG (query language = document language)
18
+ - **off-diagonal** — cross-lingual retrieval
19
+ - **all indexes at once** — MultiRAG
20
+
21
+ Because ground truth is at *document* level and the document keeps the same ID
22
+ across languages, **a single TREC-format qrels file is valid for every cell of
23
+ the matrix** — monolingual and cross-lingual runs are scored by identical code
24
+ over identical judgements.
25
+
26
+ ## Quickstart (two minutes, offline)
27
+
28
+ ```bash
29
+ pip install parallax-bench
30
+ parallax-bench run --system baseline-local --subset smoke
31
+ parallax-bench score
32
+ parallax-bench report
33
+ ```
34
+
35
+ No GPU, no API key, no server, no Postgres — the `smoke` subset ships with
36
+ document texts and the local baseline (BM25, optionally + dense via
37
+ `pip install 'parallax-bench[baseline]'`) runs anywhere. CI runs exactly these
38
+ commands on every PR.
39
+
40
+ ## Benchmarking a real system
41
+
42
+ ```bash
43
+ pip install parallax-bench
44
+ parallax-bench fetch --data-version v1 # download ONCE into corpus-store/, verify sha256_text
45
+ parallax-bench ingest --system my-system # reads only the frozen snapshot — never the network
46
+ parallax-bench run --system my-system --phase retrieval
47
+ parallax-bench run --system my-system --phase generation
48
+ parallax-bench score --run <run_id>
49
+ parallax-bench report --run <run_id>
50
+ parallax-bench verify --data-version v1 # measure source drift; fixes nothing
51
+ ```
52
+
53
+ Systems are defined in `systems.toml` (see `systems.example.toml`) as an
54
+ adapter class plus configuration. Ablations are expressed as two configured
55
+ instances of the same adapter — never as extra protocol parameters. The
56
+ adapter protocol has exactly four methods (`describe`, `index`, `search`,
57
+ `generate`); see [docs/adding-a-system.md](docs/adding-a-system.md).
58
+
59
+ `run` is resumable: the task queue lives in a database (SQLite by default,
60
+ any SQLAlchemy URL — e.g. Heroku Postgres — via `--db` or `$DATABASE_URL`).
61
+ Interrupt at any point; `run --resume <id>` picks up where it stopped.
62
+ `score` is separate from `run`, so metrics can be recomputed under different
63
+ definitions without repeating a forty-hour collection.
64
+
65
+ ## Results & reproducibility
66
+
67
+ Aggregated metrics for our runs live in [`runs/`](runs/) as small, diffable
68
+ CSVs; raw rankings are attached to GitHub releases. Every run directory
69
+ carries full provenance: `config.json` (resolved configuration, secrets
70
+ visibly redacted), `system.json` (read from the running system, never
71
+ assumed), and `manifest.lock` (the binding `sha256_text` of every document
72
+ that went into the index).
73
+
74
+ Results are **verifiable**: every published number carries the full
75
+ provenance needed to check it (`runs/<id>/`). The corpus snapshot used for
76
+ these runs is **not yet publicly archived**, so third-party re-execution on
77
+ the identical documents is not possible at this time. The manifest records
78
+ `sha256_text` for every document, so an archive published later can be
79
+ verified against the numbers already reported. Rebuilding the corpus from
80
+ EUR-Lex is best-effort; `parallax-bench verify` measures source drift
81
+ rather than assuming its absence.
82
+
83
+ To add your own system's results, open a PR adding a `runs/<id>/` directory —
84
+ CI validates the schema. There is no submission leaderboard by design.
85
+
86
+ ## Dataset
87
+
88
+ `benchmark/v1/` contains queries, TREC qrels and a corpus **manifest** —
89
+ `(celex, lang) → URL + sha256`. Document texts are **not redistributed**
90
+ (licensing, size, and trust: it is immediately visible that nobody touched
91
+ the documents). `parallax-bench fetch` downloads them from EUR-Lex and
92
+ verifies checksums; if a source document changes, the run fails loudly.
93
+
94
+ The single exception is `benchmark/smoke/` (10 documents × 3 languages,
95
+ including texts) which exists so the quickstart works offline.
96
+
97
+ ## Licensing
98
+
99
+ Dual-licensed on purpose: **code** (`src/`, `tests/`, `benchmark/build/`)
100
+ under [Apache-2.0](LICENSE); **queries + qrels** (`benchmark/*/`) under
101
+ [CC BY 4.0](benchmark/LICENSE-DATA). Corpus documents are not redistributed;
102
+ EUR-Lex content is reusable under Decision 2011/833/EU with attribution.
103
+
104
+ ## Citation
105
+
106
+ See [CITATION.cff](CITATION.cff). Code versions follow semver; dataset
107
+ versions (`v1`, `v2`, …) are independent, each with its own Zenodo DOI, and a
108
+ released dataset version is never modified in place.
@@ -0,0 +1,57 @@
1
+ # Datasheet — the PARALLAX benchmark dataset
2
+
3
+ Following the structure of *Datasheets for Datasets* (Gebru et al., 2021),
4
+ abbreviated to what applies.
5
+
6
+ ## Motivation
7
+
8
+ **Why was the dataset created?** To measure language-induced retrieval
9
+ displacement in RAG systems: how the rank of the *same document* changes when
10
+ the *same question* is asked in a different language, everything else held
11
+ constant. No existing benchmark isolates the language variable this way, and
12
+ Czech is heavily underrepresented in RAG evaluation resources.
13
+
14
+ **Who created it?** Ondřej Brůha, as part of a master's thesis on evaluating
15
+ multilingual RAG systems using parallel legislative corpora.
16
+
17
+ ## Composition
18
+
19
+ - **Queries** (`queries.jsonl`) — parallel language variants of the same
20
+ underlying question, bound by `query_group`. Each targets exactly one
21
+ source document.
22
+ - **Relevance judgements** (`qrels.txt`) — TREC format, *document*
23
+ granularity. Because documents keep the same CELEX id across languages, a
24
+ single qrels file is valid for every query-language × index-language cell.
25
+ - **Corpus manifest** (`manifest.jsonl`) — `(celex, lang) → URL + sha256 +
26
+ length`. **Document texts are not part of the dataset** (see below).
27
+ - **Smoke subset** (`smoke/`) — 10 documents × 3 languages (cs, en, de)
28
+ *including texts*, 20 hand-authored query groups. Exists so the quickstart
29
+ runs offline; not intended for drawing conclusions.
30
+
31
+ ## Collection & generation
32
+
33
+ Corpus documents come from EUR-Lex (parallel EU legislation, stable CELEX
34
+ identifiers). Query generation is documented verbatim — prompt, model,
35
+ date — in each version's `generation.md`. Where an LLM generated or
36
+ translated queries, this is disclosed there; primary sets are
37
+ pivot-generated (English) and translated (`origin: "translated"`), with a
38
+ native-generation validation sample (`origin: "native"`).
39
+
40
+ ## Distribution & licensing
41
+
42
+ Queries and qrels: **CC BY 4.0** (`LICENSE-DATA`). Corpus texts are **not
43
+ redistributed** — three reasons: upstream dataset licences vary; size; and
44
+ trust (it is immediately verifiable that documents are untouched — `fetch`
45
+ re-downloads from the source and checks sha256). EUR-Lex content itself is
46
+ reusable under Commission Decision 2011/833/EU with source attribution.
47
+
48
+ ## Known limitations
49
+
50
+ See `docs/limitations.md` — translationese in translated queries,
51
+ document-level (not chunk-level) ground truth, legal domain as primary,
52
+ automatically derived relevance without full human verification.
53
+
54
+ ## Maintenance
55
+
56
+ Dataset versions (`v1`, `v2`, …) are immutable once released; each gets its
57
+ own DOI via the GitHub–Zenodo integration. Corrections produce a new version.