Implementation:Open compass VLMEvalKit VGRPBench Binairo
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Puzzle_Solving |
Overview
Implements constraint checking and puzzle factory for the Binairo (binary puzzle) grid puzzle in VGRPBench.
Description
This module defines constraint validators and a puzzle factory for the Binairo puzzle type, where each cell must be white or black. The ConstraintRowBalance and ConstraintColBalance classes enforce that completed rows and columns contain equal counts of white and black cells. The ConstraintNoTripleAdjacent class ensures no three consecutive identical values appear in any row or column. The BinairoPuzzleFactory requires an even grid size of at least 4 and combines all three constraints.
Usage
Called internally by VGRPBench evaluation pipeline for puzzle constraint verification.
Code Reference
- Source:
vlmeval/dataset/utils/vgrpbench/puzzles/binairo.py, Lines: L1-97 - Import:
from vlmeval.dataset.utils.vgrpbench.puzzles.binairo import BinairoPuzzleFactory
Key Classes:
class ConstraintRowBalance(Constraint): ...
class ConstraintColBalance(Constraint): ...
class ConstraintNoTripleAdjacent(Constraint): ...
class BinairoPuzzleFactory(PuzzleFactory): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Puzzle grid state with board containing 'w' (white), 'b' (black), or 0 (undefined) values |
| Outputs | Boolean validation result or constraint violations |
Usage Examples
# Internal usage
from vlmeval.dataset.utils.vgrpbench.puzzles.binairo import BinairoPuzzleFactory
factory = BinairoPuzzleFactory(size=6)
result = factory.check(game_state)