Implementation:Open compass VLMEvalKit VGRPBench Nonogram
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, Evaluation, Puzzle_Solving |
Overview
Implements constraint checking and puzzle factory for the Nonogram (Picross) grid puzzle in VGRPBench.
Description
This module defines constraint validators and a puzzle factory for the Nonogram puzzle type, where cells are filled or empty according to run-length hints for each row and column. The ConstraintBase class provides a shared _check_line_hints method that validates runs of filled cells against hint sequences, handling both complete and partially-defined lines. The ConstraintRowHints and ConstraintColHints classes apply line checking to rows and columns respectively. The NonogramPuzzleFactory uses 'e' (empty) and 's' (selected/filled) as possible cell values.
Usage
Called internally by VGRPBench evaluation pipeline for puzzle constraint verification.
Code Reference
- Source:
vlmeval/dataset/utils/vgrpbench/puzzles/nonogram.py, Lines: L1-130 - Import:
from vlmeval.dataset.utils.vgrpbench.puzzles.nonogram import NonogramPuzzleFactory
Key Classes:
class ConstraintBase: ...
class ConstraintRowHints(ConstraintBase): ...
class ConstraintColHints(ConstraintBase): ...
class NonogramPuzzleFactory(PuzzleFactory): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Puzzle grid state with board and hints dictionary containing row_hints and col_hints run-length arrays |
| Outputs | Boolean validation result or constraint violations |
Usage Examples
# Internal usage
from vlmeval.dataset.utils.vgrpbench.puzzles.nonogram import NonogramPuzzleFactory
factory = NonogramPuzzleFactory(size=5)
result = factory.check(game_state)