Repository navigation
feat(mimo-music): add ABC composition resources server - #3704
Conversation
Signed-off-by: Harveen Singh Chadha <[email protected]>
| num_processes: 4 | ||
| score_timeout_seconds: 30.0 | ||
|
|
||
| mimo_music_simple_agent: |
There was a problem hiding this comment.
This config now fails with AgentWithoutEnvironmentServerError for mimo_music_simple_agent after the main merge. Could we add a legacy_agent Environment Server referencing this agent? Adding that declaration locally makes config resolution pass; no scorer or manifest redesign is needed.
There was a problem hiding this comment.
Fixed in b534deb. Added a legacy_agent Environment Server referencing mimo_music_simple_agent, without changing the scorer or manifest design. A regression test now resolves the actual YAML through GlobalConfigDictParser and checks the relay reference. Also completed a fresh five-example live gym eval run through the relay: all five requests completed, no masked samples, and aggregate metrics returned successfully. The focused music/config/routing/relay suite passes all 434 tests.
| err = len(re.findall(r"^Error", log, re.M)) | ||
| bar = len(re.findall(r"Bar \d+ has", log)) | ||
| if not os.path.exists(mp): | ||
| return {**base, "skip": "no_midi", "err": err, "bar": bar} |
There was a problem hiding this comment.
Could we check the renderer's exit status before treating missing MIDI as a valid rejection? Killing the renderer with SIGKILL (exit code -9) currently produces reward=0, mask_sample=false. Abnormal termination should be an infrastructure failure and masked; ordinary invalid compositions should remain valid zeros.
There was a problem hiding this comment.
Fixed in b534deb. The renderer return code is now checked before log/MIDI processing: negative signal exits are reported as abc2midi:* infrastructure failures, which the existing worker/server handling masks. Tests launch real subprocesses that terminate themselves with SIGKILL or SIGTERM, both with and without partial MIDI; all are masked. Separate exit-0/exit-1 invalid-composition cases remain valid unmasked zeros. All 52 music tests pass, and live reverification of all five committed responses preserves their exact rewards. Updated the vendored-code modification notice and attribution as well.
Signed-off-by: Harveen Singh Chadha <[email protected]>
|
/ok to test b534deb |
|
@harveenchadha Thanks for the approval-ready revision. CI on |
|
@harveenchadha friendly follow-up on my comment from yesterday: #3704 is approved, but CI on |
…ironment Signed-off-by: Harveen Singh Chadha <[email protected]>
Signed-off-by: Harveen Singh Chadha <[email protected]>
|
@marcromeyn Addressed and pushed 45bdfff. Thanks for the clear CI diagnosis.
Current main's default is already non-Ray after #4307/#4470; the explicit declaration remains supported. Also added the now-required source/revision/license header details to the vendored Python files; scorer logic is unchanged. The PR body has exact commands and provenance details. This head is ready for your CI authorization; I have not posted a trust-approval command. Both new commits are DCO-signed. |
|
/ok to test 45bdfff |
yaoyu-33
left a comment
There was a problem hiding this comment.
Re-approved at 45bdfff. The task schema and explicit Ray opt-out address the CI findings; unit/server CI now passes. The secrets-detector check still flags the pinned abcMIDI revision and archive SHA256 in setup_abc2midi.py (false positives), so that CI check remains to be cleared.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40710469951 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40710569187 |
mimo_music reached main (#3704) after this branch's snapshot, and the regenerated configs switched its relay. Its config test and README still named legacy_agent. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…VIDIA-NeMo#4953) * feat(environment): bind the agent's resources server when single_agent_turn names none A legacy_agent relay names no resources server: the agent's /run uses its own. A single_agent_turn_legacy server that replaces the relay had to pin one, and a pinned name breaks a benchmark that reaches the server through an _inherit_from rename of the agent. The rename also renames the resources server, and Gym follows renames only for agent references, so the pinned name dangles (for example indic/math_500 through math_with_judge's server). resources_server is now optional. Unset, the server binds the resources server the bound agent names, as the relay did, so it follows the agent rename. A server that sets none in front of an agent that names none fails at startup instead of on the first episode. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * feat(scripts): switch simple_agent relays to single_agent_turn_legacy About 307 configs reach simple_agent through a legacy_agent relay, so a crash repeats the whole episode. Under single_agent_turn_legacy, it repeats only the current step, and simple_agent resumes inside its turn (GYMINT-549). add_legacy_agent_environment_servers.py gains --switch-simple-agent. It replaces each relay in front of a simple_agent with a single_agent_turn_legacy server of the same name, so rows keep their routing. The server names no resources server, so it binds the agent's, as the relay did, and follows an agent rename. It grants direct HTTP access to the resources server's tools, the routes the agent's /run called. It resolves each config with its own config_paths, as Gym does, since instance names are unique only within a run. A relay stays, listed with its reason, when its agent binds no resources server, declares a grant simple_agent sessions reject (a required MCP access or a second direct HTTP access), binds a resources server whose seed_session takes only the legacy body (19 relays today, read from the server's source so a server passes once it migrates), or its run cannot load an include. A relay that inherits another keeps inheriting it, and the script refuses to switch only one of the two. The default mode is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(scripts): keep relays the switch would split or cannot drive The pairing guard only compared `_inherit_from` children that carry their own `legacy_agent` key, so a run that merged a switched relay with a same-name `legacy_agent` override (the hle and apex_shortlist opencode/pi recipes) or a bare `_inherit_from` child exited 0 with two environment server types. - Resolve every run after the planned switches. A relay that a run merges with a legacy_agent server stays on the relay; when the relay it inherits switches, the script refuses (exit 2) and names the config. Top-level nulls now remove instances, as in Gym. - Keep relays whose resources server reads the row's rollout coordinates (genrm_compare), whose implementation is not under resources_servers/, or that set keys the switched stanza would drop. - Build every rewrite before writing any file; a stanza that cannot be found exits 2 instead of raising StopIteration. - Dedupe scanned paths after resolving them. - Give the hle and apex_shortlist opencode/pi recipes a legacy_agent server of their own, so their benchmarks can switch. - Fix the docstring and docs examples, document the new stay reasons, note how to inherit the single_agent_turn templates, and test the legacy adapter with resources_server unset. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(scripts): keep every same-name declaration of a split relay When two files of a run declare the same relay (a base and a partial override of it) and a later config merges it with a legacy_agent server, split_servers found two switching entries for the instance itself and looked for a different inherited relay that was not there, raising StopIteration. Every declaration of the instance now stays on the relay; the script still refuses (exit 2) only when a different relay the instance inherits switches. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(config): preserve benchmark relay names in harness overrides Signed-off-by: yaoyu-33 <[email protected]> * chore(configs): move simple_agent configs off the legacy_agent relay Runs scripts/add_legacy_agent_environment_servers.py --switch-simple-agent over the repository (GYMINT-549). 287 relays in front of simple_agent in 279 config files become single_agent_turn_legacy servers of the same name, so a crash repeats only the current step instead of the whole episode, and simple_agent resumes inside its turn. 20 relays stay, as the script reports: - 19 whose resources server seeds only the legacy body (workplace_assistant, openenv, newton_bench, indirect_prompt_injection, example_session_state_mgmt, and the SWE example configs); they move once their servers accept the typed seed. - benchmarks/nemotron_3_ultra/benchmarks_no_external.yaml, whose include benchmarks/ruler/config_nemotron_3_256k.yaml does not exist on main. Tests and docs that read these configs follow the new key. The super35 container build now covers single_agent_turn_legacy too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(configs): keep genrm_compare on the relay and soften the docs claim Regenerated with the fixed --switch-simple-agent: genrm_compare's /verify needs the row's _ng_rollout_index and cohort keys, which single_agent_turn_legacy does not forward, so both genrm servers stay on legacy_agent. hle and apex_shortlist still switch now that their opencode/pi recipes declare their own relay. The YAML is byte-identical to a fresh generator run: 278 files, 285 relays switched, 22 kept. The docs said every shipped simple_agent config uses single_agent_turn_legacy; 22 stay on the relay, so say "most" and name why. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * test(super35): expect 16 core server environments after the switch The switched configs add single_agent_turn_legacy to the core batch's resolved server set, so the prebuilt dependency check now reports 16 environment paths. CI on Linux showed "16 server environment paths checked" against the old expectation of 15; macOS Bash 3.2 stops these shell tests before the count. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(agent): report simple_agent session tool calls as observations With model-call capture on, a simple_agent episode run through an Environment Server (single_agent_turn, single_agent_turn_legacy) lost its executed tool records: the session kept only the trajectory's invocations and gaps, so the collected ng_trajectory had no tool_calls and ng_perf.num_tool_calls was 0, while /run reported them. The session now adds a ToolCallObservation for each executed tool call to the agent observations it returns at close. Rollout collection already merges these into ng_trajectory.tool_calls and rejoins each call's output from the invocation conversation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> (cherry picked from commit 2ef4896) Signed-off-by: yaoyu-33 <[email protected]> * fix(config): relay session-less agents swapped onto single_agent_turn_legacy A `--agent-type` swap onto an environment fronted by single_agent_turn_legacy kept that server type even when the incoming agent does not implement agent sessions, so every episode failed with NotImplementedError from /v1/agent_sessions. Composition now rewrites such a server to a legacy_agent relay that calls the agent's own /run, keeping its entrypoint, agent_server and host/port. AGENT_SESSION_AGENT_TYPES in global_config is the single list of session-capable agent types; the legacy-relay migration script reads it instead of its own copy, and a unit test keeps it in step with the agent apps. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> (cherry picked from commit d156ef2) Signed-off-by: yaoyu-33 <[email protected]> * chore(configs): switch the relays main added since the snapshot Main gained these simple_agent relays after this branch's configs were generated. Rerunning the generator from scratch on main switches them: - benchmarks/hle_diamond/{config,text}.yaml and benchmarks/genrm_mmrb{1,2}/dataset.yaml: child relays over a parent this branch already switched. Without the switch each merges into an instance with both legacy_agent and single_agent_turn_legacy and fails to load. An incremental rerun misses them (GYMINT-632). - benchmarks/beam/{config,config_muse_128k,config_n3_1m}.yaml, resources_servers/beam/configs/beam.yaml, benchmarks/vision_arena_v1/config.yaml, resources_servers/arena/configs/vision_arena_v1.yaml, resources_servers/mimo_music/configs/mimo_music.yaml: new relays. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * test(mimo_music): expect single_agent_turn_legacy after the switch mimo_music reached main (NVIDIA-NeMo#3704) after this branch's snapshot, and the regenerated configs switched its relay. Its config test and README still named legacy_agent. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * refactor(config): centralize migrated environment timeouts Signed-off-by: yaoyu-33 <[email protected]> * test(hermes): validate recipes with the legacy environment config Signed-off-by: yaoyu-33 <[email protected]> * fix(config): switch environment configs added on main to single_agent_turn_legacy The main merge brought in two benchmarks that override `legacy_agent` on a parent environment server this PR already switched, so each resolved to both keys and failed as an almost-server. Point their overrides at `single_agent_turn_legacy`, and update the tests from main that still expect the relay or the generic config class. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> --------- Signed-off-by: yaoyu-33 <[email protected]> Signed-off-by: weijia chen <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: weijia chen <[email protected]>
Summary
Add a standalone
mimo_musicresources server for single-turn ABC musiccomposition, using the public MiMo music scorer. Reuse the existing
simple_agentand model-server interfaces; no changes to core, agents, models,or training integrations.
XiaomiMiMo/verl at a2ad9f6,
preserving original notices and adding attribution. The musical reward
formula, composition rejection gates, and baseline are unchanged; the local
renderer signal-failure classification is documented in the attribution.
[0, 1], including native rejectiongates. This is a music-distribution proxy, not a prompt-compliance or
listening-quality oracle, and not binary accuracy.
kill scorer/renderer process groups on timeout or cancellation, clean scratch
files from the parent, and mask infrastructure failures. Reverification does
not trust old reward/diagnostic fields.
macOS has a Homebrew fallback. The external GPL executable/source is not
vendored. Linux auto-install was exercised from a clean prefix.
documentation, and regression tests. No full dataset is committed.
No separate issue: this is an isolated resources-server integration of an
already released scorer, with no shared API or existing benchmark changes.
Layout / compatibility
This uses the standalone resources-server path explicitly supported in
CONTRIBUTING.md, with the five-example data validation contract. Its YAMLalso wires the standard one-turn agent and its
legacy_agentEnvironmentServer relay. It is intentionally not advertised as
a manifest-backed workload: the current
VerifierFixturerequires a genuinefull-reward endpoint case, while this native graded scorer has no known tune
scoring exactly 1.0. A manifest migration needs a suitable continuous-reward
fixture contract or a genuine endpoint example, not a changed scoring formula.
Maintainer feedback on this onboarding choice is welcome.
Existing environments and model configurations are unchanged.
verified: falseremains set; these are functional smoke tests, not reward profiling or a quality
baseline. Renderer version should be recorded with results.
Initial validation (before review updates)
Built on NVIDIA upstream
mainat9faeed1.pre-commit run --all-files— passed.gym dataset collate --config resources_servers/mimo_music/configs/mimo_music.yaml --output-dir /tmp/mimo-upstream-data-validation --mode example_validation— passed.gym env test --resources-server mimo_music +should_validate_data=true +skip_venv_if_present=true— 45 passed, zero skipped; isolated component environment was installed throughgym env startfirst. Repeated using the automatically built renderer.pytest resources_servers/mimo_music/tests --cov=resources_servers.mimo_music.app --cov=resources_servers.mimo_music.score_worker --cov=resources_servers.mimo_music.setup_abc2midi --cov-report=term-missing --cov-fail-under=95— 45 passed; 99.30% adapter/worker/setup coverage. This percentage is not a claim about coverage of the vendored upstream scorer.pytest tests/unit_tests/test_base_resources_server.py tests/unit_tests/test_openai_utils.py tests/unit_tests/test_reward_profile.py tests/unit_tests/test_failure_kinds.py— 302 passed.and its scratch directory is removed. Tests also cover cancellation,
concurrency bounds, invalid output, HTTP validation, installer paths, native
reward agreement, and recorded-rollout reverification.
abc2midi 4.88. The macOS install path is unit-tested, not executed on macOS.
git diff --check— passed.CI classification: server-only (new resources server plus Markdown
attribution/catalog updates). The entire cross-environment server suite and
full core/sandbox coverage suite were not run locally; focused relevant core
and component tests were run. Repository CI may require a maintainer's trust
approval for this external contribution.
Real rollout evidence
Ran the full Gym model-server → simple-agent → resources-server flow against
Qwen/Qwen2.5-3B-Instruct, served via vLLM, with temperature 0, 2,048 maximumoutput tokens, concurrency 4, one rollout per task, and abc2midi 4.88.
The committed
data/example_rollouts.jsonlhas all five original responses:four native rejections and one reward of 0.116, mean 0.0232, no masked
samples. Inspected failures: invalid tempo, excessive bar-length warnings,
an internal blank line, and an extracted final tune lacking a key header.
The weak positive output is repetitive and not fully prompt-compliant; the
README explicitly discusses this limitation.
A second live run on the final adapter completed all five requests without
masked samples and received five zero rewards for malformed compositions.
The same five committed responses were then posted to the final live
/verifyendpoint: every reward matched exactly, including the positive example.
All five also matched the pinned original Xiaomi scorer. A regression test
checks recorded-response reverification.
Generation is not assumed repeatable across batches; deterministic verifier
agreement is checked on identical responses. No training run or multi-model
quality claim is made.
Suggested labels:
feature,area:environment,benchmark-onboarding,needs-review.AI-assisted implementation; final diff and generated model responses inspected.
Commit includes DCO sign-off.
Review updates (2026-10-13)
Addressed both review requests in b534deb on top of the existing upstream merge:
legacy_agentEnvironment Server declaration referencingmimo_music_simple_agent, with a real configuration-parser regression test. No scorer/manifest redesign or core changes.pytest resources_servers/mimo_music/tests tests/unit_tests/test_global_config.py tests/unit_tests/test_rollout_collection.py environment_servers/legacy_agent/tests/test_app.py -q— 434 passed (52 music + 382 config/routing/relay tests).gym env test --resources-server mimo_music +should_validate_data=true +skip_venv_if_present=true— 52 passed, zero skipped, and example data validation passed in the refreshed isolated component environment.pre-commit run --all-filesandgit diff --check— passed.gym eval runthrough the Environment Server relay, standard agent, model server, and music verifier againstQwen/Qwen2.5-3B-Instruct: 5/5 requests completed, zero masked samples, four native rejections and one reward 0.116 (mean 0.0232). Used temperature 0, 2,048 maximum output tokens, concurrency 4, one rollout per example, and abc2midi 4.88. Responses were inspected; this is functional validation, not a music-quality benchmark./verifyendpoint: every reward matched exactly and all remained unmasked.The original recorded rollout fixtures remain unchanged. No full training run or full-repository test-suite claim is made. The updated commit includes DCO sign-off.
CI review updates (2026-10-27)
Addressed the CI findings from @marcromeyn in 45bdfff, after merging upstream
mainat50e23162f797b92324e4f9d63404cbd27dc64cf3(merge commitd5816dd9). The merge preserves the existing reviewed history; no force-push.ray_enabled = Falsedeclaration. The scorer uses local subprocesses, not Ray. Current main already defaults to non-Ray servers after feat(core): servers run without Ray unless they declare ray_enabled = True #4307/chore(server): drop redundant ray_enabled = False declarations #4470; the explicit declaration is compatible with the updated audit and records this server's requirement.task_data.pywith optional stringtask_idandsourceprovenance fields andextra="allow". Committed task rows validate; missing/null provenance is accepted; extra metadata is preserved and reported instead of silently dropped. Tests exercise flat,verifier_metadata, andtask_datarow shapes, wrong types, and unknown fields.Validation on the updated branch
pytest resources_servers/mimo_music/tests tests/unit_tests/test_ray_opt_out.py tests/unit_tests/test_task_data.py tests/unit_tests/test_global_config.py tests/unit_tests/test_rollout_collection.py environment_servers/legacy_agent/tests/test_app.py -q --tb=short -o log_cli=false— 1,326 passed.gym env test --resources-server mimo_music +should_validate_data=true— 62 passed, zero skipped, and data validation passed after refreshing the isolated component environment.pytest resources_servers/example_session_state_mgmt/tests -q --tb=short -o log_cli=false— 5 passed.pytest resources_servers/openenv/tests -q --tb=short -o log_cli=false— 30 passed. Both previously failing server suites pass with the upstream merge; no local patches to either server.gym env resolvewith the music and vLLM configs — passed.pre-commit run --all-files— passed. The private guardwords hook reported its catalog unavailable and skipped its scan; the public diff was also reviewed for internal details.git diff --check— passed; both new commits have DCO sign-off.run_webserver()path, with no Ray cluster address. Health passed. Posted all five committed public-model responses to live/verify: every reward matched exactly, including 0.116, and all samples were unmasked. Server shut down cleanly.New model generation is N/A for this revision: schema/declaration/provenance changes do not alter prompts, generation, or scoring. The earlier real-model rollout evidence remains above; fresh server startup and live recorded-response reverification were performed. These are scoped checks, not a full-repository or full-sandbox-suite run. CI authorization is needed for the new head.
Vendored source mapping
Source: XiaomiMiMo/verl music scorer, exact revision
a2ad9f6160b03ff2d47e59832bfb6b289f37c917, Apache-2.0.The source files
recipes/design/music/scorer/{__init__.py,core.py,feats.py,pipeline.py,score.py}map one-to-one toresources_servers/mimo_music/scorer/with the same filenames.recipes/design/music/scorer/baselines/ref_full4k.jsonmaps toresources_servers/mimo_music/scorer/baselines/ref_full4k.jsonunchanged. Original notices are retained; the Python headers andATTRIBUTIONS.mdrecord local modifications.