Repository navigation
fix(calendar): reject duplicate event IDs - #5384
Conversation
Signed-off-by: devgprime <[email protected]>
|
/ok to test f96e003 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found.
The duplicate-ID guard uses the existing string normalization and rejects duplicates before overwriting entries. Unique IDs retain the existing count, conflict, and constraint checks; the empty-expected-calendar path is unchanged.
The regression tests cover integer/string aliases, both orderings, overlapping and separated times, and valid unique-ID controls. Test documentation matches the additions. Caller and task-data contracts remain compatible.
Reviewed all three changed files and directly affected paths. The PR supplies representative model smoke-rollout evidence for this training environment. Static review only; tests were not executed here.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
/ok to test 87a7a24 |
|
/ok to test 1c496df |
|
/ok to test bed9b7e |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41513311752 |
Brings in main up to 94545e7 (#5141, #5384, #5144, #4615, #4954, #5001, #5175). Textual conflict: nemo_gym/cli/env.py, imports only. This branch imports PIPE from subprocess (the server start error capture); main imports SIGKILL from signal (#5141, the shutdown drain). Both are kept: "from signal import SIGINT, SIGKILL" and "from subprocess import PIPE, Popen, TimeoutExpired". Semantic conflict: #5141 starts each server in its own session (run_command(..., start_new_session=True)) so shutdown can signal its process group, while this branch starts servers through RunHelper._spawn_server, which keeps the tail of the error stream. The merged call passed start_new_session to _spawn_server, which did not accept it (11 test_cli failures). _spawn_server now takes start_new_session and forwards it to run_command, so both behaviours hold. The dry-run path keeps this branch's process.wait(): the tail thread of _spawn_server owns the piped stream, so main's communicate() would compete with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
What does this PR do?
The calendar verifier builds a dictionary keyed by event ID before checking the event count. Repeated IDs overwrite earlier entries, so a response containing duplicate events can receive full reward.
Reject duplicate IDs before inserting them. Use the existing string normalization so
0and"0"cannot bypass the check. Unique integer and string IDs remain accepted.Fixes #5381.
Validation
gym env test +entrypoint=resources_servers/calendar +should_validate_data=true +skip_venv_if_present=true: 34 tests passed; example data validation passed. Reused the configured local Python 3.13.17 environment.pre-commit run --all-files: passed. The private guardword catalog is unavailable, so that hook skips its private checks.git diff --check: passed.Rollouts
Ran the first shipped calendar example through the real SimpleAgent, inference-provider server, and calendar verifier using local Qwen2.5-Coder 1.5B via Ollama 0.40.6. The model returned two events at 10:00 and 11:00, each lasting 60 minutes, and received reward 1.0.
Replayed the saved response through
/verify: the original still received 1.0; appending an identical event or an event with the same ID represented as a string received 0. These duplicate responses were explicit test perturbations, not additional model generations.The single generation used 980 input tokens and 92 output tokens. It ran with temperature 0, a 256-token output limit, a 6 GiB memory limit, and a 1.5-core CPU limit. Sampled peak workload memory was 2.81 GiB. This is a smoke check, not a full benchmark run.
Compatibility and benchmark impact
For requests with a nonempty expected calendar, duplicate IDs now produce reward 0 and the grading reason
duplicate_event_id. Previously accepted duplicate schedules can therefore change historical scores. Unique schedules and the existing no-change path for empty expected calendars retain their behavior. No configuration or dataset migration is needed.Checklist
Proposed labels:
bug,area:environment,needs-review.