Repository navigation
[rl] Terminal-Bench: run each task in its image's WORKDIR and grade with task.toml timeouts - #5865
Conversation
|
Reply from claude: @claude please review |
|
Claude finished @felipemello1's task in 2m 59s —— View job Approve -- please address the items before merging -- review (fill in the human-written summary; link a Verifiers issue in the TODO). |
There was a problem hiding this comment.
Verdict: Approve -- please address the items below before merging -- the override is small, stays in the example folder, reuses Harbor's own WORKDIR parser and default timeout, and the new test exercises it through the env-server serialization path for both datasets.
What this PR does. TerminalTaskset.load now post-processes Verifiers' Harbor tasks. When task.toml names no workdir, it uses the WORKDIR of the Dockerfile's final stage, skipping values with quotes or $VARs. When ignore_timeouts=False and the task declares no verifier timeout, it fills in Harbor's 600 s times timeout_multiplier. The recipe now loads both tasksets with ignore_timeouts=False and drops the blanket scoring=12000. Setup (600 s) and rollout (7200 s) stay run-level.
Example.
TB 2.1 task, Dockerfile "WORKDIR /app ... WORKDIR /app/dclm", [verifier] timeout_sec = 900
before: agent starts in /app (empty), test.sh may run up to 12000 s
after: agent starts in /app/dclm, test.sh killed at 900 s
TMax task (prepare_tmax.py), workdir = "/home/user", no [verifier]
before: /home/user, 12000 s after: /home/user, 600 s
Must fix
- PR description -- "Summary (human-written)" is empty. The author needs to fill it in; agents don't write it (CONTRIBUTING.md, "AI-assisted contributions").
torchtitan/rl/examples/verifiers/terminal_bench/taskset.py:47-49-- the TODO links Verifiers source but not an upstream issue. File the issue and link it (inline comment).
Questions
- The validation set is Terminal-Bench 2.1, so with this PR grading uses each task's verifier timeout. The agent timeout is still a flat 7200 s, not the task's
[agent] timeout_sec. That means validation rewards are still not comparable toharbor runnumbers on the same tasks. Is that intended? If so, a sentence in the README would stop readers from comparing them directly.
Details
- Gate: the problem is concrete: 3 of 89 TB 2.1 tasks start in an empty
/app, and every task has a 12,000 s grading timeout. The root fix belongs in Verifiers. Working around it locally intorchtitan/rl/examples/is fine as long as the TODO tracks the upstream fix (Must fix 2). No core files are touched. - The default-timeout branch only changes TMax among the in-repo datasets, because every TB 2.1 task declares a timeout. Another option is to have
prepare_tmax.pywrite[verifier] timeout_sec. Keeping the default inload()is the better choice: it stops any other Harbor dataset without a timeout from grading with no limit, since this PR removes the run-levelscoring=12000. requirements.txtpinsdockerfile-parse. CPU RL CI installs this file (.github/workflows/unit_test_cpu_rl.yaml:81), so the new test has Harbor and the parser available.- Under
harbor run, a$VARWORKDIR would be expanded by Docker. Here it falls back to/app. The code comment and the test (env-var) document this.
Not verified: Verifiers 0.4.0 internals (resolve_rollout_timeouts precedence, how timeout_multiplier applies to declared timeouts, and whether rebuilding HarborTask(data, self.config.task) keeps everything super().load() sets). I couldn't read the installed package. The new test checks the first two through Verifiers' own functions.
| # TODO: open a Verifiers issue, then delete this: for a task.toml with no workdir or verifier | ||
| # timeout, Verifiers uses /app and no grading limit, not the image's WORKDIR and Harbor's 600 s. | ||
| # https://github.com/PrimeIntellect-ai/verifiers/blob/v0.4.0/verifiers/v1/tasksets/harbor/taskset.py#L692-L712 |
There was a problem hiding this comment.
This override works around a Verifiers gap (config.workdir or "/app" in its runtimes, and no default verifier timeout). CLAUDE.md principle 3 asks for a TODO with an upstream issue link. This one links to a source line and says "open a Verifiers issue", so nothing tracks when the override can be deleted. Please file the issue in PrimeIntellect-ai/verifiers (two items: fall back to the image WORKDIR rather than /app, and default the verifier timeout to Harbor's VerifierConfig.timeout_sec when ignore_timeouts=False), then put its URL in place of the "open a Verifiers issue" wording. The source permalink can stay as context.
There was a problem hiding this comment.
Reply from claude: The TODO stays as it is for now. It names the gap: no fallback to the image WORKDIR, and no default verifier timeout. It also links the Verifiers code. The author will file the Verifiers issue and link it here before merge, if maintainers want it.
There was a problem hiding this comment.
Reply from claude: The author chose not to file upstream issues. The TODO now says when to delete this override, and it links the upstream lines that read only task.toml (Verifiers v0.4.0, verifiers/v1/tasksets/harbor/taskset.py#L700-L712). That link is what tracks deletion (d5995e0).
be83ecf to
0e37959
Compare
|
Reply from claude: Thanks for the review.
|
|
Reply from claude: @claude please review |
|
Claude finished @felipemello1's task in 58s —— View job Approve -- please address the items before merging -- review (still open: the human-written summary, and a Verifiers issue link in the TODO). |
There was a problem hiding this comment.
Verdict: Approve -- please address the items below before merging -- the new commit (0e37959) only changes the README and answers the earlier question. It adds no new problems. The two earlier must-fix items are still open.
What this PR does. TerminalTaskset.load fills a missing task.toml workdir from the final-stage WORKDIR of the task's Dockerfile, using Harbor's own parser. Values with quotes or $VAR are skipped. When ignore_timeouts=False and the task declares no verifier timeout, it sets Harbor's default of 600 s, multiplied by timeout_multiplier. The recipe now loads both tasksets with ignore_timeouts=False and drops the flat scoring=12000. Setup (600 s) and agent (7,200 s) timeouts stay the same for every task.
Example.
TB 2.1 task: Dockerfile "WORKDIR /app ... WORKDIR /app/dclm", [verifier] timeout_sec = 900
before: starts in /app (empty), grading allowed up to 12000 s
after: starts in /app/dclm, grading killed at 900 s
TMax task: workdir = "/home/user", no [verifier] section
before: /home/user, 12000 s after: /home/user, 600 s
Since the last review
- Resolved: the question about the flat 7,200 s agent timeout. The README timeouts bullet now explains why it is flat, and says validation scores are not directly comparable to
harbor runresults.
Must fix (still open)
- PR description -- "Summary (human-written)" is still empty. The author has to fill it in before merge.
torchtitan/rl/examples/verifiers/terminal_bench/taskset.py:47-49-- the TODO still says "open a Verifiers issue" and has no issue URL. CLAUDE.md principle 3 asks for an upstream issue link on workarounds. Without one, nothing tracks when this override can be deleted. The author said they will file it before merge; I am keeping this item open until it lands.
Details
- Gate: unchanged since the last review. The problem is concrete: 3 of 89 TB 2.1 tasks start in an empty
/app, and every task has a 12,000 s grading timeout. The override lives in the example folder, and no core files are touched. - The default-timeout branch at
taskset.py:64-67now matters for any Harbor dataset that declares no verifier timeout, because the run-levelscoring=12000is gone. Without this branch, such a task would grade with no limit. Keep it even after the Verifiers fix if upstream does not default the timeout itself. - The test uses the default
timeout_multiplier=1.0. That means it does not check that the default timeout is scaled the same way as a declared one. That is acceptable: the scaling is a single multiplication.
Not verified: Verifiers 0.4.0 / Harbor 0.24.0 internals: whether parse_dockerfile_workdir returns None for a missing Dockerfile (the TMax test case relies on it), the precedence in resolve_rollout_timeouts, and whether rebuilding HarborTask(data, self.config.task) keeps everything super().load() sets. I could not import the installed packages in this run.
0e37959 to
d5995e0
Compare
|
Reply from claude: @claude please review |
|
Claude finished @felipemello1's task in 53s —— View job Approve -- please address the items before merging -- review (still open: the human-written summary). |
There was a problem hiding this comment.
Verdict: Approve -- please address the items below before merging -- the only change since the last review is a reworded TODO at taskset.py:170-172. It adds no new problems, and the one remaining blocker is the PR description.
What this PR does. TerminalTaskset.load fills a missing task.toml workdir with the WORKDIR from the final stage of the task's Dockerfile, using Harbor's own parser, and skips values that contain quotes or $VAR. When ignore_timeouts=False and the task has no verifier timeout, it sets Harbor's default of 600 s, multiplied by timeout_multiplier. The recipe loads both tasksets with ignore_timeouts=False and drops the flat scoring=12000. Setup (600 s) and agent (7,200 s) timeouts stay the same for every task.
Example.
TB 2.1 task: Dockerfile "WORKDIR /app ... WORKDIR /app/dclm", [verifier] timeout_sec = 900
before: starts in /app (empty), grading allowed up to 12000 s
after: starts in /app/dclm, grading killed at 900 s
TMax task: workdir = "/home/user", no [verifier] section
before: /home/user, 12000 s after: /home/user, 600 s
Since the last review
- TODO (
taskset.py:170-172): it now says when to delete the override ("once Verifiers falls back to the image's WORKDIR and Harbor's 600 s verifier timeout"). It links the Verifiers v0.4.0 lines that read only task.toml. The author chose not to file an upstream issue. CLAUDE.md principle 3 asks for an issue link on upstream workarounds. That is the maintainers' call, so I am not blocking on it. Note that a source permalink pinned to v0.4.0 will not show when upstream fixes the gap. Only an issue would.
Must fix (still open)
- PR description -- "Summary (human-written)" is still empty. The author has to fill it in before merge (CONTRIBUTING.md, "AI-assisted contributions").
Details
- Gate: unchanged. The problem is concrete: 3 of 89 TB 2.1 tasks start in an empty
/app, and every task gets a 12,000 s grading timeout. The override stays intorchtitan/rl/examples/, and no core files are touched. - The default-timeout branch at
taskset.py:187-190is what keeps a Harbor dataset with no verifier timeout from grading with no limit, now that the run-levelscoring=12000is gone. If Verifiers fixes only the WORKDIR fallback upstream, keep this branch.
Not verified: Verifiers 0.4.0 / Harbor 0.24.0 internals: whether parse_dockerfile_workdir returns None for a missing Dockerfile, the precedence in resolve_rollout_timeouts, and whether rebuilding HarborTask(data, self.config.task) keeps everything super().load() sets. I could not import the packages in this run. The new test checks these through Verifiers' own functions.
ee3ce28 to
d5995e0
Compare
d5995e0 to
9b101c1
Compare
9b101c1 to
11ea9fa
Compare
58c406f to
e082b3f
Compare
11ea9fa to
4436b5e
Compare
10c8b9a to
0e8d822
Compare
45244d0 to
83dab2b
Compare
0e8d822 to
f0d1adc
Compare
f0d1adc to
a5f114c
Compare
|
Reply from claude: @claude please review. This push puts the stack on a draft copy of the look-aside router PR, rebased onto main (row 0, DO NOT REVIEW; it closes when the original lands). The generate answer now comes from the generator, so the docs and bodies say so; each body says not to merge while row 0 is under the stack. |
|
Claude finished @felipemello1's task in 40s —— View job Approve -- please address the item before merging -- review (the restack onto row 0 leaves this PR's diff unchanged; still open: the human-written summary). |
There was a problem hiding this comment.
Verdict: Approve -- please address the item below before merging -- this push only rebases the stack onto row 0 and edits the PR body. The diff for this PR is the same as at the last review, and the PR description is the one blocker left.
What this PR does. When task.toml names no workdir, TerminalTaskset.load (taskset.py:33-54) uses the WORKDIR from the final stage of the task's Dockerfile, read with Harbor's parse_dockerfile_workdir. It skips any value that contains quotes or $. When ignore_timeouts=False and a task declares no verifier timeout, it uses Harbor's 600 s default times timeout_multiplier. The recipe loads both tasksets with ignore_timeouts=False and drops the flat scoring=12000.
Example.
TB 2.1 task: Dockerfile "WORKDIR /app ... WORKDIR /app/dclm", [verifier] timeout_sec = 900
before: starts in /app (empty), grading allowed up to 12000 s
after: starts in /app/dclm, grading killed at 900 s
TMax task: workdir = "/home/user", no [verifier] section
before: /home/user, 12000 s after: /home/user, 600 s
Since the last review
taskset.py, the recipe, the README,requirements.txt, and the test are unchanged. No new problems.- The PR body now lists row 0 (a copy of the look-aside router PR) and says not to merge while row 0 is under the stack. This PR's diff touches nothing from row 0 or the router, so the "generate answer comes from the generator" change doesn't reach this PR.
Must fix (still open)
- PR description -- "Summary (human-written)" is still empty. The author has to fill it in before merge (CONTRIBUTING.md, "AI-assisted contributions").
Not verified: Verifiers 0.4.1 / Harbor 0.24.0 internals, as in earlier reviews. The new test checks them through Verifiers' own resolve_runtime_config and resolve_rollout_timeouts.
02ffd4f to
649d113
Compare
a5f114c to
9c41deb
Compare
649d113 to
021610a
Compare
9c41deb to
ba640a7
Compare
|
Reply from claude: @claude please review. The stack is reordered: Verifiers groups in workers, then Verifiers 0.4.1, then worker placement come first (the stack table shows the new rows). It is also rebuilt with three reviewed passes: a code-style pass over every changed file, the rewritten placement docs (the |
|
Claude finished @felipemello1's task in 45s —— View job Approve -- please address the item before merging -- review (reordering the stack leaves this PR's diff unchanged; still open: the human-written summary). |
There was a problem hiding this comment.
Verdict: Approve -- please address the item below before merging -- reordering and rebuilding the stack leaves this PR's diff the same as at the last review. The PR description is the only blocker left.
What this PR does. When task.toml names no workdir, TerminalTaskset.load (taskset.py:33-54) uses the WORKDIR from the final stage of the task's Dockerfile, read with Harbor's parse_dockerfile_workdir, and skips any value that contains quotes or $. When ignore_timeouts=False and a task declares no verifier timeout, it uses Harbor's 600 s default times timeout_multiplier. The recipe loads both tasksets with ignore_timeouts=False and drops the flat scoring=12000.
Example.
TB 2.1 task: Dockerfile "WORKDIR /app ... WORKDIR /app/dclm", [verifier] timeout_sec = 900
before: starts in /app (empty), grading allowed up to 12000 s
after: starts in /app/dclm, grading killed at 900 s
TMax task: workdir = "/home/user", no [verifier] section
before: /home/user, 12000 s after: /home/user, 600 s
Since the last review
taskset.py, the recipe (verifiers_terminal_bench.py:101-131), the README,requirements.txt, and the test are unchanged by the reorder and the three passes. The only change is the READMEtaskset.pyrow moving down with the parent's edits. No new problems.- The test still uses
_rollouter_config(test_verifiers_terminal_bench.py:51), thetasksetimport (:27), and Verifiers 0.4.1'sresolve_runtime_config/resolve_rollout_timeouts, all present at HEAD. The reorder breaks nothing here.
Must fix (still open)
- PR description -- "Summary (human-written)" is still empty. The author has to fill it in before merge (CONTRIBUTING.md, "AI-assisted contributions").
Not verified: Verifiers 0.4.1 / Harbor 0.24.0 internals, as in earlier reviews. The new test checks them through Verifiers' own functions.
|
Reply from claude: @claude please review. The stack is rebased onto main (the look-aside router PR merged), and the PRs below this one are updated. |
|
Claude finished @felipemello1's task in 39s —— View job Approve -- please address the item before merging -- review (the rebase onto main doesn't change this PR's diff; still open: the human-written summary). |
There was a problem hiding this comment.
Verdict: Approve -- please address the item below before merging -- this push rebases onto main now that the look-aside router PR has merged. The PR's diff is the same as at the last review. The only thing still blocking is the PR description.
What this PR does. If a task.toml names no workdir, TerminalTaskset.load (taskset.py:33-54) uses the WORKDIR from the final stage of the task's Dockerfile. It reads it with Harbor's parse_dockerfile_workdir and skips any value that contains quotes or $. If ignore_timeouts=False and a task declares no verifier timeout, it uses Harbor's 600 s default times timeout_multiplier. The recipe loads both tasksets with ignore_timeouts=False and drops the flat scoring=12000.
Example.
TB 2.1 task: Dockerfile "WORKDIR /app ... WORKDIR /app/dclm", [verifier] timeout_sec = 900
before: starts in /app (empty), grading allowed up to 12000 s
after: starts in /app/dclm, grading killed at 900 s
TMax task: workdir = "/home/user", no [verifier] section
before: /home/user, 12000 s after: /home/user, 600 s
Since the last review
taskset.py, the recipe, the README,requirements.txt, and the test did not change in the rebase. No new problems.- What the test depends on is still at HEAD:
_rollouter_config(test_verifiers_terminal_bench.py:51), thetasksetimport (:27), andVerifiersTaskSample.verifiers_task_data(torchtitan/rl/examples/verifiers/data.py:24), which the rollout worker also reads atrollouter.py:322.
Must fix (still open)
- PR description -- "Summary (human-written)" is still empty. The author has to fill it in before merge (CONTRIBUTING.md, "AI-assisted contributions").
Not verified: Verifiers 0.4.1 / Harbor 0.24.0 internals, as in earlier reviews. The new test checks them through Verifiers' own resolve_runtime_config and resolve_rollout_timeouts.
|
Reply from claude: @claude please review |
|
Claude finished @felipemello1's task in 43s —— View job Approve -- please address the item before merging -- review (the |
There was a problem hiding this comment.
Verdict: Approve -- please address the item below before merging -- the one real change since the last review moves the dockerfile-parse pin from requirements.txt into the example's pyproject.toml. That is the right place for it, and CI still installs it. The PR description is the only blocker left.
What this PR does. If a task.toml names no workdir, TerminalTaskset.load (taskset.py:33-54) uses the WORKDIR from the final stage of the task's Dockerfile. It reads that value with Harbor's parse_dockerfile_workdir and skips any value that contains quotes or $. If ignore_timeouts=False and a task declares no verifier timeout, it uses Harbor's 600 s default times timeout_multiplier. The recipe loads both tasksets with ignore_timeouts=False and drops the flat scoring=12000.
Example.
TB 2.1 task: Dockerfile "WORKDIR /app ... WORKDIR /app/dclm", [verifier] timeout_sec = 900
before: starts in /app (empty), grading allowed up to 12000 s
after: starts in /app/dclm, grading killed at 900 s
TMax task: workdir = "/home/user", no [verifier] section
before: /home/user, 12000 s after: /home/user, 600 s
Since the last review
torchtitan/rl/examples/verifiers/terminal_bench/pyproject.toml:9-11:dockerfile-parse==2.0.1is now a dependency of the Terminal-Bench example package, not a repo-widerequirements.txtentry. That followsdesign.md("example-only ones at the example level"). The new test still gets it, because CPU RL CI runsuv pip install -e torchtitan/rl/examples/verifiers/terminal_bench(.github/workflows/unit_test_cpu_rl.yaml:86-87), and the README install step (README.md:43) installs the same package.taskset.py, the recipe, the README, and the test are the same as at the last review. No new problems.
Must fix (still open)
- PR description -- "Summary (human-written)" is still empty. The author has to fill it in before merge (CONTRIBUTING.md, "AI-assisted contributions").
Not verified: Verifiers 0.4.1 / Harbor 0.24.0 internals, as in earlier reviews. The new test checks them through Verifiers' own resolve_runtime_config and resolve_rollout_timeouts.
…ith task.toml timeouts
Summary (human-written)
Agent details
TLDR: Each Terminal-Bench task now starts in the folder
harbor runstarts it in, and is graded with its own time limit from task.toml instead of 12,000 s for every task.Stack (15 PRs, bottom first; merging a PR also merges every PR below it; this PR in bold)
Alone on main, not in this stack: "Validation reads each prompt at most once; ValidationConfig.steps defaults to -1" and "Terminal-Bench 35B-A3B recipe: Dist-MoE in both roles, FULL CUDA graph generators, DAPO loss".
Problem
workdirin task.toml in/app(config.workdir or "/app"in both, Verifiers 0.4.1).harbor runuses the image'sWORKDIR.workdir. 3 of its 89 Dockerfiles end in anotherWORKDIR, so those agents start in/app, not their project folder.ignore_timeouts=Trueand setsscoring=12000for every task.test.shholds its rollout, and the rollout's group, up to 12,000 s instead.Solution
TerminalTaskset.loadfills a missingworkdirwith Harbor's own parser,parse_dockerfile_workdir(the final build stage'sWORKDIR, relative paths joined). A value with quotes or a$VAR, which Harbor leaves raw, is skipped, so the runtime keeps/app.ignore_timeouts=False, a task with no verifier timeout gets Harbor's default (VerifierConfig, 600 s), scaled bytimeout_multiplierlike a declared one.terminal_bench_env_config, the one helper for training and validation, loads the taskset withignore_timeouts=Falseand dropsscoring=12000.load(): it is an optional Verifiers extra. The Terminal-Bench example'spyproject.tomlpinsdockerfile-parse==2.0.1, which Harbor lists only in its cloud extras.resolve_rollout_timeouts). The workdir and timeout travel in the task data, so the rollout workers need no change.harbor runresults.You may ask: why not fix this in Verifiers? It should be. The TODO at
TerminalTaskset.loadsays when to delete this override, and links the Verifiers v0.4.1 lines that read only task.toml. You may ask: why not keep 12,000 s? Task authors set these limits for Harbor's runtime, and a grader past its limit fails underharbor runtoo.NOTE: a grading deadline is
ERROR_TIMEOUT("Verifiers: only a rollout that Verifiers finished cleanly trains"), which doesn't train. So a task whose tests now run past its own task.toml timeout is left out of training, not trained at reward 0. Validation keeps its grade.NOTE: not run: the recipe end to end (needs Docker and the datasets). The counts above come from loading the public Terminal-Bench 2.1 with Verifiers 0.4.0 and Harbor 0.24.0. Verifiers 0.4.1 starts in
/appthe same way (runtimes/backends/docker.py:287,prime.py:159).Test plan
pytest tests/rl/unit_tests/cpu tests/unit_tests/cpu/components/test_renderer.py tests/unit_tests/cpu/config # Verifiers 0.4.1, at this position: 987 passed, 1 skippedtest_tasks_run_in_the_image_workdir_and_grade_with_task_timeouts: three task folders (a Terminal-Bench-like task with a two-WORKDIRDockerfile and a 900 s verifier timeout, a TMax-like task with a task.tomlworkdir, a task withWORKDIR $HOME/work). For both the training and the validation dataset of the recipe, it rebuilds each task as a rollout worker does and resolves its workdir and grading timeout with Verifiers' own functions:ignore_timeouts=Trueadds no timeout. Droppingignore_timeouts=Falseon the training taskset alone, or the quote/$VARskip, fails it.