Repository navigation
FIX Reject max_examples below 1 in the Garak and ML-VLSU loaders - #3592
Open
Shivam Sharma (ShivamSharma43) wants to merge 2 commits into
Open
Shivam Sharma (ShivamSharma43) wants to merge 2 commits into
Shivam Sharma (ShivamSharma43) wants to merge 2 commits into
Conversation
Both loaders checked the cap only after adding an item, so max_examples=0 or a negative value still loaded one seed (Garak) or one text and image pair (ML-VLSU). Raise ValueError in __init__ instead, as the ComicJailbreak loader does. Fixes microsoft#3591 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Richard Lundeen (richlundeen)
approved these changes
Oct 28, 2026
Richard Lundeen (richlundeen)
left a comment
Contributor
There was a problem hiding this comment.
The loaders now reject zero and negative limits at construction. Positive limits and None retain their existing behavior, with regression cases for the invalid values.
No blocking issues found by code inspection. Tests were not run for this review. AI-assisted review (GitHub Copilot).
This branch has not been 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.
Description
Fixes #3591.
The Garak loaders (
_GarakRemoteDatasetand all its subclasses) and_VLSUMultimodalDatasetcheckedmax_examplesonly after adding an item, somax_examples=0or a negative value still loaded the first item: one seed for the Garak datasets, and one text and image pair for ML-VLSU.Changes:
_GarakRemoteDataset.__init__and_VLSUMultimodalDataset.__init__raiseValueErrorwhenmax_examplesis below 1, with the same message as the ComicJailbreak fix in FIX Count only rendered goals toward ComicJailbreak max_examples #3590.0cannot work, because an emptySeedDatasetis invalid. The Garak subclasses don't override__init__, so they all get the check. The docstrings list the new error.Tests and Documentation
tests/unit/datasets/test_garak_package_hallucination_dataset.pyandtests/unit/datasets/test_vlsu_multimodal_dataset.py:max_examplesof0and-1are rejected. These 4 tests fail onmain; the existingmax_examplestests are unchanged.pytest tests/unit/datasets: 5227 passed.ruff check,ruff formatandty checkpass on the changed files.🤖 Generated with Claude Code