Skip to content

docs(skills): add testing rules, drop the tests they forbid - #5009

Merged
terrykong merged 20 commits into
mainfrom
yukih/drop-recipe-setting-tests
Nov 4, 2026
Merged

terrykong merged 20 commits into
mainfrom
yukih/drop-recipe-setting-tests

Conversation

@yuki-97

@yuki-97 yuki-97 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Adds four rules to the testing skill against unit tests that only restate a config or pydantic, and deletes the existing ones. Tests and docs only; no runtime code change. Once #4998 merges, these rules move with the testing skill into the contributing skill.

What changed

1. Add four unit-test rules to skills/testing/SKILL.md.

  • Do not test recipe or test-script settings, and do not unit-test functional test scripts. A config-wide guard against a known issue, such as test_all_config_no_tp_size_accuracy_issues, is still fine.
  • Do not add a test that only checks a shipped config loads or validates. test_config_validation.py already does that for every config, now including validate_single_controller_config on SingleController configs.
  • Do not add a test that only asserts a config field's default value.
  • Do not add a test that only checks pydantic's own behaviour: default fallback, value read-back, or Literal, type and required-field rejection.

2. Delete the tests these rules forbid. Whole files removed:

  • tests/unit/test_recipe_settings.py
  • tests/unit/test_video_grpo_recipes.py
  • tests/unit/tools/test_hybridep_default_8g_recipes.py
  • tests/unit/models/generation/test_vllm_qwen35_bf16_trtllm_recipe.py
  • tests/unit/models/generation/test_vllm_qwen35_mxfp8_recipe.py
  • tests/unit/models/generation/test_swe1_dynamo_config.py
  • tests/unit/single_controller/test_cc_functional_recipe.py
  • tests/unit/data/test_sft_config.py
  • tests/test_mxfp8_rollout_recipes.py

Per-recipe validate tests and default or pydantic tests across the suite are removed as well (#4037 lists several). Where a deleted test guarded a real invariant, test_config_validation.py now checks it for every config:

  • HybridEP inputs aligned to 64 × CP
  • no local paths in shipped configs or suite scripts
  • no pinned W&B entity
  • the FA2 pin on Megatron exemplars
  • check_nccl_reshard_refit_support on every nccl_reshard recipe
  • validate_batch_invariant_mode on every batch_invariant_mode recipe

The HybridEP check no longer requires AutoModel EP recipes to pick hybridep or torch, so the DEEPEP_FALLBACK_RECIPES allowlist tracked in #4427 is gone; the dispatcher is a recipe performance choice.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

yuki-97 added a commit that referenced this pull request Oct 31, 2026
@yuki-97 yuki-97 changed the title docs(skills): add contributing testing rules, drop the tests they forbid docs(skills): add testing rules, drop the tests they forbid Nov 2, 2026
@yuki-97
yuki-97 changed the base branch from yukih/refactor-skill to main November 2, 2026 06:03
@yuki-97
yuki-97 force-pushed the yukih/drop-recipe-setting-tests branch from 45b0d74 to 58cdf2d Compare November 2, 2026 06:10

@yuki-97 yuki-97 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.

Self-review via /review-pr-team: 4 agents (rl-expert, test-agent, bug-finder, design-reviewer) + devil's-advocate pass.

Verdict — 6 inline comments. C1 is blocking: the async_rl routing sends two legacy VLM recipes to SingleController validation, which fails, so L0 Other goes red. The rest are small: an assertion that always passes (C2), a stale comment (C3), a zero-KL coverage gap (C4), a value read-back the new pydantic rule forbids (C5), and a PR-body note on the removed DeepEP allowlist (C7).

Verified clean

  • Deleted tests: each of the ~110 removed tests is a default pin, a rejection pydantic already enforces, a recipe or script pin, or a load-only check now covered by test_all_config_files_have_required_keys; C4 is the only real coverage loss. No deleted file or test name is still referenced in the L0 scripts, excluded_unit_tests.sh, workflows or docs.
  • The new central guards pass on the current tree (CPU run): local paths (739 files), W&B entity (416), HybridEP 64 × CP (28 recipes), nccl_reshard refit (8), FA2 pin (8 exemplar sections). The local-path and W&B guards cover more than the deleted experiments-only checks.
  • Validating the real SingleController configs against SingleControllerMasterConfig drops no schema check, and check_nccl_reshard_refit_support(SimpleNamespace(policy=...)) matches what that function reads (master_config.policy.get(...)).
  • tests/unit/test_config_validation.py is the right home for these guards: it already held the config-wide ones, and the nccl_reshard and SingleController checks call the production validators instead of copying them.

Generated by Claude Code

Comment thread tests/unit/test_config_validation.py Resolved
Comment thread tests/unit/test_config_validation.py Resolved
Comment thread tests/unit/test_config_validation.py Resolved
Comment thread skills/testing/SKILL.md Resolved
Comment thread tests/unit/test_config_validation.py Resolved
@yuki-97 yuki-97 added the CI:L0 Run doctests and unit tests label Nov 2, 2026
@yuki-97

yuki-97 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1eba047

@yuki-97
yuki-97 requested a review from terrykong November 2, 2026 09:29

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this cleanup. Moving the guards that matter into config-wide tests in test_config_validation.py means a new recipe is covered without writing a new test. The fixes from your self-review check out at 1eba047 (C1 routing, C2, C3, C5), and CI is green on this head.

Two coverage gaps to fix before approval. Both are setup-time validators of ours, and the deleted tests were their only PR-time run:

  1. (C8) The zero-KL check, as a reply on your C4 thread: the new test runs only validate_batch_invariant_mode, not validate_zero_train_gen_mismatch.
  2. (C9) The full-vocab MOPD loss check, which SingleController setup runs only after the GPUs are up.

Lower priority:
3. (C11) Rule 4 wording, plus three leftover tests it covers.

Optional: the follow-up in #4427 still says to remove the recipes' exception from the PR #4037 config guard. That guard is gone, so a one-line note on #4427 would keep it accurate.

Comment IDs start at C8 because your self-review already used C1–C7 on this PR.

Generated by Claude Code

Comment thread tests/unit/test_config_validation.py Resolved
Comment thread skills/testing/SKILL.md Resolved
Comment thread tests/unit/test_config_validation.py Resolved
@yuki-97
yuki-97 force-pushed the yukih/drop-recipe-setting-tests branch from 1eba047 to ec0d292 Compare November 3, 2026 16:53
@yuki-97

yuki-97 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5f20365

@yuki-97

yuki-97 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Besides rebasing and addressing review comments:

  • Consolidated config checks under test_shipped_config.
  • Moved suite-script path checks back to test_recipes_and_test_suites.py, reusing all_test_suites.
  • Removed the W&B entity check.
  • Reorganized helpers and standalone tests, renamed _validate_config_section, shortened comments, and updated the skill references.

@terrykong
terrykong enabled auto-merge (squash) November 3, 2026 19:05
@terrykong
terrykong merged commit efc3095 into main Nov 4, 2026
70 checks passed
@terrykong
terrykong deleted the yukih/drop-recipe-setting-tests branch November 4, 2026 06:17
lonexreb added a commit to lonexreb/RL that referenced this pull request Nov 7, 2026
Merge origin/main (49 commits) to clear the conflicts with NVIDIA-NeMo#5009 and the
"Check if PR branch is up to date" gate. Code main moved into
rollout_checkpointing/ and main's new tests get the same attribute access
as the rest of this PR.

Review fixes:
- load_replay_buffer is a plain bool defaulting to True; readers test
  `not load_replay_buffer`, and the reference configs dump `true`.
- save_period defaults to 10; note that higher_is_better is only read
  when metric_name is set.
- PretrainedCheckpointConfig stays a TypedDict until PolicyConfig migrates
  (NVIDIA-NeMo#3197), so setup hands it over unchanged and
  PolicyConfig.pretrained_checkpoint keeps its TypedDict annotation.
- Indent the CheckpointingConfig docstring under Attributes: and document
  save_period, checkpoint_must_save_by and pretrained_checkpoint.
- Tests build CheckpointingConfig with keyword arguments.
- Drop the defaults-only CheckpointManager test (NVIDIA-NeMo#5009 testing rules).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Shubhankar Tripathy <[email protected]>
yfw added a commit that referenced this pull request Nov 21, 2026
…kind-advantages

Brings in main 939890a (94 commits). Conflicts, all keeping both sides:

- rollout_recovery.py: main's ledger is at schema 8 (6: turn-level
  recovery, 7: taskset attribution, 8: steps_allowed_short), so the
  sealed failure_kind moves from 6 to 9; schemas 2 to 8 still load,
  with failure_kind=None. The failure_kind check sits next to main's
  attribution_key check.
- rollout_manager.py: main's imports plus Collection; main's
  mask_sample_flagged() next to the failure_kind read.
- docs/guides/grpo.md: main unwrapped the guide's sentences (#5211);
  the exclude_infra text follows that style.
- test_grpo.py: main removed the masked_reward_policy default test
  under its testing rules (#5009); the exclude_infra behaviour tests
  stay.
- test_rollouts.py, test_single_controller_actor.py,
  test_rollout_reassembler_actor.py: both sides' tests and fields.
- test_rollout_manager.py: generate_for_finalization now returns
  (request, rollout_metrics).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L0 Run doctests and unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants