Skip to content

[rl] Verifiers 0.4.1 and renderers 0.2.0 - #6119

Draft
felipemello1 wants to merge 1 commit into
felipemello1/verifiers-041/3-env-in-workerfrom
felipemello1/verifiers-041/4-bump
Draft

felipemello1 wants to merge 1 commit into
felipemello1/verifiers-041/3-env-in-workerfrom
felipemello1/verifiers-041/4-bump

Conversation

@felipemello1

@felipemello1 felipemello1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary (human-written)

Agent details

TLDR: Pins Verifiers 0.4.1 and renderers 0.2.0, which move together. The code changes follow from what 0.4.1 changed. The trace converter now reads Verifiers' new numpy arrays directly: 0.7 ms vs 10.6 ms per 65K-token trace. The logprob reply is packed: 2.6 ms vs 31 ms to encode and decode 16K tokens on CPU.

The generation server's reply goes from one JSON object per token to one base64 float32 array that renderers 0.2.0 decodes, so a 16,384-token reply shrinks from 1.05 MB to 0.21 MB and encode plus decode takes 2.6 ms instead of 30.9 ms on CPU.

0.4.1 change                                     this PR
Branch.token_ids and logprobs are numpy arrays   the converter reads them as arrays; split_prompt takes arrays
trace.dropped: the env's judge declined it       new status DROPPED: not trained, not an error
HarborEnv and HarborEnvConfig are deleted        TB recipe: vf.SingleAgentEnvConfig; Harbor stays the taskset
Runtime.run_program is deleted                   TB harness: runtime.run
renderers 0.2.0 reads packed logprobs            generation server: one base64 float32 array per reply

Problem

  1. Verifiers 0.4.1 returns each branch's token ids and logprobs as numpy arrays.
  2. The converter passes them to split_prompt. Its if prompt_token_ids[: len(previous_token_ids)] == previous_token_ids raises on an array ("The truth value of an empty array is ambiguous").
  3. So every Verifiers rollout fails on 0.4.1, and the Terminal-Bench recipe doesn't import (HarborEnv is gone).
  4. 0.4.1 also adds trace.dropped: the env's judge declined to grade the rollout, e.g. the reference answer is wrong. The trace still looks ok, so it would train as COMPLETED.

Solution

  1. Pins: renderers == 0.2.0 in .ci/docker/requirements.txt, verifiers==0.4.1 in both example requirements. Main's httpx pin stays. renderers 0.2.0 still imports httpx without declaring it, so its TODO no longer names a version.
  2. split_prompt takes two Prompts, as before, or two token-id arrays. The array path finds the first mismatch in one vectorized compare.
  3. trace_to_rollout_turns keeps Verifiers' arrays: each turn holds views of them, with no list copies. It checks each node first: one mask entry per token, and one logprob per sampled token. Branch.logprobs pads a missing logprob with 0.0, so a check on the branch would miss it.
  4. It skips a branch Verifiers marks trainable=False, e.g. a compaction attempt the harness rejected. Verifiers 0.4.1 documents the flag as "whether this physical path contributes a training sample" (verifiers/v1/trace.py:385-386).
  5. New status DROPPED, not trainable and not an error. rollout_status returns it first. The worker logs the grader's reason at info, and Rollout.logs keeps it.
  6. Terminal-Bench: vf.SingleAgentEnvConfig, no HarborEnv export, runtime.run(argv=..., env=...).
  7. The generation server answers with completion_logprobs (base64 float32), not one JSON object per token.
  8. Docs: renderers and Verifiers links, .ci/docker/README.md, the Verifiers README pin, and a Muse Glimmer TODO (renderers 0.2.0 ships its own Muse Glimmer renderer).
  9. Verifiers 0.4.1 adds a 4th token limit, max_turn_tokens, which caps each response. Like the other three (max_input_tokens, max_output_tokens, max_total_tokens), its stop is TRUNCATED_LENGTH (new case max_turn_tokens in test_rollout_status_says_who_failed).
  10. Unchanged: TokenEnv still passes Prompt lists to split_prompt.

Results

trace -> turns, real 0.4.1 Branch, 65,520 tokens x 18 turns (CPU, one core, 5 runs each):
  copy arrays to lists    10.50-10.66 ms per trace    6.23 MiB peak
  arrays (this PR)         0.68-0.72 ms per trace     0.59 MiB peak

TokenEnv's split_prompt on lists, 65,536 tokens: unchanged
  prompt extends the previous one    0.228-0.237 ms -> 0.233-0.238 ms
  one token edited mid-prompt        1.94-2.00 ms   -> 1.93-1.95 ms

logprob reply, encode + decode in one process (CPU; decoder from renderers 0.2.0):
  1,024 tokens:   JSON 1.9 ms    packed 0.18 ms
  16,384 tokens:  JSON 30.9 ms   packed 2.6 ms    (1.05 MB -> 0.21 MB)

What was checked

SFT uses renderers?          yes: build_training_sample (text and multimodal datasets) and the SFT recipe
what 0.2.0 changes there     nothing: build_training_sample and the Qwen3, Qwen3.5 and GptOss renderers are unchanged
same tokens                  25 of 25 equal vs 0.1.12: Qwen3, Qwen3.5, GptOss; 5 recipe configs x 5 conversations,
                             tool calls and reasoning included
CPU tests                    the suites in the test plan pass; all of tests/unit_tests/cpu on 0.2.0 matched main on
                             0.1.12 at this PR's first version (2050 passed both, the same 10 failures and 1
                             collection error on both: no torchao, no Hub access on the test host)
