Skip to content

fix(calendar): reject duplicate event IDs - #5384

Merged
cmunley1 merged 4 commits into
NVIDIA-NeMo:mainfrom
deavgprime:fix/calendar-duplicate-event-ids
Nov 2, 2026
Merged

cmunley1 merged 4 commits into
NVIDIA-NeMo:mainfrom
deavgprime:fix/calendar-duplicate-event-ids

Conversation

@deavgprime

Copy link
Copy Markdown
Contributor

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 0 and "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.
  • Added eight duplicate-ID cases covering both orderings, overlapping and non-overlapping times, and integer/string aliases, plus two unique-ID controls. Six duplicate cases fail on unchanged main; the other two already receive zero for a time conflict. All ten pass with the fix.
  • 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

  • Contributing guidelines reviewed.
  • Change is focused on calendar: duplicate event IDs can receive full reward #5381.
  • Tests added and passing locally.
  • Test documentation updated.
  • Repository-wide pre-commit checks pass, with the private guardword check skipped as noted above.
  • No new source files; existing license headers retained.
  • Commit includes DCO sign-off.

Proposed labels: bug, area:environment, needs-review.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 20:14
@copy-pr-bot

copy-pr-bot Bot commented Oct 30, 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Oct 30, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working labels Oct 30, 2026
@cmunley1

Copy link
Copy Markdown
Contributor

/ok to test f96e003

@cmunley1

Copy link
Copy Markdown
Contributor

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@cmunley1
cmunley1 enabled auto-merge October 30, 2026 22:04
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the ready-to-merge PR is approved, current, and waiting for final CI or merge label Oct 30, 2026
@cmunley1

Copy link
Copy Markdown
Contributor

/ok to test 87a7a24

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Nov 2, 2026
@weijiac0619

Copy link
Copy Markdown
Contributor

/ok to test 1c496df

@weijiac0619

Copy link
Copy Markdown
Contributor

/ok to test bed9b7e

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41513311752

@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Nov 2, 2026
Merged via the queue into NVIDIA-NeMo:main with commit 2b8efc9 Nov 2, 2026
54 of 57 checks passed
AdamRajfer added a commit that referenced this pull request Nov 2, 2026
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]>

This branch was previously deployed

1 inactive deployment
public — bed9b7e5 Deployed Nov 2, 2026 by copy-pr-bot[bot] via release / finalize / notify #9232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working community-request Issue reported or requested by someone from the community ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

calendar: duplicate event IDs can receive full reward

5 participants