evalsuite-python 1.0.0__tar.gz → 1.1.0__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 (143) hide show
  1. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/CHANGELOG.md +22 -0
  2. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/PKG-INFO +2 -2
  3. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/README.md +1 -1
  4. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/pyproject.toml +6 -0
  5. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/Cargo.lock +6 -6
  6. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/Cargo.toml +1 -1
  7. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/surface.rs +20 -21
  8. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/text.rs +105 -14
  9. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/version.py +1 -1
  10. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/CONTRIBUTING.md +0 -0
  11. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/LICENSE +0 -0
  12. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/LICENSE-APACHE +0 -0
  13. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/Cargo.toml +0 -0
  14. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/README.md +0 -0
  15. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/agreement.rs +0 -0
  16. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/coco.rs +0 -0
  17. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/curve.rs +0 -0
  18. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/groups.rs +0 -0
  19. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/hash.rs +0 -0
  20. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/lib.rs +0 -0
  21. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/meteor.rs +0 -0
  22. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/permutation.rs +0 -0
  23. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/qa.rs +0 -0
  24. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/ranks.rs +0 -0
  25. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/resample.rs +0 -0
  26. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-core/src/ter.rs +0 -0
  27. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-py/Cargo.toml +0 -0
  28. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/rust/evalsuite-py/src/lib.rs +0 -0
  29. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/__init__.py +0 -0
  30. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/__main__.py +0 -0
  31. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/_bench_metrics.py +0 -0
  32. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/_evalci.py +0 -0
  33. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/_lazy.py +0 -0
  34. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/_native.py +0 -0
  35. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/api.py +0 -0
  36. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/benchmarks.py +0 -0
  37. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/calibration.py +0 -0
  38. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/cards.py +0 -0
  39. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/classification/__init__.py +0 -0
  40. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/classification/_common.py +0 -0
  41. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/classification/metrics.py +0 -0
  42. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/cli/__init__.py +0 -0
  43. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/cli/main.py +0 -0
  44. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/clinical/__init__.py +0 -0
  45. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/clinical/metrics.py +0 -0
  46. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/clinical/report.py +0 -0
  47. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/__init__.py +0 -0
  48. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/context.py +0 -0
  49. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/exceptions.py +0 -0
  50. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/export.py +0 -0
  51. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/registry.py +0 -0
  52. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/result.py +0 -0
  53. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/types.py +0 -0
  54. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/core/validation.py +0 -0
  55. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/harness.py +0 -0
  56. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/integrations.py +0 -0
  57. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/__init__.py +0 -0
  58. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/_common.py +0 -0
  59. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/agents.py +0 -0
  60. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/code.py +0 -0
  61. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/efficiency.py +0 -0
  62. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/longcontext.py +0 -0
  63. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/multilingual.py +0 -0
  64. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/robustness.py +0 -0
  65. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/safety.py +0 -0
  66. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/llmsys/uncertainty.py +0 -0
  67. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/monitor.py +0 -0
  68. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/plot.py +0 -0
  69. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/py.typed +0 -0
  70. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/regression/__init__.py +0 -0
  71. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/regression/metrics.py +0 -0
  72. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/reporting.py +0 -0
  73. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/__init__.py +0 -0
  74. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/_resolve.py +0 -0
  75. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/compare.py +0 -0
  76. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/effect.py +0 -0
  77. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/hypothesis.py +0 -0
  78. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/intervals.py +0 -0
  79. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/paired.py +0 -0
  80. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/stats/results.py +0 -0
  81. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/__init__.py +0 -0
  82. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/_common.py +0 -0
  83. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/factuality.py +0 -0
  84. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/generation.py +0 -0
  85. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/judge.py +0 -0
  86. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/qa.py +0 -0
  87. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/rag.py +0 -0
  88. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/reasoning.py +0 -0
  89. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/report.py +0 -0
  90. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/retrieval.py +0 -0
  91. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/semantic.py +0 -0
  92. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/spice.py +0 -0
  93. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/text/structured.py +0 -0
  94. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/vision/__init__.py +0 -0
  95. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/vision/detection.py +0 -0
  96. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/src/evalsuite/vision/segmentation.py +0 -0
  97. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/__init__.py +0 -0
  98. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/classification/__init__.py +0 -0
  99. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/classification/test_against_sklearn.py +0 -0
  100. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/clinical/__init__.py +0 -0
  101. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/clinical/test_outputs.py +0 -0
  102. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/clinical/test_v020.py +0 -0
  103. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/conftest.py +0 -0
  104. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/integration/__init__.py +0 -0
  105. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/integration/test_qa.py +0 -0
  106. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/integration/test_readme_examples.py +0 -0
  107. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/integration/test_repo_hygiene.py +0 -0
  108. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/llmsys/__init__.py +0 -0
  109. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/llmsys/test_code_longcontext_efficiency.py +0 -0
  110. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/llmsys/test_edges.py +0 -0
  111. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/llmsys/test_fast_text.py +0 -0
  112. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/llmsys/test_hardening.py +0 -0
  113. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/llmsys/test_safety_robustness.py +0 -0
  114. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/llmsys/test_uncertainty_agents_multilingual.py +0 -0
  115. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/output/__init__.py +0 -0
  116. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/output/test_benchmarks.py +0 -0
  117. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/output/test_cli.py +0 -0
  118. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/output/test_plot.py +0 -0
  119. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/output/test_reporting.py +0 -0
  120. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/regression/__init__.py +0 -0
  121. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/regression/test_against_sklearn.py +0 -0
  122. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/stats/__init__.py +0 -0
  123. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/stats/test_branches.py +0 -0
  124. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/stats/test_compare.py +0 -0
  125. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/stats/test_fast_paths.py +0 -0
  126. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/stats/test_reference.py +0 -0
  127. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/test_cards.py +0 -0
  128. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/test_harness.py +0 -0
  129. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/test_integrations.py +0 -0
  130. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/test_monitor.py +0 -0
  131. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/test_native.py +0 -0
  132. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/text/__init__.py +0 -0
  133. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/text/test_against_references.py +0 -0
  134. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/text/test_text_edges.py +0 -0
  135. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/text/test_v040.py +0 -0
  136. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/unit/__init__.py +0 -0
  137. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/unit/test_core.py +0 -0
  138. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/unit/test_edges.py +0 -0
  139. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/vision/__init__.py +0 -0
  140. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/vision/test_detection.py +0 -0
  141. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/vision/test_edges.py +0 -0
  142. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/vision/test_outputs.py +0 -0
  143. {evalsuite_python-1.0.0 → evalsuite_python-1.1.0}/tests/vision/test_segmentation.py +0 -0
@@ -6,6 +6,28 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.0] - 2026-11-26
10
+
11
+ ### Added
12
+ - **The engine everywhere**: npm, C, R and Julia now cover clinical metrics (sensitivity, PPV, NPV, likelihood
13
+ ratios, diagnostic odds ratio, Youden's J, net benefit), calibration (slope, intercept, ECE, MCE,
14
+ Hosmer–Lemeshow), retrieval (NDCG, MRR, MAP, precision / recall / hit rate at k) and segmentation (Dice, IoU),
15
+ in addition to the 1.0 set.
16
+ - **Confidence intervals in every language**: `ci: "analytic"` (Wilson for proportions, DeLong for ROC AUC,
17
+ bootstrap otherwise) or `ci: "bootstrap"` (seeded BCa) returns `ci_low` / `ci_high` alongside the value.
18
+ - **Leaderboard in the engine** (`leaderboard`): Wilson intervals, McNemar tests with Holm adjustment and
19
+ significance-aware ranks, available from JavaScript, C, R and Julia.
20
+ - **R package distribution**: a self-contained source package (Rust sources vendored, offline build, Windows
21
+ support) checked with `R CMD check`, attached to each release and published to the `r-package` branch for
22
+ R-universe. **Julia**: a BinaryBuilder recipe for `EvalSuite_jll`.
23
+ - **Example notebooks** (Colab): classification quickstart, clinical TRIPOD+AI, LLM leaderboard, monitoring,
24
+ vision.
25
+
26
+ ### Changed
27
+ - BLEU 1.3× and HD95 1.6× faster than the Python reference path (memoised 13a tokenization, byte-level
28
+ tokenizer, per-segment vocabularies, packed n-gram matching; row-parallel surface scan, allocation-free label
29
+ checks). Results unchanged.
30
+
9
31
  ## [1.0.0] - 2026-11-25
10
32
 
11
33
  EvalSuite 1.0: answers with uncertainty by default, and one engine in every language.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalsuite-python
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Intended Audience :: Science/Research
6
6
  Classifier: Intended Audience :: Healthcare Industry
@@ -97,7 +97,7 @@ Project-URL: Source, https://github.com/mkcs28/evalsuite-python
97
97
  EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
98
98
  evaluation into one consistent, validated, documented framework.
99
99
 
100
- > **Status: stable (1.0.0).** **1.0** makes `evaluate()` report confidence intervals by default and test
100
+ > **Status: stable (1.1.0).** Try it in Colab: [example notebooks](notebooks/README.md). **1.0** makes `evaluate()` report confidence intervals by default and test
101
101
  > against a baseline, and adds an LLM leaderboard harness, framework integrations (scikit-learn, Hugging Face,
102
102
  > Keras, Lightning, MLflow, W&B), monitoring with drift alerts, TRIPOD+AI / model-card report cards, and the same
103
103
  > engine for JavaScript (npm, WebAssembly), C, R and Julia.
@@ -10,7 +10,7 @@
10
10
  EvalSuite brings classification, regression, clinical, statistical, segmentation and object-detection
11
11
  evaluation into one consistent, validated, documented framework.
12
12
 
13
- > **Status: stable (1.0.0).** **1.0** makes `evaluate()` report confidence intervals by default and test
13
+ > **Status: stable (1.1.0).** Try it in Colab: [example notebooks](notebooks/README.md). **1.0** makes `evaluate()` report confidence intervals by default and test
14
14
  > against a baseline, and adds an LLM leaderboard harness, framework integrations (scikit-learn, Hugging Face,
15
15
  > Keras, Lightning, MLflow, W&B), monitoring with drift alerts, TRIPOD+AI / model-card report cards, and the same
16
16
  > engine for JavaScript (npm, WebAssembly), C, R and Julia.
@@ -129,6 +129,8 @@ ignore = ["N803", "N806", "RUF022", "UP007", "UP045", "RUF001", "RUF002", "RUF00
129
129
  "src/evalsuite/*/metrics.py" = ["E501"]
130
130
  # Developer script recording parity fixtures for the Rust crate: each case's lambda runs immediately.
131
131
  "scripts/rust_fixtures.py" = ["B007", "B023", "E501", "E731", "E741", "RUF005"]
132
+ "scripts/make_notebooks.py" = ["E501", "S102"]
133
+ "notebooks/*.ipynb" = ["E501", "I001", "S311"]
132
134
 
133
135
  [tool.mypy]
134
136
  python_version = "3.10"
@@ -149,3 +151,7 @@ follow_untyped_imports = false
149
151
  testpaths = ["tests"]
150
152
  addopts = "-q --strict-markers"
151
153
  filterwarnings = ["error::RuntimeWarning"]
154
+
155
+ [tool.ruff.format]
156
+ # Generated by scripts/make_notebooks.py.
157
+ exclude = ["notebooks/*.ipynb"]
@@ -319,7 +319,7 @@ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
319
319
 
320
320
  [[package]]
321
321
  name = "evalsuite"
322
- version = "1.0.0"
322
+ version = "1.1.0"
323
323
  dependencies = [
324
324
  "criterion",
325
325
  "evalsuite-core",
@@ -334,14 +334,14 @@ dependencies = [
334
334
 
335
335
  [[package]]
336
336
  name = "evalsuite-capi"
337
- version = "1.0.0"
337
+ version = "1.1.0"
338
338
  dependencies = [
339
339
  "evalsuite",
340
340
  ]
341
341
 
342
342
  [[package]]
343
343
  name = "evalsuite-cli"
344
- version = "1.0.0"
344
+ version = "1.1.0"
345
345
  dependencies = [
346
346
  "clap",
347
347
  "csv",
@@ -351,14 +351,14 @@ dependencies = [
351
351
 
352
352
  [[package]]
353
353
  name = "evalsuite-core"
354
- version = "1.0.0"
354
+ version = "1.1.0"
355
355
  dependencies = [
356
356
  "rayon",
357
357
  ]
358
358
 
359
359
  [[package]]
360
360
  name = "evalsuite-py"
361
- version = "1.0.0"
361
+ version = "1.1.0"
362
362
  dependencies = [
363
363
  "evalsuite-core",
364
364
  "pyo3",
@@ -367,7 +367,7 @@ dependencies = [
367
367
 
368
368
  [[package]]
369
369
  name = "evalsuite-wasm"
370
- version = "1.0.0"
370
+ version = "1.1.0"
371
371
  dependencies = [
372
372
  "evalsuite",
373
373
  "js-sys",
@@ -3,7 +3,7 @@ members = ["evalsuite-core", "evalsuite-py"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
- version = "1.0.0"
6
+ version = "1.1.0"
7
7
  edition = "2021"
8
8
  rust-version = "1.82"
9
9
  license = "MIT OR Apache-2.0"
@@ -13,29 +13,28 @@ pub fn surface_points(mask: &[bool], dims: &[usize]) -> Vec<[i64; 3]> {
13
13
  d3[3 - nd..].copy_from_slice(dims);
14
14
  let (n0, n1, n2) = (d3[0], d3[1], d3[2]);
15
15
  let strides = [n1 * n2, n2, 1];
16
- let per_slab: Vec<Vec<[i64; 3]>> = (0..n0)
16
+ // Parallel over rows (slab × row), not only slabs, so 2-D images use every core; rows are collected in
17
+ // order, so the points come out in the same (C) order as a serial scan.
18
+ let per_slab: Vec<Vec<[i64; 3]>> = (0..n0 * n1)
17
19
  .into_par_iter()
18
- .map(|i| {
20
+ .with_min_len(16)
21
+ .map(|r| {
22
+ let (i, j) = (r / n1, r % n1);
19
23
  let mut out = Vec::new();
20
- for j in 0..n1 {
21
- let row = (i * n1 + j) * n2;
22
- for k in 0..n2 {
23
- let f = row + k;
24
- if !mask[f] {
25
- continue;
26
- }
27
- let idx = [i, j, k];
28
- // Surface: on the image border along a real axis, or a face neighbour is background.
29
- let border = (3 - nd..3).any(|ax| {
30
- let p = idx[ax];
31
- p == 0
32
- || p + 1 == d3[ax]
33
- || !mask[f - strides[ax]]
34
- || !mask[f + strides[ax]]
35
- });
36
- if border {
37
- out.push([i as i64, j as i64, k as i64]);
38
- }
24
+ let row = r * n2;
25
+ for k in 0..n2 {
26
+ let f = row + k;
27
+ if !mask[f] {
28
+ continue;
29
+ }
30
+ let idx = [i, j, k];
31
+ // Surface: on the image border along a real axis, or a face neighbour is background.
32
+ let border = (3 - nd..3).any(|ax| {
33
+ let p = idx[ax];
34
+ p == 0 || p + 1 == d3[ax] || !mask[f - strides[ax]] || !mask[f + strides[ax]]
35
+ });
36
+ if border {
37
+ out.push([i as i64, j as i64, k as i64]);
39
38
  }
40
39
  }
41
40
  out
@@ -19,27 +19,118 @@ pub fn bleu_stats(hyp: &[u32], refs: &[&[u32]], order: usize) -> Vec<i64> {
19
19
  let mut out = vec![0i64; 2 + 2 * order];
20
20
  out[0] = hyp_len;
21
21
  out[1] = if refs.is_empty() { 0 } else { closest };
22
+ // Short segments (the usual case): sorted n-gram runs merged against each reference, which avoids hash
23
+ // maps and their allocations; long ones: hash counting. Counts are integers, so both give the same result.
24
+ let short = hyp.len() <= 256 && refs.iter().all(|r| r.len() <= 256);
22
25
  for n in 1..=order {
23
- // Max count of each n-gram over the references, then matches clipped by it.
24
- let mut ref_max: FxMap<&[u32], u32> = FxMap::default();
25
- for r in refs {
26
- for (g, c) in ngram_counts(r, n) {
27
- let e = ref_max.entry(g).or_insert(0);
28
- if c > *e {
29
- *e = c;
26
+ let correct = if short {
27
+ clipped_sorted(hyp, refs, n)
28
+ } else {
29
+ clipped_hashed(hyp, refs, n)
30
+ };
31
+ out[1 + n] = correct;
32
+ out[1 + order + n] = (hyp_len - n as i64 + 1).max(0);
33
+ }
34
+ out
35
+ }
36
+
37
+ /// Runs of equal n-grams in sorted order: (n-gram, count).
38
+ fn sorted_runs(seq: &[u32], n: usize) -> Vec<(&[u32], u32)> {
39
+ if n == 0 || seq.len() < n {
40
+ return Vec::new();
41
+ }
42
+ let mut w: Vec<&[u32]> = seq.windows(n).collect();
43
+ w.sort_unstable();
44
+ let mut runs: Vec<(&[u32], u32)> = Vec::with_capacity(w.len());
45
+ for g in w {
46
+ match runs.last_mut() {
47
+ Some((last, c)) if *last == g => *c += 1,
48
+ _ => runs.push((g, 1)),
49
+ }
50
+ }
51
+ runs
52
+ }
53
+
54
+ fn clipped_sorted(hyp: &[u32], refs: &[&[u32]], n: usize) -> i64 {
55
+ // n-grams packed into one integer when the ids fit (16 bits each, n ≤ 4): sorting integers is much
56
+ // cheaper than sorting slices; otherwise slices.
57
+ let fits = n <= 4
58
+ && hyp
59
+ .iter()
60
+ .chain(refs.iter().flat_map(|r| r.iter()))
61
+ .all(|&t| t < 1 << 16);
62
+ if fits {
63
+ let pack = |s: &[u32]| -> Vec<u64> {
64
+ let mut v: Vec<u64> = if s.len() < n {
65
+ Vec::new()
66
+ } else {
67
+ s.windows(n)
68
+ .map(|w| w.iter().fold(0u64, |k, &t| (k << 16) | u64::from(t)))
69
+ .collect()
70
+ };
71
+ v.sort_unstable();
72
+ v
73
+ };
74
+ return clipped_merge(&runs_of(&pack(hyp)), refs.iter().map(|r| runs_of(&pack(r))));
75
+ }
76
+ let h = sorted_runs(hyp, n);
77
+ clipped_merge(&h, refs.iter().map(|r| sorted_runs(r, n)))
78
+ }
79
+
80
+ fn runs_of(sorted: &[u64]) -> Vec<(u64, u32)> {
81
+ let mut runs: Vec<(u64, u32)> = Vec::with_capacity(sorted.len());
82
+ for &g in sorted {
83
+ match runs.last_mut() {
84
+ Some((last, c)) if *last == g => *c += 1,
85
+ _ => runs.push((g, 1)),
86
+ }
87
+ }
88
+ runs
89
+ }
90
+
91
+ fn clipped_merge<K: Ord>(h: &[(K, u32)], refs: impl Iterator<Item = Vec<(K, u32)>>) -> i64 {
92
+ if h.is_empty() {
93
+ return 0;
94
+ }
95
+ let mut max_ref = vec![0u32; h.len()];
96
+ for rr in refs {
97
+ let (mut i, mut j) = (0, 0);
98
+ while i < h.len() && j < rr.len() {
99
+ match h[i].0.cmp(&rr[j].0) {
100
+ std::cmp::Ordering::Less => i += 1,
101
+ std::cmp::Ordering::Greater => j += 1,
102
+ std::cmp::Ordering::Equal => {
103
+ max_ref[i] = max_ref[i].max(rr[j].1);
104
+ i += 1;
105
+ j += 1;
30
106
  }
31
107
  }
32
108
  }
33
- let mut correct = 0i64;
34
- for (g, c) in ngram_counts(hyp, n) {
35
- if let Some(&m) = ref_max.get(g) {
36
- correct += i64::from(c.min(m));
109
+ }
110
+ h.iter()
111
+ .zip(&max_ref)
112
+ .map(|((_, c), m)| i64::from((*c).min(*m)))
113
+ .sum()
114
+ }
115
+
116
+ fn clipped_hashed(hyp: &[u32], refs: &[&[u32]], n: usize) -> i64 {
117
+ // Max count of each n-gram over the references, then matches clipped by it.
118
+ let mut ref_max: FxMap<&[u32], u32> = FxMap::default();
119
+ for r in refs {
120
+ for (g, c) in ngram_counts(r, n) {
121
+ let e = ref_max.entry(g).or_insert(0);
122
+ if c > *e {
123
+ *e = c;
37
124
  }
38
125
  }
39
- out[1 + n] = correct;
40
- out[1 + order + n] = (hyp_len - n as i64 + 1).max(0);
41
126
  }
42
- out
127
+ let mut correct = 0i64;
128
+ for (g, c) in ngram_counts(hyp, n) {
129
+ if let Some(&m) = ref_max.get(g) {
130
+ correct += i64::from(c.min(m));
131
+ }
132
+ }
133
+ correct
43
134
  }
44
135
 
45
136
  /// Clipped n-gram overlap between a reference `t` and a prediction `p` (ROUGE-N numerator).
@@ -1,3 +1,3 @@
1
1
  """Package version (single source of truth, read by the build backend)."""
2
2
 
3
- __version__ = "1.0.0"
3
+ __version__ = "1.1.0"