Skip to content

fix(resources_servers): add missing READMEs for string_match and gui_coordinate - #2377

Merged
ananthsub merged 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:fix/verifier-readmes
Aug 6, 2026
Merged

ananthsub merged 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:fix/verifier-readmes

Conversation

@ananthsub

Copy link
Copy Markdown
Contributor

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. #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).

…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
ananthsub force-pushed the fix/verifier-readmes branch from 3816d4c to 4949af3 Compare August 6, 2026 07:13
@ananthsub
ananthsub merged commit a9e42d5 into NVIDIA-NeMo:main Aug 6, 2026
18 checks passed
@ananthsub
ananthsub deleted the fix/verifier-readmes branch August 6, 2026 07:16
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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant