Skip to content

fix(tier3): preserve trailing hyphens in Gym trial identity - #732

Merged
rng1995 merged 15 commits into
NVIDIA:mainfrom
Afloat16:fix/preserve-gym-task-name-hyphens
Nov 23, 2026
Merged

rng1995 merged 15 commits into
NVIDIA:mainfrom
Afloat16:fix/preserve-gym-task-name-hyphens

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Trailing hyphens are valid in dataset case IDs, and Harbor task directories preserve them. NeMo Gym normalization strips leading/trailing hyphens when forming trial directory names, so distinct cases such as case and case- both write case__gym001. The later case overwrites the earlier reward, result and trajectory while aggregate statistics still count both trials.

Preserve these safe identity characters when normalizing Gym trial names. Unsafe-character replacement and the existing empty-name fallback remain intact.

Integration refresh — 2026-11-19

Head f3830e6710231387e595044021da334c072ba25d merges main ac9fc0ef4999ee5eb86eae27ec3a83c880891c92 and resolves the Unreleased changelog conflict by retaining both entries. The Gym result implementation and trial-identity regression-test blobs are unchanged from the preceding PR head; all non-PR files match that main revision. Structural review confirmed that the original PR diff is preserved. Earlier test results below apply to those unchanged files; this changelog resolution does not claim a full-suite rerun. Current workflows await maintainer approval.

Verification

All four new regressions fail on unchanged base 8fe9723. They validate the case IDs and exercise the actual job writer with one/two trailing hyphens and one/two attempts, then verify distinct directories, rewards, case metadata, trajectories and aggregate trial references.

python -m pytest tests/tier3/test_gym_trial_identity.py tests/test_nemo_gym_backend.py -q — 196 passed, 25 failed. All four new regressions pass. Each of the 25 failures is in an existing runner test and raises Output provenance key must be outside evaluated and generated trees before reaching normalization. Running those same 25 tests against unchanged base 8fe9723 reproduces all 25 failures with the same error; the sandbox fixture places its provenance key under the generated workspace.

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes (Unreleased changelog)
  • Ran make lint equivalent: python -m ruff check src tests
  • Full make test did not complete successfully in this environment (see below)
  • Ran make build equivalent: python -m build (wheel and sdist)
  • Did not add credentials, private datasets, or proprietary benchmark content

The unchanged base 8fe9723, tested with python -m pytest -x -q, stops after 456 passed and 19 deselected at tests/ci/test_gateway_benchmark_workflows.py::test_gitlab_enriched_tier1_applies_the_keyless_job_baselines[extra0-expected0]. The sandbox has no /tmp, while that workflow fixture explicitly invokes mktemp -d /tmp/skillevaluator-enriched-tier1.XXXXXX. The same test fails for the same reason on the retry branch. No full-suite pass is claimed.

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

Signed-off-by: Afloat <ShuffleMonkey@163.com>

@chrisknvidia chrisknvidia 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, good catch. Case IDs may end in '-' and Harbor keeps them, so collapsing 'case' and 'case-' into the same Gym trial directory really did lose a trial's evidence while the stats still counted it. Dropping the strip is the right fix: everything that reaches _safe() is a validated case ID or a staged task directory name, neither of which can start with '-' or contain characters outside the safe set, and unknown rollout task IDs are rejected before a trial is named, so nothing can now produce a leading-hyphen directory. The four new tests fail on main and pass here, and they exercise the real job writer end to end (directories, result.json, rewards, trajectories and the aggregate reward groups).

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>

@rng1995 rng1995 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, @Afloat16, for fixing the Gym trial identity collision. Preserving trailing hyphens matches the validated case-ID contract and keeps rewards, trajectories, attempt records and aggregate reward groups separate. I found no new actionable issues on this head.

Validation: 13 focused tests passed, covering the new trailing-hyphen cases and existing Gym writer/collector behavior.

@rng1995 rng1995 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 @Afloat16 for this contribution! I reviewed c1896c1a54. I reproduced the problem on main, confirmed this change fixes it, checked that the new tests fail on main, and ran the new and related tests on this head (all pass). I left 1 inline comment (1 P3); please take a look.

Comment thread CHANGELOG.md Resolved
Merge current main while retaining this change and the published release notes.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
@Afloat16

Copy link
Copy Markdown
Contributor Author

Addressed in f7a103a: after merging main, the NeMo Gym trailing-hyphen note now belongs to Unreleased / Fixed, and main's published release notes are preserved. This PR's existing production and regression-test changes are preserved. The changelog placement and git diff --check have been verified; hosted workflows still await maintainer approval.

@rng1995
rng1995 enabled auto-merge (squash) November 18, 2026 05:16
Signed-off-by: Afloat <ShuffleMonkey@163.com>
auto-merge was automatically disabled November 18, 2026 06:03

Head branch was pushed to by a user without write access

@rng1995 rng1995 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 @Afloat16 for this contribution and for addressing the earlier review! I re-checked be71f3efc8: all 1 earlier comment is resolved in the code, the tests pass, and I found nothing new. Approving.

Preserve this pull request's code and tests while resolving the changelog conflict.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Afloat16 and others added 5 commits November 19, 2026 17:19
Preserve both the PR entry and current upstream release notes.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Synchronize with NVIDIA/SkillEvaluator main f867b7f.
Retain this PR's entry under Unreleased and preserve published release history.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Resolve the CHANGELOG.md conflict by keeping main's Unreleased/Fixed entries unchanged and
retaining the trailing-hyphen note as a Fixed bullet under Unreleased.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Resolve the CHANGELOG.md conflict by keeping main's entries and this change's entry under Unreleased.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Resolve the CHANGELOG.md conflict by keeping main's entries and this change's entry under Unreleased.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>

@rng1995 rng1995 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 @Afloat16 for this contribution! I re-checked 3ea4e26f0: I merged current main into the branch (the only conflict was CHANGELOG.md, resolved by keeping main's entries and this entry under Unreleased), confirmed that every earlier review comment is addressed in the code, and ran this PR's tests and ruff, which pass. I found nothing new. Approving.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>

@rng1995 rng1995 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.

Reviewed the refreshed branch. The merge preserves the Gym implementation and its regression tests and keeps the release note under Unreleased. The four Gym regression cases and the previously failing timing check passed locally.

@rng1995
rng1995 merged commit 9e410d4 into NVIDIA:main Nov 23, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants