fix(v1): resume must match saved rollouts by load position, not data.idx#2017
fix(v1): resume must match saved rollouts by load position, not data.idx#2017dumko2001 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3fd46612e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| finished, owed = resume.load( | ||
| out, [t.data.idx for t in tasks], config.num_rollouts, group | ||
| out, [task_positions[t.data.idx] for t in tasks], config.num_rollouts, group | ||
| ) |
There was a problem hiding this comment.
Preserve legacy data.idx matches when resuming
When resuming output dirs written before info.task_idx existed, those rows fall back to task.data.idx, but this call now passes selected positions instead of the saved data indices. For tasksets whose saved ids are sparse or raw dataset rows (the Lean case this change targets), completed legacy rows no longer match selected_idxs, so resume.load drops them, rewrites traces.jsonl without them, and reruns work that had already finished.
Useful? React with 👍 / 👎.
6e8072d to
19d2088
Compare
The runner selects and dispatches tasks by load position (enumerate(tasks)), but resume.load matched saved traces.jsonl rows by task.data.idx. In LeanTaskset, data.idx was the raw dataset enumeration index while empty statements were filtered out, so data.idx and the load position diverged. On resume, finished rollouts were dropped and the wrong tasks reran. - Record the load position in trace.info["task_idx"] in both the local and server eval paths. - Make resume.load prefer info["task_idx"] and fall back to task.data.idx mapped to the current load position via an optional data_idx_to_pos argument. - Leave LeanTaskset.data.idx as the raw dataset index; the runner builds the data.idx -> load-position map and passes it to resume.load, so legacy traces without info.task_idx still resume correctly. PrimeIntellect-ai#1962 rewrote resume.load but did not fix the load-position mismatch. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
19d2088 to
627ff7b
Compare
Description
The runner selects and dispatches tasks by load position (
enumerate(tasks)), butresume.loadmatched savedtraces.jsonlrows bytask.data.idx. InLeanTaskset,data.idxis the raw dataset enumeration index and empty statements are filtered out, sodata.idxand the load position diverge. On resume, finished rollouts were dropped and the wrong tasks reran.This change:
trace.info["task_idx"]in both the local and server eval paths.resume.loadpreferinfo["task_idx"]and fall back totask.data.idxmapped to the current load position via a newdata_idx_to_posargument.LeanTaskset.data.idxas the stable raw dataset index; the runner builds adata.idx -> load-positionmap from the selected task slice and passes it toresume.load, so legacy traces withoutinfo.task_idxstill resume correctly.#1962 rewrote
resume.loadto reload finished traces, but it did not fix this load-position mismatch. This PR is a follow-up to that work.Type of Change
Testing
uv run pytestlocally.uv run pytest tests/v1/test_taskset.py tests/test_eval_utils.py tests/test_eval_display.py -qand the fulluv run pytest tests/v1 -m 'not e2e'pass.Checklist
Additional Notes
PrimeIntellect-ai/verifiers:main(commit9b01a8172).docs/v1/evaluation.mdandskills/evaluate-environments/references/REFERENCE.mdalready describe resume as keeping good rollouts and rerunning missing/errored ones, including group-scored tasks being resumed as a whole group. This fix aligns the implementation with that documented behavior.AGENTS.md, no unit tests were added.Note
Fix resume to match saved rollouts by positional index rather than
data.idxtask.data.idx, which breaks when the current selection differs from the original run's ordering.info.task_idxfrom saved traces when present, falling back totask.data.idxremapped through a caller-supplieddata_idx_to_posdict, or rawdata.idxas a last resort.task_positionsmap (data.idx → position in selected slice) and passes it toresume.load; owed rollouts and post-resume filtering are now driven by these positional indices.info.task_idxrecording the task's positional index, enabling correct matching in future resumes.data.idx.Macroscope summarized 627ff7b.