Repository navigation
fix(tier3): preserve trailing hyphens in Gym trial identity #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rng1995
merged 15 commits into
NVIDIA:main
from
Afloat16:fix/preserve-gym-task-name-hyphens
Nov 23, 2026
+52
−1
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f28881e
fix(tier3): preserve trailing hyphens in Gym trial identity
Afloat16 a1dae01
Merge branch 'main' into fix/preserve-gym-task-name-hyphens
chrisknvidia 2ec1c11
Merge main and retain both release notes
Afloat16 c1896c1
Merge upstream main after documentation reorganization
Afloat16 f7a103a
docs: move pending change notes into Unreleased
Afloat16 f1e1776
Merge branch 'main' into fix/preserve-gym-task-name-hyphens
rng1995 be71f3e
Merge upstream main and preserve unreleased notes
Afloat16 f3830e6
Merge main and retain independent Unreleased changelog entries
Afloat16 05b3c85
chore: merge upstream main and resolve changelog conflict
Afloat16 c17a850
chore: integrate latest SkillSpector diagnostics from main
Afloat16 09a4c30
chore: merge main and preserve the PR release note
Afloat16 37d816d
Merge main into fix/preserve-gym-task-name-hyphens
rng1995 fbe6fbc
Merge main into afloat/pr-732
rng1995 3ea4e26
Merge main into afloat/pr-732
rng1995 3306305
Merge main and preserve the NeMo Gym release note
rng1995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Distinct valid case IDs must not overwrite one another's Gym trial evidence.""" | ||
|
|
||
| import json | ||
|
|
||
| import pytest | ||
|
|
||
| from skillevaluator.tier3.case_ids import validate_case_ids | ||
| from skillevaluator.tier3.nemo_gym.results import write_job_from_rollouts | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("suffix", ["-", "--"]) | ||
| @pytest.mark.parametrize("attempts", [1, 2]) | ||
| def test_gym_trials_keep_distinct_trailing_hyphen_case_ids(tmp_path, suffix, attempts): | ||
| task_names = ["case", "case" + suffix] | ||
| assert validate_case_ids(task_names) == task_names | ||
| rows = [] | ||
| for index, task_name in enumerate(task_names): | ||
| for attempt in range(1, attempts + 1): | ||
| logs = tmp_path / "logs" / task_name / str(attempt) | ||
| logs.mkdir(parents=True) | ||
| (logs / "reward.json").write_text(json.dumps({"overall": index / 2, "entry_id": task_name})) | ||
| (logs / "trajectory.json").write_text(json.dumps({"steps": [{"message": f"{task_name}/{attempt}"}]})) | ||
| rows.append({"task_id": task_name, "verifier_return_code": 0, "verifier_logs_dir": str(logs)}) | ||
|
|
||
| job = tmp_path / "job" | ||
| errors = write_job_from_rollouts( | ||
| rows, job, eval_name="agent", task_case_ids={name: name for name in task_names}, n_attempts=attempts | ||
| ) | ||
|
|
||
| assert errors == [] | ||
| trials = {path.name: path for path in job.iterdir() if path.is_dir()} | ||
| expected_names = {f"{name}__gym{attempt:03d}" for name in task_names for attempt in range(1, attempts + 1)} | ||
| assert trials.keys() == expected_names | ||
| for index, task_name in enumerate(task_names): | ||
| for attempt in range(1, attempts + 1): | ||
| trial = trials[f"{task_name}__gym{attempt:03d}"] | ||
| result = json.loads((trial / "result.json").read_text()) | ||
| assert result["task_name"] == task_name | ||
| assert result["verifier_result"]["rewards"] == {"overall": index / 2, "entry_id": task_name} | ||
| assert ( | ||
| json.loads((trial / "agent/trajectory.json").read_text())["steps"][0]["message"] | ||
| == f"{task_name}/{attempt}" | ||
| ) | ||
| result = json.loads((job / "result.json").read_text()) | ||
| reward_groups = result["stats"]["evals"]["agent"]["reward_stats"]["reward"] | ||
| assert {name for group in reward_groups.values() for name in group} == expected_names |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.