Skip to content

Validate sample indices when reporting evaluation coverage - #33

Open
zhachar14h-cell wants to merge 1 commit into
deepseek-ai:mainfrom
zhachar14h-cell:fix/eval-sample-coverage
Open

zhachar14h-cell wants to merge 1 commit into
deepseek-ai:mainfrom
zhachar14h-cell:fix/eval-sample-coverage

Conversation

@zhachar14h-cell

Copy link
Copy Markdown

The evaluation scorer can report coverage_complete: true even when expected samples are missing. With two tasks and n_sample=2, task A with indices [0] and task B with [0, 1, 2] satisfy the current task-presence and total-count checks. Shifted or negative sample indices can also pass. This matters because the evaluation README requires complete coverage for a valid reported Pass@1 result.

Check that every sample index lies in [0, n_sample) before marking coverage complete. Since load_raw deduplicates (task_id, sample_idx), the existing total-count and task-presence checks then establish that every expected pair is present. Invalid coverage uses the existing warning and summary flag; scoring remains available.

Add eight CPU-only tests that run score_run against temporary datasets, metadata, and rank output files, checking the persisted summary and warning. Cover complete and out-of-order samples, missing tasks/samples, extra samples, uneven counts, shifted indices, and negative indices.

Validation (Windows, Python 3.13.12, pytest 8.4.2, Ruff 0.15.0):

  • Before the fix: 3 failed, 5 passed.
  • After the fix: python -m pytest -q tests/eval/test_score_coverage.py — 8 passed.
  • Repository-wide ruff check --no-cache and ruff format --check --no-cache passed (271 Python files).
  • git diff --check passed.

Linux/Python 3.12 and the GPU/NPU inference suite were not exercised.

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.

1 participant