test: add 10 TRL parity tests for deprecation readiness#241
Merged
Conversation
Adds tests/test_trl_parity.py with 25 test cases covering the 10 areas identified in docs/STANDALONE_VS_TRL_COMPARISON.md as needed before the standalone GRPO trainer can be deprecated: 1. Constrained decoding — Outlines generator build + ACTION_REGEX 2. Constrained decoding ImportError — returns None, not silent success 3. Prompt format identity — TRL imports SYSTEM_PROMPT from standalone 4. DSL round-trip parsing — CLICK, TYPE, WAIT, DONE via parse_action_json 5. Thought-prefix parsing — "Thought: ...\nAction: DSL" format 6. Unsloth loading — FastVisionModel.from_pretrained + get_peft_model 7. LoRA checkpoint resume — lora_checkpoint passed through config 8. HookBridge on_step_complete — callback fires with correct args 9. HookBridge unused hooks — on_before_collect/on_rollout_complete stored 10. _AgentOutput schema — Pydantic validation, JSON schema, roundtrip All tests are light (no torch/transformers/trl imports), use unittest.mock, and pass with [dev] deps only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_trl_parity.pywith 25 test cases covering the 10 parity areas identified indocs/STANDALONE_VS_TRL_COMPARISON.mdsection "Tests Needed for TRL Deprecation Readiness"unittest.mock, and pass with[dev]deps only_AgentOutputPydantic schema validationTest plan
uv run --no-sources pytest tests/test_trl_parity.py -v— all 25 passuv run --no-sources pytest tests/ -v— no new failures (7 pre-existing failures intest_synthetic_demos.pyandtest_demo_persistence.pydue to missing demo fixture files)🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com