full run                     one 20-step Terminal-Bench run on Verifiers 0.4.1 (previous PR's NOTE), compared to an
                             env-server version of these PRs, not to main
node checks                  on real 0.4.1 DAPO traces (end-to-end test) and synthetic 65K-token traces; not on a
                             Terminal-Bench trace: the run above predates them
rollout outputs              5 rollouts read end to end, plus counts over all their turns (below)
not run                      a Terminal-Bench run of main, Verifiers DAPO-Math, any native RL recipe, SFT

Rollout inspection (the 20-step run: 2,598 recorded rollouts. The recorder keeps each group's lowest and highest reward plus every error, so these aren't run-wide rates.)

  • Read 5 rollouts end to end: solved (35 turns, policy versions 14-19, reward 1.0), failed (13 turns, reward 0), error (55 turns, ends on a context overflow), max turns (120 turns), and one from the latest policy version.
  • Every turn is the harness's JSON (analysis, plan, commands), with the model's reasoning kept. Each tool reply is the terminal's output.
  • Over all 51,902 turns: every turn has reasoning. 120 have empty content (reasoning cut at max tokens). 1,436 (2.8%) aren't valid JSON; the harness counts those as format errors. 1 has a stray </think> in its content.
  • 33 rollouts have no turn, all errors. In this run they trained with reward 0 and dropped their group. With this stack they are not trained.
  • Not recorded: the prompt messages (0 of 2,565 rollouts with turns), so the recorder's output doesn't show the task text.

You may ask: do we still use Harbor? Yes, as the taskset. 0.4.1 moved Harbor's grading into its task, so the env is Verifiers' plain single-agent env.
You may ask: does a task with a separate verifier still get its own box? Yes. 0.4.1 asks each task for its grader in every env (Verifiers 0.4.1 verifiers/v1/rollout.py:319, verifiers/v1/grading.py:224). HarborTask.grading_task picks shared or separate, and a separate one gets verifier_box_data (verifiers/v1/tasksets/harbor/taskset.py:236-250).
You may ask: why not make Prompt.token_ids an array? Generators hand it straight to vLLM.
You may ask: why not ERROR_INFRA for a dropped trace? A judge's decision is not a failure. ERROR_INFRA is an error status, so the worker would log each drop as a failed rollout.

Follow up (each one is a TODO in the code)

  • Use renderers 0.2.0's Muse Glimmer renderer once it gives this renderer's tokens, and delete ours.
  • Record each rollout's prompt messages, so the recorder's output shows the task text.
  • Keep DROPPED rollouts in the recorder, so a drop's reason can be read later.

Test plan

pytest -rs tests/rl/unit_tests/cpu tests/unit_tests/cpu/components/test_renderer.py tests/unit_tests/cpu/config
# Verifiers 0.4.1, renderers 0.2.0: 1083 passed, 1 skipped (test_train_loop.py, skipped on main too).
# Without Verifiers (renderers 0.1.12): 979 passed, 7 skipped (the Verifiers test files and recipes).
MUSE_GLIMMER_TOKENIZER=<local Muse-Glimmer-30B tokenizer> pytest -rs \
  tests/unit_tests/cpu/models/muse_glimmer/test_muse_glimmer_renderer.py
# renderers 0.2.0: 127 passed.
  • test_split_prompt: every case runs on Prompt lists and on arrays. Without the array path, the array cases raise.
  • New: test_trace_to_rollout_turns_refuses_a_node_whose_logprobs_dont_match_its_tokens (a missing logprob, a mask shorter than its tokens), on real 0.4.1 nodes.
  • New: test_a_dropped_verifiers_trace_is_never_scored, with and without a turn; test_rollout_status_says_who_failed gains two dropped rows.
  • New: test_trace_to_rollout_turns_reads_verifiers_arrays, on a real 0.4.1 MessageNode and Branch.
  • New: test_trace_to_rollout_turns_skips_a_branch_verifiers_marks_untrainable, on real 0.4.1 nodes: two branches share a prefix, and the trainable=False one adds no turn.
  • The four harness tests now record runtime.run: test_harness_options_reach_terminus2, test_prompts_reach_terminus2_outside_its_argv, test_agent_shell_runs_inside_the_login_shell, test_tmux_server_outlives_launch_until_cleanup.
  • test_generation_server_forwards_token_request decodes the reply with renderers' own _parse_completion_logprobs.

@felipemello1
felipemello1 added this pull request to stack #6120 November 16, 2026 07:13
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review

@claude

claude Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 2m 48s —— View job


Request changes: review -- the renderers 0.2.0 bump reaches core SFT/RL rendering, and no tests have run against it yet.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Request changes -- the Verifiers-side changes look right, but the renderers 0.1.12 -> 0.2.0 bump also reaches core SFT/RL data rendering, and no test run against 0.2.0 has checked that code yet.

What this PR does. Pins Verifiers 0.4.1 and renderers 0.2.0. It adapts to the 0.4.1 API:

  • Branch.token_ids/logprobs are now numpy arrays, so the converter calls .tolist().
  • HarborEnvConfig -> vf.SingleAgentEnvConfig.
  • run_program -> run.

It also changes the generation server's reply to send logprobs as one base64 float32 array (completion_logprobs) instead of one JSON object per token.

Example. One completion of 2 tokens:

before: "logprobs": {"content": [{"token": "token_id:31", "logprob": -0.1}, {"token": "token_id:32", "logprob": -0.2}]}
after:  "completion_logprobs": {"data": "<8 bytes, base64>", "shape": [2], "dtype": "float32"}

The trainer gets the same values. The converter already cast logprobs to float32 (rollouter.py:427), so moving the cast to the server does not change numerics.

Must fix

  1. The "Summary (human-written)" section is empty. The author needs to fill it in.
  2. .ci/docker/requirements.txt:8 -- the renderers bump is repo-wide. The core consumers are text_datasets.py, mm_datasets.py, the qwen3_5 renderer subclass, and muse_spark's private renderers.parsing imports. "CPU Unit Test" was skipped on this stacked PR, and the test plan covered only test_renderer.py plus the skipped Glimmer test. Run tests/unit_tests/cpu on 0.2.0, and state in the description whether the Qwen3, Qwen3.5 and GptOss tokens change (details inline).

Should consider

  • torchtitan/rl/examples/verifiers/rollouter.py:392-396 -- trainable=False branches are trained on silently. Raise (or skip) now instead of leaving it as a TODO.
  • tests/rl/unit_tests/cpu/test_verifiers.py:588 -- the test imports the private _parse_completion_logprobs. Add a comment saying it is pinned to renderers 0.2.0.
Details
  • Gate: the change is necessary. Every Verifiers rollout fails on 0.4.1 without the .tolist() (the array truth-value error in split_prompt), and the Terminal-Bench recipe doesn't import without the HarborEnv change. This is the right layer, and no overlapping open PR exists. The logprob packing is a small extra concern, but it deletes code (net -8 LoC in generation_server.py) and uses the format renderers 0.2.0 reads, so bundling it here is acceptable.
  • Callsites: no remaining references to HarborEnv, run_program, 0.4.0, 0.1.12 or the old token_id: logprob format.
  • harness.py:117 returns runtime.run(...)'s ProgramResult, which matches the updated _RecordingRuntime. The 4 harness tests now read the program call from runtime.commands[0], and the cleanup call is at index 1.
  • .ci/docker/README.md now matches what unit_test_cpu_rl.yaml:78-88 already does (it installs with nightly constraints).

Not verified: what renderers 0.2.0 and Verifiers 0.4.1 contain (no package access in this run). That covers the renderers.MuseGlimmerRendererConfig claim in the Glimmer TODO, the loaders.py#L91 link, and Branch.trainable. GPU and Terminal-Bench runs are pending, per the description.

wandb
tokenizers >= 0.15.0
renderers == 0.1.12
renderers == 0.2.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pin is in the shared CI image, not just the Verifiers example. Core code builds training data with renderers:

  • torchtitan/components/data/text_datasets.py:13 and mm_datasets.py:70 (build_training_sample, used by SFT)
  • torchtitan/models/qwen3_5/renderer.py:41-42 (subclasses renderers.qwen35.Qwen35Renderer)
  • torchtitan/models/muse_spark/renderer.py:42, which imports the private renderers.parsing._build_param_type_index and _coerce_arg_value
  • the Qwen3 / GptOss / Qwen3.5 renderer configs in every RL and SFT recipe

The test plan only ran tests/unit_tests/cpu/components/test_renderer.py plus the Muse Glimmer test, and that one was skipped. The "CPU Unit Test" workflow was skipped on this stacked PR, so tests/unit_tests/cpu/models/qwen3_5/test_qwen3_5_renderer.py, tests/unit_tests/cpu/models/muse_spark/test_renderer.py, tests/unit_tests/cpu/components/data/test_chat_dataset.py and test_mm_dataset_preprocessing.py have not run against 0.2.0.

A minor bump that changes a chat template, or the private helpers muse_spark uses, would quietly change the SFT/RL token streams, and that changes the loss.

Fix: run pytest tests/unit_tests/cpu on renderers 0.2.0 (with MUSE_GLIMMER_TOKENIZER set, so the Glimmer parity test actually runs). Then add one line to the description saying whether 0.2.0 changes the rendered tokens for Qwen3, Qwen3.5 and GptOss.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reply from claude: Done. Full tests/unit_tests/cpu on renderers 0.2.0 (with MUSE_GLIMMER_TOKENIZER set) gives the same result as main on 0.1.12: 2050 passed on both, with the same 10 failures and 1 collection error, all from this host (no torchao, offline Hub). The renderer tests you named pass. A render probe gives identical token ids on 0.1.12 and 0.2.0 in 25 of 25 cases (Qwen3 x2, Qwen3.5 x2, GptOss configs x 5 conversations with tool calls and reasoning). The description's NOTE says so.

Comment on lines +392 to +396
# TODO: read Verifiers' numpy arrays without copying them to lists: needs `split_prompt` to
# take arrays. Also skip `trainable=False` branches (a compaction attempt), and check each
# sampled node has one logprob per sampled token.
token_ids = branch.token_ids.tolist()
logprobs = branch.logprobs.tolist()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO says 0.4.1 can emit trainable=False branches (compaction attempts). This loop currently trains on their sampled spans with no signal. The array copy is a perf TODO, but this one is a silent training-data problem.

If no in-repo config can produce such a branch, add a guard now so the assumption is explicit. The guard is one line plus a message:

if not branch.trainable:
    raise ValueError("Verifiers compaction branches (trainable=False) are not supported")

(or continue, if skipping is the intended behavior). Then drop that clause from the TODO. The SimpleNamespace branches in test_verifiers.py would need trainable=True.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reply from claude: Fixed in bcc8100: no in-repo config compacts (the Terminal-Bench harness and Terminus-2 have no compaction; the DAPO null harness has it off by default), so trace_to_rollout_turns now raises on a trainable=False branch, naming the trace and branch. A new test uses a real Branch(trainable=False); the TODO drops that clause.


def test_generation_server_forwards_token_request() -> None:
"""Two calls of one session; the second prompt is over 1 MiB of JSON."""
from renderers.client import _parse_completion_logprobs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this imports a private upstream name (_parse_completion_logprobs). Decoding with renderers' own parser is the right contract to check, so keep it. Add a short comment noting that it is private and pinned to renderers 0.2.0, so the next bump knows where to look if it breaks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reply from claude: Fixed in bcc8100: the import has a one-line comment saying it is private and pinned to renderers 0.2.0.

@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from 5478582 to bcc8100 Compare November 16, 2026 08:38
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: Fixes and the renderers evidence are in bcc8100 and the description's NOTE. @claude please review

@claude

claude Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 54s —— View job


Approve, once the human-written summary is filled in: review

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- please address the item below before merging. bcc8100 resolves the earlier findings. The only one left is the empty human-written summary, which the author has to write. A maintainer still needs to review, because the renderers pin is in the shared CI image.

What changed since the last review.

  • Renderers 0.2.0 coverage (earlier must-fix 2): resolved. The description now reports the full tests/unit_tests/cpu run, which matches main on 0.1.12 (2050 passed on both, with the same host-only failures). It also reports 25 of 25 identical token-id renders for Qwen3, Qwen3.5 and GptOss.
  • trainable=False branches: resolved. rollouter.py:393-397 now raises ValueError, the same way the existing one-trainable-trace check at rollouter.py:287-291 does. The TODO drops that clause. The new test uses a real Branch(trainable=False).
  • The private _parse_completion_logprobs import: resolved. test_verifiers.py:610 now has a comment saying it is private and pinned to renderers 0.2.0.

Example. A compaction attempt used to be trained silently. Now it fails loudly:

before: branch(trainable=False) -> its sampled spans become RolloutTurns and are trained
after:  ValueError("Verifiers trace <id> branch <i> is a compaction attempt (trainable=False) ...")

Must fix

  1. The "Summary (human-written)" section is still empty. The author needs to fill it in. Agents don't write that section.
Details
  • The new commit adds no new problems. The trainable guard runs before .tolist(), so a compaction branch fails with the intended message rather than on its arrays. The SimpleNamespace branches in test_verifiers.py now carry trainable=True and numpy arrays, so they also cover the .tolist() conversion.
  • Sending logprobs packed also fixes something the old per-token JSON got wrong: a -inf logprob used to produce invalid JSON (repr(-inf)), and a float32 array encodes it fine.
  • The gate and callsite notes from the previous review still hold. No references to HarborEnv, run_program, 0.4.0, 0.1.12 or the token_id: format remain.

Not verified: what Verifiers 0.4.1 and renderers 0.2.0 contain (no package access in this run). That covers Branch.trainable/Branch.index, renderers.MuseGlimmerRendererConfig, and the loaders.py#L91 link. The GPU and Terminal-Bench runs are still pending, per the description.

@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from bcc8100 to a5876c7 Compare November 16, 2026 16:57
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review

@claude

claude Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 11s —— View job


Approve, once the human-written summary is filled in: review. The force-pushed head has the changes that were approved before.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- please address the item below before merging. The force-pushed head (a5876c7, a single commit on the updated 3-env-in-worker base) has the same changes I approved at bcc8100, and the rebase adds no new problems. The human-written summary is still empty. The renderers pin is in the shared CI image, so a maintainer still needs to review.

What changed since the last review. The diff is now one commit, rebased onto the base branch's new tip (6cceb46). I re-read the whole diff at HEAD:

  • The trainable=False guard is at rollouter.py:393-397. It runs before .tolist(), as before.
  • The private _parse_completion_logprobs import still has its pin comment (test_verifiers.py:610).
  • The SimpleNamespace branches still carry trainable=True and numpy arrays.
  • On the new base, trace_to_rollout_turns (rollouter.py:295) is still the only code that reads branch.token_ids and branch.logprobs. No references to run_program, HarborEnv/HarborEnvConfig, verifiers==0.4.0, renderers 0.1.12 or the token_id: logprob format are left anywhere in the repo.

Example. One completion of 2 tokens, unchanged from the last review:

before: "logprobs": {"content": [{"token": "token_id:31", "logprob": -0.1}, {"token": "token_id:32", "logprob": -0.2}]}
after:  "completion_logprobs": {"data": "<8 bytes, base64>", "shape": [2], "dtype": "float32"}

Must fix

  1. The "Summary (human-written)" section is still empty. The author has to write it; agents don't fill it in.
Details
  • I couldn't diff bcc8100 against a5876c7 directly, because the old commit can no longer be fetched after the force-push. So "same changes" is based on re-reading the full HEAD diff against the earlier review's findings and the replies to them, not on a commit-to-commit diff.
  • Nit, outside this diff: the comment at rollouter.py:282-283 still says "A compaction ... adds a branch to this trace". It's still true of Verifiers, but such a branch now raises at line 393. You could add "(rejected below)" in a follow-up. It doesn't block.
  • The gate and callsite notes from the first review still hold.

Not verified: what Verifiers 0.4.1 and renderers 0.2.0 contain, and test or CI results at this head. I had no package access and couldn't run tests in this job. The GPU and Terminal-Bench runs are as stated in the description.

@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from a5876c7 to a7b18af Compare November 16, 2026 17:06

@felipemello1 felipemello1 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe SFT is also using renderers. Did you check it? does everything else work normally? tests pass? Did we run a full run and compare vs main? Did you inspect rollout outputs and sanity check it? Please add it to the pr description

Comment on lines +398 to +399
# TODO: read Verifiers' numpy arrays without copying them to lists: needs `split_prompt` to
# take arrays. Also check each sampled node has one logprob per sampled token.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the lift to do it in this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reply from claude: Done in this PR. split_prompt now takes numpy arrays too, so the converter no longer copies Verifiers' arrays into lists: 0.7 ms vs 10.6 ms per 65K-token trace on CPU.
The converter also checks each node: one mask entry per token, and one logprob per sampled token.

@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from a7b18af to 3c494f6 Compare November 17, 2026 00:20
@felipemello1
felipemello1 removed this pull request from stack #6120 November 17, 2026 00:20
@felipemello1
felipemello1 added this pull request to stack #6150 November 17, 2026 00:21
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: on your review,

i believe SFT is also using renderers. Did you check it? does everything else work normally? tests pass? Did we run a full run and compare vs main? Did you inspect rollout outputs and sanity check it? Please add it to the pr description

Added to the PR description. "What was checked" answers the SFT, tests and full-run questions: SFT's renderer code is unchanged in 0.2.0, the tokens match in 25 of 25 cases, and the one full run was compared to an earlier version of these PRs, not to main.
"Rollout inspection" covers 5 rollouts read end to end, plus counts over all 51,902 turns.

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. Since your last review: split_prompt takes numpy arrays (no list copy in the converter); a trace the env's grader drops gets the new DROPPED status; a branch Verifiers marks trainable=False is skipped; the body adds a rollout inspection of the 20-step run. The human-written Summary is still empty on purpose.

@claude

claude Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 2m 35s —— View job


Approve, once the human-written summary is filled in: review

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- please address the item below before merging. The new commit adds no new problems. The only blocker is the empty human-written summary, which the author has to write. This PR touches core RL types and the shared CI image, so a maintainer still needs to review.

What changed since the last review.

  • split_prompt gained an array path (types.py:1022-1027 in the diff). It finds the first mismatch with one vectorized compare. The converter now hands Verifiers' int32/float32 arrays straight to RolloutTurn as views, with no list copy. The test_split_prompt cases run on both paths.
  • A trainable=False branch is now skipped (rollouter.py:507) instead of raising. This follows Verifiers' meaning of the flag. Its shared nodes still train on the other branch, and the earlier nit about the compaction comment is gone.
  • New status DROPPED (types.py:245). It is checked first in rollout_status, never scored, and logged at info with the grader's reason. The no-turn path leaves it alone (rollouter.py:354 only promotes trainable statuses). metrics.py:285-293 loops over RolloutStatus, so status_rate/dropped appears without any other change.
  • Each node is checked: one mask entry per token, and one logprob per sampled token (rollouter.py:519-528). This catches the 0.0 padding that branch.logprobs would hide.

Example. A judge drops one of four siblings:

before: trace(ok, dropped="reference wrong", reward=1.0) -> COMPLETED, reward 1.0, trained
after:  -> DROPPED, no reward, no advantage; siblings 0-2 are scored and centered among themselves

Must fix

  1. The "Summary (human-written)" section is still empty. Agents don't fill it in.

Should consider

  • torchtitan/rl/examples/verifiers/rollouter.py:554-555 -- the completions now keep whatever dtype Verifiers returns, but the delta is still cast to int32. Cast both with copy=False, or neither (inline).

Questions

  • A drop because "the reference answer is wrong" is a problem with the task, but trace.dropped is per trace. If the judge drops only some siblings, the rest are still scored against that same bad reference and produce advantages. Does Verifiers drop every sibling in that case, or should one DROPPED rollout make TitanRL skip its whole group?
Details
  • Numerics: the completion logprobs are the same float32 values as before. The old path was float32 -> .tolist() -> np.asarray(float32), and now it is a float32 view. The server-side cast to float32 matches the converter cast that was already there.
  • The views keep each branch's full token and logprob arrays alive for as long as the rollout lives. Before, the turns held copies whose total size was about the same, so retained memory doesn't change. Pickling a slice copies only that slice.
  • The new prompt_messages TODO in the converter and the DROPPED TODO in the recorder are comments only. They record limitations found during the rollout inspection.
  • No remaining references to HarborEnv, run_program, 0.4.0, 0.1.12 or the token_id: logprob format.

Not verified: Verifiers 0.4.1 internals (no package access in this run). That includes whether a sampled node's mask is always exactly its sampled tokens (otherwise the new node check raises on real traces), the Branch.trainable semantics, and trace.dropped. The description reports the node check passing on real 0.4.1 DAPO traces, but not yet on a Terminal-Bench trace.

Comment on lines +554 to +555
completion_token_ids=token_ids[absolute_start:absolute_end],
completion_logprobs=logprobs[absolute_start:absolute_end],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: RolloutTurn documents completion_token_ids as int32 and completion_logprobs as float32 (types.py:309-312). The old code enforced that with np.asarray(..., dtype=...). This one now takes whatever dtype branch.token_ids/branch.logprobs happen to have. The array path of split_prompt still casts the delta (types.py:1027 in the diff, .astype(np.int32, copy=False)), so the two halves of a turn are treated differently. The SimpleNamespace tests already push int64/float64 arrays through here, and nothing fails.

Pick one way. Either cast both completions with copy=False (a no-op on Verifiers 0.4.1's int32/float32 arrays, so the 0.7 ms result holds), or drop the cast in split_prompt and rely on the pin. Casting is cheaper than finding float64 logprobs in the loss later.

Suggested change
completion_token_ids=token_ids[absolute_start:absolute_end],
completion_logprobs=logprobs[absolute_start:absolute_end],
completion_token_ids=token_ids[absolute_start:absolute_end].astype(np.int32, copy=False),
completion_logprobs=logprobs[absolute_start:absolute_end].astype(np.float32, copy=False),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reply from claude: applied in f514aa1: both completion slices are cast with copy=False (a no-op on Verifiers 0.4.1's int32/float32 arrays). Verifiers 0.4.1 tests: 84 passed; core CPU suite: 939 passed, 7 skipped (the usual ones).

@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from 3c494f6 to f514aa1 Compare November 17, 2026 01:25
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review f514aa1: your dtype suggestion, applied as written (inline reply has the test counts). Your DROPPED question (drop only the judged sibling, or its whole group?) is for the author.

@claude

claude Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 44s —— View job


Approve, once the human-written summary is filled in: review. f514aa1 resolves the dtype comment.

@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from 6166e8c to 9b75564 Compare November 22, 2026 09:03
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review

@claude

claude Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 56s —— View job


Approve, once the human-written summary is filled in: review. The rebased head 9b75564 has the same changes approved at 3113f02.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- please address the item below before merging. The new head (9b75564, one commit on base cdf494a) has the changes I approved at 3113f02, and I found no new problems. The human-written summary is still empty. tianyu-l has approved since the last automated review.

What changed since the last review. Only a rebase. The diff went from +394/-140 to +393/-140 across the same 18 files, and the logic is unchanged. I re-read the full diff at HEAD:

  • trainable=False branches are still skipped (rollouter.py:541-542).
  • The per-node mask/logprob check still runs on every node before any span is read (rollouter.py:552-562).
  • The completion slices are still cast with .astype(..., copy=False). split_prompt's array path does the same for the prompt delta (types.py).
  • DROPPED is still checked first in rollout_status (rollouter.py:454-455) and is in is_trainable's exclusion list. The no-turn promotion at rollouter.py:370 only applies to trainable statuses, so a dropped rollout with no turn stays DROPPED.
  • max_turn_tokens still maps to TRUNCATED_LENGTH.
  • split_prompt callers: the Verifiers converter passes arrays, and token_env.py:395 still passes Prompts. Nothing else calls it.

Example. A judge drops one of four siblings (unchanged):

before: trace(ok, dropped="reference wrong", reward=1.0) -> COMPLETED, reward 1.0, trained
after:  -> DROPPED, no reward, no advantage; siblings 0-2 are scored among themselves

Must fix

  1. The "Summary (human-written)" section is still empty. The author has to write it; agents don't fill it in.
Details
  • The earlier open question about DROPPED (drop the whole group or only that sibling) is answered in the thread. Verifiers 0.4.1 defines dropped per trace, and this stack's builder rule is to drop the rollout, not its group. I have nothing to add.
  • I found no remaining references to HarborEnv/HarborEnvConfig, run_program, verifiers==0.4.0, renderers 0.1.12 or the token_id: logprob format.
  • I couldn't diff 3113f02 against 9b75564 directly, because the old commit isn't in this shallow checkout. "Same changes" comes from re-reading the HEAD diff against the earlier findings.

Not verified: Verifiers 0.4.1 and renderers 0.2.0 internals, and test or CI results at this head. This job had no package access.

@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch 6 times, most recently from 8388d45 to f2f3160 Compare November 23, 2026 20:12
@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from f2f3160 to cb137e8 Compare November 24, 2026 02:15
@felipemello1
felipemello1 force-pushed the felipemello1/verifiers-041/4-bump branch from cb137e8 to 8992f84 Compare November 24, 2026 02:29
Pins Verifiers 0.4.1 and renderers 0.2.0, which move together. Main's httpx
pin stays: renderers 0.2.0 still imports httpx without declaring it, so its
TODO no longer names a version. The trace converter reads 0.4.1's numpy
arrays without copying them to lists (split_prompt takes arrays), checks
each node's logprob count, and skips a branch Verifiers marks untrainable;
the Terminal-Bench recipe and harness follow what 0.4.1 deleted (HarborEnv,
Runtime.run_program); the generation server replies with packed float32
logprobs. A trace the env's judge dropped becomes the new DROPPED status:
not trained, not an error.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/docker ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants