Repository navigation
fix(resources_servers): add missing READMEs for string_match and gui_coordinate - #2377
Merged
Merged
Conversation
…coordinate `gym env test` counts every server directory as a candidate but only tests the ones with a README.md, so the two servers added in NVIDIA-NeMo#2332 tripped the total-vs-tested assertion on main (144 found, 142 tested). Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub
force-pushed
the
fix/verifier-readmes
branch
from
August 6, 2026 07:13
3816d4c to
4949af3
Compare
OlegSudakov
pushed a commit
to OlegSudakov/Gym
that referenced
this pull request
Aug 7, 2026
…coordinate (NVIDIA-NeMo#2377) `gym env test` counts every directory under `resources_servers/` etc. as a candidate module, but only tests the ones containing a `README.md` (`nemo_gym/cli/env.py:717`), then asserts the two counts match. NVIDIA-NeMo#2332 added `string_match` and `gui_coordinate` without READMEs, so main fails with `Mismatch on the number of total modules found (144) and the number of actual modules tested (142)`. This adds a README to each, describing the extraction/scoring behavior, the input JSONL fields, and how to run them. Both servers' tests now run: 10 passed for `string_match`, 12 for `gui_coordinate`. Data validation preconditions hold for both (5 examples, 5 rollouts, `"Number of examples": 5`). Signed-off-by: Ananth Subramaniam <[email protected]>
ehosseiniasl
pushed a commit
to ehosseiniasl/Gym
that referenced
this pull request
Oct 13, 2026
…IDIA-NeMo#4554) ## What does this PR do? `gui_coordinate` rollouts now keep each row's `metadata`, as the server's README says (`metadata` "is passed through and is not used for scoring"). Before this PR, `gym eval run` saved rollout rows without it, even though every materialized input row had it. Scoring is unchanged. Fixes NVBug [6783212](https://nvbugspro.nvidia.com/bug/6783212). Closes NVIDIA-NeMo#4495. ### Cause `GuiCoordinateRunRequest` declares `metadata` (`resources_servers/gui_coordinate/app.py:39`), but `GuiCoordinateVerifyResponse` did not. `verify()` builds its response from `**body.model_dump(...)`, so `metadata` arrived as a keyword the response model didn't declare. `BaseVerifyResponse` keeps pydantic's default `extra="ignore"`, so the field was dropped. The simple agent returns the `/verify` JSON as the rollout row, so the saved row had no `metadata`. The server has done this since it was added in NVIDIA-NeMo#2332; the README line came later in NVIDIA-NeMo#2377. The committed `data/example_rollouts.jsonl` from NVIDIA-NeMo#2332 shows it too: all 5 input rows have `metadata`, and none of the 5 rollout rows do. ### Fix Declare `metadata: Optional[dict[str, Any]] = None` on `GuiCoordinateVerifyResponse`. `verify()` already passes the request's value in, so nothing else changes. Downstream, the simple agent and `image_tools_agent` both validate the `/verify` JSON with `extra="allow"`, and rollout collection writes the `/run` result as the row, so the field reaches `rollouts.jsonl`. Alternatives not taken: - **Make the response inherit `GuiCoordinateVerifyRequest`**, as 16 servers do. That would also echo `max_dist`, which the README doesn't promise. Declaring only the documented field keeps the diff to what the README says. - **Change the README to say `metadata` is kept only in `*_materialized_inputs.jsonl`.** Nothing in the gui_coordinate PRs or docs narrows "passed through" that way, and the QA case reads the README as promising it in saved output. Not changed: `data/example_rollouts.jsonl`. It is model output from NVIDIA-NeMo#2332 and still lacks `metadata`; regenerating it needs a GPU run of the example and would replace all five model outputs. Test: `test_verify_passes_metadata_through` calls `verify()` with a metadata-bearing request and checks that the serialized response carries the same dict, and that the reward is unchanged. ### Before the fix Gym `91d8c6c9f` (`main`), with this PR's test file, from `resources_servers/gui_coordinate`: ```bash python -m pytest tests -q -rf --tb=short ``` ```text tests/test_app.py::TestApp::test_verify_passes_metadata_through FAILED [100%] tests/test_app.py:117: in test_verify_passes_metadata_through assert result["metadata"] == metadata E KeyError: 'metadata' FAILED tests/test_app.py::TestApp::test_verify_passes_metadata_through - KeyE... =================== 1 failed, 12 passed, 1 warning in 3.23s ==================== ``` End to end, the NVBug's QA case runs the README flow (`gym env start` + `gym eval run --no-serve --agent gui_coordinate_simple_agent`) on 5 independent GUI screenshots with Qwen/Qwen3-VL-8B-Instruct on one H100. Its scoring and `/verify` control checks pass; it fails only on saved-output metadata: ```text FAIL 167.2s five independent GUI screenshots follow documented coordinate scoring and preserve output metadata - documented metadata pass-through: saved CLI rollout 0 saved rollout rows with metadata: 0/5 row keys: _ng_environment_server, _ng_result_type, _ng_rollout_index, _ng_task_index, agent_ref, distance, expected_answer, extracted_x, extracted_y, failure_kind, failure_reason, mask_sample, response, responses_create_params, reward ``` ### After the fix Gym `40767fa54` (this branch), same command: ```text tests/test_app.py::TestApp::test_verify_passes_metadata_through PASSED [100%] ======================== 13 passed, 1 warning in 2.85s ========================= ``` Same QA case, same model and inputs: ```text PASS 162.3s five independent GUI screenshots follow documented coordinate scoring and preserve output metadata saved rollout rows with metadata: 5/5, each equal to its input row's metadata e.g. {"fixture_id": "button", "target_label": "Create report", "source": "independent gui_coordinate GUI fixtures"} ``` ### Validation - `pytest` in `resources_servers/gui_coordinate`: before 1 failed / 12 passed; after 13 passed. - `gym env test --resources-server gui_coordinate` (server venv): 13 passed. - `tests/unit_tests/test_task_data.py::TestSchemaPresence` and `tests/unit_tests/test_ray_opt_out.py`: 21 passed. - `pre-commit run --all-files`: passed, no changes. - QA testcase `gui_coordinate` (5 independent GUI screenshots, Qwen/Qwen3-VL-8B-Instruct on one H100): before 0/1 (fails on `documented metadata pass-through`), after 1/1. The rows went through `gui_coordinate_environment_server` (`legacy_agent`), so the relay path is covered. - Rollout evidence: the QA run above is a real 5-row rollout with the README commands; all 5 saved rows carry their input's `metadata`. Model rewards were 0.0 on both commits: Qwen3-VL-8B answered in an attribute form (`<point x1="862" y1="207" ...>`) that the documented `<point>(x, y)</point>` parser does not match. That is unchanged by this PR. The case's 17 direct `/verify` controls still score 1.0, 0.25 and 0.0 where expected, and each control response now includes `metadata`. ### Compatibility Rollout rows from `gui_coordinate` gain a top-level `metadata` key: the row's dict, or `null` when the input row has none. Rewards, metrics, and other fields are unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: qiaochuz <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was previously deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
gym env testcounts every directory underresources_servers/etc. as a candidate module, but only tests the ones containing aREADME.md(nemo_gym/cli/env.py:717), then asserts the two counts match. #2332 addedstring_matchandgui_coordinatewithout READMEs, so main fails withMismatch on the number of total modules found (144) and the number of actual modules tested (142).This adds a README to each, describing the extraction/scoring behavior, the input JSONL fields, and how to run them.
Both servers' tests now run: 10 passed for
string_match, 12 forgui_coordinate. Data validation preconditions hold for both (5 examples, 5 rollouts,"Number of examples": 5).