Skip to content

Conversation

@mikasenghaas
Copy link
Member

@mikasenghaas mikasenghaas commented Nov 4, 2025

Description

prime-rl depend on example_id being unique across the entire env dataset - this is currently not the case for EnvGroup.

from datasets import Dataset

import verifiers as vf

a = vf.SingleTurnEnv(
    dataset=Dataset.from_dict({"question": ["a"], "completion": ["A"]})
)
b = vf.SingleTurnEnv(
    dataset=Dataset.from_dict({"question": ["a"], "completion": ["A"]})
)

print(vf.EnvGroup([a, b]).get_dataset().to_list())

Previously, both samples have ID 0

[{'question': 'a', 'completion': 'A', 'example_id': 0, 'prompt': [{'content': 'a', 'role': 'user'}], 'task': 'env_0'}, {'question': 'a', 'completion': 'A', 'example_id': 0, 'prompt': [{'content': 'a', 'role': 'user'}], 'task': 'env_1'}]

Now, they have IDs 0 and 1, as expected

[{'question': 'a', 'completion': 'A', 'prompt': [{'content': 'a', 'role': 'user'}], 'task': 'env_0', 'example_id': 0}, {'question': 'a', 'completion': 'A', 'prompt': [{'content': 'a', 'role': 'user'}], 'task': 'env_1', 'example_id': 1}]

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

@mikasenghaas mikasenghaas marked this pull request as ready for review November 4, 2025 15:30
@willccbb willccbb merged commit e354112 into main Nov 5, 2025
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.

3 participants