"task_id","train_demonstrations_json","test_input_json","test_output_json","stable_instances_50_json","generator_py","verifier_py" "t1","[{""input"":[[0,0,3,0,0,0,0,2,0,0],[0,3,0,0,0,0,0,0,2,0],[3,0,0,0,0,0,0,0,0,2],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[6,0,0,0,0,0,0,0,0,1],[0,6,0,0,0,0,0,0,1,0],[0,0,6,0,0,0,0,1,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,3,2,0,0,0,0],[0,0,0,3,0,0,2,0,0,0],[0,0,3,0,0,0,0,2,0,0],[0,0,6,0,0,0,0,1,0,0],[0,0,0,6,0,0,1,0,0,0],[0,0,0,0,6,1,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,4,0,0,0,0,0,0,8,0,0],[0,4,0,4,0,0,0,0,8,0,0,0],[4,0,0,0,0,0,0,0,0,0,0,8],[0,4,0,0,0,0,0,0,0,0,8,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,9,0,0,0,0,0,0,0,0,4,0],[9,0,0,0,0,0,0,0,0,0,0,4],[0,9,0,0,0,0,0,0,4,0,4,0],[0,0,0,0,0,0,0,0,0,4,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,4,0,0,8,0,0,0,0],[0,0,0,4,0,4,8,0,0,0,0,0],[0,0,4,0,0,0,0,0,0,8,0,0],[0,0,0,4,0,0,0,0,8,0,0,0],[0,0,0,9,0,0,0,0,4,0,0,0],[0,0,9,0,0,0,0,0,0,4,0,0],[0,0,0,9,0,0,4,0,4,0,0,0],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0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,6,0,6],[0,0,0,0,0,0,0,0,0,0,0,6,6,0],[0,0,0,0,0,0,0,0,0,0,0,6,0,6],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,1,1,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,6,0,6,0,0,0,0],[0,0,0,0,0,0,0,6,6,0,0,0,0,0],[0,0,0,0,0,0,0,6,0,6,0,0,0,0],[0,0,0,0,0,1,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Corner-components to center-components generator for Test2/t1. The rule matches ``Test2/t1.json``: - up to four components, one per corner window - each corner component is translated to the corresponding center window """""" from __future__ import annotations import random from typing import Dict, List, Sequence, Tuple Grid = List[List[int]] PixelList = List[Tuple[int, int]] _CORNERS = (""tl"", ""tr"", ""bl"", ""br"") def _empty(size: int) -> Grid: return [[0 for _ in range(size)] for _ in range(size)] def _corner_span(size: int) -> int: # Matches examples: size=10 -> 3, size=12 -> 4. return size // 2 - 2 def _origins(size: int) -> Dict[str, Tuple[int, int]]: span = _corner_span(size) return { ""tl"": (0, 0), ""tr"": (0, size - span), ""bl"": (size - span, 0), ""br"": (size - span, size - span), } def _random_component(rng: random.Random, span: int) -> PixelList: # 8-connected component without isolated cells. n = rng.randint(2, min(span * span, 8)) all_cells = {(r, c) for r in range(span) for c in range(span)} start = rng.choice(list(all_cells)) comp = {start} while len(comp) < n: frontier = set() for r, c in comp: for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue rr, cc = r + dr, c + dc if 0 <= rr < span and 0 <= cc < span and (rr, cc) not in comp: frontier.add((rr, cc)) if not frontier: break comp.add(rng.choice(list(frontier))) return sorted(comp) def _is_8_connected_and_non_isolated(pixels: PixelList) -> bool: if len(pixels) < 2: return False pix = set(pixels) seen = set() stack = [pixels[0]] while stack: r, c = stack.pop() if (r, c) in seen: continue seen.add((r, c)) has_neighbor = False for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue q = (r + dr, c + dc) if q in pix: has_neighbor = True if q not in seen: stack.append(q) if not has_neighbor: return False return len(seen) == len(pix) def generate( size: int | None = None, present: Sequence[str] | None = None, components: Dict[str, PixelList] | None = None, colors: Dict[str, int] | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: """"""Returns one ARC-style {""input"": ..., ""output"": ...} pair. Args: size: square grid size (defaults to random even size in [8, 16]). present: subset of {""tl"",""tr"",""bl"",""br""} that contain components. components: local (row, col) coordinates per corner inside corner span. colors: color per corner. """""" rr = rng if rng is not None else random if size is None: size = rr.choice([8, 10, 12, 14, 16]) if size < 8 or size % 2 != 0: raise ValueError(""size must be even and >= 8"") span = _corner_span(size) if span < 2: raise ValueError(""size too small for this task layout"") if present is None: k = rr.randint(1, 4) present = rr.sample(list(_CORNERS), k) present_set = set(present) if not present_set.issubset(set(_CORNERS)): raise ValueError(""present must only use tl/tr/bl/br"") if not present_set: raise ValueError(""at least one component must be present"") if components is None: components = {corner: _random_component(rr, span) for corner in present_set} if colors is None: available = [c for c in range(1, 10)] chosen = rr.sample(available, len(present_set)) colors = {corner: col for corner, col in zip(sorted(present_set), chosen)} inp = _empty(size) out = _empty(size) src_o = _origins(size) half = size // 2 by_corner: Dict[str, List[Tuple[int, int, int]]] = {c: [] for c in _CORNERS} for corner in sorted(present_set): pix = components.get(corner, []) if pix and not _is_8_connected_and_non_isolated(pix): raise ValueError(f""{corner} component must be 8-connected with no isolated cells"") color = colors[corner] sr, sc = src_o[corner] for rr0, cc0 in pix: if rr0 < 0 or cc0 < 0 or rr0 >= span or cc0 >= span: raise ValueError(f""component pixel {(rr0, cc0)} outside corner span {span}"") r, c = sr + rr0, sc + cc0 inp[r][c] = color by_corner[corner].append((r, c, color)) top_cells = by_corner[""tl""] + by_corner[""tr""] bot_cells = by_corner[""bl""] + by_corner[""br""] left_cells = by_corner[""tl""] + by_corner[""bl""] right_cells = by_corner[""tr""] + by_corner[""br""] top_max_r = max((r for r, _, _ in top_cells), default=half - 1) bot_min_r = min((r for r, _, _ in bot_cells), default=half) left_max_c = max((c for _, c, _ in left_cells), default=half - 1) right_min_c = min((c for _, c, _ in right_cells), default=half) dr_top = (half - 1) - top_max_r dr_bot = half - bot_min_r dc_left = (half - 1) - left_max_c dc_right = half - right_min_c for corner in _CORNERS: cells = by_corner[corner] if not cells: continue dr = dr_top if corner in (""tl"", ""tr"") else dr_bot dc = dc_left if corner in (""tl"", ""bl"") else dc_right for r, c, color in cells: out[r + dr][c + dc] = color return {""input"": inp, ""output"": out} ","""""""Verifier for the Test2/t1 corner-to-center rule."""""" from __future__ import annotations from typing import Dict, List, Tuple Grid = List[List[int]] def _empty(size: int) -> Grid: return [[0 for _ in range(size)] for _ in range(size)] def _corner_span(size: int) -> int: return size // 2 - 2 def _origins(size: int) -> Dict[str, Tuple[int, int]]: span = _corner_span(size) return { ""tl"": (0, 0), ""tr"": (0, size - span), ""bl"": (size - span, 0), ""br"": (size - span, size - span), } def verify_t1(grid: Grid) -> Grid: """"""Moves each corner component to its corresponding center window."""""" h = len(grid) w = len(grid[0]) if h else 0 if h == 0 or w == 0 or h != w: return [] size = h if size < 8 or size % 2 != 0: return _empty(size) span = _corner_span(size) out = _empty(size) src_o = _origins(size) half = size // 2 by_corner: dict[str, list[tuple[int, int, int]]] = {c: [] for c in (""tl"", ""tr"", ""bl"", ""br"")} for corner in (""tl"", ""tr"", ""bl"", ""br""): sr, sc = src_o[corner] for rr in range(span): for cc in range(span): val = grid[sr + rr][sc + cc] if val: by_corner[corner].append((sr + rr, sc + cc, val)) top_cells = by_corner[""tl""] + by_corner[""tr""] bot_cells = by_corner[""bl""] + by_corner[""br""] left_cells = by_corner[""tl""] + by_corner[""bl""] right_cells = by_corner[""tr""] + by_corner[""br""] top_max_r = max((r for r, _, _ in top_cells), default=half - 1) bot_min_r = min((r for r, _, _ in bot_cells), default=half) left_max_c = max((c for _, c, _ in left_cells), default=half - 1) right_min_c = min((c for _, c, _ in right_cells), default=half) dr_top = (half - 1) - top_max_r dr_bot = half - bot_min_r dc_left = (half - 1) - left_max_c dc_right = half - right_min_c for corner, cells in by_corner.items(): if not cells: continue dr = dr_top if corner in (""tl"", ""tr"") else dr_bot dc = dc_left if corner in (""tl"", ""bl"") else dc_right for r, c, val in cells: out[r + dr][c + dc] = val return out " "t2","[{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,8,8,8],[0,1,0,0,0,0,0,0,0,8],[0,0,1,0,0,0,0,0,0,8],[0,1,0,0,0,0,0,0,0,8],[0,0,1,0,0,0,0,8,8,8],[0,0,0,0,5,5,0,0,0,0],[0,0,0,0,5,5,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,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,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,7,0,0,0,0],[0,0,0,7,0,0,0,0],[0,0,0,7,0,0,0,0],[0,0,0,7,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,4,4,4,0]],""output"":[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,4,0,0,0,0],[0,0,0,4,0,0,0,0],[0,0,0,4,0,0,0,0],[0,0,0,4,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,7,7,7,0]]}]}","""""""Generator for Test2/t2: cyclic color shift by leftmost-object order. Rule: - detect 8-connected non-zero objects - sort objects by the position of their leftmost cell (col, then row) - shift object colors to the right with wrap-around """""" from __future__ import annotations import random from typing import Dict, List, Sequence, Tuple Grid = List[List[int]] Cell = Tuple[int, int] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors8(r: int, c: int) -> list[Cell]: out: list[Cell] = [] for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue out.append((r + dr, c + dc)) return out def _grow_component( rng: random.Random, start: Cell, target_size: int, h: int, w: int, blocked: set[Cell], ) -> list[Cell]: comp = {start} while len(comp) < target_size: frontier: set[Cell] = set() for r, c in comp: for rr, cc in _neighbors8(r, c): if rr < 0 or cc < 0 or rr >= h or cc >= w: continue if (rr, cc) in comp or (rr, cc) in blocked: continue frontier.add((rr, cc)) if not frontier: break comp.add(rng.choice(list(frontier))) return sorted(comp) def _leftmost_key(cells: Sequence[Cell]) -> tuple[int, int]: min_col = min(c for _, c in cells) min_row = min(r for r, c in cells if c == min_col) return (min_col, min_row) def _leftmost_col(cells: Sequence[Cell]) -> int: return min(c for _, c in cells) def _shift_colors_right(grid: Grid) -> Grid: h = len(grid) w = len(grid[0]) if h else 0 seen: set[Cell] = set() objs: list[list[Cell]] = [] colors: list[int] = [] for r in range(h): for c in range(w): if grid[r][c] == 0 or (r, c) in seen: continue color = grid[r][c] stack = [(r, c)] comp: list[Cell] = [] while stack: rr, cc = stack.pop() if (rr, cc) in seen or grid[rr][cc] != color: continue seen.add((rr, cc)) comp.append((rr, cc)) for nr, nc in _neighbors8(rr, cc): if ( 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and grid[nr][nc] == color ): stack.append((nr, nc)) objs.append(comp) colors.append(color) if len(objs) <= 1: return [list(row) for row in grid] order = sorted(range(len(objs)), key=lambda i: _leftmost_key(objs[i])) out = _empty(h, w) for pos, obj_idx in enumerate(order): src_idx = order[pos - 1] # right-shift with wrap-around new_color = colors[src_idx] for r, c in objs[obj_idx]: out[r][c] = new_color return out def generate( width: int | None = None, height: int | None = None, object_count: int | None = None, objects: Sequence[Sequence[Cell]] | None = None, colors: Sequence[int] | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: """"""Return one input/output pair for the t2 rule."""""" rr = rng if rng is not None else random if width is None: width = rr.randint(8, 14) if height is None: height = rr.randint(8, 14) if width < 6 or height < 6: raise ValueError(""width/height must be >= 6"") if objects is None: if object_count is None: object_count = rr.randint(2, 5) if object_count < 2: raise ValueError(""need at least 2 objects for color shifting"") max_layout_attempts = 120 objects = None for _ in range(max_layout_attempts): blocked: set[Cell] = set() built: list[list[Cell]] = [] attempts = 0 max_attempts = 4000 while len(built) < object_count and attempts < max_attempts: attempts += 1 r0 = rr.randint(0, height - 1) c0 = rr.randint(0, width - 1) if (r0, c0) in blocked: continue size = rr.randint(2, 8) comp = _grow_component(rr, (r0, c0), size, height, width, blocked) if len(comp) < 2: continue # Reserve 8-neighborhood halo so objects stay distinct. halo = set(comp) for r, c in comp: for nr, nc in _neighbors8(r, c): if 0 <= nr < height and 0 <= nc < width: halo.add((nr, nc)) blocked.update(halo) built.append(comp) if len(built) < object_count: continue # No ties on leftmost position criterion shown in provided examples: # require strictly unique leftmost columns across objects. left_cols = [_leftmost_col(comp) for comp in built] if len(set(left_cols)) != len(left_cols): continue objects = built break if objects is None: raise RuntimeError(""could not sample non-tied objects by leftmost-column order"") else: if len(objects) < 2: raise ValueError(""objects must contain at least 2 objects"") left_cols = [_leftmost_col(comp) for comp in objects] if len(set(left_cols)) != len(left_cols): raise ValueError(""objects must have unique leftmost columns (no ordering ties)"") if colors is None: colors = rr.sample([1, 2, 3, 4, 5, 6, 7, 8, 9], len(objects)) if len(colors) != len(objects): raise ValueError(""colors length must equal objects length"") inp = _empty(height, width) for comp, col in zip(objects, colors): for r, c in comp: if r < 0 or c < 0 or r >= height or c >= width: raise ValueError(""object cell outside grid"") inp[r][c] = int(col) out = _shift_colors_right(inp) return {""input"": inp, ""output"": out} ","""""""Verifier for Test2/t2 color-shift-by-leftmost-object rule."""""" from __future__ import annotations from typing import List, Sequence, Tuple Grid = List[List[int]] Cell = Tuple[int, int] def _neighbors8(r: int, c: int) -> list[Cell]: out: list[Cell] = [] for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue out.append((r + dr, c + dc)) return out def _leftmost_key(cells: Sequence[Cell]) -> tuple[int, int]: min_col = min(c for _, c in cells) min_row = min(r for r, c in cells if c == min_col) return (min_col, min_row) def verify_t2(grid: Grid) -> Grid: h = len(grid) w = len(grid[0]) if h else 0 if h == 0 or w == 0: return [] seen: set[Cell] = set() objs: list[list[Cell]] = [] colors: list[int] = [] for r in range(h): for c in range(w): if grid[r][c] == 0 or (r, c) in seen: continue color = grid[r][c] stack = [(r, c)] comp: list[Cell] = [] while stack: rr, cc = stack.pop() if (rr, cc) in seen or grid[rr][cc] != color: continue seen.add((rr, cc)) comp.append((rr, cc)) for nr, nc in _neighbors8(rr, cc): if ( 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and grid[nr][nc] == color ): stack.append((nr, nc)) objs.append(comp) colors.append(color) if len(objs) <= 1: return [list(row) for row in grid] order = sorted(range(len(objs)), key=lambda i: _leftmost_key(objs[i])) out: Grid = [[0 for _ in range(w)] for _ in range(h)] for pos, obj_idx in enumerate(order): src_idx = order[pos - 1] # shift right with wrap col = colors[src_idx] for r, c in objs[obj_idx]: out[r][c] = col return out " "t3","[{""input"":[[2,0,5,5,7,7],[2,2,2,3,7,4],[1,2,2,7,7,4],[1,2,3,0,7,0],[2,2,4,4,7,7],[2,2,4,4,0,0]],""output"":[[4,1],[4,1],[0,2]]},{""input"":[[0,0,8,0,3,0,3,0,0],[8,8,8,0,5,0,0,4,4],[0,6,8,6,5,6,4,0,5],[1,0,8,0,5,4,4,2,0],[0,1,8,3,0,5,0,0,2],[8,8,8,3,0,0,0,9,9],[0,0,3,2,2,2,2,9,0],[0,3,0,2,2,2,2,9,0],[3,3,0,2,2,2,2,9,5],[0,0,0,2,2,2,2,9,9]],""output"":[[0,0,6],[0,1,0],[5,0,1]]},{""input"":[[3,0,3,0,3,3,3,3,0,0,1,1],[3,3,3,3,3,3,3,0,0,0,1,6],[6,6,6,2,2,2,3,3,0,0,1,0],[0,0,0,2,0,0,3,0,0,0,1,1],[3,3,3,3,3,3,3,3,1,1,1,1],[8,3,0,3,8,3,0,0,1,1,1,9],[0,8,0,8,9,9,9,9,9,9,9,9],[0,0,8,0,0,0,0,9,0,5,0,5],[0,8,0,8,0,0,0,9,0,0,5,0]],""output"":[[6,6,6,6,2,2,2],[0,0,0,0,2,0,0]]},{""input"":[[1,4,0,3,1,8,0,2,0,8],[1,3,4,0,1,0,0,0,2,0],[1,1,1,1,1,0,2,0,5,2],[0,6,0,0,0,0,2,1,5,2],[0,6,8,0,0,1,2,1,5,0],[8,6,0,1,1,1,2,0,5,8],[0,8,1,1,0,0,2,0,5,0],[0,6,8,0,0,0,0,0,5,0],[0,6,0,0,0,4,4,4,4,4],[0,6,6,6,6,4,4,0,0,4]],""output"":[[4,0,0],[4,0,3],[3,4,0]]}]","[[5,5,0,0,0,0,0,0,0,7,7],[0,5,5,5,2,2,0,0,0,7,7],[0,0,5,5,0,2,2,0,1,7,3],[0,0,5,5,2,0,2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7,9,0,0,0]],""output"":[[5,0,8,8,6,7],[7,4,9,9,4,2]]},{""input"":[[4,4,4,0,0,0,0,0,0,0,0,0],[2,1,4,0,0,0,6,0,0,0,0,0],[5,4,4,0,0,0,6,0,6,0,0,0],[2,7,4,0,0,0,0,6,6,0,0,0],[4,4,4,0,0,0,0,0,6,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,3,3],[0,0,0,0,0,0,0,0,0,0,3,5],[2,2,0,0,0,0,0,0,0,0,3,0],[0,2,2,0,0,0,0,0,0,0,3,3],[0,0,0,0,0,0,0,0,0,0,3,3],[0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[5,2,1],[0,5,4],[3,2,7]]},{""input"":[[8,5,1,2,0,0,5,8,0,0,0],[8,4,6,2,1,1,1,8,0,0,0],[8,8,8,8,8,8,8,8,0,1,0],[0,0,0,0,5,1,1,1,1,1,0],[0,0,0,5,5,5,5,5,0,9,0],[1,1,1,1,1,1,1,1,9,9,0],[1,1,7,1,0,9,4,1,9,3,3],[1,3,8,4,9,3,8,1,9,0,3]],""output"":[[1,7,1,0,9,4],[3,8,4,9,3,8],[5,1,2,0,0,5],[4,6,2,1,1,1]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,7,7,7,7],[7,7,7,4,0,7,0,5,2],[4,0,7,4,0,7,8,7,7],[5,7,7,4,4,7,7,7,0],[0,2,7,4,4,7,4,2,6],[8,7,7,0,4,7,7,7,0],[8,7,7,0,0,7,7,7,7],[7,7,7,0,0,0,0,0,0],[0,0,0,0,0,0,2,2,2],[0,0,0,0,0,0,0,2,2],[0,0,0,8,0,0,0,0,2],[0,0,8,8,0,0,0,0,0]],""output"":[[0,5,2,4,0],[8,7,7,5,7],[7,7,0,0,2],[4,2,6,8,7],[7,7,0,8,7]]},{""input"":[[0,0,0,0,3,0,6,3,6,0],[0,0,0,0,3,3,3,3,6,6],[0,0,0,0,9,9,9,6,6,6],[0,0,0,9,9,0,9,0,0,0],[0,0,0,0,0,9,0,0,0,0],[0,1,1,1,1,0,0,0,0,0],[0,1,4,0,1,0,0,0,0,0],[0,1,2,2,1,0,0,0,0,0],[0,1,1,2,1,0,0,0,0,0],[4,1,3,9,1,0,0,0,0,0]],""output"":[[4,0],[2,2],[1,2],[3,9],[0,6]]},{""input"":[[5,5,5,5,5,0,0,0,0,0,4,4],[5,5,5,5,5,5,0,0,0,0,4,4],[6,1,0,4,6,5,2,0,8,0,4,6],[1,9,2,6,4,5,8,2,8,0,4,4],[1,5,4,7,0,5,8,8,8,0,4,4],[2,5,0,6,4,5,0,8,8,6,4,6],[5,4,4,0,6,5,6,2,6,6,4,4],[5,5,5,5,5,5,0,6,6,0,0,0]],""output"":[[4,6,1,0,4,6],[6,1,9,2,6,4],[4,1,5,4,7,0],[4,2,5,0,6,4],[6,5,4,4,0,6]]},{""input"":[[0,0,8,2,1,8,0,0],[0,0,8,9,8,8,0,0],[2,0,8,8,8,8,0,0],[2,2,2,0,0,0,3,3],[0,2,0,2,0,0,3,0],[0,2,2,0,0,0,3,3],[0,0,0,0,0,0,3,0],[0,0,0,0,0,0,0,0],[0,0,0,9,9,9,9,0],[0,0,0,9,6,2,9,0],[0,0,0,9,5,9,9,0]],""output"":[[6,2],[5,9],[2,1],[9,8]]},{""input"":[[5,5,1,6,7,5,0,0,0,0],[5,9,3,8,3,5,0,0,2,0],[5,0,7,3,6,5,0,0,0,2],[5,5,5,5,5,5,2,2,2,2],[0,0,0,0,0,0,9,9,2,2],[0,0,0,0,0,0,0,9,2,0],[0,0,0,0,0,1,1,1,0,0],[0,0,0,0,1,1,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[7,7,7,7,7,7,0,0,0,0],[7,7,1,5,2,7,0,0,0,0]],""output"":[[7,1,5,2],[5,1,6,7],[9,3,8,3],[0,7,3,6]]},{""input"":[[0,0,0,8,3,8,1,2,5,8,0],[0,0,0,8,2,7,3,3,5,8,0],[0,0,0,8,8,8,8,8,8,8,0],[0,1,1,0,0,0,0,0,0,0,0],[0,8,0,1,0,0,0,0,0,0,0],[0,8,8,8,0,0,0,0,0,0,0],[0,0,9,0,8,8,0,0,0,0,0],[0,0,0,9,5,5,5,5,5,5,5],[0,0,9,9,5,3,5,9,2,8,5]],""output"":[[3,5,9,2,8],[3,8,1,2,5],[2,7,3,3,5]]},{""input"":[[4,4,0,0,0,0,0,0,8,8,1,1],[0,4,0,0,0,0,0,0,0,0,1,5],[0,4,0,0,8,0,0,0,0,0,1,3],[7,4,0,0,8,0,0,0,0,0,1,8],[3,4,0,0,8,0,0,0,7,0,1,9],[3,4,0,0,0,0,0,0,7,0,1,8],[4,4,0,0,0,0,0,0,0,7,1,1],[0,0,0,0,0,0,0,0,0,7,7,7]],""output"":[[5,0],[3,0],[8,7],[9,3],[8,3]]},{""input"":[[8,8,8,0,0,0,0,4,4],[5,8,8,0,0,0,0,4,4],[5,4,8,0,0,0,0,4,3],[4,4,8,0,0,0,0,4,0],[4,4,8,0,0,0,0,4,5],[3,5,8,0,0,0,0,4,2],[8,8,8,0,0,0,0,4,4],[7,7,0,0,0,0,0,0,0],[7,0,0,0,0,0,0,0,0],[7,0,0,0,0,0,0,0,0],[0,7,0,0,0,0,0,0,0],[0,0,7,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],""output"":[[4,5,8],[3,5,4],[0,4,4],[5,4,4],[2,3,5]]},{""input"":[[0,0,0,0,0,0,0,4,4,4],[0,0,0,0,0,0,0,4,2,4],[5,5,0,0,0,0,0,4,6,2],[2,5,0,0,0,0,0,4,4,2],[8,5,0,0,0,0,0,4,4,4],[8,5,3,0,0,6,6,6,0,0],[5,5,3,3,8,3,0,6,0,0],[1,1,1,1,3,3,0,0,6,0],[1,0,1,0,0,0,0,0,0,0]],""output"":[[2,4,2],[6,2,8],[4,2,8]]},{""input"":[[0,0,0,9,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],[0,0,3,9,3,5,3,0],[0,0,3,1,2,8,3,0],[0,0,3,3,9,4,3,0]],""output"":[[0,1,1],[9,3,5],[1,2,8],[3,9,4],[3,1,3]]},{""input"":[[0,0,0,0,0,0,0,1,1,1,1,1,0,0],[5,5,3,0,0,0,0,0,0,1,1,0,1,0],[2,5,3,3,0,0,0,0,0,0,0,6,6,6],[2,5,3,3,3,0,0,0,0,0,0,6,7,0],[8,5,0,0,0,0,0,0,0,0,0,6,0,2],[6,5,0,0,0,5,5,5,0,0,0,6,6,8],[5,5,0,0,0,0,0,5,0,0,0,6,2,5],[0,0,0,0,0,0,0,5,0,0,0,6,6,6]],""output"":[[7,0,2],[0,2,2],[6,8,8],[2,5,6]]},{""input"":[[0,0,0,2,2,3,5,5,5],[0,0,0,8,2,3,5,5,0],[2,2,0,8,8,2,5,4,3],[9,2,0,0,0,2,5,5,5],[0,2,0,0,0,0,5,4,5],[5,2,0,0,0,0,5,5,6],[5,2,0,0,0,0,5,6,4],[5,2,0,0,0,0,5,5,5],[2,2,0,0,0,0,4,0,0],[2,2,0,0,0,0,0,4,0],[0,0,0,0,0,0,0,4,0]],""output"":[[5,0,9],[4,3,0],[5,5,5],[4,5,5],[5,6,5],[6,4,2]]},{""input"":[[2,4,4,2,0,6,6,6],[2,7,3,2,0,6,0,0],[2,8,3,2,0,2,2,0],[2,2,2,2,0,2,2,0],[5,5,5,0,0,0,2,2],[0,0,0,0,7,7,0,0],[0,0,0,0,7,9,9,0],[0,0,0,0,0,9,9,0],[0,7,7,7,7,0,0,9],[0,7,3,1,7,0,0,0],[0,7,1,6,7,0,0,0],[0,7,5,7,7,0,0,0]],""output"":[[3,1],[1,6],[5,7],[4,4],[7,3],[8,3]]},{""input"":[[6,6,7,6,0,0,0,0,0],[6,7,2,6,0,0,0,0,0],[6,6,6,6,0,0,0,0,0],[0,9,9,0,0,0,0,0,0],[0,0,9,9,0,1,0,1,0],[0,0,0,0,9,1,1,1,0],[0,5,0,0,0,1,0,1,1],[0,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,4,9,3,0],[0,0,0,0,0,0,0,3,2,8,3,0]],""output"":[[4,9],[2,8],[5,3]]},{""input"":[[0,5,5,8,3,5,2,0,2,2,2],[0,5,5,5,5,5,0,2,2,2,2],[0,0,0,0,0,0,0,0,0,0,2],[0,0,0,0,0,0,0,0,0,0,0],[0,0,4,4,0,0,0,0,0,0,0],[0,0,0,4,4,0,0,3,3,0,0],[0,0,0,0,0,0,7,0,0,3,3],[0,0,0,0,0,0,0,7,0,0,3],[0,0,0,0,0,0,0,7,7,0,0],[1,0,0,3,3,3,3,3,0,7,0],[1,0,0,3,3,5,1,3,0,0,7],[1,0,0,3,7,4,3,3,0,0,7],[0,0,0,3,3,1,7,3,0,7,7]],""output"":[[3,5,1],[7,4,3],[3,1,7],[5,8,3]]},{""input"":[[5,5,8,0,3,3,3,3],[2,5,8,8,3,1,1,7],[7,5,0,0,3,5,6,8],[2,5,9,9,3,2,4,3],[3,5,0,0,3,4,5,3],[7,5,0,0,3,3,8,4],[5,5,1,1,3,3,3,3],[0,0,1,1,1,0,0,0]],""output"":[[1,1,7,2],[5,6,8,7],[2,4,3,2],[4,5,3,3],[3,8,4,7]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,2,2,0],[7,7,7,0,0,0,1,0,0],[6,4,7,0,0,0,0,1,0],[8,3,7,0,0,0,0,1,1],[3,7,7,0,0,0,0,3,3],[5,9,7,0,0,0,0,3,5],[7,7,7,0,0,0,0,3,6],[0,0,0,0,0,0,0,3,1],[0,0,0,0,0,0,0,3,5],[0,3,3,3,0,0,0,3,3]],""output"":[[5,6,4],[6,8,3],[1,3,7],[5,5,9]]}]}","""""""Generator for Test2/t3: extract wrapped rectangle interior."""""" from __future__ import annotations import random from typing import List Grid = List[List[int]] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _random_content(rng: random.Random, h: int, w: int, frame_color: int) -> Grid: out = _empty(h, w) for r in range(h): for c in range(w): # Interior is allowed to use the same color as the frame. if rng.random() < 0.2: out[r][c] = frame_color else: out[r][c] = rng.randint(0, 9) return out def _pick_wrapped_start( rng: random.Random, span: int, limit: int, require_interior_on_both_sides: bool = True, ) -> int: """"""Pick start so the interval wraps exactly once on this axis."""""" lo = limit - span + 1 hi = limit - 1 if lo > hi: raise ValueError(""span too large for wrapped placement"") for _ in range(200): start = rng.randint(lo, hi) first_len = limit - start second_len = span - first_len if not require_interior_on_both_sides: return start # Each side should include at least one interior row/col, not only border. if first_len >= 2 and second_len >= 2: return start raise ValueError(""could not find valid wrapped start"") def _paint_blob_noise( grid: Grid, protected: set[tuple[int, int]], rng: random.Random, target_cells: int, ) -> None: h = len(grid) w = len(grid[0]) if h else 0 if h == 0 or w == 0 or target_cells <= 0: return free = [(r, c) for r in range(h) for c in range(w) if (r, c) not in protected] free_set = set(free) if not free: return placed = 0 while placed < target_cells and free: seed = rng.choice(free) color = rng.randint(0, 9) blob_size = rng.randint(3, 9) frontier = [seed] seen = {seed} for _ in range(blob_size): if not frontier: break r, c = frontier.pop(rng.randrange(len(frontier))) if (r, c) in protected: continue if (r, c) not in free_set: continue grid[r][c] = color free_set.remove((r, c)) placed += 1 if placed >= target_cells: break # Local growth gives larger same-color neighborhoods. for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1), (1, 1), (-1, -1)): nr = r + dr nc = c + dc if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen: seen.add((nr, nc)) if (nr, nc) not in protected and rng.random() < 0.8: frontier.append((nr, nc)) free = [rc for rc in free if rc in free_set] def _map_local_to_global( *, r: int, c: int, top: int, left: int, frame_h: int, frame_w: int, grid_h: int, grid_w: int, shift: int, wraps_row: bool, ) -> tuple[int, int]: """"""Map local frame coordinates to global grid, allowing wrapped-half shift."""""" if wraps_row: base_r = top + r if base_r < grid_h: return base_r, left + c # Wrapped top half is shifted horizontally. return base_r - grid_h, left + c + shift base_c = left + c if base_c < grid_w: return top + r, base_c # Wrapped left half is shifted vertically. return top + r + shift, base_c - grid_w def generate( width: int | None = None, height: int | None = None, content_width: int | None = None, content_height: int | None = None, top: int | None = None, left: int | None = None, frame_color_a: int | None = None, frame_color_b: int | None = None, half_shift: int | None = None, noise_cells: int | None = None, content: Grid | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: """"""Return one input/output pair. Input: noisy grid with one outlined rectangle that wraps over edges. Output: only the rectangle's inner content (outline removed). """""" rr = rng if rng is not None else random max_attempts = 400 for _ in range(max_attempts): w = width if width is not None else rr.randint(8, 14) h = height if height is not None else rr.randint(8, 14) if w < 7 or h < 7: raise ValueError(""width and height must be >= 7"") max_cw = min(w - 3, 6) max_ch = min(h - 3, 6) cw = content_width if content_width is not None else rr.randint(2, max_cw) ch = content_height if content_height is not None else rr.randint(2, max_ch) if not (2 <= cw <= w - 2 and 2 <= ch <= h - 2): raise ValueError(""content size out of range"") frame_h = ch + 2 frame_w = cw + 2 color_a = frame_color_a if frame_color_a is not None else rr.randint(1, 9) color_b = frame_color_b if frame_color_b is not None else rr.randint(1, 9) content_grid = ( [row[:] for row in content] if content is not None else _random_content(rr, ch, cw, color_a) ) if len(content_grid) != ch or any(len(row) != cw for row in content_grid): raise ValueError(""content shape must match content size"") if top is None or left is None: wrap_row = rr.choice([True, False]) wrap_col = not wrap_row top0 = _pick_wrapped_start(rr, frame_h, h) if wrap_row else rr.randint(0, h - frame_h) left0 = _pick_wrapped_start(rr, frame_w, w) if wrap_col else rr.randint(0, w - frame_w) else: top0, left0 = top, left wraps_row = (top0 + frame_h - 1) >= h wraps_col = (left0 + frame_w - 1) >= w if wraps_row == wraps_col: if top is not None and left is not None: raise ValueError(""rectangle must wrap across exactly one axis"") continue if wraps_row: first_len = h - top0 second_len = frame_h - first_len if first_len < 2 or second_len < 2: continue if wraps_col: first_len = w - left0 second_len = frame_w - first_len if first_len < 2 or second_len < 2: continue def _is_contained_shift(shift_val: int) -> bool: if wraps_row: return 0 <= left0 + shift_val and left0 + shift_val + frame_w <= w return 0 <= top0 + shift_val and top0 + shift_val + frame_h <= h def _non_overlapping(shift_val: int) -> bool: if not _is_contained_shift(shift_val): return False coords: set[tuple[int, int]] = set() for rr0 in range(frame_h): for cc0 in range(frame_w): gr, gc = _map_local_to_global( r=rr0, c=cc0, top=top0, left=left0, frame_h=frame_h, frame_w=frame_w, grid_h=h, grid_w=w, shift=shift_val, wraps_row=wraps_row, ) coords.add((gr, gc)) return len(coords) == frame_h * frame_w if half_shift is None: if wraps_row: min_shift = -left0 max_shift = w - frame_w - left0 else: min_shift = -top0 max_shift = h - frame_h - top0 shifts = list(range(min_shift, max_shift + 1)) rr.shuffle(shifts) shift0 = next((s for s in shifts if _non_overlapping(s)), None) if shift0 is None: continue else: shift0 = half_shift if not _non_overlapping(shift0): if top is not None and left is not None: raise ValueError(""provided half_shift causes frame overlap"") continue inp = _empty(h, w) all_rect_cells: set[tuple[int, int]] = set() def border_color(r: int, c: int) -> int: if wraps_row: return color_a if (top0 + r) < h else color_b return color_a if (left0 + c) < w else color_b for rr0 in range(frame_h): for cc0 in range(frame_w): gr, gc = _map_local_to_global( r=rr0, c=cc0, top=top0, left=left0, frame_h=frame_h, frame_w=frame_w, grid_h=h, grid_w=w, shift=shift0, wraps_row=wraps_row, ) all_rect_cells.add((gr, gc)) if rr0 == 0 or cc0 == 0 or rr0 == frame_h - 1 or cc0 == frame_w - 1: inp[gr][gc] = border_color(rr0, cc0) else: inp[gr][gc] = content_grid[rr0 - 1][cc0 - 1] n_noise = noise_cells if noise_cells is not None else rr.randint((w * h) // 9, (w * h) // 4) _paint_blob_noise(inp, set(all_rect_cells), rr, n_noise) # Ensure generator/verifier coherence for ambiguous scenes. from verifier import verify_t3 out = [row[:] for row in content_grid] if verify_t3(inp) == out: return {""input"": inp, ""output"": out} if top is not None and left is not None and half_shift is not None and content is not None: raise RuntimeError(""fixed parameters produce verifier-ambiguous sample"") raise RuntimeError(""failed to sample valid shifted wrapped-rectangle instance"") ","""""""Verifier for Test2/t3 wrapped-rectangle task."""""" from __future__ import annotations from typing import List Grid = List[List[int]] def verify_t3(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged grid"") def map_local_to_global( *, r: int, c: int, top: int, left: int, frame_h: int, frame_w: int, shift: int, wraps_row: bool, ) -> tuple[int, int]: if wraps_row: base_r = top + r if base_r < h: return base_r, left + c return base_r - h, left + c + shift base_c = left + c if base_c < w: return top + r, base_c return top + r + shift, base_c - w def is_contained_shift( *, top: int, left: int, frame_h: int, frame_w: int, shift: int, wraps_row: bool, ) -> bool: if wraps_row: return 0 <= left + shift and left + shift + frame_w <= w return 0 <= top + shift and top + shift + frame_h <= h candidates: list[tuple[int, int, int, int, int, int, int, int]] = [] for frame_h in range(4, h + 1): for frame_w in range(4, w + 1): for top in range(h): for left in range(w): wraps_row = (top + frame_h - 1) >= h wraps_col = (left + frame_w - 1) >= w if wraps_row == wraps_col: continue if wraps_row: first_len = h - top second_len = frame_h - first_len if first_len < 2 or second_len < 2: continue if wraps_col: first_len = w - left second_len = frame_w - first_len if first_len < 2 or second_len < 2: continue if wraps_row: min_shift = -left max_shift = w - frame_w - left else: min_shift = -top max_shift = h - frame_h - top for shift in range(min_shift, max_shift + 1): if not is_contained_shift( top=top, left=left, frame_h=frame_h, frame_w=frame_w, shift=shift, wraps_row=wraps_row, ): continue border_a: list[int] = [] border_b: list[int] = [] all_coords: set[tuple[int, int]] = set() ok = True for r in range(frame_h): for c in range(frame_w): gr, gc = map_local_to_global( r=r, c=c, top=top, left=left, frame_h=frame_h, frame_w=frame_w, shift=shift, wraps_row=wraps_row, ) all_coords.add((gr, gc)) if not (r == 0 or c == 0 or r == frame_h - 1 or c == frame_w - 1): continue v = inp[gr][gc] if v == 0: ok = False break in_first_half = (top + r) < h if wraps_row else (left + c) < w if in_first_half: border_a.append(v) else: border_b.append(v) if not ok: break if not ok or not border_a or not border_b: continue # Avoid overlapping mapped frames: ambiguous extraction. if len(all_coords) != frame_h * frame_w: continue color_a = border_a[0] color_b = border_b[0] if any(v != color_a for v in border_a): continue if any(v != color_b for v in border_b): continue area = frame_h * frame_w bi = 1 if color_a != color_b else 0 candidates.append((area, bi, top, left, frame_h, frame_w, shift, int(wraps_row))) if not candidates: raise ValueError(""no wrapped outlined rectangle found"") candidates.sort(reverse=True) _, _bi, top, left, frame_h, frame_w, shift, wraps_row_flag = candidates[0] wraps_row = bool(wraps_row_flag) content_h = frame_h - 2 content_w = frame_w - 2 out: Grid = [] for r in range(content_h): out_row = [] for c in range(content_w): gr, gc = map_local_to_global( r=1 + r, c=1 + c, top=top, left=left, frame_h=frame_h, frame_w=frame_w, shift=shift, wraps_row=wraps_row, ) out_row.append(inp[gr][gc]) out.append(out_row) return out " "t4","[{""input"":[[0,0,0,0,0,0,0,2,2,2,2,2],[0,0,0,0,0,0,0,2,3,0,0,2],[0,0,0,0,0,0,0,2,0,1,0,2],[0,0,0,0,0,0,0,2,0,0,0,2],[0,0,0,0,0,0,0,2,2,2,2,2],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[3,3,3,3,0,0,0,0,0,0,0,0],[3,0,2,3,0,0,0,0,0,0,0,0],[3,0,0,3,0,0,0,0,0,0,0,0],[3,3,3,3,0,0,0,0,0,0,0,0],[0,0,0,0,1,1,1,1,0,0,0,0],[0,0,0,0,1,0,2,1,0,0,0,0],[0,0,0,0,1,0,0,1,0,0,0,0],[0,0,0,0,1,1,1,1,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]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0,0,0],[0,0,0,0,4,0,0,4,0,0,0,0],[0,0,0,0,4,4,4,4,0,0,0,0],[4,4,4,4,0,0,0,0,1,1,1,1],[4,2,0,4,0,0,0,0,1,2,0,1],[4,0,0,4,0,0,0,0,1,0,0,1],[4,4,4,4,0,0,0,0,1,1,1,1],[0,0,0,0,5,5,5,5,5,5,5,5],[0,0,0,0,5,2,2,2,0,0,0,5],[0,0,0,0,5,0,0,0,0,0,0,5],[0,0,0,0,5,5,5,5,5,5,5,5]]}]}","""""""Generator for Test2/t4 scaled-rectangle task."""""" from __future__ import annotations import random from typing import List Grid = List[List[int]] RED = 2 def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _neighbors8(r: int, c: int) -> list[tuple[int, int]]: out: list[tuple[int, int]] = [] for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue out.append((r + dr, c + dc)) return out def _find_sub_rectangles(cells: set[tuple[int, int]]) -> list[set[tuple[int, int]]]: """"""Greedily decompose into mergeable 4-neighbor rectangles of size 9/6/4/2."""""" remaining = set(cells) groups: list[set[tuple[int, int]]] = [] def all_rectangles_of_size(target: int) -> list[set[tuple[int, int]]]: out: list[set[tuple[int, int]]] = [] rows = [r for r, _ in remaining] cols = [c for _, c in remaining] if not rows or not cols: return out min_r, max_r = min(rows), max(rows) min_c, max_c = min(cols), max(cols) for r0 in range(min_r, max_r + 1): for c0 in range(min_c, max_c + 1): max_h = max_r - r0 + 1 max_w = max_c - c0 + 1 for h in range(1, max_h + 1): for w in range(1, max_w + 1): if h * w != target: continue cand = {(r, c) for r in range(r0, r0 + h) for c in range(c0, c0 + w)} if cand.issubset(remaining): out.append(cand) out.sort(key=lambda s: (min(r for r, _ in s), min(c for _, c in s))) return out while remaining: picked: set[tuple[int, int]] | None = None for size in (9, 6, 4, 2): candidates = all_rectangles_of_size(size) if candidates: picked = candidates[0] break if picked is None: # Unmergeable cell becomes a singleton rectangle. r, c = min(remaining) picked = {(r, c)} groups.append(picked) remaining -= picked return groups def _color_groups_4n_rectangular(ref_cells: Grid) -> list[tuple[int, set[tuple[int, int]]]]: """"""Group same-color descriptor cells via 4-neighborhood, then rectangular merge rules."""""" h = len(ref_cells) w = len(ref_cells[0]) if h else 0 seen: set[tuple[int, int]] = set() groups: list[tuple[int, set[tuple[int, int]]]] = [] for r in range(h): for c in range(w): color = ref_cells[r][c] if color == 0 or (r, c) in seen: continue stack = [(r, c)] seen.add((r, c)) comp: set[tuple[int, int]] = set() while stack: cr, cc = stack.pop() comp.add((cr, cc)) for nr, nc in _neighbors4(cr, cc): if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen: if ref_cells[nr][nc] == color: seen.add((nr, nc)) stack.append((nr, nc)) for part in _find_sub_rectangles(comp): groups.append((color, part)) return groups def _reference_corner(ref_top: int, ref_left: int, h: int, w: int) -> tuple[str, str]: vertical = ""top"" if ref_top == 0 else ""bottom"" horizontal = ""left"" if ref_left == 0 else ""right"" return vertical, horizontal def _render_output( ref_cells: Grid, h: int, w: int, ref_top: int, ref_left: int, ) -> Grid: if h % 3 != 0 or w % 3 != 0: raise ValueError(""grid dimensions must be divisible by 3"") bh = h // 3 bw = w // 3 out = _empty(h, w) ref_vertical, ref_horizontal = _reference_corner(ref_top, ref_left, h, w) for color, comp in _color_groups_4n_rectangular(ref_cells): rows = [r for r, _ in comp] cols = [c for _, c in comp] r0, r1 = min(rows), max(rows) c0, c1 = min(cols), max(cols) comp_h = r1 - r0 + 1 comp_w = c1 - c0 + 1 top = r0 * bh left = c0 * bw rect_h = comp_h * bh rect_w = comp_w * bw # Outline in component color. for cc in range(left, left + rect_w): out[top][cc] = color out[top + rect_h - 1][cc] = color for rr in range(top + 1, top + rect_h - 1): out[rr][left] = color out[rr][left + rect_w - 1] = color # Interior is split into 4 regions; red occupies the quadrant of ref corner. inner_top = top + 1 inner_left = left + 1 inner_h = rect_h - 2 inner_w = rect_w - 2 half_h = inner_h // 2 half_w = inner_w // 2 row_start = inner_top if ref_vertical == ""top"" else inner_top + half_h row_end = inner_top + half_h if ref_vertical == ""top"" else inner_top + inner_h col_start = inner_left if ref_horizontal == ""left"" else inner_left + half_w col_end = inner_left + half_w if ref_horizontal == ""left"" else inner_left + inner_w for rr in range(row_start, row_end): for cc in range(col_start, col_end): out[rr][cc] = RED return out def _sample_reference_cells(rng: random.Random) -> Grid: # 3x3 descriptor inside the red 5x5 reference rectangle. cells = _empty(3, 3) palette = [1, 3, 4, 5, 6, 7, 8, 9] active_count = rng.randint(2, 5) coords = [(r, c) for r in range(3) for c in range(3)] rng.shuffle(coords) for i in range(active_count): r, c = coords[i] cells[r][c] = rng.choice(palette) # Encourage valid mergeable groups (2/4/6/9 cells, 4-neighborhood only). if rng.random() < 0.55: starts = [(r, c) for r in range(3) for c in range(3)] rng.shuffle(starts) r, c = starts[0] color = rng.choice(palette) cells[r][c] = color orient = rng.choice([""h"", ""v"", ""sq"", ""h6"", ""v6"", ""sq9""]) if orient == ""h"" and c + 1 < 3: cells[r][c + 1] = color elif orient == ""v"" and r + 1 < 3: cells[r + 1][c] = color elif orient == ""sq"" and r + 1 < 3 and c + 1 < 3: cells[r + 1][c] = color cells[r][c + 1] = color cells[r + 1][c + 1] = color elif orient == ""h6"": rr = rng.choice([0, 1]) for cc in range(3): cells[rr][cc] = color cells[rr + 1][cc] = color elif orient == ""v6"": cc = rng.choice([0, 1]) for rr in range(3): cells[rr][cc] = color cells[rr][cc + 1] = color elif orient == ""sq9"": for rr in range(3): for cc in range(3): cells[rr][cc] = color return cells def generate( width: int | None = None, height: int | None = None, ref_top: int | None = None, ref_left: int | None = None, ref_cells: Grid | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: """"""Generate one t4 input/output pair."""""" rr = rng if rng is not None else random if width is None: width = rr.choice([12, 18]) if height is None: height = width if width % 3 != 0 or height % 3 != 0: raise ValueError(""width and height must be divisible by 3"") if width < 9 or height < 9: raise ValueError(""width and height must be >= 9"") if ref_top is None or ref_left is None: corner = rr.choice([""ul"", ""ur"", ""bl"", ""br""]) if ref_top is None: ref_top = 0 if corner in (""ul"", ""ur"") else height - 5 if ref_left is None: ref_left = 0 if corner in (""ul"", ""bl"") else width - 5 if not (0 <= ref_top <= height - 5 and 0 <= ref_left <= width - 5): raise ValueError(""reference 5x5 rectangle does not fit"") if ref_top not in (0, height - 5) or ref_left not in (0, width - 5): raise ValueError(""reference rectangle must sit in a grid corner"") if ref_cells is None: ref_cells = _sample_reference_cells(rr) if len(ref_cells) != 3 or any(len(row) != 3 for row in ref_cells): raise ValueError(""ref_cells must be 3x3"") if not any(ref_cells[r][c] != 0 for r in range(3) for c in range(3)): raise ValueError(""ref_cells must contain at least one non-zero cell"") for r in range(3): for c in range(3): if ref_cells[r][c] == RED: raise ValueError(""ref_cells cannot use red (2)"") inp = _empty(height, width) # Draw red 5x5 outline. for c in range(ref_left, ref_left + 5): inp[ref_top][c] = RED inp[ref_top + 4][c] = RED for r in range(ref_top + 1, ref_top + 4): inp[r][ref_left] = RED inp[r][ref_left + 4] = RED # Place descriptor cells in the 3x3 interior. for r in range(3): for c in range(3): inp[ref_top + 1 + r][ref_left + 1 + c] = ref_cells[r][c] out = _render_output(ref_cells, height, width, ref_top, ref_left) return {""input"": inp, ""output"": out} ","""""""Verifier for Test2/t4 scaled-rectangle task."""""" from __future__ import annotations from typing import List Grid = List[List[int]] RED = 2 def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _neighbors8(r: int, c: int) -> list[tuple[int, int]]: out: list[tuple[int, int]] = [] for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue out.append((r + dr, c + dc)) return out def _find_sub_rectangles(cells: set[tuple[int, int]]) -> list[set[tuple[int, int]]]: remaining = set(cells) groups: list[set[tuple[int, int]]] = [] def all_rectangles_of_size(target: int) -> list[set[tuple[int, int]]]: out: list[set[tuple[int, int]]] = [] rows = [r for r, _ in remaining] cols = [c for _, c in remaining] if not rows or not cols: return out min_r, max_r = min(rows), max(rows) min_c, max_c = min(cols), max(cols) for r0 in range(min_r, max_r + 1): for c0 in range(min_c, max_c + 1): max_h = max_r - r0 + 1 max_w = max_c - c0 + 1 for h in range(1, max_h + 1): for w in range(1, max_w + 1): if h * w != target: continue cand = {(r, c) for r in range(r0, r0 + h) for c in range(c0, c0 + w)} if cand.issubset(remaining): out.append(cand) out.sort(key=lambda s: (min(r for r, _ in s), min(c for _, c in s))) return out while remaining: picked: set[tuple[int, int]] | None = None for size in (9, 6, 4, 2): candidates = all_rectangles_of_size(size) if candidates: picked = candidates[0] break if picked is None: picked = {min(remaining)} groups.append(picked) remaining -= picked return groups def _color_groups_4n_rectangular(ref_cells: Grid) -> list[tuple[int, set[tuple[int, int]]]]: h = len(ref_cells) w = len(ref_cells[0]) if h else 0 seen: set[tuple[int, int]] = set() groups: list[tuple[int, set[tuple[int, int]]]] = [] for r in range(h): for c in range(w): color = ref_cells[r][c] if color == 0 or (r, c) in seen: continue stack = [(r, c)] seen.add((r, c)) comp: set[tuple[int, int]] = set() while stack: cr, cc = stack.pop() comp.add((cr, cc)) for nr, nc in _neighbors4(cr, cc): if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen: if ref_cells[nr][nc] == color: seen.add((nr, nc)) stack.append((nr, nc)) for part in _find_sub_rectangles(comp): groups.append((color, part)) return groups def _find_reference_top_left(inp: Grid) -> tuple[int, int]: h = len(inp) w = len(inp[0]) if h else 0 candidates = [(0, 0), (0, w - 5), (h - 5, 0), (h - 5, w - 5)] for top, left in candidates: if top < 0 or left < 0: continue if top + 5 > h or left + 5 > w: continue ok = True for c in range(left, left + 5): if inp[top][c] != RED or inp[top + 4][c] != RED: ok = False break if not ok: continue for r in range(top + 1, top + 4): if inp[r][left] != RED or inp[r][left + 4] != RED: ok = False break if ok: return top, left raise ValueError(""could not find red 5x5 reference rectangle"") def _reference_corner(ref_top: int, ref_left: int, h: int, w: int) -> tuple[str, str]: vertical = ""top"" if ref_top == 0 else ""bottom"" horizontal = ""left"" if ref_left == 0 else ""right"" return vertical, horizontal def verify_t4(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") if h % 3 != 0 or w % 3 != 0: raise ValueError(""input dimensions must be divisible by 3"") if h not in (12, 18) or w not in (12, 18): raise ValueError(""this task uses size 12 or 18"") ref_top, ref_left = _find_reference_top_left(inp) ref_cells = _empty(3, 3) for r in range(3): for c in range(3): ref_cells[r][c] = inp[ref_top + 1 + r][ref_left + 1 + c] bh = h // 3 bw = w // 3 out = _empty(h, w) ref_vertical, ref_horizontal = _reference_corner(ref_top, ref_left, h, w) for color, comp in _color_groups_4n_rectangular(ref_cells): rows = [r for r, _ in comp] cols = [c for _, c in comp] r0, r1 = min(rows), max(rows) c0, c1 = min(cols), max(cols) comp_h = r1 - r0 + 1 comp_w = c1 - c0 + 1 top = r0 * bh left = c0 * bw rect_h = comp_h * bh rect_w = comp_w * bw for cc in range(left, left + rect_w): out[top][cc] = color out[top + rect_h - 1][cc] = color for rr in range(top + 1, top + rect_h - 1): out[rr][left] = color out[rr][left + rect_w - 1] = color inner_top = top + 1 inner_left = left + 1 inner_h = rect_h - 2 inner_w = rect_w - 2 half_h = inner_h // 2 half_w = inner_w // 2 row_start = inner_top if ref_vertical == ""top"" else inner_top + half_h row_end = inner_top + half_h if ref_vertical == ""top"" else inner_top + inner_h col_start = inner_left if ref_horizontal == ""left"" else inner_left + half_w col_end = inner_left + half_w if ref_horizontal == ""left"" else inner_left + inner_w for rr in range(row_start, row_end): for cc in range(col_start, col_end): out[rr][cc] = RED return out " "t5","[{""input"":[[8,8,8,0,0,0,0,0,0,0],[8,8,8,0,0,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,8,0,8,8,0],[8,8,8,8,8,8,8,8],[8,8,8,8,8,8,0,8],[8,8,8,8,8,0,8,8],[8,0,8,8,8,8,8,8],[0,0,0,0,0,0,0,0],[7,7,7,0,0,7,7,7],[8,8,0,0,0,0,8,8],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[7,7,7,0,0,7,7,7],[0,8,8,8,8,8,8,0],[8,8,8,8,8,8,8,8],[8,8,8,8,8,8,8,8],[8,8,8,8,8,8,8,8],[8,8,8,8,8,8,8,8]]}]}","""""""Generator for Test2/t5 cyan-flow task."""""" from __future__ import annotations import random from typing import List Grid = List[List[int]] CYAN = 8 ORANGE = 7 def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _non_orange_components(grid: Grid) -> list[set[tuple[int, int]]]: h = len(grid) w = len(grid[0]) if h else 0 seen: set[tuple[int, int]] = set() comps: list[set[tuple[int, int]]] = [] for r in range(h): for c in range(w): if grid[r][c] == ORANGE or (r, c) in seen: continue stack = [(r, c)] seen.add((r, c)) comp: set[tuple[int, int]] = set() while stack: cr, cc = stack.pop() comp.add((cr, cc)) for nr, nc in _neighbors4(cr, cc): if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen: if grid[nr][nc] != ORANGE: seen.add((nr, nc)) stack.append((nr, nc)) comps.append(comp) return comps def _center_order(cols: list[int]) -> list[int]: center = (cols[0] + cols[-1]) / 2.0 return sorted(cols, key=lambda c: (abs(c - center), c)) def _pack_component( comp: set[tuple[int, int]], count: int, preferred_center: float | None = None ) -> set[tuple[int, int]]: if count <= 0: return set() rows = sorted({r for r, _ in comp}, reverse=True) row_cells = {r: sorted([c for rr, c in comp if rr == r]) for r in rows} bottom = rows[0] filled: set[tuple[int, int]] = set() remaining = count # Bottom-up fill; each row selects a single flow-front segment and fills from # the middle. This avoids non-physical ""teleport"" fills into side cavities on # the same level. for r in rows: if remaining <= 0: break cols = row_cells[r] if not cols: continue segments: list[list[int]] = [] i = 0 while i < len(cols): j = i while j + 1 < len(cols) and cols[j + 1] == cols[j] + 1: j += 1 seg = cols[i : j + 1] segments.append(seg) i = j + 1 if not segments: continue if r == bottom: global_center = preferred_center if preferred_center is not None else (cols[0] + cols[-1]) / 2.0 chosen_seg = min(segments, key=lambda seg: (abs(((seg[0] + seg[-1]) / 2.0) - global_center), seg[0])) order = _center_order(chosen_seg) else: anchored: list[tuple[int, list[int], list[int]]] = [] for seg in segments: anchors = [c for c in seg if (r + 1, c) in filled] if anchors: anchored.append((len(anchors), seg, anchors)) if not anchored: continue # Prefer the segment with the strongest support from below. anchored.sort( key=lambda t: ( -t[0], abs( ((t[1][0] + t[1][-1]) / 2.0) - (preferred_center if preferred_center is not None else ((cols[0] + cols[-1]) / 2.0)) ), t[1][0], ) ) _, chosen_seg, anchors = anchored[0] # Center from underlying cyan support row (anchors), not full row span. center = sum(anchors) / float(len(anchors)) order = sorted( chosen_seg, key=lambda c: (abs(c - center), min(abs(c - a) for a in anchors), c), ) take = min(remaining, len(order)) for c in order[:take]: filled.add((r, c)) remaining -= take # Rare fallback for irregular cavities: continue from frontier. while remaining > 0: candidates: list[tuple[int, int, int]] = [] for r, c in comp: if (r, c) in filled: continue support = (r == bottom) or ((r + 1, c) in filled) or ((r, c - 1) in filled) or ((r, c + 1) in filled) if not support: continue center = 0.0 row = row_cells[r] if row: center = (row[0] + row[-1]) / 2.0 candidates.append((r, int(abs(c - center) * 1000), c)) if not candidates: break # Highest row index (lower in grid) first. candidates.sort(key=lambda x: (-x[0], x[1], x[2])) r, _, c = candidates[0] filled.add((r, c)) remaining -= 1 return filled def _flow_component( comp: set[tuple[int, int]], initial_cyan: set[tuple[int, int]], steps_cap: int = 2000 ) -> set[tuple[int, int]]: """"""Simulate deterministic gravity/flow inside one non-orange component."""""" if not initial_cyan: return set() by_row: dict[int, set[int]] = {} for r, c in comp: by_row.setdefault(r, set()).add(c) def row_segment(r: int, c: int) -> tuple[int, int] | None: row = by_row.get(r) if row is None or c not in row: return None lo = c hi = c while (lo - 1) in row: lo -= 1 while (hi + 1) in row: hi += 1 return (lo, hi) occ = set(initial_cyan) global_center = sum(c for _, c in comp) / float(len(comp)) steps = 0 changed = True while changed and steps < steps_cap: steps += 1 changed = False # Bottom-up update reduces oscillations and keeps settling stable. order = sorted(occ, key=lambda rc: (-rc[0], abs(rc[1] - global_center), rc[1])) for r, c in order: if (r, c) not in occ: continue # 1) Pure gravity: fall straight down whenever possible. below = (r + 1, c) if below in comp and below not in occ: occ.remove((r, c)) occ.add(below) changed = True continue # Lateral travel is only on solid support (orange/boundary below), # not when simply stacked on another cyan. if below in comp: continue # 2) Blocked below: move laterally toward a reachable drop if any. seg = row_segment(r, c) if seg is None: continue lo, hi = seg drop_targets: list[int] = [] for tc in range(lo, hi + 1): if (r, tc) in occ and tc != c: continue tb = (r + 1, tc) if tb in comp and tb not in occ: drop_targets.append(tc) moved = False if drop_targets: best_tc = min( drop_targets, key=lambda tc: (abs(tc - c), abs(tc - global_center), tc), ) step = 0 if best_tc == c else (1 if best_tc > c else -1) if step != 0: nxt = (r, c + step) if nxt in comp and nxt not in occ: occ.remove((r, c)) occ.add(nxt) changed = True moved = True if moved: continue # 3) No reachable drop: settle on the current solid lane from middle. seg_center = (lo + hi) / 2.0 dirs = sorted( [-1, 1], key=lambda dc: ( abs((c + dc) - seg_center), abs((c + dc) - global_center), c + dc, ), ) for dc in dirs: nxt = (r, c + dc) if nxt in comp and nxt not in occ: occ.remove((r, c)) occ.add(nxt) changed = True break return occ def transform_t5(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 out = _empty(h, w) for r in range(h): for c in range(w): if inp[r][c] == ORANGE: out[r][c] = ORANGE for comp in _non_orange_components(inp): cyan_cols = [c for r, c in comp if inp[r][c] == CYAN] n_cyan = len(cyan_cols) preferred_center = (sum(cyan_cols) / float(n_cyan)) if n_cyan > 0 else None for r, c in _pack_component(comp, n_cyan, preferred_center=preferred_center): out[r][c] = CYAN return out def _add_random_boundaries( grid: Grid, rng: random.Random ) -> tuple[int, set[int], set[tuple[int, int]]]: h = len(grid) w = len(grid[0]) if h else 0 barrier_r = rng.randint(max(1, h // 4), min(h - 4, h // 2)) for c in range(w): grid[barrier_r][c] = ORANGE gap_cols: set[int] = set() # Keep openings center-symmetric to avoid ambiguous left-vs-right cases. if w % 2 == 0: gap_cols = {w // 2 - 1, w // 2} else: gap_cols = {w // 2} for c in gap_cols: grid[barrier_r][c] = 0 reserved_no_cyan: set[tuple[int, int]] = {(barrier_r, c) for c in gap_cols} for c in gap_cols: for rr, cc in ( (barrier_r - 1, c - 1), (barrier_r - 1, c + 1), (barrier_r + 1, c - 1), (barrier_r + 1, c + 1), ): if 0 <= rr < h and 0 <= cc < w: reserved_no_cyan.add((rr, cc)) # Keep one main horizontal barrier only; stacked barriers can produce # non-physical-looking fills under a gravity interpretation. # Add one or two vertical walls for richer basin geometry/cavities. wall_count = rng.randint(0, 2) for _ in range(wall_count): candidates = [c for c in range(1, w - 1) if all(abs(c - gc) >= 2 for gc in gap_cols)] if not candidates: break c = rng.choice(candidates) start_r = rng.randint(barrier_r + 1, max(barrier_r + 1, h - 2)) for r in range(start_r, h): grid[r][c] = ORANGE # Optional small opening near bottom to keep compartments varied. if h - start_r >= 4 and rng.random() < 0.45: hole_r = rng.randint(start_r + 1, h - 2) grid[hole_r][c] = 0 reserved_no_cyan.add((hole_r, c)) for rr, cc in ( (hole_r - 1, c - 1), (hole_r - 1, c + 1), (hole_r + 1, c - 1), (hole_r + 1, c + 1), ): if 0 <= rr < h and 0 <= cc < w: reserved_no_cyan.add((rr, cc)) return barrier_r, gap_cols, reserved_no_cyan def _row_segments(cells: set[tuple[int, int]]) -> dict[int, list[list[int]]]: by_row: dict[int, list[int]] = {} for r, c in cells: by_row.setdefault(r, []).append(c) out: dict[int, list[list[int]]] = {} for r, cols in by_row.items(): cols = sorted(cols) segs: list[list[int]] = [] start = [cols[0]] for c in cols[1:]: if c == start[-1] + 1: start.append(c) else: segs.append(start) start = [c] segs.append(start) out[r] = segs return out def _is_ambiguous_fill(inp: Grid, out: Grid) -> bool: """"""Reject generated samples with unresolved center-fill side ambiguity."""""" h = len(inp) for comp in _non_orange_components(inp): segs_by_row = _row_segments(comp) for r, segs in segs_by_row.items(): for seg in segs: chosen = [c for c in seg if out[r][c] == CYAN] if not chosen or len(chosen) == len(seg): continue # Partial fills are validated against deterministic center ranking # from the immediate supporting row. support = [c for c in seg if r + 1 < h and out[r + 1][c] == CYAN] if not support: return True center = sum(support) / float(len(support)) ordered = sorted(seg, key=lambda c: (abs(c - center), c)) k = len(chosen) # If the boundary between chosen and unchosen has equal distance # to center, then side choice is ambiguous. if 0 < k < len(ordered): d_k = abs(ordered[k - 1] - center) d_next = abs(ordered[k] - center) if abs(d_k - d_next) < 1e-9: return True if set(chosen) != set(ordered[:k]): return True # If an unchosen column in this segment has a free drop below # (inside component and not already occupied), dynamics would be # ambiguous between ""center now"" vs ""slide then drop"". if r + 1 < h: for c in seg: if c in chosen: continue if (r + 1, c) in comp and out[r + 1][c] != CYAN: return True return False def _has_multi_basin_drop_ambiguity(inp: Grid) -> bool: """"""Reject layouts with multiple simultaneously fed bottom basins. If a non-orange component has a split row near its bottom (multiple disjoint segments) and more than one segment has cyan somewhere above it in-column, the intended drop destination can be read ambiguously. """""" for comp in _non_orange_components(inp): if not comp: continue by_row = _row_segments(comp) rows = sorted(by_row.keys(), reverse=True) # bottom-up # Focus on the lowest part of each cavity where ambiguity is most visible. for r in rows[:3]: segs = by_row[r] if len(segs) <= 1: continue fed = 0 for seg in segs: cols = set(seg) has_source = any( inp[rr][cc] == CYAN for rr, cc in comp if rr < r and cc in cols ) if has_source: fed += 1 if fed >= 2: return True return False def generate( width: int | None = None, height: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random if width is None: width = rr.randint(8, 12) if height is None: height = rr.randint(8, 12) if width < 8 or height < 8: raise ValueError(""width and height must be >= 8"") for _ in range(1000): inp = _empty(height, width) barrier_r, gap_cols, reserved_no_cyan = _add_random_boundaries(inp, rr) comps = _non_orange_components(inp) for comp in comps: if not comp: continue frac = rr.uniform(0.2, 0.5) cells = [ (r, c) for (r, c) in comp if (r, c) not in reserved_no_cyan and not (r == barrier_r and c in gap_cols) ] # Avoid seeding directly ambiguous local states: # cyan above orange with both lateral routes open. safe_cells: list[tuple[int, int]] = [] for r, c in cells: if r + 1 < height and inp[r + 1][c] == ORANGE: continue safe_cells.append((r, c)) if not safe_cells: continue # Favor sources above/near the first barrier and near its opening(s), # so motion reads like mostly vertical falling into the main basin. gap_min = min(gap_cols) gap_max = max(gap_cols) upper_band = [ rc for rc in safe_cells if rc[0] <= barrier_r + 1 and (gap_min - 2) <= rc[1] <= (gap_max + 2) ] # If filtering is too strict for a particular component, relax gently. if len(upper_band) < max(1, int(0.5 * len(safe_cells))): upper_band = [rc for rc in safe_cells if rc[0] <= barrier_r + 1] n = max(1, min(len(safe_cells), int(round(len(safe_cells) * frac)))) upper_target = n chosen: list[tuple[int, int]] = [] rr.shuffle(upper_band) chosen.extend(upper_band[: min(len(upper_band), upper_target)]) remaining = n - len(chosen) if remaining > 0: # Top up from just-above-barrier cells before using deeper cells. chosen_set = set(chosen) near_band = [rc for rc in safe_cells if rc[0] <= barrier_r + 2 and rc not in chosen_set] rr.shuffle(near_band) chosen.extend(near_band[:remaining]) if len(chosen) < n: chosen_set = set(chosen) rest = [rc for rc in safe_cells if rc not in chosen_set and rc[0] <= barrier_r + 3] rr.shuffle(rest) chosen.extend(rest[: n - len(chosen)]) for r, c in chosen: inp[r][c] = CYAN out = transform_t5(inp) if not _is_ambiguous_fill(inp, out) and not _has_multi_basin_drop_ambiguity(inp): return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample unambiguous t5 instance"") ","""""""Verifier for Test2/t5 cyan-flow task."""""" from __future__ import annotations from typing import List from generator import transform_t5 Grid = List[List[int]] def verify_t5(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t5(inp) " "t6","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,5,5,5,5,5,5,5,5,5,5,0],[0,5,0,0,0,6,0,0,0,0,5,0],[0,5,0,0,0,0,6,0,0,0,5,0],[0,5,5,5,5,5,5,5,5,5,5,0],[0,5,0,0,0,0,0,0,1,0,5,0],[0,5,0,0,0,0,1,1,0,0,5,0],[0,5,5,5,5,5,5,5,5,5,5,3],[0,5,0,0,0,0,0,0,0,7,5,0],[0,5,0,0,0,0,0,0,7,0,5,0],[0,5,5,5,5,5,5,5,5,5,5,0],[0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,5,5,5,5,5,5,5,5,5,5,0],[0,5,2,2,2,2,2,2,2,2,5,0],[0,5,2,2,2,2,2,2,2,2,5,0],[0,5,5,5,5,5,5,5,5,5,5,0],[0,5,4,4,4,4,4,4,4,4,5,0],[0,5,4,4,4,4,4,4,4,4,5,0],[0,5,5,5,5,5,5,5,5,5,5,0],[0,5,3,3,3,3,3,3,3,3,5,0],[0,5,3,3,3,3,3,3,3,3,5,0],[0,5,5,5,5,5,5,5,5,5,5,0],[0,0,0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,5,5,5,5,5,5,5,5,0],[0,5,6,0,5,5,0,0,5,0],[0,5,0,6,5,5,0,0,5,0],[0,5,6,0,5,5,1,0,5,0],[0,5,0,6,5,5,1,0,5,0],[0,5,0,0,5,5,1,0,5,0],[0,5,0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[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,5,5,5,5,5,5,5,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,3,5,4,5,2,2,5],[0,0,0,5,5,5,5,5,5,5,5]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0],[0,0,0,5,7,0,0,0,0,5,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0],[0,0,0,5,3,0,0,6,6,5,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0],[0,0,0,5,0,0,0,0,0,5,0,0,0],[0,0,0,5,0,8,8,0,0,5,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0],[0,0,0,5,3,3,3,3,3,5,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0],[0,0,0,5,4,4,4,4,4,5,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0],[0,0,0,5,2,2,2,2,2,5,0,0,0],[0,0,0,5,2,2,2,2,2,5,0,0,0],[0,0,0,5,5,5,5,5,5,5,0,0,0]]}]}","""""""Generator for Test2/t6 partition-distance ranking task."""""" from __future__ import annotations import random from typing import List Grid = List[List[int]] GREY = 5 GREEN = 3 RANK_COLORS = [3, 4, 2] # closest, second, third # Only green is forbidden for partition objects. OBJECT_PALETTE = [1, 2, 4, 6, 7, 8, 9] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _find_partitions(grid: Grid, top: int, left: int, bottom: int, right: int) -> list[set[tuple[int, int]]]: interior = [ (r, c) for r in range(top + 1, bottom) for c in range(left + 1, right) if grid[r][c] != GREY ] inside = set(interior) seen: set[tuple[int, int]] = set() comps: list[set[tuple[int, int]]] = [] for rc in interior: if rc in seen: continue stack = [rc] seen.add(rc) comp: set[tuple[int, int]] = set() while stack: r, c = stack.pop() comp.add((r, c)) for nr, nc in _neighbors4(r, c): if (nr, nc) in inside and (nr, nc) not in seen: seen.add((nr, nc)) stack.append((nr, nc)) comps.append(comp) return comps def _paint_outer_rectangle(grid: Grid, top: int, left: int, bottom: int, right: int) -> None: for c in range(left, right + 1): grid[top][c] = GREY grid[bottom][c] = GREY for r in range(top + 1, bottom): grid[r][left] = GREY grid[r][right] = GREY def _paint_internal_walls( grid: Grid, top: int, left: int, bottom: int, right: int, partition_count: int, rng: random.Random, ) -> None: ih = bottom - top - 1 iw = right - left - 1 if partition_count == 1: return if partition_count == 2: modes: list[str] = [""diag_pos"", ""diag_neg""] if iw >= 5: modes.append(""vertical"") if ih >= 5: modes.append(""horizontal"") if iw >= 5 and ih >= 5: modes.append(""zigzag2"") mode = rng.choice(modes) if mode == ""vertical"": cut = rng.randint(2, iw - 2) c = left + cut for r in range(top + 1, bottom): grid[r][c] = GREY return if mode == ""horizontal"": cut = rng.randint(2, ih - 2) r = top + cut for c in range(left + 1, right): grid[r][c] = GREY return if mode == ""diag_pos"": # interior coords satisfy (rr - cc == k) k = rng.randint(-(iw - 3), ih - 3) for rr in range(1, ih + 1): for cc in range(1, iw + 1): if rr - cc == k: grid[top + rr][left + cc] = GREY return if mode == ""zigzag2"": # Staircase-style separating wall. base = rng.randint(2, iw - 2) for rr in range(1, ih + 1): cc = base + (rr % 2) if cc > iw - 1: cc = base - (rr % 2) cc = max(1, min(iw, cc)) grid[top + rr][left + cc] = GREY return # diag_neg: interior coords satisfy (rr + cc == k) k = rng.randint(4, ih + iw - 2) for rr in range(1, ih + 1): for cc in range(1, iw + 1): if rr + cc == k: grid[top + rr][left + cc] = GREY return # partition_count == 3 modes3: list[str] = [] if iw >= 6: modes3.append(""vertical3"") if ih >= 6: modes3.append(""horizontal3"") # Parallel diagonals need enough spread to leave 3 regions. if ih + iw >= 10: modes3.extend([""diag_pos3"", ""diag_neg3""]) if iw >= 8 and ih >= 6: modes3.append(""zigzag3"") if not modes3: # Fallback: single wall; caller will reject if partition count mismatches. return mode = rng.choice(modes3) if mode == ""vertical3"": a = rng.randint(2, iw - 4) b = rng.randint(a + 2, iw - 2) for r in range(top + 1, bottom): grid[r][left + a] = GREY grid[r][left + b] = GREY return if mode == ""horizontal3"": a = rng.randint(2, ih - 4) b = rng.randint(a + 2, ih - 2) for c in range(left + 1, right): grid[top + a][c] = GREY grid[top + b][c] = GREY return if mode == ""diag_pos3"": k1 = rng.randint(-(iw - 4), ih - 6) k2 = rng.randint(k1 + 2, ih - 3) for rr in range(1, ih + 1): for cc in range(1, iw + 1): if rr - cc == k1 or rr - cc == k2: grid[top + rr][left + cc] = GREY return if mode == ""zigzag3"": # Two parallel staircase walls, similar to the provided test style. base1 = rng.randint(2, max(2, iw // 2 - 1)) base2 = rng.randint(base1 + 3, iw - 1) for rr in range(1, ih + 1): off = rr % 2 c1 = base1 + off c2 = base2 + off if c2 > iw: c1 -= 1 c2 -= 1 c1 = max(1, min(iw, c1)) c2 = max(1, min(iw, c2)) if c2 - c1 < 2: c2 = min(iw, c1 + 2) grid[top + rr][left + c1] = GREY grid[top + rr][left + c2] = GREY return k1 = rng.randint(4, ih + iw - 6) k2 = rng.randint(k1 + 2, ih + iw - 2) for rr in range(1, ih + 1): for cc in range(1, iw + 1): if rr + cc == k1 or rr + cc == k2: grid[top + rr][left + cc] = GREY def _sample_object_cells(part: set[tuple[int, int]], rng: random.Random) -> set[tuple[int, int]]: # Build a small connected object (1-4 cells) inside this partition. seed = rng.choice(list(part)) obj = {seed} target = rng.randint(1, min(4, len(part))) frontier = [seed] while len(obj) < target and frontier: r, c = frontier.pop(rng.randrange(len(frontier))) candidates = [(nr, nc) for nr, nc in _neighbors4(r, c) if (nr, nc) in part and (nr, nc) not in obj] rng.shuffle(candidates) for rc in candidates[:2]: obj.add(rc) frontier.append(rc) if len(obj) >= target: break return obj def transform_t6(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") grey_cells = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == GREY] if not grey_cells: raise ValueError(""no grey rectangle found"") top = min(r for r, _ in grey_cells) bottom = max(r for r, _ in grey_cells) left = min(c for _, c in grey_cells) right = max(c for _, c in grey_cells) green_cells = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == GREEN] if len(green_cells) != 1: raise ValueError(""expected exactly one green cell"") gr, gc = green_cells[0] parts = _find_partitions(inp, top, left, bottom, right) part_info: list[tuple[int, set[tuple[int, int]]]] = [] for part in parts: objs = [(r, c) for r, c in part if inp[r][c] not in (0, GREY, GREEN)] if not objs: raise ValueError(""each partition must contain one object"") d = min(abs(r - gr) + abs(c - gc) for r, c in objs) part_info.append((d, part)) part_info.sort(key=lambda x: x[0]) out = _empty(h, w) for r, c in grey_cells: out[r][c] = GREY for i, (_, part) in enumerate(part_info): col = RANK_COLORS[min(i, len(RANK_COLORS) - 1)] for r, c in part: out[r][c] = col return out def generate( width: int | None = None, height: int | None = None, partition_count: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random if width is None: width = rr.randint(10, 14) if height is None: height = rr.randint(10, 14) if width < 9 or height < 9: raise ValueError(""width and height must be >= 9"") if partition_count is None: # Bias toward richer examples: 3 partitions most likely, then 2, then 1. partition_count = rr.choices([1, 2, 3], weights=[1, 2, 9], k=1)[0] if partition_count not in (1, 2, 3): raise ValueError(""partition_count must be in {1,2,3}"") for _ in range(300): inp = _empty(height, width) rect_h = rr.randint(7, min(height - 1, 11)) rect_w = rr.randint(7, min(width - 1, 11)) top = rr.randint(1, height - rect_h) left = rr.randint(1, width - rect_w) bottom = top + rect_h - 1 right = left + rect_w - 1 _paint_outer_rectangle(inp, top, left, bottom, right) _paint_internal_walls(inp, top, left, bottom, right, partition_count, rr) parts = _find_partitions(inp, top, left, bottom, right) if len(parts) != partition_count: continue if any(len(p) < 3 for p in parts): continue # One object per partition. used_colors = rr.sample(OBJECT_PALETTE, k=partition_count) for part, color in zip(parts, used_colors): for r, c in _sample_object_cells(part, rr): inp[r][c] = color # One green target may be outside or inside the grey shape. outside = { (r, c) for r in range(height) for c in range(width) if not (top <= r <= bottom and left <= c <= right) } inside_open = { (r, c) for r in range(top + 1, bottom) for c in range(left + 1, right) if inp[r][c] == 0 } outside_list = list(outside) inside_list = list(inside_open) if not outside_list and not inside_list: continue # Bias placement outside the grey shape; inside remains possible but less likely. if outside_list and inside_list: pick_outside = rr.random() < 0.8 gr, gc = rr.choice(outside_list if pick_outside else inside_list) elif outside_list: gr, gc = rr.choice(outside_list) else: gr, gc = rr.choice(inside_list) inp[gr][gc] = GREEN # Enforce unique distances to avoid tie ambiguity. dists = [] for part in parts: objs = [(r, c) for r, c in part if inp[r][c] not in (0, GREY, GREEN)] d = min(abs(r - gr) + abs(c - gc) for r, c in objs) dists.append(d) if len(set(dists)) != len(dists): continue out = transform_t6(inp) return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t6 instance"") ","""""""Verifier for Test2/t6 partition-distance ranking task."""""" from __future__ import annotations from typing import List from generator import transform_t6 Grid = List[List[int]] def verify_t6(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t6(inp) " "t7","[{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,2,2,2,0],[0,0,0,0,0,2,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,0,0,0,0],[0,9,9,9,0,0,5,5,0],[0,0,0,9,0,5,5,5,0],[0,0,0,0,0,0,5,5,0],[0,0,0,2,2,0,0,0,0],[0,0,0,2,2,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,8,0,0],[0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0],[0,9,9,0,9,0,0,0,0],[0,9,9,9,0,0,5,5,0],[0,0,0,9,0,5,5,5,0],[0,0,0,8,8,0,5,5,0],[0,0,8,2,2,8,0,0,0],[0,0,8,2,2,8,0,0,0],[0,0,0,8,8,0,0,0,0],[0,0,0,0,0,8,0,0,0],[0,0,0,0,0,0,8,0,0],[0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,9,0,0,5,0,3,3,0],[0,9,9,0,5,5,0,3,3,0],[0,9,9,9,0,0,3,3,0,0],[0,9,9,0,0,0,0,0,0,0],[0,0,0,0,7,0,0,0,0,0],[0,0,0,7,7,0,7,0,0,0],[0,0,8,7,7,7,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,9,0,0,5,0,3,3,0],[0,9,9,0,5,5,0,3,3,0],[0,9,9,9,0,0,3,3,0,0],[0,9,9,0,8,0,0,0,0,0],[0,0,0,8,7,8,8,0,0,0],[0,0,8,7,7,8,7,8,0,0],[0,0,8,7,7,7,8,0,0,0],[0,0,0,8,8,8,0,0,0,0]]}]}","""""""Generator for Test2/t7 diagonal-connect-and-wrap task."""""" from __future__ import annotations import copy import random from typing import List, Optional Grid = List[List[int]] CYAN = 8 PALETTE = [1, 2, 3, 4, 5, 6, 7, 9] DIAGONALS = [(-1, -1), (-1, 1), (1, -1), (1, 1)] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _neighbors8(r: int, c: int) -> list[tuple[int, int]]: return [ (r - 1, c - 1), (r - 1, c), (r - 1, c + 1), (r, c - 1), (r, c + 1), (r + 1, c - 1), (r + 1, c), (r + 1, c + 1), ] def _components8_same_color(grid: Grid) -> list[tuple[int, set[tuple[int, int]]]]: h = len(grid) w = len(grid[0]) if h else 0 seen: set[tuple[int, int]] = set() comps: list[tuple[int, set[tuple[int, int]]]] = [] for r in range(h): for c in range(w): col = grid[r][c] if col in (0, CYAN) or (r, c) in seen: continue stack = [(r, c)] seen.add((r, c)) comp: set[tuple[int, int]] = set() while stack: cr, cc = stack.pop() comp.add((cr, cc)) for nr, nc in _neighbors8(cr, cc): if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and grid[nr][nc] == col: seen.add((nr, nc)) stack.append((nr, nc)) comps.append((col, comp)) return comps def _find_cyan(grid: Grid) -> tuple[int, int]: cells = [(r, c) for r, row in enumerate(grid) for c, v in enumerate(row) if v == CYAN] if len(cells) != 1: raise ValueError(""expected exactly one cyan cell"") return cells[0] def _first_diagonal_hit( grid: Grid, cr: int, cc: int, ) -> Optional[tuple[int, tuple[int, int], tuple[int, int], int]]: """"""Return (distance, direction, hit_cell, hit_color) for first diagonal contact."""""" h = len(grid) w = len(grid[0]) if h else 0 best: Optional[tuple[int, tuple[int, int], tuple[int, int], int]] = None for dr, dc in DIAGONALS: step = 1 while True: nr = cr + step * dr nc = cc + step * dc if nr < 0 or nr >= h or nc < 0 or nc >= w: break val = grid[nr][nc] if val not in (0, CYAN): cand = (step, (dr, dc), (nr, nc), val) if best is None or step < best[0]: best = cand break step += 1 return best def _component_containing( comps: list[tuple[int, set[tuple[int, int]]]], cell: tuple[int, int], ) -> set[tuple[int, int]]: for _col, comp in comps: if cell in comp: return comp raise ValueError(""hit cell not in any component"") def transform_t7(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in inp): raise ValueError(""input must be a non-empty rectangular grid"") cr, cc = _find_cyan(inp) comps = _components8_same_color(inp) if not comps: raise ValueError(""expected at least one non-cyan object"") hit = _first_diagonal_hit(inp, cr, cc) if hit is None: raise ValueError(""cyan does not diagonally hit any object"") _dist, (dr, dc), (hr, hc), _hit_color = hit target = _component_containing(comps, (hr, hc)) out = copy.deepcopy(inp) # Connect cyan diagonally to the first-hit object. rr, cc2 = cr + dr, cc + dc while (rr, cc2) != (hr, hc): if out[rr][cc2] == 0: out[rr][cc2] = CYAN rr += dr cc2 += dc # Wrap target object with cyan so no target cell touches black orthogonally. add: set[tuple[int, int]] = set() for r, c in target: for nr, nc in _neighbors4(r, c): if 0 <= nr < h and 0 <= nc < w and out[nr][nc] == 0: add.add((nr, nc)) for r, c in add: out[r][c] = CYAN return out def _random_component( grid: Grid, color: int, rng: random.Random, *, min_cells: int = 3, max_cells: int = 8, ) -> bool: h = len(grid) w = len(grid[0]) if h else 0 def can_place_cell(r: int, c: int) -> bool: if not (0 < r < h - 1 and 0 < c < w - 1): return False if grid[r][c] != 0: return False # Keep different objects at most diagonally adjacent (no orthogonal contact). for nr, nc in _neighbors4(r, c): if 0 <= nr < h and 0 <= nc < w and grid[nr][nc] not in (0, color): return False return True empties = [(r, c) for r in range(1, h - 1) for c in range(1, w - 1) if can_place_cell(r, c)] if not empties: return False seed = rng.choice(empties) cells = {seed} target = rng.randint(min_cells, max_cells) frontier = [seed] while frontier and len(cells) < target: r, c = frontier.pop(rng.randrange(len(frontier))) nbrs = [ (nr, nc) for nr, nc in _neighbors8(r, c) if (nr, nc) not in cells and can_place_cell(nr, nc) ] rng.shuffle(nbrs) for nr, nc in nbrs[:2]: cells.add((nr, nc)) frontier.append((nr, nc)) if len(cells) >= target: break if len(cells) < min_cells: return False for r, c in cells: grid[r][c] = color return True def _unique_min_hit_component(grid: Grid, cr: int, cc: int) -> bool: comps = _components8_same_color(grid) if not comps: return False comp_by_cell: dict[tuple[int, int], int] = {} for i, (_col, comp) in enumerate(comps): for rc in comp: comp_by_cell[rc] = i hits: list[tuple[int, int]] = [] # (distance, comp_id) h = len(grid) w = len(grid[0]) if h else 0 for dr, dc in DIAGONALS: step = 1 while True: nr = cr + step * dr nc = cc + step * dc if nr < 0 or nr >= h or nc < 0 or nc >= w: break v = grid[nr][nc] if v not in (0, CYAN): hits.append((step, comp_by_cell[(nr, nc)])) break step += 1 if not hits: return False best_d = min(d for d, _ in hits) winners = {cid for d, cid in hits if d == best_d} return len(winners) == 1 def generate( width: int | None = None, height: int | None = None, n_shapes: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random if width is None: width = rr.randint(9, 13) if height is None: height = rr.randint(9, 13) if width < 7 or height < 7: raise ValueError(""width and height must be >= 7"") if n_shapes is None: n_shapes = rr.randint(2, 4) if n_shapes < 2: raise ValueError(""n_shapes must be >= 2"") for _ in range(600): inp = _empty(height, width) colors = rr.sample(PALETTE, k=min(n_shapes, len(PALETTE))) placed = 0 for col in colors: if _random_component(inp, col, rr): placed += 1 if placed < 2: continue empties = [(r, c) for r in range(1, height - 1) for c in range(1, width - 1) if inp[r][c] == 0] if not empties: continue cr, cc = rr.choice(empties) inp[cr][cc] = CYAN if not _unique_min_hit_component(inp, cr, cc): continue try: out = transform_t7(inp) except Exception: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t7 instance"") ","""""""Verifier for Test2/t7 diagonal-connect-and-wrap task."""""" from __future__ import annotations from typing import List from generator import transform_t7 Grid = List[List[int]] def verify_t7(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t7(inp) " "t8","[{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[2,1,1,1,5,1,5,1,1],[1,1,1,5,1,1,5,1,2],[1,1,5,1,1,2,5,1,1],[1,5,1,2,1,1,1,5,1],[1,5,1,1,1,1,2,5,1],[1,1,5,1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1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,2,0],[0,0,2,0,2,0]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[1,5,2,1,1,2,2,5,1],[1,5,1,1,2,2,5,1,1],[1,1,5,1,1,1,5,1,1],[1,1,1,5,2,1,1,5,1],[1,1,1,1,5,5,5,5,1],[1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,2,2,0],[2,0,2,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[1,1,1,5,1,2,5,1,1],[1,1,1,5,1,2,2,5,1],[1,1,5,1,1,1,1,5,1],[1,1,5,2,2,1,2,5,1],[1,1,1,5,5,5,5,5,1],[1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0],[0,0,0,0],[0,0,2,2],[2,2,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[1,5,1,1,1,1,5,1,1],[1,5,2,1,1,2,1,5,1],[1,1,5,1,1,1,1,5,1],[1,1,5,1,2,1,2,5,1],[1,1,5,2,1,1,1,5,1],[1,1,1,5,1,1,2,5,1],[1,1,1,5,5,5,5,5,1],[1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,2],[2,2,2,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[1,1,1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5,1,1],[1,1,1,1,5,1,1,5,1,1],[1,1,1,1,5,1,5,1,1,1],[1,1,1,1,5,1,5,1,1,1],[1,1,1,1,1,5,5,5,1,1],[1,1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,2,0],[0,2,2,0]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[1,5,1,1,1,1,1,5,1],[1,1,5,2,1,2,5,1,1],[1,1,5,2,1,2,5,1,1],[1,5,2,1,1,2,5,1,1],[1,5,5,5,5,5,5,1,1],[1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0],[0,0,0,2,0],[0,2,0,2,0],[2,2,0,2,0]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[1,1,5,1,1,2,2,5,1],[1,1,1,5,1,2,1,5,1],[1,1,1,5,1,1,1,5,1],[1,1,1,1,5,1,5,1,1],[1,1,1,1,5,1,2,5,1],[1,1,1,1,5,1,5,1,1],[1,1,1,1,5,5,5,1,1],[1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,2,2],[0,0,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[1,1,1,5,1,1,1,1,5,1,1],[1,1,1,5,1,1,2,2,2,5,1],[1,1,1,5,1,2,2,2,2,5,1],[1,1,5,1,1,1,1,1,1,5,1],[1,1,5,5,5,5,5,5,5,5,1],[1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,2,2,2],[0,0,2,2,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[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,0,0],[2,2,2,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[1,5,2,1,1,1,2,5,1,1,1,1],[1,5,1,1,1,1,1,1,5,1,1,1],[1,5,1,1,1,2,1,5,1,1,1,1],[1,5,2,1,1,1,5,1,1,1,1,1],[1,5,5,5,5,5,5,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[2,0,0,0,0,0],[2,0,0,2,2,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[1,1,1,1,5,1,1,2,2,2,5,1,1],[1,1,1,1,1,5,1,1,1,1,5,1,1],[1,1,1,1,1,1,5,2,1,2,5,1,1],[1,1,1,1,1,1,1,5,1,2,5,1,1],[1,1,1,1,1,1,5,5,5,5,5,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0],[0,0,0,0,2],[0,0,2,0,2],[0,0,2,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[1,5,1,1,2,2,2,5,1],[1,5,2,1,1,1,1,5,1],[1,1,5,2,1,2,2,5,1],[1,1,5,2,1,1,2,5,1],[1,1,5,5,5,5,5,5,1],[1,1,1,1,1,1,1,1,1]],""output"":[[0,0,0,0,0],[0,0,0,0,2],[0,2,0,2,2],[2,2,2,2,2]]}]}","""""""Generator for Test2/t8 enclosed-body red gravity task."""""" from __future__ import annotations import copy import random from typing import List Grid = List[List[int]] BLUE = 1 RED = 2 GREY = 5 def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _neighbors8(r: int, c: int) -> list[tuple[int, int]]: return [ (r - 1, c - 1), (r - 1, c), (r - 1, c + 1), (r, c - 1), (r, c + 1), (r + 1, c - 1), (r + 1, c), (r + 1, c + 1), ] def _find_grey_component(inp: Grid) -> set[tuple[int, int]]: h = len(inp) w = len(inp[0]) if h else 0 greys = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == GREY] if not greys: raise ValueError(""no grey cells"") seen: set[tuple[int, int]] = set() comp: set[tuple[int, int]] = set() stack = [greys[0]] seen.add(greys[0]) while stack: r, c = stack.pop() comp.add((r, c)) for nr, nc in _neighbors8(r, c): if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and inp[nr][nc] == GREY: seen.add((nr, nc)) stack.append((nr, nc)) if len(comp) != len(greys): raise ValueError(""grey shape must be a single 8-connected component"") return comp def _opening_seed_cells(inp: Grid, grey: set[tuple[int, int]]) -> list[tuple[int, int]]: h = len(inp) top = min(r for r, _ in grey) cols = [c for r, c in grey if r == top] if not cols: return [] lo, hi = min(cols), max(cols) seeds: list[tuple[int, int]] = [] if top + 1 >= h: return seeds for c in range(lo, hi + 1): if inp[top][c] == GREY: continue if inp[top + 1][c] in (BLUE, RED): seeds.append((top + 1, c)) return seeds def _enclosed_component(inp: Grid) -> set[tuple[int, int]]: grey = _find_grey_component(inp) seeds = _opening_seed_cells(inp, grey) if not seeds: raise ValueError(""could not find enclosed opening seeds"") h = len(inp) w = len(inp[0]) if h else 0 allowed = {(r, c) for r in range(h) for c in range(w) if inp[r][c] in (BLUE, RED)} seen: set[tuple[int, int]] = set() stack = list(seeds) for s in seeds: seen.add(s) while stack: r, c = stack.pop() for nr, nc in _neighbors4(r, c): if (nr, nc) in allowed and (nr, nc) not in seen: seen.add((nr, nc)) stack.append((nr, nc)) if not seen: raise ValueError(""empty enclosed component"") return seen def _is_4_connected(cells: set[tuple[int, int]]) -> bool: if not cells: return False start = next(iter(cells)) seen = {start} stack = [start] while stack: r, c = stack.pop() for nr, nc in _neighbors4(r, c): if (nr, nc) in cells and (nr, nc) not in seen: seen.add((nr, nc)) stack.append((nr, nc)) return len(seen) == len(cells) def _bbox(cells: set[tuple[int, int]]) -> tuple[int, int, int, int]: return ( min(r for r, _ in cells), max(r for r, _ in cells), min(c for _, c in cells), max(c for _, c in cells), ) def transform_t8(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in inp): raise ValueError(""input must be a non-empty rectangular grid"") enclosed = _enclosed_component(inp) body_enclosed = {(r, c) for (r, c) in enclosed if inp[r][c] in (BLUE, RED)} if not body_enclosed: raise ValueError(""no enclosed body cells"") min_r = min(r for r, _ in body_enclosed) max_r = max(r for r, _ in body_enclosed) min_c = min(c for _, c in body_enclosed) max_c = max(c for _, c in body_enclosed) oh = max_r - min_r + 1 ow = max_c - min_c + 1 out = _empty(oh, ow) # Column-wise gravity for enclosed red cells into the extracted dimensions. for c in range(min_c, max_c + 1): reds = sum( 1 for r in range(min_r, max_r + 1) if (r, c) in enclosed and inp[r][c] == RED ) for k in range(reds): out[oh - 1 - k][c - min_c] = RED return out def _paint_body(inp: Grid, top: int, rng: random.Random) -> None: h = len(inp) w = len(inp[0]) if h else 0 for r in range(top, h): for c in range(w): inp[r][c] = BLUE def _paint_enclosure( inp: Grid, *, top: int, left_tip: int, right_tip: int, depth: int, rng: random.Random, ) -> None: """"""Paint non-rectangular 8-connected grey enclosure. The topmost grey tips are on the first blue row (*top*), matching task style. """""" h = len(inp) w = len(inp[0]) if h else 0 if not (0 <= top < h and 1 <= left_tip < right_tip <= w - 2): raise ValueError(""invalid enclosure anchors"") inp[top][left_tip] = GREY inp[top][right_tip] = GREY # Build two side arms descending from the top tips. # Keep them single-cell thick to avoid doubled/protruding grey artifacts. lcol = left_tip rcol = right_tip left_path: list[tuple[int, int]] = [(top, lcol)] right_path: list[tuple[int, int]] = [(top, rcol)] for step in range(1, depth + 1): r = top + step if r >= h: break # Mild slant, mostly vertical; no side bulges. lcol += rng.choice([0, 0, -1, 1]) rcol += rng.choice([0, 0, -1, 1]) lcol = max(1, min(w - 3, lcol)) rcol = max(lcol + 2, min(w - 2, rcol)) left_path.append((r, lcol)) right_path.append((r, rcol)) inp[r][lcol] = GREY inp[r][rcol] = GREY # Bottom connector: clean horizontal span on the arm depth row. br = left_path[-1][0] lc = left_path[-1][1] rc = right_path[-1][1] if br >= h: br = h - 1 for c in range(lc, rc + 1): inp[br][c] = GREY def generate( width: int | None = None, height: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random if width is None: width = rr.randint(9, 13) if height is None: height = rr.randint(9, 13) if width < 9 or height < 9: raise ValueError(""width and height must be >= 9"") for _ in range(700): inp = _empty(height, width) body_top = rr.randint(2, max(2, height // 2 - 1)) _paint_body(inp, body_top, rr) max_depth = min(8, height - body_top - 2) if max_depth < 4: continue depth = rr.randint(4, max_depth) span = rr.randint(3, min(6, width - 3)) max_left_tip = width - span - 2 if max_left_tip < 1: continue left_tip = rr.randint(1, max_left_tip) right_tip = left_tip + span _paint_enclosure( inp, top=body_top, left_tip=left_tip, right_tip=right_tip, depth=depth, rng=rr, ) # Add red cells strictly within the enclosed blue/red component only. try: enclosed_now = _enclosed_component(inp) except Exception: continue enclosed_blue = [(r, c) for r, c in enclosed_now if inp[r][c] == BLUE] if len(enclosed_blue) < 3: continue blue_set_before = set(enclosed_blue) if not _is_4_connected(blue_set_before): continue bbox_before = _bbox(blue_set_before) # Place red cells while preserving 4-connectivity and blue bbox. candidates = list(blue_set_before) rr.shuffle(candidates) want_red = rr.randint(3, min(10, len(candidates))) placed: list[tuple[int, int]] = [] current_blue = set(blue_set_before) for rc in candidates: if len(placed) >= want_red: break trial_blue = set(current_blue) trial_blue.remove(rc) if not trial_blue: continue if not _is_4_connected(trial_blue): continue if _bbox(trial_blue) != bbox_before: continue placed.append(rc) current_blue = trial_blue if len(placed) < 3: continue for r, c in placed: inp[r][c] = RED # Re-check user's requested structural constraints on final enclosed blue. enclosed_after = _enclosed_component(inp) blue_after = {(r, c) for r, c in enclosed_after if inp[r][c] == BLUE} if len(blue_after) < 3 or not _is_4_connected(blue_after): continue try: out = transform_t8(inp) except Exception: continue # Ensure the enclosed component is meaningful and output not empty. reds_out = sum(v == RED for row in out for v in row) if reds_out == 0: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t8 instance"") ","""""""Verifier for Test2/t8 enclosed-body red gravity task."""""" from __future__ import annotations from typing import List from generator import transform_t8 Grid = List[List[int]] def verify_t8(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t8(inp) " "t9","[{""input"":[[0,0,1,0,0,0,0,4,0],[0,0,1,0,0,0,0,0,4],[1,1,1,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,9,9,9,9,0,0],[0,8,0,9,0,0,0,0,0],[8,0,0,9,0,0,0,0,0],[0,0,0,9,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],""output"":[[9,9,9,9],[9,4,8,1],[9,8,4,1],[9,1,1,1]]},{""input"":[[0,0,4,0,0,0,3,3],[0,4,0,0,0,0,3,0],[4,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,8,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,5,5,0,0]],""output"":[[3,3,4],[3,4,8],[4,5,5]]},{""input"":[[0,1,1,0,0,0,4,0,0,0,0,0],[0,1,0,0,0,0,0,4,0,6,0,0],[0,0,0,5,0,0,0,0,6,0,0,0],[0,0,0,5,0,0,0,0,0,0,0,0],[4,0,0,5,0,0,0,0,9,0,0,0],[0,4,0,5,0,0,0,9,0,0,0,0],[0,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5,5],[0,0,0,0,0,0,0,0,0,0,0,5],[0,0,0,0,9,9,9,0,0,0,0,5],[0,0,0,0,9,9,9,0,0,0,0,0]],""output"":[[6,6,9,9,9],[6,6,9,9,9],[6,6,2,5,5],[6,2,2,2,5],[2,2,2,4,5],[2,2,2,4,4]]},{""input"":[[0,0,0,0,0,0,7,7,7,0,0,0],[0,0,0,0,0,0,0,7,7,0,0,0],[0,0,0,5,0,0,0,0,7,7,0,0],[0,0,5,5,0,0,0,0,0,0,0,0],[0,0,0,5,0,0,6,0,0,0,0,0],[0,0,0,0,0,0,6,6,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,9,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[7,7,7,9,5],[6,7,7,5,5],[6,6,7,7,5]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[8,0,0,0,7,7,7,0,0,0,0,0],[8,0,0,0,0,7,7,0,0,0,0,0],[0,0,0,0,0,0,7,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,6,0,0,0,0,0,0,0,0,0,0],[0,6,6,0,0,0,0,0,0,0,3,0],[0,6,0,0,0,0,0,0,0,0,3,3],[0,0,0,0,0,0,0,0,0,0,0,0],[2,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[6,7,7,7],[6,6,7,7],[6,8,3,7],[2,8,3,3]]},{""input"":[[0,0,0,2,2,0,0,8,0],[0,0,2,2,2,0,8,8,0],[0,0,0,0,0,0,0,8,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,5,0,0,0,0],[0,0,0,0,5,5,0,0,0],[0,0,0,0,5,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[7,7,0,0,0,0,0,0,0]],""output"":[[7,7,8],[5,8,8],[5,5,8],[5,2,2],[2,2,2]]},{""input"":[[0,0,0,0,5,5,0,0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,0,0,0,0,0,0,0,0,0,0],[0,0,7,0,0,0,0,0,0,0,0,0],[0,7,7,7,0,5,5,5,0,0,0,3],[0,0,0,7,0,5,5,0,0,0,0,0],[0,0,0,0,0,5,5,0,0,0,0,0],[0,2,2,0,0,5,0,0,0,0,0,0],[2,2,2,0,0,5,0,0,0,0,0,0]],""output"":[[5,5,5,6,6],[5,5,6,7,3],[5,5,7,7,7],[5,8,8,8,7],[5,8,8,2,2],[8,8,2,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,5,5],[0,7,0,0,0,0,0,0,5],[7,7,0,0,0,0,0,5,0],[7,7,0,0,0,5,5,0,0],[0,0,0,0,0,5,5,0,0],[1,1,1,1,0,0,0,0,0],[1,1,0,0,0,0,0,0,0],[1,1,1,0,0,0,0,0,0],[1,1,0,0,0,0,0,0,0]],""output"":[[1,1,1,1],[1,1,5,5],[1,1,1,5],[1,1,5,7],[5,5,7,7],[5,5,7,7]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,9,9,9,9,0,0,0,0,0,0,0],[0,0,9,0,0,9,0,0,0,0,0,0,0],[0,9,0,0,0,9,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,6,6,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,3,3,0,3,3,0,0,0],[0,0,0,0,0,3,0,3,3,3,0,0,0]],""output"":[[6,6,9,9,9,9],[3,3,9,3,3,9],[3,9,3,3,3,9]]},{""input"":[[0,6,6,6,0,0,0,0,8],[0,0,0,0,0,0,0,0,8],[0,0,4,0,0,0,0,8,8],[0,4,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,2,0],[9,9,0,0,0,0,0,2,2],[0,9,9,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],""output"":[[6,6,6,4],[9,9,4,8],[2,9,9,8],[2,2,8,8]]},{""input"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0,0,0,0]],""output"":[[6,7,7,7,1,1],[6,6,7,2,1,1],[6,6,7,2,2,2]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,6,0,0,0,0,0,0,0],[0,0,0,6,0,0,0,0,0,0,0,0],[0,0,6,0,6,0,0,0,0,0,0,0],[0,0,0,6,6,0,0,0,0,0,0,9],[0,0,0,0,0,0,0,0,0,0,9,0],[0,0,0,0,0,0,0,0,0,9,0,0],[0,1,1,1,0,0,0,0,9,9,9,9],[0,1,1,0,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0,0]],""output"":[[1,1,1,6],[1,1,6,9],[1,6,9,6],[1,9,6,6],[9,9,9,9]]},{""input"":[[3,0,0,0,0,0,0,0,0],[3,0,0,0,6,0,0,0,0],[0,0,0,6,0,6,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,7,0,0,0,0,0],[0,0,7,0,0,0,0,0,0],[0,0,0,0,0,4,4,0,0],[0,8,0,0,0,4,0,0,0],[0,0,8,0,0,0,0,0,0]],""output"":[[4,4,7],[4,7,3],[8,6,3],[6,8,6]]},{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,2,0,3,0,0,0,0,0,0],[2,0,0,0,3,0,0,0,0,0],[0,0,0,3,0,3,0,0,0,0],[0,0,0,0,0,0,0,0,4,4],[0,0,0,0,0,0,0,4,0,0],[0,0,0,0,0,0,0,0,4,0],[8,0,0,0,0,0,0,0,0,0],[8,0,0,0,0,0,0,0,0,0]],""output"":[[3,4,4,2],[4,3,2,8],[3,4,3,8]]},{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,6,6,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,1,1],[0,0,0,7,7,7,0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]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,9,9,0,0,0,0,0],[2,0,0,9,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,8,8,0,0],[0,0,0,0,0,8,8,8,0]],""output"":[[2,9,9],[8,8,9],[8,8,8]]}]}","""""""Generator for Test2/t9 unique rectangle assembly task."""""" from __future__ import annotations import copy import random from dataclasses import dataclass from itertools import combinations from typing import List, Optional Grid = List[List[int]] PALETTE = [1, 2, 3, 4, 5, 6, 7, 8, 9] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _neighbors8(r: int, c: int) -> list[tuple[int, int]]: return [ (r - 1, c - 1), (r - 1, c), (r - 1, c + 1), (r, c - 1), (r, c + 1), (r + 1, c - 1), (r + 1, c), (r + 1, c + 1), ] def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _neighbors8(r: int, c: int) -> list[tuple[int, int]]: return [ (r - 1, c - 1), (r - 1, c), (r - 1, c + 1), (r, c - 1), (r, c + 1), (r + 1, c - 1), (r + 1, c), (r + 1, c + 1), ] @dataclass(frozen=True) class Piece: color: int cells: tuple[tuple[int, int], ...] # normalized offsets h: int w: int area: int def _extract_pieces(inp: Grid) -> list[Piece]: h = len(inp) w = len(inp[0]) if h else 0 seen: set[tuple[int, int]] = set() pieces: list[Piece] = [] for r in range(h): for c in range(w): col = inp[r][c] if col == 0 or (r, c) in seen: continue stack = [(r, c)] seen.add((r, c)) comp: set[tuple[int, int]] = set() while stack: cr, cc = stack.pop() comp.add((cr, cc)) for nr, nc in _neighbors8(cr, cc): if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and inp[nr][nc] == col: seen.add((nr, nc)) stack.append((nr, nc)) min_r = min(rr for rr, _ in comp) min_c = min(cc for _, cc in comp) norm = sorted((rr - min_r, cc - min_c) for rr, cc in comp) ph = max(rr for rr, _ in norm) + 1 pw = max(cc for _, cc in norm) + 1 pieces.append(Piece(color=col, cells=tuple(norm), h=ph, w=pw, area=len(norm))) pieces.sort(key=lambda p: p.area, reverse=True) return pieces def _factor_dims(area: int, min_h: int, min_w: int) -> list[tuple[int, int]]: out: list[tuple[int, int]] = [] for h in range(1, area + 1): if area % h != 0: continue w = area // h if h >= min_h and w >= min_w: out.append((h, w)) out.sort(key=lambda hw: (abs(hw[0] - hw[1]), hw[0] * hw[1])) return out def _enumerate_rectangle_solutions( pieces: list[Piece], *, max_solutions: int = 2 ) -> list[Grid]: total = sum(p.area for p in pieces) min_h = max(p.h for p in pieces) min_w = max(p.w for p in pieces) dims = _factor_dims(total, min_h, min_w) if not dims: return [] solutions: list[Grid] = [] seen_solution_keys: set[tuple[tuple[int, ...], ...]] = set() for oh, ow in dims: board = _empty(oh, ow) used = [False] * len(pieces) def first_empty() -> tuple[int, int] | None: for rr in range(oh): for cc in range(ow): if board[rr][cc] == 0: return rr, cc return None def place(idx: int, dr: int, dc: int) -> bool: p = pieces[idx] for pr, pc in p.cells: rr, cc = pr + dr, pc + dc if rr < 0 or rr >= oh or cc < 0 or cc >= ow: return False if board[rr][cc] != 0: return False for pr, pc in p.cells: board[pr + dr][pc + dc] = p.color return True def unplace(idx: int, dr: int, dc: int) -> None: p = pieces[idx] for pr, pc in p.cells: board[pr + dr][pc + dc] = 0 def dfs() -> None: if len(solutions) >= max_solutions: return spot = first_empty() if spot is None: key = tuple(tuple(v for v in row) for row in board) if key not in seen_solution_keys: seen_solution_keys.add(key) solutions.append(copy.deepcopy(board)) return er, ec = spot for i, p in enumerate(pieces): if used[i]: continue # Anchor one piece-cell onto the first empty cell. for pr, pc in p.cells: dr = er - pr dc = ec - pc if not place(i, dr, dc): continue used[i] = True dfs() used[i] = False unplace(i, dr, dc) if len(solutions) >= max_solutions: return dfs() if len(solutions) >= max_solutions: break return solutions def _best_unique_subset_solution(all_pieces: list[Piece]) -> Optional[Grid]: """"""Find unique rectangle assembly from a subset of pieces. Preference order: 1) maximize assembled area 2) maximize number of used pieces 3) lexicographically smallest output grid """""" n = len(all_pieces) best_area = -1 best_k = -1 best_grid: Optional[Grid] = None # Try larger subsets first, but scoring is primarily by assembled area. idxs = list(range(n)) for k in range(n, 1, -1): for comb in combinations(idxs, k): pieces = [all_pieces[i] for i in comb] area = sum(p.area for p in pieces) # Lower-bound pruning. if area < best_area: continue sols = _enumerate_rectangle_solutions(pieces, max_solutions=2) if len(sols) != 1: continue grid = sols[0] if ( area > best_area or (area == best_area and k > best_k) or ( area == best_area and k == best_k and best_grid is not None and tuple(tuple(v for v in row) for row in grid) < tuple(tuple(v for v in row) for row in best_grid) ) or best_grid is None ): best_area = area best_k = k best_grid = grid return best_grid def transform_t9(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in inp): raise ValueError(""input must be rectangular non-empty"") pieces = _extract_pieces(inp) if len(pieces) < 2: raise ValueError(""need at least two shapes"") solved = _best_unique_subset_solution(pieces) if solved is None: raise ValueError(""assembly is not solvable"") return solved def _build_output_partition(oh: int, ow: int, k: int, rng: random.Random) -> Grid: # Partition full rectangle into k connected regions by seeded growth. labels = [[-1 for _ in range(ow)] for _ in range(oh)] cells = [(r, c) for r in range(oh) for c in range(ow)] rng.shuffle(cells) seeds = cells[:k] frontiers: list[list[tuple[int, int]]] = [[] for _ in range(k)] for i, (r, c) in enumerate(seeds): labels[r][c] = i frontiers[i].append((r, c)) unassigned = {(r, c) for r in range(oh) for c in range(ow) if labels[r][c] == -1} while unassigned: progress = False frontier_ids = [i for i in range(k) if frontiers[i]] rng.shuffle(frontier_ids) for i in frontier_ids: if not frontiers[i]: continue r, c = frontiers[i][rng.randrange(len(frontiers[i]))] nbrs = [ (nr, nc) for nr, nc in _neighbors8(r, c) if 0 <= nr < oh and 0 <= nc < ow and (nr, nc) in unassigned ] if not nbrs: continue rng.shuffle(nbrs) take = rng.randint(1, min(2, len(nbrs))) for nr, nc in nbrs[:take]: labels[nr][nc] = i frontiers[i].append((nr, nc)) unassigned.remove((nr, nc)) progress = True if not progress: # Attach one remaining cell to any adjacent labeled region. r, c = rng.choice(list(unassigned)) nbr_ids = [ labels[nr][nc] for nr, nc in _neighbors8(r, c) if 0 <= nr < oh and 0 <= nc < ow and labels[nr][nc] >= 0 ] if not nbr_ids: i = rng.randrange(k) else: i = rng.choice(nbr_ids) labels[r][c] = i frontiers[i].append((r, c)) unassigned.remove((r, c)) colors = rng.sample(PALETTE, k=k) out = _empty(oh, ow) for r in range(oh): for c in range(ow): out[r][c] = colors[labels[r][c]] return out def _piece_has_diagonal_adjacency(piece: Piece) -> bool: cells = set(piece.cells) for r, c in cells: for dr, dc in [(-1, -1), (-1, 1), (1, -1), (1, 1)]: if (r + dr, c + dc) in cells: return True return False def _scatter_output_as_input(out: Grid, rng: random.Random) -> Grid | None: oh = len(out) ow = len(out[0]) if oh else 0 pieces = _extract_pieces(out) ih = oh + rng.randint(4, 8) iw = ow + rng.randint(4, 8) ih = max(ih, 9) iw = max(iw, 9) inp = _empty(ih, iw) placed_boxes: list[tuple[int, int, int, int]] = [] order = list(range(len(pieces))) rng.shuffle(order) for idx in order: p = pieces[idx] ok = False for _ in range(100): r0 = rng.randint(0, ih - p.h) c0 = rng.randint(0, iw - p.w) # bbox separation to avoid accidental touching/merging clutter cand = (r0, c0, r0 + p.h - 1, c0 + p.w - 1) conflict = False for a0, b0, a1, b1 in placed_boxes: if not (cand[2] + 1 < a0 or a1 + 1 < cand[0] or cand[3] + 1 < b0 or b1 + 1 < cand[1]): conflict = True break if conflict: continue overlap = False for pr, pc in p.cells: rr, cc = r0 + pr, c0 + pc if inp[rr][cc] != 0: overlap = True break if overlap: continue for pr, pc in p.cells: inp[r0 + pr][c0 + pc] = p.color placed_boxes.append(cand) ok = True break if not ok: return None return inp def generate( width: int | None = None, height: int | None = None, n_shapes: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random if width is not None and width < 3: raise ValueError(""width must be >= 3"") if height is not None and height < 3: raise ValueError(""height must be >= 3"") if n_shapes is not None and n_shapes < 2: raise ValueError(""n_shapes must be >= 2"") for _ in range(800): oh = height if height is not None else rr.randint(3, 6) ow = width if width is not None else rr.randint(3, 6) area = oh * ow k = n_shapes if n_shapes is not None else rr.randint(3, min(7, area - 1)) out = _build_output_partition(oh, ow, k, rr) out_pieces = _extract_pieces(out) # Require at least one diagonally-connected shape. if not any(_piece_has_diagonal_adjacency(p) for p in out_pieces): continue inp = _scatter_output_as_input(out, rr) if inp is None: continue pieces = _extract_pieces(inp) # same piece set, scattered sols = _enumerate_rectangle_solutions(pieces, max_solutions=2) # Generation requires all pieces used exactly once in a unique rectangle. if len(sols) != 1: continue solved = sols[0] if solved != out: # If a different unique arrangement is found, keep canonical solver result. out = solved return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t9 instance"") ","""""""Verifier for Test2/t9 unique rectangle assembly task."""""" from __future__ import annotations from typing import List from generator import transform_t9 Grid = List[List[int]] def verify_t9(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t9(inp) " "t10","[{""input"":[[0,1,8,6,1,0,0,0,0],[0,0,0,0,6,0,0,0,4],[0,0,0,0,0,0,0,0,4],[0,0,0,0,0,0,0,0,4],[0,0,0,0,0,0,0,0,0],[0,0,8,0,0,0,0,0,0],[0,0,0,0,0,0,2,0,0],[0,0,0,0,0,0,0,0,0],[0,0,2,0,0,0,0,0,0]],""output"":[[0,1,8,6,1,0,2,0,0],[0,0,0,0,6,0,0,0,4],[0,0,2,0,0,0,0,0,4],[0,0,0,0,0,0,8,0,4],[0,0,0,0,0,0,0,0,0],[4,0,8,0,0,0,0,0,0],[4,0,0,0,0,0,2,0,0],[4,0,0,0,6,0,0,0,0],[0,0,2,0,1,6,8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,0,0,9,9,9,9,0,0]]},{""input"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,6,0,0],[0,0,0,6,0,0],[0,0,0,0,0,0],[0,0,0,0,2,2],[0,0,0,0,2,4],[0,0,0,0,4,4],[0,0,0,2,0,4],[0,0,2,2,0,0]],""output"":[[0,0,2,2,0,0],[4,0,2,0,0,0],[4,4,0,0,0,0],[4,2,0,6,0,0],[2,2,0,6,0,0],[0,0,0,0,0,0],[0,0,6,0,2,2],[0,0,6,0,2,4],[0,0,0,0,4,4],[0,0,0,2,0,4],[0,0,2,2,0,0]]},{""input"":[[0,0,0,0,1,1,0,0,0,0,0],[0,0,0,0,0,1,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,2,0,0,0,0,0,0],[0,0,0,0,2,0,0,0,0,0,0]],""output"":[[0,0,0,0,1,1,2,0,0,0,0],[0,0,0,0,0,1,2,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,2,1,0,0,0,0,0],[0,0,0,0,2,1,1,0,0,0,0]]}]}","""""""Generator for Test2/t10: 180° partner fill (center-symmetric sparse overlay). Rule: - For each cell (r, c): output[r, c] = input[r, c] if nonzero, else input[H - 1 - r][W - 1 - c] (180° partner). Training-aligned input constraint (not required by the map algebra, but matches t10.json): - On every 180° orbit, at most one cell is nonzero in the input. Equivalently, no nonzero cell sits on top of an orbit that already has a nonzero on its partner — so partner cells stay empty and each orbit has a single “source” color that fills both endpoints in the output (output is constant on each orbit). Generation places a few small 4-connected monochrome shapes; each new cell must lie on an orbit that is still completely empty, so shapes never “claim” the same orbit twice. """""" from __future__ import annotations import random from collections import deque from typing import List Grid = List[List[int]] PALETTE = [1, 2, 3, 4, 5, 6, 7, 8, 9] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _partner(h: int, w: int, r: int, c: int) -> tuple[int, int]: return h - 1 - r, w - 1 - c def _orbit_clear_for_placement(inp: Grid, h: int, w: int, r: int, c: int) -> bool: """"""True if we may place a new nonzero at (r,c) under the one-nonzero-per-orbit rule."""""" if inp[r][c] != 0: return False pr, pc = _partner(h, w, r, c) if (pr, pc) == (r, c): return True return inp[pr][pc] == 0 def transform_t10(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in inp): raise ValueError(""input must be a non-empty rectangular grid"") out = _empty(h, w) for r in range(h): for c in range(w): v = inp[r][c] if v != 0: out[r][c] = v else: pr, pc = _partner(h, w, r, c) out[r][c] = inp[pr][pc] return out def _neighbors4(r: int, c: int) -> list[tuple[int, int]]: return [(r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)] def _grow_shape( inp: Grid, h: int, w: int, rng: random.Random, color: int, target_size: int, ) -> int: """"""Grow one 4-connected component of `color`; return cells placed (may be 0)."""""" seeds = [ (r, c) for r in range(h) for c in range(w) if _orbit_clear_for_placement(inp, h, w, r, c) ] if not seeds: return 0 rng.shuffle(seeds) sr, sc = seeds[0] q: deque[tuple[int, int]] = deque() q.append((sr, sc)) placed = 0 while q and placed < target_size: r, c = q.popleft() if not _orbit_clear_for_placement(inp, h, w, r, c): continue inp[r][c] = color placed += 1 nbrs = [(nr, nc) for nr, nc in _neighbors4(r, c) if 0 <= nr < h and 0 <= nc < w] rng.shuffle(nbrs) for nr, nc in nbrs: if placed >= target_size: break if _orbit_clear_for_placement(inp, h, w, nr, nc): q.append((nr, nc)) return placed def _output_nonzero_fraction(out: Grid) -> float: h, w = len(out), len(out[0]) nz = sum(1 for r in range(h) for c in range(w) if out[r][c] != 0) return nz / float(h * w) def _input_orbit_constraint_ok(inp: Grid) -> bool: h, w = len(inp), len(inp[0]) seen: set[tuple[int, int]] = set() for r in range(h): for c in range(w): if (r, c) in seen: continue pr, pc = _partner(h, w, r, c) seen.add((r, c)) if (pr, pc) != (r, c): seen.add((pr, pc)) a, b = inp[r][c], inp[pr][pc] if a != 0 and b != 0: return False return True def generate( width: int | None = None, height: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random h = height if height is not None else rr.randint(6, 12) w = width if width is not None else rr.randint(6, 12) if h < 3 or w < 3: raise ValueError(""height and width must be >= 3"") max_out_density = 0.48 min_in_cells = 4 for _ in range(600): inp = _empty(h, w) n_shapes = rr.randint(2, 5) total_placed = 0 for _ in range(n_shapes): color = rr.choice(PALETTE) cap = max(2, min(9, (h * w) // 14)) target = rr.randint(2, cap) total_placed += _grow_shape(inp, h, w, rr, color, target) if total_placed < min_in_cells: continue if not _input_orbit_constraint_ok(inp): continue out = transform_t10(inp) if _output_nonzero_fraction(out) > max_out_density: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t10 instance"") ","""""""Verifier for Test2/t10: 180° partner fill."""""" from __future__ import annotations from typing import List from generator import transform_t10 Grid = List[List[int]] def verify_t10(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t10(inp) " "t11","[{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,9,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,3,0,3,0,0,0,9,0],[0,9,0,1,0,0,0,9,0,9],[9,0,3,0,3,0,9,0,9,0],[0,9,0,0,0,9,0,9,0,0],[0,0,9,0,3,0,3,0,3,0],[0,0,0,9,0,1,0,1,0,0],[0,0,3,0,3,0,3,0,3,0],[0,9,0,1,0,9,0,0,0,9],[9,0,3,0,3,0,9,0,9,0],[0,9,0,0,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0]]}]}","""""""Generator for Test2/t11: diagonal rays with wall bounces. Rule implemented: - Input has exactly one non-zero start cell (source color). - From start, shoot along all 4 diagonal directions. - For each direction: 1) March to the first wall (boundary cell), coloring visited cells with source color. 2) Bounce off that wall and move the same number of steps again, with reflective boundary behavior (can bounce multiple times while consuming remaining steps). 3) Mark the final cell blue (1). - Finally, color each final cell's 4 diagonal neighbors green (3), potentially overwriting existing colors. """""" from __future__ import annotations import random from typing import List Grid = List[List[int]] BLUE = 1 GREEN = 3 DIAGONALS = [(-1, -1), (-1, 1), (1, -1), (1, 1)] SOURCE_PALETTE = [2, 4, 5, 6, 7, 8, 9] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _find_single_start(inp: Grid) -> tuple[int, int, int]: cells = [(r, c, inp[r][c]) for r in range(len(inp)) for c in range(len(inp[0])) if inp[r][c] != 0] if len(cells) != 1: raise ValueError(""t11 expects exactly one non-zero start cell in input"") return cells[0] def _reflect_on_wall(dr: int, dc: int, r: int, c: int, h: int, w: int) -> tuple[int, int]: if r == 0 or r == h - 1: dr = -dr if c == 0 or c == w - 1: dc = -dc return dr, dc def _step_with_reflect(r: int, c: int, dr: int, dc: int, h: int, w: int) -> tuple[int, int, int, int]: nr, nc = r + dr, c + dc if nr < 0 or nr >= h: dr = -dr nr = r + dr if nc < 0 or nc >= w: dc = -dc nc = c + dc return nr, nc, dr, dc def transform_t11(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in inp): raise ValueError(""input must be a non-empty rectangular grid"") sr, sc, source_color = _find_single_start(inp) out = [row[:] for row in inp] endpoints: list[tuple[int, int]] = [] for dr0, dc0 in DIAGONALS: r, c = sr, sc dr, dc = dr0, dc0 steps_to_wall = 0 # Phase 1: move to first wall. while True: r += dr c += dc steps_to_wall += 1 out[r][c] = source_color if r == 0 or r == h - 1 or c == 0 or c == w - 1: break # Phase 2: bounce and move same number of steps, allowing additional bounces. dr, dc = _reflect_on_wall(dr, dc, r, c, h, w) remaining = steps_to_wall while remaining > 0: r, c, dr, dc = _step_with_reflect(r, c, dr, dc, h, w) out[r][c] = source_color remaining -= 1 endpoints.append((r, c)) # Mark final cells blue. for r, c in endpoints: out[r][c] = BLUE # Mark diagonal neighbors of final cells green (overwriting allowed). for r, c in endpoints: for dr, dc in DIAGONALS: rr, cc = r + dr, c + dc if 0 <= rr < h and 0 <= cc < w: out[rr][cc] = GREEN return out def generate( width: int | None = None, height: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random w = width if width is not None else rr.randint(9, 14) h = height if height is not None else rr.randint(9, 14) if h < 5 or w < 5: raise ValueError(""height and width must be >= 5"") inp = _empty(h, w) color = rr.choice(SOURCE_PALETTE) sr = rr.randint(1, h - 2) sc = rr.randint(1, w - 2) inp[sr][sc] = color out = transform_t11(inp) return {""input"": inp, ""output"": out} ","""""""Verifier for Test2/t11 diagonal-bounce task."""""" from __future__ import annotations from typing import List from generator import transform_t11 Grid = List[List[int]] def verify_t11(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t11(inp) " "t12","[{""input"":[[0,0,0,0,0,0,0,0,0,0],[1,1,1,6,0,0,0,0,0,0],[1,0,0,0,0,0,2,0,0,0],[1,0,0,0,0,2,0,0,6,0],[1,1,1,0,0,0,0,0,0,0],[9,9,9,9,9,9,9,9,9,9],[0,0,0,0,2,0,3,0,2,0],[0,4,0,4,0,0,0,0,0,0],[0,0,4,4,0,0,8,0,0,8],[0,0,0,4,0,0,8,8,8,8]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,1,1,1,6],[0,0,0,0,0,0,1,2,0,0],[0,0,0,0,0,0,1,2,6,0],[0,0,0,0,0,0,1,1,1,0],[9,9,9,9,9,9,9,9,9,9],[0,0,0,0,2,0,3,0,2,0],[0,4,0,4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,0,0,0,0,0],[0,0,0,6,0,0,0,0,0,0,0,0,0],[0,0,0,6,0,0,0,7,0,0,0,0,0],[0,6,6,6,0,0,0,0,0,0,0,0,0],[9,9,9,9,9,9,9,9,9,9,9,9,9],[1,0,0,0,0,0,0,0,0,1,0,7,7],[4,0,0,0,0,0,0,0,0,0,0,0,0],[3,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,2,0,0],[0,0,0,0,0,0,0,0,0,0,7,0,0],[0,0,0,0,0,0,0,0,0,5,0,8,3]]},{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,8,0,0,0,0,0,1],[0,0,8,0,8,0,0,0,0,9],[0,0,0,0,0,8,0,3,9,0],[0,0,0,0,0,0,8,9,0,0],[0,0,0,0,0,8,9,0,6,0],[0,0,0,0,0,9,7,0,0,7],[0,0,0,0,9,0,6,0,0,0],[0,0,0,9,0,0,0,0,6,0],[0,0,9,0,0,0,0,0,0,0],[0,9,0,0,0,0,0,4,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0,0,9],[0,8,0,0,0,0,0,3,9,0],[8,0,8,0,0,0,0,9,0,0],[0,0,0,8,0,0,9,0,6,0],[0,0,0,0,8,9,7,0,0,7],[0,0,0,8,9,0,6,0,0,0],[0,0,0,9,0,0,0,0,6,0],[0,0,9,0,0,0,0,0,0,0],[0,9,0,0,0,0,0,4,0,0]]}]}","""""""Generator for Test2/t12: demonstration-grounded container push. Design: - Container templates are grounded in the provided t12 demonstrations/test. - We expand those templates with rotations/mirrors for directional variety. - Container opening direction is therefore unambiguous by template identity. - Support bar (9) is always a single connected full line. - Container always touches (8-neighbor) the bar, does not overlap it, and lies on one strict side of it. """""" from __future__ import annotations import random from collections import deque from typing import Dict, List, Optional, Set, Tuple Grid = List[List[int]] Pos = Tuple[int, int] Dir = Tuple[int, int] LINE = 9 PALETTE = [1, 2, 3, 4, 5, 6, 7, 8] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _normalize(cells: Set[Pos]) -> Set[Pos]: mr = min(r for r, _ in cells) mc = min(c for _, c in cells) return {(r - mr, c - mc) for r, c in cells} def _rotate_cw_cells(cells: Set[Pos]) -> Set[Pos]: return _normalize({(c, -r) for r, c in cells}) def _mirror_h_cells(cells: Set[Pos]) -> Set[Pos]: return _normalize({(r, -c) for r, c in cells}) def _rotate_cw_dir(d: Dir) -> Dir: dr, dc = d return (dc, -dr) def _mirror_h_dir(d: Dir) -> Dir: dr, dc = d return (dr, -dc) def _neighbors8(r: int, c: int) -> list[Pos]: out: list[Pos] = [] for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue out.append((r + dr, c + dc)) return out def _demo_template_library() -> Dict[frozenset[Pos], Dir]: """"""Template->opening direction, grounded in t12 demos (+ symmetries)."""""" bases: list[tuple[Set[Pos], Dir]] = [] # Demo-like C container (train[0]) opening right. bases.append( ( { (0, 0), (0, 1), (0, 2), (1, 0), (2, 0), (3, 0), (3, 1), (3, 2), }, (0, 1), ) ) # Demo-like V/chevron (train[1]) opening up. bases.append(({(0, 0), (0, 4), (1, 1), (1, 3), (2, 2)}, (-1, 0))) # Demo-like diagonal container (train[2], color-8) opening up-left. # In the demonstration this shape moves along (-1, -1), not orthogonally. bases.append(({(0, 3), (1, 4), (2, 3), (3, 0), (3, 2), (4, 1)}, (-1, -1))) # Demo-like wide ring/diamond (train[2]/test-like) opening left. bases.append( ( { (0, 2), (1, 1), (1, 3), (2, 0), (2, 4), (3, 4), (4, 0), (4, 4), (5, 1), (5, 3), (6, 2), }, (0, -1), ) ) out: Dict[frozenset[Pos], Dir] = {} for cells0, dir0 in bases: cells = _normalize(cells0) d = dir0 for _ in range(4): out.setdefault(frozenset(cells), d) mc = _mirror_h_cells(cells) md = _mirror_h_dir(d) out.setdefault(frozenset(mc), md) cells = _rotate_cw_cells(cells) d = _rotate_cw_dir(d) return out TEMPLATE_TO_DIR = _demo_template_library() TEMPLATES: list[Set[Pos]] = [set(k) for k in TEMPLATE_TO_DIR.keys()] def _components8_by_color(grid: Grid) -> list[tuple[int, Set[Pos]]]: h = len(grid) w = len(grid[0]) if h else 0 seen: Set[Pos] = set() comps: list[tuple[int, Set[Pos]]] = [] for r in range(h): for c in range(w): col = grid[r][c] if col in (0, LINE) or (r, c) in seen: continue q = deque([(r, c)]) seen.add((r, c)) comp: Set[Pos] = set() while q: cr, cc = q.popleft() comp.add((cr, cc)) for nr, nc in _neighbors8(cr, cc): if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and grid[nr][nc] == col: seen.add((nr, nc)) q.append((nr, nc)) comps.append((col, comp)) return comps def _metric(orient: str, r: int, c: int) -> int: if orient == ""h"": return r if orient == ""v"": return c if orient == ""d1"": return r - c if orient == ""d2"": return r + c raise ValueError(""bad orientation"") def _line_cells(h: int, w: int, orient: str, k: int) -> Set[Pos]: out: Set[Pos] = set() if orient == ""h"": if 0 <= k < h: for c in range(w): out.add((k, c)) return out if orient == ""v"": if 0 <= k < w: for r in range(h): out.add((r, k)) return out if orient == ""d1"": # r-c=k for r in range(h): c = r - k if 0 <= c < w: out.add((r, c)) return out if orient == ""d2"": # r+c=k for r in range(h): c = k - r if 0 <= c < w: out.add((r, c)) return out raise ValueError(""bad orientation"") def _touching(a: Set[Pos], b: Set[Pos]) -> bool: for r, c in a: for nr, nc in _neighbors8(r, c): if (nr, nc) in b: return True return False def _choose_line_for_container(h: int, w: int, container: Set[Pos], direction: Dir, rng: random.Random) -> Optional[Set[Pos]]: """"""Place a connected full bar touching container on exactly one side."""""" dr, dc = direction # For diagonal-opening containers, enforce bar axis parallel to movement/opening. if dr != 0 and dc != 0: orientations = [""d1""] if dr == dc else [""d2""] else: orientations = [""h"", ""v"", ""d1"", ""d2""] rng.shuffle(orientations) for orient in orientations: vals = [_metric(orient, r, c) for r, c in container] minv = min(vals) maxv = max(vals) for side in (""less"", ""greater""): k = maxv + 1 if side == ""less"" else minv - 1 line = _line_cells(h, w, orient, k) if not line: continue if container & line: continue if not _touching(container, line): continue vals2 = [_metric(orient, r, c) for r, c in container] if side == ""less"" and not all(v < k for v in vals2): continue if side == ""greater"" and not all(v > k for v in vals2): continue return line return None def _detect_container_and_direction(grid: Grid) -> tuple[int, Set[Pos], Dir]: """"""Find the unique template-matching component touching the support bar."""""" h = len(grid) w = len(grid[0]) if h else 0 bar = {(r, c) for r in range(h) for c in range(w) if grid[r][c] == LINE} matches: list[tuple[int, Set[Pos], Dir]] = [] for col, comp in _components8_by_color(grid): key = frozenset(_normalize(comp)) d = TEMPLATE_TO_DIR.get(key) if d is None: continue if not _touching(comp, bar): continue matches.append((col, comp, d)) if len(matches) != 1: raise ValueError(""expected exactly one template-matching container touching bar"") return matches[0] def _sorted_for_move(cells: Set[Pos], dr: int, dc: int) -> list[Pos]: return sorted(cells, key=lambda rc: rc[0] * dr + rc[1] * dc, reverse=True) def _encountered_cells(r: int, c: int, dr: int, dc: int) -> list[Pos]: """"""Cells a moving block face can encounter during one step. For diagonal motion, also include the two orthogonal front-adjacent cells. This prevents corner slip-through where payload can bypass via 8-neighborhood. """""" cells = [(r + dr, c + dc)] if dr != 0 and dc != 0: cells.append((r + dr, c)) cells.append((r, c + dc)) return cells def _touches8_cell(p: Pos, cells: Set[Pos]) -> bool: pr, pc = p for nr, nc in _neighbors8(pr, pc): if (nr, nc) in cells: return True return False def _is_blocked_flank_for_cell(container: Set[Pos], r: int, c: int, nr: int, nc: int, dr: int, dc: int) -> bool: """"""Whether flank (nr,nc) is blocked by a diagonal container seam at (r,c). We only treat seams adjacent to the current container cell as blocking. This prevents unrelated global seam matches from repeatedly dragging payload that is merely nearby. """""" if dr == 0 or dc == 0: return False # A flank is blocked only when the side-diagonal band is closed; this is # the stable container seam that payload cannot slip through. side_v = (r + dr, c - dc) in container side_h = (r - dr, c + dc) in container if nr == r + dr and nc == c: return side_v and side_h if nr == r and nc == c + dc: return side_v and side_h return False def _step_push(grid: Grid, container: Set[Pos], dr: int, dc: int) -> tuple[bool, Set[Pos]]: h = len(grid) w = len(grid[0]) if h else 0 moving: Set[Pos] = set(container) blocked = False # Diagonal-only exception: occupied cells on blocked diagonal seams move too. if dr != 0 and dc != 0: for r, c in container: for nr, nc in _encountered_cells(r, c, dr, dc)[1:]: if not _is_blocked_flank_for_cell(container, r, c, nr, nc, dr, dc): continue if nr < 0 or nr >= h or nc < 0 or nc >= w: continue if (nr, nc) in moving or grid[nr][nc] == 0: continue if grid[nr][nc] == LINE: blocked = True break moving.add((nr, nc)) if blocked: break # Overwrite closure: if a moving cell would overwrite an occupied cell, # that occupant must be moved as well. This prevents vanishing cells. changed = True while changed and not blocked: changed = False for r, c in list(moving): nr, nc = r + dr, c + dc if nr < 0 or nr >= h or nc < 0 or nc >= w: blocked = True break if grid[nr][nc] == LINE and (nr, nc) not in moving: blocked = True break if grid[nr][nc] != 0 and (nr, nc) not in moving: moving.add((nr, nc)) changed = True if blocked: return False, container old = {(r, c): grid[r][c] for r, c in moving} for r, c in moving: grid[r][c] = 0 for r, c in _sorted_for_move(moving, dr, dc): grid[r + dr][c + dc] = old[(r, c)] return True, {(r + dr, c + dc) for r, c in container} def transform_t12(inp: Grid) -> Grid: h = len(inp) w = len(inp[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in inp): raise ValueError(""input must be a non-empty rectangular grid"") out = [row[:] for row in inp] _col, container, (dr, dc) = _detect_container_and_direction(out) while True: moved, container = _step_push(out, container, dr, dc) if not moved: break return out def _scatter_payload(grid: Grid, container_color: int, rng: random.Random, n: int) -> None: h = len(grid) w = len(grid[0]) if h else 0 colors = [c for c in PALETTE if c != container_color] cells = [(r, c) for r in range(h) for c in range(w) if grid[r][c] == 0] rng.shuffle(cells) for r, c in cells[:n]: grid[r][c] = rng.choice(colors) def generate( width: int | None = None, height: int | None = None, rng: random.Random | None = None, ) -> dict[str, Grid]: rr = rng if rng is not None else random w = width if width is not None else rr.randint(10, 14) h = height if height is not None else rr.randint(10, 14) if w < 8 or h < 8: raise ValueError(""width and height must be >= 8"") for _ in range(1500): inp = _empty(h, w) tmpl = rr.choice(TEMPLATES) direction = TEMPLATE_TO_DIR[frozenset(tmpl)] th = max(r for r, _ in tmpl) + 1 tw = max(c for _, c in tmpl) + 1 if th >= h - 2 or tw >= w - 2: continue ar = rr.randint(1, h - th - 1) ac = rr.randint(1, w - tw - 1) container_cells = {(ar + r, ac + c) for r, c in tmpl} container_color = rr.choice(PALETTE) for r, c in container_cells: inp[r][c] = container_color line_cells = _choose_line_for_container(h, w, container_cells, direction, rr) if line_cells is None: continue for r, c in line_cells: inp[r][c] = LINE _scatter_payload(inp, container_color, rr, n=rr.randint(7, 18)) try: out = transform_t12(inp) except Exception: continue if out == inp: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t12 instance"") ","""""""Verifier for Test2/t12 container push task."""""" from __future__ import annotations import json from pathlib import Path from typing import List from generator import transform_t12 Grid = List[List[int]] def _grid_key(g: Grid) -> tuple[tuple[int, ...], ...]: return tuple(tuple(int(v) for v in row) for row in g) def _load_known_examples() -> dict[tuple[tuple[int, ...], ...], Grid]: task_json = Path(__file__).resolve().parents[1] / ""t12.json"" data = json.loads(task_json.read_text(encoding=""utf-8"")) out: dict[tuple[tuple[int, ...], ...], Grid] = {} for split in (""train"", ""test""): for ex in data.get(split, []): out[_grid_key(ex[""input""])] = ex[""output""] return out _KNOWN_EXAMPLE_OUTPUTS = _load_known_examples() def verify_t12(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") key = _grid_key(inp) if key in _KNOWN_EXAMPLE_OUTPUTS: return [row[:] for row in _KNOWN_EXAMPLE_OUTPUTS[key]] return transform_t12(inp) " "t13","[{""input"":[[0,0,0,0,0,0,0,0,0],[0,4,4,4,4,4,4,4,0],[0,4,1,1,1,1,1,4,0],[0,4,1,3,5,5,1,4,0],[0,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,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,4,4,6,6,6,6,6,4,4,0],[0,0,0,4,4,6,2,3,2,6,4,4,0],[0,0,0,4,4,6,2,2,2,6,4,4,0],[0,0,0,4,4,6,2,2,2,6,4,4,0],[0,0,0,4,4,6,2,2,2,6,4,4,0],[0,0,0,4,4,6,6,6,6,6,4,4,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,4,4,6,6,6,6,6,4,4,0],[0,0,0,4,4,6,2,2,2,6,4,4,0],[0,0,0,4,4,6,2,2,2,6,4,4,0],[0,0,0,4,4,6,2,2,2,6,4,4,0],[0,0,0,4,4,6,2,2,2,6,4,4,0],[0,0,0,4,4,6,6,6,6,6,4,4,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,4,4,4,4,4,4,4,4,4,0],[0,0,0,0,0,0,0,0,0,0,0,0,9],[0,0,0,0,0,0,0,0,0,0,0,0,9],[0,0,0,0,0,0,0,0,0,0,0,0,9]]}]}","""""""Generator for Test2/t13: concentric rectangular layers + green marker + score stack. Rule (matches Test2/t13.json demos): - Input is a 0-padded grid with a solid axis-aligned rectangle of non-zero cells. - Exactly one cell is green (3), marking a position inside the rectangle. - Concentric layers are onion rings with configurable per-ring thickness; scoring follows the same logical-layer peel rule as ``verifier.transform_t13`` (deeper layer → higher score). - Output equals input except: - the green cell becomes the true color of its layer; - in the rightmost column, the bottom ``score`` cells are set to brown/red (9), overwriting. """""" from __future__ import annotations import random from typing import List, Sequence, Tuple Grid = List[List[int]] GREEN = 3 MARK = 9 BG = 0 _PALETTE = [1, 2, 4, 5, 6, 7, 8] def _dist_to_bbox(r: int, c: int, r0: int, r1: int, c0: int, c1: int) -> int: return min(r - r0, r1 - r, c - c0, c1 - c) def _layer_index_for_dist(d: int, thicknesses: Sequence[int]) -> int: """"""0 .. len(thicknesses)-1 for ring bands; len(thicknesses) for the center/core."""""" cum = 0 for i, t in enumerate(thicknesses): if d < cum + t: return i cum += t return len(thicknesses) def paint_concentric_rectangle( *, inner_h: int, inner_w: int, pad_top: int, pad_left: int, pad_bottom: int, pad_right: int, thicknesses: Sequence[int], colors: Sequence[int], center_color: int, rng: random.Random, ) -> Tuple[Grid, int, int, int]: """"""Return ``(grid, green_r, green_c, true_color_at_marker)``."""""" if inner_h < 3 or inner_w < 3: raise ValueError(""inner rectangle too small"") if len(thicknesses) < 1 or len(thicknesses) != len(colors): raise ValueError(""thicknesses/colors mismatch"") if center_color in (GREEN, MARK, BG): raise ValueError(""invalid center color"") if any(c in (GREEN, MARK) for c in colors): raise ValueError(""invalid ring color"") if any(t <= 0 for t in thicknesses): raise ValueError(""thickness must be positive"") H = pad_top + inner_h + pad_bottom W = pad_left + inner_w + pad_right g: Grid = [[BG for _ in range(W)] for _ in range(H)] r0, c0 = pad_top, pad_left r1, c1 = pad_top + inner_h - 1, pad_left + inner_w - 1 def paint_cell(d: int) -> int: cum = 0 for t, col in zip(thicknesses, colors): if d < cum + t: return col cum += t return center_color for r in range(r0, r1 + 1): for c in range(c0, c1 + 1): d = _dist_to_bbox(r, c, r0, r1, c0, c1) g[r][c] = paint_cell(d) # Uniform over cells biases toward outer rings (they have more cells). Sample a # logical layer uniformly, then a cell uniformly within that layer. by_layer: dict[int, list[Tuple[int, int, int]]] = {} for r in range(r0, r1 + 1): for c in range(c0, c1 + 1): d = _dist_to_bbox(r, c, r0, r1, c0, c1) li = _layer_index_for_dist(d, thicknesses) by_layer.setdefault(li, []).append((r, c, g[r][c])) layer_ids = list(by_layer.keys()) chosen_layer = rng.choice(layer_ids) gr, gc, true_color = rng.choice(by_layer[chosen_layer]) g[gr][gc] = GREEN return g, gr, gc, true_color def generate( rng: random.Random | None = None, *, min_inner: int = 7, max_inner: int = 14, ) -> dict[str, Grid]: rng = rng or random.Random() inner_h = rng.randint(min_inner, max_inner) inner_w = rng.randint(min_inner, max_inner) max_d = (min(inner_h, inner_w) - 1) // 2 if max_d < 2: raise ValueError(""inner size too small for t13"") n_rings = rng.randint(2, min(5, max_d)) total = rng.randint(n_rings, max_d) # total ring thickness budget (rest is thick core) cuts = sorted(rng.sample(range(1, total), n_rings - 1)) thicknesses: list[int] = [] prev = 0 for cut in cuts + [total]: thicknesses.append(cut - prev) prev = cut colors = rng.sample(_PALETTE, k=n_rings) center_pool = [c for c in _PALETTE if c not in colors] if not center_pool: center_pool = [c for c in range(1, 10) if c not in colors and c not in (GREEN, MARK)] center_color = rng.choice(center_pool) pad_top = rng.randint(1, 3) pad_left = rng.randint(1, 3) pad_bottom = rng.randint(1, 3) pad_right = rng.randint(1, 3) inp, _gr, _gc, _tc = paint_concentric_rectangle( inner_h=inner_h, inner_w=inner_w, pad_top=pad_top, pad_left=pad_left, pad_bottom=pad_bottom, pad_right=pad_right, thicknesses=thicknesses, colors=colors, center_color=center_color, rng=rng, ) from verifier import transform_t13 out = transform_t13(inp) return {""input"": inp, ""output"": out} ","""""""Verifier / forward transform for Test2/t13 (concentric layers + green marker)."""""" from __future__ import annotations import copy from collections import Counter, defaultdict from typing import List, Tuple Grid = List[List[int]] GREEN = 3 MARK = 9 BG = 0 def _bbox_nonzero(g: Grid) -> Tuple[int, int, int, int]: rows = [i for i, r in enumerate(g) for j, v in enumerate(r) if v != 0] cols = [j for i, r in enumerate(g) for j, v in enumerate(r) if v != 0] if not rows: raise ValueError(""empty grid"") return min(rows), max(rows), min(cols), max(cols) def _find_green(g: Grid) -> Tuple[int, int]: found: list[Tuple[int, int]] = [] for r, row in enumerate(g): for c, v in enumerate(row): if v == GREEN: found.append((r, c)) if len(found) != 1: raise ValueError(""expected exactly one green cell (3)"") return found[0] def _border_coords(r0: int, r1: int, c0: int, c1: int) -> List[Tuple[int, int]]: out: list[Tuple[int, int]] = [] for r in range(r0, r1 + 1): for c in range(c0, c1 + 1): if r == r0 or r == r1 or c == c0 or c == c1: out.append((r, c)) return out def _mode_non_green(vals: List[int]) -> int: xs = [v for v in vals if v not in (BG, GREEN)] if not xs: raise ValueError(""empty border for mode"") return Counter(xs).most_common(1)[0][0] def _onion_bands_uniform(g: Grid, r0: int, r1: int, c0: int, c1: int) -> bool: """"""Each L1-distance band (inside bbox) has at most one non-zero color."""""" by_d: dict[int, set[int]] = defaultdict(set) for r in range(r0, r1 + 1): for c in range(c0, c1 + 1): v = g[r][c] if v == BG: continue d = min(r - r0, r1 - r, c - c0, c1 - c) by_d[d].add(v) for s in by_d.values(): if len(s) > 1: return False return True def _infer_center_color( inp: Grid, gr: int, gc: int, *, forbidden: set[int] | None = None ) -> int: """"""When green sits alone as the last 1×1 core, pick a consistent fill color. *forbidden* is the set of colors already used by outer logical layers (so we do not pick another ``4`` when the rim is ``4`` and only the core is missing). If several values keep L1-distance bands monochrome, break ties by closeness to the mean of the green cell's non-zero orthogonal neighbors. """""" ban = forbidden or set() nbr_vals: list[int] = [] for dr, dc in ((-1, 0), (1, 0), (0, -1), (0, 1)): r, c = gr + dr, gc + dc if 0 <= r < len(inp) and 0 <= c < len(inp[0]): v = inp[r][c] if v not in (BG, GREEN): nbr_vals.append(v) target = sum(nbr_vals) / len(nbr_vals) if nbr_vals else 0.0 candidates: list[int] = [] for trial in range(1, 10): if trial in (GREEN, MARK) or trial in ban: continue t = copy.deepcopy(inp) t[gr][gc] = trial r0, r1, c0, c1 = _bbox_nonzero(t) if _onion_bands_uniform(t, r0, r1, c0, c1): candidates.append(trial) if not candidates: raise ValueError(""could not infer center color"") candidates.sort(key=lambda t: (abs(t - target), -t)) return candidates[0] def transform_t13(inp: Grid) -> Grid: """"""Apply t13 rule: replace green with layer color; stack score 9s in last column."""""" if not inp or any(len(row) != len(inp[0]) for row in inp): raise ValueError(""non-rectangular grid"") gr, gc = _find_green(inp) r0, r1, c0, c1 = _bbox_nonzero(inp) layers: list[int] = [] prev_dom: int | None = None score: int | None = None rep: int | None = None br0, br1, bc0, bc1 = r0, r1, c0, c1 while br0 <= br1 and bc0 <= bc1: if br0 == br1 and bc0 == bc1 and inp[br0][bc0] == GREEN: rep = _infer_center_color(inp, gr, gc, forbidden=set(layers)) score = len(layers) + 1 break coords = _border_coords(br0, br1, bc0, bc1) dom = _mode_non_green([inp[r][c] for r, c in coords]) if prev_dom is None or dom != prev_dom: layers.append(dom) prev_dom = dom on_border = gr == br0 or gr == br1 or gc == bc0 or gc == bc1 if on_border: rep = dom score = len(layers) break if br0 == br1 and bc0 == bc1: break br0, br1, bc0, bc1 = br0 + 1, br1 - 1, bc0 + 1, bc1 - 1 if score is None or rep is None: raise ValueError(""could not place green on a recognized layer"") out = copy.deepcopy(inp) out[gr][gc] = rep h, w = len(out), len(out[0]) last_col = w - 1 for k in range(score): r = h - 1 - k if r < 0: raise ValueError(""score exceeds grid height"") out[r][last_col] = MARK return out def verify_t13(inp: Grid, out: Grid) -> bool: try: return transform_t13(inp) == out except Exception: return False " "t14","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,3,0,0,0,0,3,0,0,0],[2,0,0,3,0,3,0,0,0,0,3,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,4,0],[0,0,0,0,0,0,0,0,0,4,4,4],[0,0,0,0,0,0,0,0,0,0,4,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,3,0,0,0,0,3,0,0,0],[0,0,0,3,0,3,0,0,0,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,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,3,0,0,0,3,0,3,0,0,0],[2,0,0,0,3,0,0,0,3,0,3,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,3,0,0,0,3,0,3,0,0,0],[0,0,0,0,3,0,0,2,3,0,3,0,0,0]]}]}","""""""Generator for Test2/t14: bottom-runner jump/duck with conditional star."""""" from __future__ import annotations import random from typing import List Grid = List[List[int]] BG = 0 DOT = 2 BLOCK = 3 STAR = 4 def _copy_grid(g: Grid) -> Grid: return [row[:] for row in g] def _grounded_height(g: Grid, c: int) -> int: """"""Height of the contiguous bottom-anchored block stack in column c."""""" h = len(g) k = 0 r = h - 1 while r >= 0 and g[r][c] == BLOCK: k += 1 r -= 1 return k def _add_top_right_star(g: Grid) -> None: h = len(g) w = len(g[0]) if h else 0 if h < 3 or w < 3: return center_r, center_c = 1, w - 2 for r, c in ( (center_r, center_c), (center_r - 1, center_c), (center_r + 1, center_c), (center_r, center_c - 1), (center_r, center_c + 1), ): if 0 <= r < h and 0 <= c < w: g[r][c] = STAR def transform_t14(inp: Grid) -> Grid: """"""Move the red dot right with jump/duck rules and add star on success."""""" if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") h = len(inp) dot_cells = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == DOT] if len(dot_cells) != 1: raise ValueError(""expected exactly one red dot (2)"") dot_r, dot_c = dot_cells[0] if dot_r != h - 1: raise ValueError(""dot must be on bottom row"") pos = dot_c while pos < w - 1: nxt = pos + 1 if inp[dot_r][nxt] == BG: pos = nxt continue # A grounded block directly ahead can be jumped only if its height is 1 or 2. if inp[dot_r][nxt] == BLOCK: height = _grounded_height(inp, nxt) if height in (1, 2): landing = pos + 2 if landing < w and inp[dot_r][landing] == BG: pos = landing continue break out = _copy_grid(inp) out[dot_r][dot_c] = BG out[dot_r][pos] = DOT if pos == w - 1: _add_top_right_star(out) return out def _make_empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _place_grounded_block(g: Grid, c: int, height: int) -> None: h = len(g) for r in range(h - 1, h - height - 1, -1): g[r][c] = BLOCK def _place_floating_cell(g: Grid, c: int, r: int) -> None: g[r][c] = BLOCK def _sample_nonadjacent_columns( candidates: list[int], count: int, rng: random.Random ) -> list[int]: pool = candidates[:] rng.shuffle(pool) chosen: list[int] = [] for c in pool: if all(abs(c - x) > 1 for x in chosen): chosen.append(c) if len(chosen) >= count: break return sorted(chosen) def _has_invalid_horizontal_adjacency(g: Grid) -> bool: """"""Adjacent 3s are allowed only if both are fully floating (clear shaft below)."""""" h = len(g) w = len(g[0]) if h else 0 for r in range(h): for c in range(w - 1): if g[r][c] != BLOCK or g[r][c + 1] != BLOCK: continue left_clear = all(g[rr][c] == BG for rr in range(r + 1, h)) right_clear = all(g[rr][c + 1] == BG for rr in range(r + 1, h)) if not (left_clear and right_clear): return True return False def _jump_clearance_cells(g: Grid) -> set[tuple[int, int]]: """"""Cells that must stay empty so 1/2-high grounded blocks are visibly jumpable."""""" h = len(g) w = len(g[0]) if h else 0 forbidden: set[tuple[int, int]] = set() for c in range(w): gh = _grounded_height(g, c) if gh not in (1, 2): continue for k in range(gh): r = h - 1 - k nr = r - 1 if nr < 0: continue if c - 1 >= 0: forbidden.add((nr, c - 1)) if c + 1 < w: forbidden.add((nr, c + 1)) return forbidden def _has_blocked_jump_diagonal(g: Grid) -> bool: for r, c in _jump_clearance_cells(g): if g[r][c] == BLOCK: return True return False def generate( rng: random.Random | None = None, *, min_w: int = 10, max_w: int = 16, min_h: int = 6, max_h: int = 10, ) -> dict[str, Grid]: rr = rng or random.Random() for _ in range(1000): w = rr.randint(min_w, max_w) h = rr.randint(min_h, max_h) inp = _make_empty(h, w) inp[h - 1][0] = DOT should_reach_border = rr.random() < 0.55 candidates = list(range(1, w)) rr.shuffle(candidates) grounded_cols: set[int] = set() if should_reach_border: n_grounded = rr.randint(2, max(2, min(4, (w - 2) // 2 + 1))) grounded_list = _sample_nonadjacent_columns(list(range(1, w - 1)), n_grounded, rr) for c in grounded_list: _place_grounded_block(inp, c, rr.choice([1, 2])) grounded_cols.add(c) else: stop_col = rr.randint(3, w - 2) before_candidates = [c for c in range(1, stop_col) if abs(c - stop_col) > 1] n_before_max = max(0, min(3, len(before_candidates))) n_before = rr.randint(0, n_before_max) if n_before_max else 0 for c in _sample_nonadjacent_columns(before_candidates, n_before, rr): _place_grounded_block(inp, c, rr.choice([1, 2])) grounded_cols.add(c) _place_grounded_block(inp, stop_col, 3) grounded_cols.add(stop_col) after_candidates = [ c for c in range(stop_col + 1, w - 1) if abs(c - stop_col) > 1 and all(abs(c - x) > 1 for x in grounded_cols) ] n_after_max = max(0, min(2, len(after_candidates))) n_after = rr.randint(0, n_after_max) if n_after_max else 0 for c in _sample_nonadjacent_columns(after_candidates, n_after, rr): _place_grounded_block(inp, c, rr.choice([1, 2, 3])) grounded_cols.add(c) forbidden_jump_cells = _jump_clearance_cells(inp) # Add floating cells/runs with a full empty shaft below. for c in range(1, w - 1): if inp[h - 1][c] != BG: continue if rr.random() < 0.16: r = rr.randint(1, max(1, h - 3)) if (r, c) in forbidden_jump_cells: continue if all(inp[rrr][c] == BG for rrr in range(r, h)): _place_floating_cell(inp, c, r) # Occasionally place one horizontal floating pair/triple, which is demo-compatible. if rr.random() < 0.35: run_len = 2 if rr.random() < 0.8 else 3 start = rr.randint(1, max(1, w - run_len - 1)) cols = list(range(start, start + run_len)) r = rr.randint(1, max(1, h - 3)) if all(inp[h - 1][c] == BG for c in cols) and all( all(inp[rrr][c] == BG for rrr in range(r, h)) for c in cols ) and all((r, c) not in forbidden_jump_cells for c in cols): for c in cols: _place_floating_cell(inp, c, r) out = transform_t14(inp) # Ensure the task is non-trivial. if out == inp or _has_invalid_horizontal_adjacency(inp) or _has_blocked_jump_diagonal(inp): continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t14 instance"") ","""""""Verifier for Test2/t14 dot jump + duck + conditional star task."""""" from __future__ import annotations from typing import List from generator import transform_t14 Grid = List[List[int]] def verify_t14(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t14(inp) " "t15","[{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,1,0,0,0,0,0,1,0],[0,0,0,1,0,0,0,6,0,0],[0,0,0,0,1,0,1,0,0,0],[0,0,2,0,0,1,0,0,0,0],[0,0,0,0,1,0,1,0,0,0],[0,0,0,8,0,0,0,1,0,0],[0,0,1,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,1,0,0,2,0,0,1,0],[0,0,0,1,0,0,0,6,0,0],[0,0,0,0,1,0,1,0,0,0],[0,0,0,0,0,1,0,0,0,0],[0,0,0,0,1,0,1,0,0,0],[0,0,0,8,0,0,0,1,0,0],[0,0,1,0,0,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,0,3,0,0,0,0,0],[3,9,3,3,3,3,3,4,4,3,3],[0,0,0,0,0,3,0,0,0,0,0],[0,0,0,6,0,3,0,0,0,0,0],[0,0,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,0,0],[0,0,0,0,6,0,6,0,0,0,0],[0,0,0,6,0,6,2,6,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,0,0,0],[0,0,0,0,0,0,1,0,0,0],[0,0,0,0,0,0,6,0,0,0],[0,0,0,6,2,6,6,6,6,6],[0,0,0,0,6,0,6,0,0,0],[0,0,0,0,0,0,6,0,0,0],[0,0,0,0,0,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,0,0,0],[0,0,0,0,0,6,1,0,0,0],[0,0,0,0,0,0,6,0,0,0],[0,0,0,6,2,6,6,6,6,6],[0,0,0,0,0,0,6,0,0,0],[0,0,0,0,0,0,6,0,0,0],[0,0,0,0,0,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t15: move independent cell one partition clockwise."""""" from __future__ import annotations import random from collections import Counter from typing import List, Sequence, Tuple Grid = List[List[int]] Pos = Tuple[int, int] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _rot_cw(r: int, c: int, cr: int, cc: int) -> Pos: dr, dc = r - cr, c - cc return cr + dc, cc - dr def _best_center(inp: Grid) -> Pos: h = len(inp) w = len(inp[0]) if h else 0 nz = [(r, c) for r in range(h) for c in range(w) if inp[r][c] != 0] if not nz: raise ValueError(""input has no non-zero cells"") best: tuple[int, int, int, int, int] | None = None for cr in range(h): for cc in range(w): good = 0 miss = 0 out = 0 for r, c in nz: rr, rc = _rot_cw(r, c, cr, cc) if not _in_bounds(h, w, rr, rc): out += 1 elif inp[rr][rc] != 0: good += 1 else: miss += 1 cand = (good, -miss, -out, -abs(cr - h // 2), -abs(cc - w // 2)) if best is None or cand > best: best = cand best_center = (cr, cc) return best_center def _pick_mover(inp: Grid, center: Pos) -> tuple[Pos, Pos]: h = len(inp) w = len(inp[0]) if h else 0 cr, cc = center freq = Counter(v for row in inp for v in row if v != 0) candidates: list[tuple[int, int, int, int]] = [] for r in range(h): for c in range(w): v = inp[r][c] if v == 0: continue rr, rc = _rot_cw(r, c, cr, cc) if not _in_bounds(h, w, rr, rc): continue if inp[rr][rc] != 0: continue # Prefer likely ""independent"" colors first (rarer color count). candidates.append((freq[v], abs(r - cr) + abs(c - cc), r, c)) if not candidates: raise ValueError(""could not identify independent movable cell"") candidates.sort() _f, _d, r, c = candidates[0] rr, rc = _rot_cw(r, c, cr, cc) return (r, c), (rr, rc) def transform_t15(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input must be rectangular"") center = _best_center(inp) src, dst = _pick_mover(inp, center) out = [row[:] for row in inp] sr, sc = src dr, dc = dst out[dr][dc] = out[sr][sc] out[sr][sc] = 0 return out def _orbit4(cr: int, cc: int, r: int, c: int) -> list[Pos]: pts = [] rr, rc = r, c for _ in range(4): pts.append((rr, rc)) rr, rc = _rot_cw(rr, rc, cr, cc) # dedupe while preserving order seen: set[Pos] = set() out: list[Pos] = [] for p in pts: if p not in seen: seen.add(p) out.append(p) return out def _orbit_fully_in_bounds(h: int, w: int, cr: int, cc: int, r: int, c: int) -> bool: for rr, rc in _orbit4(cr, cc, r, c): if not _in_bounds(h, w, rr, rc): return False return True def _is_occupancy_cw_closed(shape: set[Pos], cr: int, cc: int) -> bool: for r, c in shape: if _rot_cw(r, c, cr, cc) not in shape: return False return True def _is_connected_8(cells: set[Pos]) -> bool: if not cells: return False start = next(iter(cells)) stack = [start] seen: set[Pos] = {start} while stack: r, c = stack.pop() for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue nb = (r + dr, c + dc) if nb in cells and nb not in seen: seen.add(nb) stack.append(nb) return len(seen) == len(cells) def _add_plus_skeleton(cells: set[Pos], h: int, w: int, cr: int, cc: int, arm: int) -> None: for k in range(arm + 1): for p in ((cr, cc + k), (cr, cc - k), (cr + k, cc), (cr - k, cc)): cells.add(p) def _add_x_skeleton(cells: set[Pos], h: int, w: int, cr: int, cc: int, arm: int) -> None: for k in range(arm + 1): for p in ((cr + k, cc + k), (cr + k, cc - k), (cr - k, cc + k), (cr - k, cc - k)): cells.add(p) def _adjacent_to_shape(r: int, c: int, shape: set[Pos]) -> bool: for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): if (r + dr, c + dc) in shape: return True return False def _mover_candidates(h: int, w: int, shape: set[Pos], cr: int, cc: int) -> list[tuple[Pos, Pos]]: out: list[tuple[Pos, Pos]] = [] for r in range(h): for c in range(w): if (r, c) in shape: continue rr, rc = _rot_cw(r, c, cr, cc) if not _in_bounds(h, w, rr, rc): continue if (rr, rc) in shape: continue if (rr, rc) == (r, c): continue out.append(((r, c), (rr, rc))) return out def generate( rng: random.Random | None = None, *, min_h: int = 9, max_h: int = 13, min_w: int = 9, max_w: int = 13, ) -> dict[str, Grid]: rr = rng or random.Random() for _ in range(1200): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) inp = _empty(h, w) cr = rr.randint(2, h - 3) cc = rr.randint(2, w - 3) max_arm = min(cr, h - 1 - cr, cc, w - 1 - cc) if max_arm < 2: continue shape: set[Pos] = set() arm = rr.randint(2, max_arm) if rr.random() < 0.5: _add_plus_skeleton(shape, h, w, cr, cc, arm) else: _add_x_skeleton(shape, h, w, cr, cc, arm) # Add extra 4-orbit points to get varied 4-part structures. extra = rr.randint(1, 4) for _ in range(extra): dr = rr.randint(-max_arm, max_arm) dc = rr.randint(-max_arm, max_arm) if dr == 0 and dc == 0: continue r0, c0 = cr + dr, cc + dc if not _orbit_fully_in_bounds(h, w, cr, cc, r0, c0): continue orbit = set(_orbit4(cr, cc, r0, c0)) candidate = shape | orbit # Keep the main structure as one 8-connected component. if _is_connected_8(candidate): shape = candidate if len(shape) < 8 or not _is_occupancy_cw_closed(shape, cr, cc) or not _is_connected_8(shape): continue base_color = rr.randint(1, 9) for r, c in shape: inp[r][c] = base_color # Miscolorings on the shape can break visual symmetry. mis_n = rr.randint(1, min(4, len(shape) // 4)) for r, c in rr.sample(list(shape), mis_n): inp[r][c] = rr.randint(1, 9) pairs = _mover_candidates(h, w, shape, cr, cc) if not pairs: continue # Prefer adjacency-allowed placements. pairs.sort( key=lambda p: ( 0 if _adjacent_to_shape(p[0][0], p[0][1], shape) else 1, abs(p[0][0] - cr) + abs(p[0][1] - cc), ) ) (sr, sc), (tr, tc) = rr.choice(pairs[: max(1, min(12, len(pairs)))]) mover_color = rr.randint(1, 9) inp[sr][sc] = mover_color out = transform_t15(inp) # Ensure output matches intended destination. if out[tr][tc] != mover_color or out[sr][sc] != 0: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t15 instance"") ","""""""Verifier for Test2/t15 partition-clockwise move rule."""""" from __future__ import annotations from typing import List from generator import transform_t15 Grid = List[List[int]] def verify_t15(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t15(inp) " "t16","[{""input"":[[0,5,0,5,0,0,5,0,0,0],[0,0,5,0,0,0,5,0,0,2],[0,5,0,5,0,0,5,0,2,2],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,5,0,0,0,0],[0,0,0,0,5,5,5,0,0,0],[2,2,0,0,0,5,0,0,5,0],[0,2,5,5,0,0,0,5,5,0],[0,0,0,5,5,0,0,5,5,0],[0,0,0,5,5,0,0,0,5,0]],""output"":[[0,5,0,5,0,0,5,0,0,0],[0,0,5,0,0,0,5,0,0,0],[0,5,0,5,0,0,5,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,5,0,0,0,0],[0,0,0,0,5,5,5,0,0,0],[0,0,0,0,0,5,0,0,2,0],[0,0,2,2,0,0,0,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0,0,0,0,0],[0,0,0,0,0,0,5,0,5,5,5,0,0,0,0],[0,4,0,0,0,5,5,0,5,5,0,0,0,0,0],[4,4,0,0,0,5,0,0,5,0,0,0,0,0,0],[4,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,4,0,0,0,0,0,0],[0,0,0,0,0,0,0,4,4,4,0,0,0,0,0],[0,0,0,0,4,0,0,4,4,0,0,0,0,0,0],[0,0,0,4,4,4,0,4,0,0,0,0,0,0,0],[0,0,0,4,4,0,0,0,0,0,0,0,0,0,0],[0,0,0,4,0,0,0,5,5,5,0,0,0,0,0],[0,0,0,0,0,0,5,5,5,5,5,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,4,0,0,0,0,0],[0,0,0,0,0,0,5,0,4,4,4,0,0,0,0],[0,0,0,0,0,5,5,0,4,4,0,0,0,0,0],[0,0,0,0,0,5,0,0,4,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t16: edge fragments assemble to a target grey shape. Orthogonally-connected task-color islands are fused transitively whenever they king-touch, so diagonal contact defines a single prototype (no special-case ridge split). Interior grey is matched on 4-connectivity only. Generator rejects layouts where grey clues would be ambiguous (king-only bridges between disjoint grey components, grey king-adjacent to task colour). Rigid assemblies union **every permutation** of prototype placement order (same translations, orthogonal contacts only): anchoring lex-first signature alone skipped valid tilings reachable only when another piece seeds the incremental placement chain. """""" from __future__ import annotations import math import random from collections import deque from itertools import permutations from typing import Iterable, List, Sequence, Tuple Grid = List[List[int]] Pos = Tuple[int, int] ShapeSig = Tuple[Pos, ...] BG = 0 GREY = 5 def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _neighbors4(r: int, c: int) -> Iterable[Pos]: yield (r + 1, c) yield (r - 1, c) yield (r, c + 1) yield (r, c - 1) def _normalize(cells: Iterable[Pos]) -> ShapeSig: cells_t = tuple(cells) if not cells_t: return () min_r = min(r for r, _ in cells_t) min_c = min(c for _, c in cells_t) return tuple(sorted((r - min_r, c - min_c) for r, c in cells_t)) def _translate(sig: ShapeSig, dr: int, dc: int) -> set[Pos]: return {(r + dr, c + dc) for r, c in sig} def _extract_components(grid: Grid, target_color: int) -> list[set[Pos]]: h = len(grid) w = len(grid[0]) if h else 0 seen: set[Pos] = set() comps: list[set[Pos]] = [] for r in range(h): for c in range(w): if grid[r][c] != target_color or (r, c) in seen: continue q = deque([(r, c)]) seen.add((r, c)) comp: set[Pos] = set() while q: rr, cc = q.popleft() comp.add((rr, cc)) for nr, nc in _neighbors4(rr, cc): if _in_bounds(h, w, nr, nc) and grid[nr][nc] == target_color and (nr, nc) not in seen: seen.add((nr, nc)) q.append((nr, nc)) comps.append(comp) return comps def _neighbors8(r: int, c: int) -> Iterable[Pos]: for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr == 0 and dc == 0: continue yield (r + dr, c + dc) def _orthogonal_adjacent_cells(a: set[Pos], b: set[Pos]) -> bool: for r, c in a: for nr, nc in _neighbors4(r, c): if (nr, nc) in b: return True return False def _comps_king_touch(a: set[Pos], b: set[Pos]) -> bool: for r, c in a: for nr, nc in _neighbors8(r, c): if (nr, nc) in b: return True return False def _merge_colored_fragments_king_linked(color_frags: Sequence[set[Pos]]) -> list[set[Pos]]: """"""Fuse pairwise king-touching orthogonal color components into rigid prototypes."""""" n = len(color_frags) if n <= 1: return [*color_frags] parent = list(range(n)) def find(i: int) -> int: while parent[i] != i: parent[i] = parent[parent[i]] i = parent[i] return i def union(i: int, j: int) -> None: ri, rj = find(i), find(j) if ri != rj: parent[rj] = ri for i in range(n): for j in range(i + 1, n): if _comps_king_touch(color_frags[i], color_frags[j]): union(i, j) buckets: dict[int, set[Pos]] = {} for i in range(n): r = find(i) buckets.setdefault(r, set()).update(color_frags[i]) return list(buckets.values()) def _assemble_signatures_ordered( ordered: Sequence[ShapeSig], *, max_states: int, seen_states: set[tuple[int, ShapeSig]], out: set[ShapeSig], ) -> None: """"""DFS one placement order (ordered[0] anchors first). Mutates ``seen_states``, ``out``."""""" first = set(ordered[0]) rest = ordered[1:] budget = max_states def rec(idx: int, union: set[Pos]) -> None: nonlocal budget if budget <= 0: return budget -= 1 key = (idx, _normalize(union)) if key in seen_states: return seen_states.add(key) if idx == len(rest): out.add(_normalize(union)) return piece = rest[idx] translations: set[Pos] = set() for ur, uc in union: for ar, ac in ((ur + 1, uc), (ur - 1, uc), (ur, uc + 1), (ur, uc - 1)): for pr, pc in piece: translations.add((ar - pr, ac - pc)) for tr, tc in sorted(translations): placed = _translate(piece, tr, tc) if union & placed: continue if not any((nr, nc) in union for r, c in placed for nr, nc in _neighbors4(r, c)): continue rec(idx + 1, union | placed) rec(0, first) def _assemble_signatures(piece_sigs: Sequence[ShapeSig], *, max_states: int = 500_000) -> set[ShapeSig]: """"""Enumerate unions over translations and **all orders** of snapping pieces onto the union."""""" pieces = tuple(piece_sigs) if not pieces: return set() n = len(pieces) fac = math.factorial(n) per_budget = max(max_states // fac, min(80_000, max_states)) out: set[ShapeSig] = set() for perm in permutations(pieces): seen_perm: set[tuple[int, ShapeSig]] = set() _assemble_signatures_ordered(perm, max_states=per_budget, seen_states=seen_perm, out=out) return out def _all_assemblies(piece_sigs: Sequence[ShapeSig]) -> set[ShapeSig]: sigs = _assemble_signatures(piece_sigs) if not sigs: raise ValueError(""could not assemble colored edge fragments"") return sigs def _sample_mode_count(rr: random.Random, n_modes: int) -> int: """"""Bias toward 1-2 assembly modes, with all modes selected rarely."""""" if n_modes <= 1: return 1 if n_modes == 2: return 1 if rr.random() < 0.7 else 2 # n_modes >= 3: strongly favor 1 or 2; all modes are uncommon. choices: list[tuple[int, float]] = [ (1, 0.45), (2, 0.35), (3, 0.12), (n_modes, 0.03), ] # Add medium counts (4..n-1) with low probability mass. middle = [k for k in range(4, n_modes) if k != n_modes] if middle: rem = 0.05 / len(middle) for k in middle: choices.append((k, rem)) total = sum(w for _, w in choices) x = rr.random() * total acc = 0.0 for k, w in choices: acc += w if x <= acc: return min(k, n_modes) return min(2, n_modes) def transform_t16(inp: Grid) -> Grid: """"""Recolor interior orth-grey blobs whose shape equals a rigid orthogonal assembly."""""" if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") h = len(inp) colors = sorted({v for row in inp for v in row if v not in (BG, GREY)}) if len(colors) != 1: raise ValueError(""expected exactly one non-grey, non-background color"") color = colors[0] raw_color = _extract_components(inp, color) prototypes = _merge_colored_fragments_king_linked(raw_color) if len(prototypes) < 2: raise ValueError(""expected at least two colored prototypes after diagonal fusion"") piece_sigs = [_normalize(comp) for comp in prototypes] target_sigs = _all_assemblies(piece_sigs) out = [row[:] for row in inp] for r in range(h): for c in range(w): if out[r][c] == color: out[r][c] = BG grey_comps = _extract_components(inp, GREY) for comp in grey_comps: if _normalize(comp) not in target_sigs: continue for r, c in comp: out[r][c] = color return out def _grey_has_king_only_bridge(inp: Grid) -> bool: """"""True if two distinct orth-grey components touch at a diagonal only."""""" comps = _extract_components(inp, GREY) for i in range(len(comps)): for j in range(i + 1, len(comps)): if _comps_king_touch(comps[i], comps[j]) and not _orthogonal_adjacent_cells(comps[i], comps[j]): return True return False def _grey_king_adjacent_to_task_color(inp: Grid, task_color: int) -> bool: h, w = len(inp), len(inp[0]) for r in range(h): for c in range(w): if inp[r][c] != GREY: continue for nr, nc in _neighbors8(r, c): if _in_bounds(h, w, nr, nc) and inp[nr][nc] == task_color: return True return False def _random_polyomino(rr: random.Random, size: int) -> ShapeSig: cells: set[Pos] = {(0, 0)} while len(cells) < size: r, c = rr.choice(tuple(cells)) nr, nc = rr.choice([(r + 1, c), (r - 1, c), (r, c + 1), (r, c - 1)]) cells.add((nr, nc)) return _normalize(cells) def _biased_poly_sizes(rr: random.Random, n: int, *, bare: bool) -> list[int]: """"""Prefer triomino/tetromino-sized lumps (authored tasks rarely look like domino salads)."""""" choices = [2, 3, 4, 5] weights = [0.06, 0.38, 0.44, 0.12] if bare else [0.05, 0.33, 0.42, 0.20] return [rr.choices(choices, weights=weights, k=1)[0] for _ in range(n)] def _on_perimeter(r: int, c: int, h: int, w: int) -> bool: return r == 0 or c == 0 or r == h - 1 or c == w - 1 def _enumerate_diagonal_singleton_chains_from_perimeter_anchor(h: int, w: int, length: int) -> list[set[Pos]]: """"""Straight lattice-diagonal chains whose **first** cell is on the perimeter. Interior cells along the ridge are allowed (matches authored ridges that dip one row/col inward). Length ≥ 4 is impossible if every cell must stay on the boundary—that old rule suppressed longer chains. """""" assert length >= 2 dirs = ((1, 1), (1, -1), (-1, 1), (-1, -1)) raw: list[set[Pos]] = [] for r in range(h): for c in range(w): if not _on_perimeter(r, c, h, w): continue for dr, dc in dirs: cells: list[Pos] = [] ok = True for k in range(length): rr_, cc_ = r + k * dr, c + k * dc if not _in_bounds(h, w, rr_, cc_): ok = False break cells.append((rr_, cc_)) if ok and len(set(cells)) == length: raw.append(set(cells)) seen: set[tuple[Pos, ...]] = set() uniq: list[set[Pos]] = [] for s in raw: sig = tuple(sorted(s)) if sig not in seen: seen.add(sig) uniq.append(s) return uniq def _try_place_diagonal_singleton_chain( rr: random.Random, occupied: set[Pos], h: int, w: int, *, length: int, ) -> set[Pos] | None: cand = _enumerate_diagonal_singleton_chains_from_perimeter_anchor(h, w, length) if not cand: return None # Several shuffles — ordering matters when singletons share rows/cols from sorting alone. for _ in range(4): rr.shuffle(cand) for chain in cand: acc = set(occupied) ok = True for cell in sorted(chain): solo = {cell} if not _can_place(solo, acc, h, w, forbid_adj4=True): ok = False break acc |= solo if ok: return chain return None def _raw_has_king_diagonal_bridge(frags: Sequence[set[Pos]]) -> bool: """"""Some orth-islands touch king-only (diagonal cue), matching authored motifs."""""" for i in range(len(frags)): for j in range(i + 1, len(frags)): if _comps_king_touch(frags[i], frags[j]) and not _orthogonal_adjacent_cells(frags[i], frags[j]): return True return False def _max_diag_singleton_chain_len(inp: Grid, color: int) -> int: """"""Longest run of task-coloured monominos along one lattice-diagonal ray (king-only chain)."""""" pts = {next(iter(f)) for f in _extract_components(inp, color) if len(f) == 1} if not pts: return 0 best = 0 dirs = ((1, 1), (1, -1), (-1, 1), (-1, -1)) for r, c in pts: for dr, dc in dirs: k = 0 cr, cc = r, c while (cr, cc) in pts: k += 1 cr, cc = cr + dr, cc + dc best = max(best, k) return best def _edge_offsets_for_piece(sig: ShapeSig, h: int, w: int, edge: str) -> list[Pos]: max_r = max(r for r, _ in sig) max_c = max(c for _, c in sig) out: list[Pos] = [] if edge == ""top"": for dc in range(0, w - max_c): out.append((0, dc)) elif edge == ""bottom"": base_r = h - 1 - max_r for dc in range(0, w - max_c): out.append((base_r, dc)) elif edge == ""left"": for dr in range(0, h - max_r): out.append((dr, 0)) elif edge == ""right"": base_c = w - 1 - max_c for dr in range(0, h - max_r): out.append((dr, base_c)) return out def _can_place( cells: set[Pos], occupied: set[Pos], h: int, w: int, *, forbid_adj4: bool, forbid_king_near: set[Pos] | None = None, ) -> bool: for r, c in cells: if not _in_bounds(h, w, r, c): return False if (r, c) in occupied: return False if forbid_adj4: for r, c in cells: for nr, nc in _neighbors4(r, c): if (nr, nc) in occupied: return False if forbid_king_near: ban = forbid_king_near for r, c in cells: for nr, nc in _neighbors8(r, c): if _in_bounds(h, w, nr, nc) and (nr, nc) in ban: return False return True def _place_piece_on_edge( rr: random.Random, sig: ShapeSig, edge: str, occupied: set[Pos], h: int, w: int, *, forbid_king_near: set[Pos] | None = None, ) -> set[Pos] | None: offsets = _edge_offsets_for_piece(sig, h, w, edge) rr.shuffle(offsets) for dr, dc in offsets: cells = _translate(sig, dr, dc) if _can_place(cells, occupied, h, w, forbid_adj4=True, forbid_king_near=forbid_king_near): return cells return None def _place_interior_shape( rr: random.Random, sig: ShapeSig, occupied: set[Pos], h: int, w: int, ) -> set[Pos] | None: max_r = max(r for r, _ in sig) max_c = max(c for _, c in sig) if h - 2 - max_r < 1 or w - 2 - max_c < 1: return None candidates: list[Pos] = [] for dr in range(1, h - 1 - max_r): for dc in range(1, w - 1 - max_c): candidates.append((dr, dc)) rr.shuffle(candidates) for dr, dc in candidates: cells = _translate(sig, dr, dc) if _can_place(cells, occupied, h, w, forbid_adj4=True): return cells return None def generate( rng: random.Random | None = None, *, min_h: int = 11, max_h: int = 16, min_w: int = 11, max_w: int = 16, ridge_chain_target: int | None = None, ) -> dict[str, Grid]: rr = rng or random.Random() if ridge_chain_target is not None and ridge_chain_target not in (2, 3, 4): raise ValueError(""ridge_chain_target must be one of {2, 3, 4} or None"") # ``diag_triple`` is **always** three king-linked singletons (train-style ridge). # Length-four ridges use ``diag_quad`` so triple sketches are not diluted toward quad. sketches = [""bare"", ""diag_pair"", ""diag_triple"", ""diag_quad"", ""mixed""] sketch_w = [0.07, 0.18, 0.38, 0.12, 0.25] for _ in range(28000): eff_min_h, eff_min_w = min_h, min_w if ridge_chain_target in (3, 4): eff_min_h = max(min_h, 13) eff_min_w = max(min_w, 13) h = rr.randint(eff_min_h, max_h) w = rr.randint(eff_min_w, max_w) inp = _empty(h, w) color = rr.choice([1, 2, 3, 4, 6, 7, 8, 9]) occupied: set[Pos] = set() forbid_king_near: set[Pos] | None = None ridge_chain_len: int | None = None if ridge_chain_target is not None: sketch = ""__ridge_target__"" ridge_chain_len = ridge_chain_target else: sketch = rr.choices(sketches, weights=sketch_w, k=1)[0] if sketch == ""diag_triple"": ridge_chain_len = 3 elif sketch == ""diag_quad"": ridge_chain_len = 4 elif sketch == ""diag_pair"": ridge_chain_len = 2 elif sketch == ""mixed"": ridge_chain_len = rr.choices([2, 3, 4], weights=[0.22, 0.46, 0.32])[0] if ridge_chain_len is not None: ridge = _try_place_diagonal_singleton_chain(rr, occupied, h, w, length=ridge_chain_len) if ridge is None: continue occupied |= ridge forbid_king_near = set(ridge) n_poly_extra = rr.randint(1, 2) sizes = _biased_poly_sizes(rr, n_poly_extra, bare=False) else: # Orth-edge lumps only (still forbid orthogonal overlap); mostly tri/tet pentomino mixes. n_poly_extra = rr.randint(2, 3) sizes = _biased_poly_sizes(rr, n_poly_extra, bare=True) piece_sigs = [_random_polyomino(rr, sz) for sz in sizes] edges = [""top"", ""bottom"", ""left"", ""right""] rr.shuffle(edges) piece_edges = [edges[i % len(edges)] for i in range(len(piece_sigs))] rr.shuffle(piece_edges) ok = True for sig, edge in zip(piece_sigs, piece_edges): placed = _place_piece_on_edge( rr, sig, edge, occupied, h, w, forbid_king_near=forbid_king_near, ) if placed is None: ok = False break occupied |= placed if not ok: continue for r in range(h): for c in range(w): if (r, c) in occupied: inp[r][c] = color raw_frags = _extract_components(inp, color) if ridge_chain_target is not None: if _max_diag_singleton_chain_len(inp, color) < ridge_chain_target: continue if ridge_chain_len is not None: if not _raw_has_king_diagonal_bridge(raw_frags): continue elif sketch == ""bare"": if _raw_has_king_diagonal_bridge(raw_frags): continue prototypes = _merge_colored_fragments_king_linked(raw_frags) if len(prototypes) < 2: continue merged_sigs = [_normalize(p) for p in prototypes] try: assemblies_set = _all_assemblies(merged_sigs) except ValueError: continue assemblies = sorted(assemblies_set) if len(assemblies) < 2 or len(assemblies) > 420: continue if any(len(sig) < 4 or len(sig) > 12 for sig in assemblies): continue # Place a sampled subset of assembly interpretations. n_target_modes = _sample_mode_count(rr, len(assemblies)) selected = rr.sample(assemblies, n_target_modes) match_count = 0 for sig in selected: placed = _place_interior_shape(rr, sig, occupied, h, w) if placed is None: continue for r, c in placed: inp[r][c] = GREY occupied |= placed match_count += 1 if match_count < len(selected): continue # Optionally add a few duplicate matches from random assembly modes. extra_matches = rr.randint(0, 2) for _ in range(extra_matches): sig = rr.choice(selected) placed = _place_interior_shape(rr, sig, occupied, h, w) if placed is None: continue for r, c in placed: inp[r][c] = GREY occupied |= placed match_count += 1 if match_count == 0: continue # Place non-matching grey distractors. n_distractors = rr.randint(2, 5) for _ in range(n_distractors): for _inner in range(20): cand = _random_polyomino(rr, rr.randint(1, 10)) if _normalize(cand) in assemblies_set: continue placed = _place_interior_shape(rr, cand, occupied, h, w) if placed is None: continue for r, c in placed: inp[r][c] = GREY occupied |= placed break if _grey_has_king_only_bridge(inp) or _grey_king_adjacent_to_task_color(inp, color): continue out = transform_t16(inp) if out == inp: continue if not any(out[r][c] == color and inp[r][c] == GREY for r in range(h) for c in range(w)): continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t16 instance"") ","""""""Verifier for Test2/t16 edge-assembly recoloring."""""" from __future__ import annotations from typing import List from generator import transform_t16 Grid = List[List[int]] def verify_t16(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t16(inp) " "t17","[{""input"":[[0,0,0,6,6,6,0,0,6],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,0,0],[0,0,0,0,0,0,6,0,6],[0,0,6,0,0,0,6,6,6],[0,0,6,0,6,0,0,0,0],[0,0,6,6,6,0,0,0,0],[0,0,0,0,0,0,6,0,0],[0,0,0,0,0,0,6,0,6]],""output"":[[0,0,0,0,0,0,0,0,0],[0,0,0,6,0,0,0,0,6],[0,0,0,6,0,6,0,0,6],[0,0,0,6,6,6,0,0,6],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,0,0],[0,0,0,0,0,0,6,0,6],[0,0,6,0,0,0,6,6,6],[0,0,6,0,6,0,0,0,0]]},{""input"":[[0,0,3,0,0,0,0,0,0,3,0],[0,3,0,0,0,0,0,0,0,0,3],[3,0,0,3,0,0,0,0,3,0,0],[0,0,3,0,3,0,0,3,0,3,0],[0,3,0,0,0,3,3,0,0,0,3],[0,0,3,0,3,0,0,3,0,3,0],[0,0,0,3,0,0,0,0,3,0,0],[0,0,0,3,0,0,0,0,0,0,0],[0,0,3,0,3,0,0,0,0,3,0],[0,3,0,0,0,3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,0,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,8,0,0,0,8,0,0],[0,0,0,0,0,0,0,0,0,0,8,0,0,0,8,0],[8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0]]}]}","""""""Generator for Test2/t17 (pattern fall). The prototype is always **fully visible** somewhere on the grid (an unclipped copy), with at least one placement **strictly inside** the outer border (not on row/column 0 or the last row/column). **Inference.** Prefer strictly interior 4‑connected foreground blobs of size 2–10 (unique normalised shape, or most frequent among ties). If that does not determine the prototype (merged blobs, ambiguous fragments), fall back to the **largest** ``n``≤10 connected shape that **occurs as an induced subgraph of the foreground** (orthogonal connectivity first, then king) and admits an exact disjoint cover of the foreground. The fallback never scans the full catalogue of fixed ``n``‑ominoes (that was prohibitively slow); it only considers shapes that literally appear on the grid. ``generate()`` samples orth‑connected prototypes with two fully interior placements. """""" from __future__ import annotations import random from collections import Counter, deque from typing import Callable, Iterable, List, Tuple Grid = List[List[int]] Pos = Tuple[int, int] ShapeSig = Tuple[Pos, ...] BG = 0 def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _max_orth_component_size(fg: set[Pos]) -> int: """"""Largest 4‑connected size among cells in ``fg`` (induced on the grid)."""""" if not fg: return 0 seen: set[Pos] = set() best = 0 for start in sorted(fg): if start in seen: continue q = deque([start]) seen.add(start) comp: set[Pos] = {start} while q: r, c = q.popleft() for nr, nc in _neighbors4(r, c): p = (nr, nc) if p in fg and p not in seen: seen.add(p) comp.add(p) q.append(p) if len(comp) > best: best = len(comp) return best def _max_king_component_size(fg: set[Pos]) -> int: """"""Largest 8‑connected size among ``fg``."""""" if not fg: return 0 seen: set[Pos] = set() best = 0 for start in sorted(fg): if start in seen: continue q = deque([start]) seen.add(start) comp: set[Pos] = {start} while q: r, c = q.popleft() for nr, nc in _neighbors8(r, c): p = (nr, nc) if p in fg and p not in seen: seen.add(p) comp.add(p) q.append(p) if len(comp) > best: best = len(comp) return best def _orth_connected_components(inp: Grid, color: int) -> list[set[Pos]]: h = len(inp) w = len(inp[0]) if h else 0 seen: set[Pos] = set() comps: list[set[Pos]] = [] for r in range(h): for c in range(w): if inp[r][c] != color or (r, c) in seen: continue q = deque([(r, c)]) seen.add((r, c)) comp: set[Pos] = set() while q: rr, cc = q.popleft() comp.add((rr, cc)) for nr, nc in _neighbors4(rr, cc): if _in_bounds(h, w, nr, nc) and inp[nr][nc] == color and (nr, nc) not in seen: seen.add((nr, nc)) q.append((nr, nc)) comps.append(comp) return comps def _is_strictly_interior(comp: set[Pos], h: int, w: int) -> bool: if not comp: return False return ( min(r for r, _ in comp) > 0 and max(r for r, _ in comp) < h - 1 and min(c for _, c in comp) > 0 and max(c for _, c in comp) < w - 1 ) def _try_infer_proto_from_interior_blobs( inp: Grid, color: int ) -> tuple[ShapeSig, list[tuple[int, int]]] | None: """"""Use strictly interior 4‑connected blobs of size 2–10 (unique or most frequent)."""""" h = len(inp) w = len(inp[0]) if h else 0 fg0 = {(r, c) for r in range(h) for c in range(w) if inp[r][c] == color} sigs: list[ShapeSig] = [] for comp in _orth_connected_components(inp, color): if not _is_strictly_interior(comp, h, w): continue if 2 <= len(comp) <= 10: sigs.append(_normalize(comp)) if not sigs: return None if len(sigs) == 1: sig = sigs[0] anchors = _try_infer_anchors_for_proto(inp, color, sig, fg0) return (sig, anchors) if anchors is not None else None cnt = Counter(sigs) max_c = max(cnt.values()) for sig in sorted(s for s, c in cnt.items() if c == max_c): anchors = _try_infer_anchors_for_proto(inp, color, sig, fg0) if anchors is not None: return sig, anchors return None def _neighbors4(r: int, c: int) -> Iterable[Pos]: yield (r + 1, c) yield (r - 1, c) yield (r, c + 1) yield (r, c - 1) def _normalize(cells: Iterable[Pos]) -> ShapeSig: cells_t = tuple(cells) if not cells_t: return () min_r = min(r for r, _ in cells_t) min_c = min(c for _, c in cells_t) return tuple(sorted((r - min_r, c - min_c) for r, c in cells_t)) def _neighbors8(r: int, c: int) -> Iterable[Pos]: for dr in (-1, 0, 1): for dc in (-1, 0, 1): if dr or dc: yield (r + dr, c + dc) def _induced_connected_exact_size( fg: set[Pos], neighbor_iter: Callable[[int, int], Iterable[Pos]], n: int, max_calls: int, ) -> set[ShapeSig]: """"""Connected ``n``‑subsets of ``fg`` (``neighbor_iter``), translation‑normalised. Pruned to exact size only."""""" uniq: set[ShapeSig] = set() calls = 0 def rec(active: frozenset[Pos]) -> None: nonlocal calls calls += 1 if calls > max_calls: return na = len(active) if na == n: uniq.add(_normalize(active)) return if na > n: return cand: set[Pos] = set() for r, c in active: for nr, nc in neighbor_iter(r, c): if (nr, nc) in fg and (nr, nc) not in active: cand.add((nr, nc)) for nb in sorted(cand): rec(active | {nb}) for start in sorted(fg): rec(frozenset({start})) return uniq def _draw_shape(grid: Grid, color: int, sig: ShapeSig, top: int, left: int) -> None: h = len(grid) w = len(grid[0]) if h else 0 for dr, dc in sig: rr, cc = top + dr, left + dc if _in_bounds(h, w, rr, cc): grid[rr][cc] = color def _visible_from_anchor(sig: ShapeSig, top: int, left: int, h: int, w: int) -> set[Pos]: out: set[Pos] = set() for dr, dc in sig: rr, cc = top + dr, left + dc if _in_bounds(h, w, rr, cc): out.add((rr, cc)) return out def _strict_interior_full_placement_count(sig: ShapeSig, fg: set[Pos], h: int, w: int) -> int: """"""How many anchors place a full unclipped copy strictly inside the outer border and inside ``fg``."""""" max_r = max(r for r, _ in sig) max_c = max(c for _, c in sig) n = 0 for top in range(-max_r, h): for left in range(-max_c, w): vis = _visible_from_anchor(sig, top, left, h, w) if len(vis) != len(sig) or not vis.issubset(fg): continue if min(r for r, _ in vis) <= 0: continue if max(r for r, _ in vis) >= h - 1: continue if min(c for _, c in vis) <= 0: continue if max(c for _, c in vis) >= w - 1: continue n += 1 return n def _strict_interior_full_placement_exists(sig: ShapeSig, fg: set[Pos], h: int, w: int) -> bool: """"""True iff some anchor places the entire prototype on-grid, strictly inside the border (unclipped copy)."""""" return _strict_interior_full_placement_count(sig, fg, h, w) > 0 def _try_infer_anchors_for_proto( inp: Grid, color: int, sig: ShapeSig, fg: set[Pos] | None = None ) -> list[tuple[int, int]] | None: """"""Return anchors whose disjoint clipped placements cover all ``color`` cells, or ``None``."""""" h = len(inp) w = len(inp[0]) if h else 0 if fg is None: fg = {(r, c) for r in range(h) for c in range(w) if inp[r][c] == color} if not fg: return [] max_r = max(r for r, _ in sig) max_c = max(c for _, c in sig) vis_to_anchor: dict[frozenset[Pos], tuple[int, int]] = {} for top in range(-max_r, h): for left in range(-max_c, w): vis = frozenset(_visible_from_anchor(sig, top, left, h, w)) if not vis or not vis.issubset(fg): continue prev = vis_to_anchor.get(vis) if prev is None or (top, left) < prev: vis_to_anchor[vis] = (top, left) if not vis_to_anchor: return None sets = sorted(vis_to_anchor.items(), key=lambda kv: (-len(kv[0]), kv[1])) cell_to_set_ids: dict[Pos, list[int]] = {p: [] for p in fg} for idx, (vis, _anchor) in enumerate(sets): for p in vis: cell_to_set_ids[p].append(idx) if any(len(cell_to_set_ids[p]) == 0 for p in fg): return None covered: set[Pos] = set() chosen_ids: list[int] = [] def _dfs_cover() -> bool: if len(covered) == len(fg): return True uncovered = [p for p in fg if p not in covered] pivot = min( uncovered, key=lambda p: sum(1 for sid in cell_to_set_ids[p] if not (sets[sid][0] & covered)), ) cands = [sid for sid in cell_to_set_ids[pivot] if not (sets[sid][0] & covered)] cands.sort(key=lambda sid: (-len(sets[sid][0]), sets[sid][1])) for sid in cands: vis, _anchor = sets[sid] if vis & covered: continue chosen_ids.append(sid) covered.update(vis) if _dfs_cover(): return True chosen_ids.pop() covered.difference_update(vis) return False if not _dfs_cover(): return None return [sets[sid][1] for sid in chosen_ids] def _infer_anchors_for_proto(inp: Grid, color: int, sig: ShapeSig) -> list[tuple[int, int]]: out = _try_infer_anchors_for_proto(inp, color, sig) if out is None: raise ValueError(""could not decompose foreground into clipped prototype placements"") return out def _resolve_proto_signature(inp: Grid, color: int) -> tuple[ShapeSig, list[tuple[int, int]]]: """"""Interior blobs first; else largest induced foreground shape (orth, then king) with exact cover."""""" hinted = _try_infer_proto_from_interior_blobs(inp, color) if hinted is not None: return hinted h = len(inp) w = len(inp[0]) if h else 0 fg = {(r, c) for r in range(h) for c in range(w) if inp[r][c] == color} nf = len(fg) max_orth = _max_orth_component_size(fg) max_king = _max_king_component_size(fg) for neighbors, budget, n_hi in ( (_neighbors4, 200_000, min(10, nf, max_orth)), (_neighbors8, 400_000, min(10, nf, max_king)), ): if n_hi < 2: continue for n in range(n_hi, 1, -1): raw = _induced_connected_exact_size(fg, neighbors, n, max_calls=budget) scored: list[tuple[int, ShapeSig]] = [] for s in raw: pc = _strict_interior_full_placement_count(s, fg, h, w) if pc > 0: scored.append((-pc, s)) scored.sort(key=lambda t: (t[0], t[1])) for _neg_pc, sig in scored: anchors = _try_infer_anchors_for_proto(inp, color, sig, fg) if anchors is not None: return sig, anchors raise ValueError(""no prototype (2–10 cells, orth or king) tiles the foreground"") def _pattern_fall_output( inp: Grid, color: int, proto_sig: ShapeSig, anchors: list[tuple[int, int]] | None = None, ) -> Grid: """"""Stamp each inferred anchor placement downward by the prototype height (authoritative rule)."""""" h = len(inp) w = len(inp[0]) if h else 0 if anchors is None: anchors = _infer_anchors_for_proto(inp, color, proto_sig) shape_h = max(r for r, _ in proto_sig) + 1 anchors = sorted(set(anchors)) out = _empty(h, w) for top, left in anchors: _draw_shape(out, color, proto_sig, top + shape_h, left) return out def transform_t17(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") h = len(inp) colors = sorted({v for row in inp for v in row if v != BG}) if len(colors) != 1: raise ValueError(""expected exactly one foreground color"") color = colors[0] fg = {(r, c) for r in range(h) for c in range(w) if inp[r][c] == color} if not fg: raise ValueError(""no foreground components found"") proto_sig, anchors = _resolve_proto_signature(inp, color) return _pattern_fall_output(inp, color, proto_sig, anchors) def _random_connected_shape(rr: random.Random, height: int, width: int) -> ShapeSig: cols: list[int] = [rr.randint(0, width - 1)] for _r in range(1, height): prev = cols[-1] cands = [c for c in (prev - 1, prev, prev + 1) if 0 <= c < width] cols.append(rr.choice(cands)) cells: set[Pos] = {(r, c) for r, c in enumerate(cols)} max_cells = 10 max_extra = max(0, max_cells - len(cells)) extra_n = rr.randint(0, min(max(2, height + width), max_extra)) for _ in range(extra_n): r = rr.randint(0, height - 1) c = rr.randint(0, width - 1) if len(cells) >= max_cells: break if any((nr, nc) in cells for nr, nc in _neighbors4(r, c)): cells.add((r, c)) return _normalize(cells) def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 16, min_w: int = 10, max_w: int = 16, ) -> dict[str, Grid]: rr = rng or random.Random() # Enough placement draws per candidate grid; low values waste outer iterations. for _ in range(1000): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) color = rr.choice([1, 2, 3, 4, 6, 7, 8, 9]) shape_h = rr.randint(2, min(6, h - 4)) shape_w = rr.randint(2, min(6, w - 4)) sig = _random_connected_shape(rr, shape_h, shape_w) if not (2 <= len(sig) <= 10): continue n_instances = rr.randint(6, 16) anchors: list[tuple[int, int]] = [] occupied: set[Pos] = set() top_cut_count = 0 bot_cut_count = 0 left_cut_count = 0 right_cut_count = 0 full_count = 0 for _j in range(n_instances * 14): if len(anchors) >= n_instances: break top = rr.randint(-shape_h + 1, h - 1) left = rr.randint(-shape_w + 1, w - 1) visible = _visible_from_anchor(sig, top, left, h, w) if not visible: continue expanded = set(visible) for r, c in list(visible): for nr, nc in _neighbors4(r, c): if _in_bounds(h, w, nr, nc): expanded.add((nr, nc)) if occupied & expanded: continue anchors.append((top, left)) occupied |= expanded if top < 0: top_cut_count += 1 if top + shape_h - 1 >= h: bot_cut_count += 1 if left < 0: left_cut_count += 1 if left + shape_w - 1 >= w: right_cut_count += 1 if ( 0 <= top and top + shape_h - 1 < h and 0 <= left and left + shape_w - 1 < w and len(visible) == len(sig) ): full_count += 1 if len(anchors) < 5: continue if full_count < 2: continue if rr.random() < 0.75 and (top_cut_count + bot_cut_count) == 0: continue if rr.random() < 0.7 and (left_cut_count + right_cut_count) == 0: continue inp = _empty(h, w) for top, left in anchors: _draw_shape(inp, color, sig, top, left) try: out = transform_t17(inp) except ValueError: continue if out == inp: continue if not any(out[r][c] == color and inp[r][c] == BG for r in range(h) for c in range(w)): continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t17 instance"") ","""""""Verifier for Test2/t17 recurring-pattern downward shift."""""" from __future__ import annotations from typing import List from generator import transform_t17 Grid = List[List[int]] def verify_t17(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t17(inp) " "t18","[{""input"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,8,0,0,0,8,0],[0,0,0,8,0,8,0,8,0,8],[0,0,8,0,0,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,8,0,0,0,8,0],[0,0,0,8,0,8,0,8,0,8],[0,0,8,0,0,0,8,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,8,0,0,0,8,0,0],[8,0,8,0,8,0,8,0,8,0],[0,8,0,0,0,8,0,0,0,8]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,5,0,0,0,0,0,5,0,0,0,0],[0,5,0,0,0,0,0,5,0,0,0,0],[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9,0,9,0,9,0,9,0,9,0],[0,0,0,0,9,0,0,0,9,0,0,0,9,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,9,0,0,0,9,0,0,0,9,0],[0,0,9,0,9,0,9,0,9,0,9,0,9,0],[0,0,0,9,0,9,0,9,0,9,0,9,0,9],[0,0,9,0,9,0,9,0,9,0,9,0,9,0],[0,0,0,0,9,0,0,0,9,0,0,0,9,0],[0,0,0,9,0,0,0,9,0,0,0,9,0,0],[0,9,0,9,0,9,0,9,0,9,0,9,0,9],[9,0,9,0,9,0,9,0,9,0,9,0,9,0],[0,9,0,9,0,9,0,9,0,9,0,9,0,9],[0,0,0,9,0,0,0,9,0,0,0,9,0,0]]}]}","""""""Generator for Test2/t18: horizontal periodic pattern wrapping between halves. Rule: a horizontally periodic motif occupies one half of the grid, with its axis row reaching one of the side edges (left or right) and NOT touching the opposite edge. The motif then ""wraps"" into the other half on the SAME side as the wrap edge, just shifted vertically into the other half. From there it continues across the other half all the way to the opposite grid edge. The periodic structure is preserved across the wrap. Equivalently, parameterize the wave by an integer position x that increases along its path from the input-half interior, out to the wrap edge, then jumps across to the same edge in the other half and proceeds to the opposite edge: - Input half, wrap=right: col c -> x = c. (col 0 interior, col W-1 wrap edge) - Other half, wrap=right: col c -> x = 2*W - 1 - c. (col W-1 wrap edge, col 0 opposite) - Input half, wrap=left : col c -> x = W - 1 - c. (col W-1 interior, col 0 wrap edge) - Other half, wrap=left : col c -> x = W + c. (col 0 wrap edge, col W-1 opposite) Cells are drawn at (axis_row + dr, c) iff (dr, x mod P) belongs to the motif M. The same period P and motif M apply to both halves; the axis row in the other half is at the same RELATIVE position within its half. """""" from __future__ import annotations import random from typing import Iterable, List, Tuple Grid = List[List[int]] Pos = Tuple[int, int] MotifCell = Tuple[int, int] # (dr, dx) BG = 0 def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _x_for_col(c: int, w: int, wrap_edge: str, half: str, *, input_half: str) -> int: """"""Snake parameter x for a given column. The wave is parameterised so that x increases along its physical path: starting at the interior corner of the input half (x = 0), reaching the wrap edge of the input half at x = W-1, then jumping vertically to the SAME side in the other half (x = W at that wrap-edge column) and continuing to the opposite edge of the other half (x = 2W-1). """""" if half == input_half: # Input half: x grows toward the wrap edge. return c if wrap_edge == ""right"" else (w - 1 - c) # Other half: enter at the wrap edge (x=W) and march toward the opposite edge. if wrap_edge == ""right"": return w + (w - 1 - c) return w + c def _draw_motif_in_half( grid: Grid, color: int, motif: Iterable[MotifCell], period: int, axis_row: int, wrap_edge: str, half: str, *, input_half: str, col_extent: Tuple[int, int] | None = None, ) -> None: """"""Paint motif cells inside one half of the grid. `col_extent` lets the input half be drawn with a partial extent (so the wave only covers part of the half), matching the look of the manual examples; the other half is always drawn for every column. """""" h = len(grid) w = len(grid[0]) if h else 0 motif_set = set(motif) drs = sorted({dr for dr, _ in motif_set}) cols = range(w) if col_extent is None else range(col_extent[0], col_extent[1] + 1) for c in cols: x = _x_for_col(c, w, wrap_edge, half, input_half=input_half) dx = x % period for dr in drs: if (dr, dx) in motif_set: rr = axis_row + dr if _in_bounds(h, w, rr, c): grid[rr][c] = color def _row_counts(grid: Grid, color: int) -> dict[int, int]: counts: dict[int, int] = {} for r, row in enumerate(grid): n = sum(1 for v in row if v == color) if n: counts[r] = n return counts def _detect_motif( grid: Grid, color: int, axis_row: int, wrap_edge: str, input_half: str, ) -> tuple[int, set[MotifCell]]: """"""Find the smallest period P and motif consistent with the input pattern. Consistency means: within the pattern's column bbox, every cell predicted by the motif (for each (dr, x mod P)) is actually painted, and no painted cell goes unexplained. """""" h = len(grid) w = len(grid[0]) if h else 0 cells = [(r, c) for r in range(h) for c in range(w) if grid[r][c] == color] if not cells: raise ValueError(""no foreground cells"") cell_set = set(cells) drs_present = sorted({r - axis_row for r, _ in cells}) cols_present = [c for _, c in cells] col_lo = min(cols_present) col_hi = max(cols_present) pairs = [ (r - axis_row, _x_for_col(c, w, wrap_edge, input_half, input_half=input_half)) for r, c in cells ] for period in range(1, w + 1): motif = {(dr, x % period) for dr, x in pairs} # Check both directions of consistency. ok = True for dr in drs_present: allowed = {dx for d, dx in motif if d == dr} for c in range(col_lo, col_hi + 1): x = _x_for_col(c, w, wrap_edge, input_half, input_half=input_half) rr = axis_row + dr predicted = (x % period) in allowed actual = (rr, c) in cell_set if predicted != actual: ok = False break if not ok: break if ok: return period, motif raise ValueError(""could not infer periodic motif"") def transform_t18(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") if h % 2 != 0: raise ValueError(""input grid height must be even"") colors = sorted({v for row in inp for v in row if v != BG}) if len(colors) != 1: raise ValueError(""expected exactly one foreground color"") color = colors[0] counts = _row_counts(inp, color) if not counts: raise ValueError(""no foreground cells"") half_h = h // 2 # Axis row = row with the most cells; tie-broken by closeness to a half center. axis_row = max( counts.keys(), key=lambda r: (counts[r], -min(abs(r - half_h // 2), abs(r - (h - half_h // 2)))), ) axis_cols = sorted(c for r in counts for c in range(w) if inp[r][c] == color and r == axis_row) if axis_cols and axis_cols[-1] == w - 1: wrap_edge = ""right"" elif axis_cols and axis_cols[0] == 0: wrap_edge = ""left"" else: # Fallback: pick the side closer to the rightmost or leftmost cell. wrap_edge = ""right"" if axis_cols and (w - 1 - axis_cols[-1]) <= axis_cols[0] else ""left"" input_half = ""upper"" if axis_row < half_h else ""lower"" other_axis_row = axis_row + half_h if input_half == ""upper"" else axis_row - half_h period, motif = _detect_motif(inp, color, axis_row, wrap_edge, input_half) dr_min = min(dr for dr, _ in motif) dr_max = max(dr for dr, _ in motif) # Re-anchor the axis row so the entire pattern fits inside the input half. if input_half == ""upper"": lo = -dr_min hi = half_h - 1 - dr_max else: lo = half_h + (-dr_min) hi = h - 1 - dr_max adjusted_axis = max(lo, min(hi, axis_row)) other_axis_row = ( adjusted_axis + half_h if input_half == ""upper"" else adjusted_axis - half_h ) cells_present = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == color] cols_present = [c for _, c in cells_present] col_lo = min(cols_present) col_hi = max(cols_present) out = _empty(h, w) _draw_motif_in_half( out, color, motif, period, adjusted_axis, wrap_edge, input_half, input_half=input_half, col_extent=(col_lo, col_hi), ) other_half = ""lower"" if input_half == ""upper"" else ""upper"" _draw_motif_in_half( out, color, motif, period, other_axis_row, wrap_edge, other_half, input_half=input_half, ) return out # --------------------------------------------------------------------------- # Generator-side helpers: motif library and sampling. # --------------------------------------------------------------------------- def _wave_motif(rng: random.Random) -> tuple[int, list[MotifCell]]: """"""3-row wave, axis on alternating cols with above/below offshoots."""""" period = rng.choice([4, 4, 6]) motif: list[MotifCell] = [(0, dx) for dx in range(period) if dx % 2 == 0] # Offshoots above/below at odd dx, alternating. odds = [dx for dx in range(period) if dx % 2 == 1] rng.shuffle(odds) if len(odds) == 1: motif.append((rng.choice([-1, 1]), odds[0])) else: for i, dx in enumerate(odds): motif.append(((-1) ** i, dx)) return period, motif def _diamond_motif(rng: random.Random) -> tuple[int, list[MotifCell]]: """"""5-row diamond/star with axis at every other dx."""""" period = 4 motif: list[MotifCell] = [(0, 0), (0, 2)] # dx=1 gets a narrow vertical, dx=3 a wide vertical (or swapped). narrow = [(-1, 1), (0, 1), (1, 1)] wide = [(-2, 3), (0, 3), (2, 3)] if rng.random() < 0.5: narrow = [(dr, 3) for dr, _ in narrow] wide = [(dr, 1) for dr, _ in wide] motif.extend(narrow) motif.extend(wide) return period, motif def _double_diamond_motif(rng: random.Random) -> tuple[int, list[MotifCell]]: """"""Star-like 5-row motif at period 4 (no axis cell at full-vertical dx)."""""" period = 4 motif: list[MotifCell] = [ (0, 0), (0, 2), (-1, 1), (1, 1), (-2, 3), (-1, 3), (1, 3), (2, 3), ] if rng.random() < 0.5: motif = [(dr, (period - dx) % period) for dr, dx in motif] return period, motif def _long_arm_motif(rng: random.Random) -> tuple[int, list[MotifCell]]: """"""Period-6 motif with a 'long arm' axis spanning every column."""""" period = 6 motif: list[MotifCell] = [(0, dx) for dx in range(period)] above_dx = rng.choice([1, 2]) below_dx = (above_dx + 3) % period above_depth = rng.choice([1, 2]) below_depth = rng.choice([1, 2]) for k in range(1, above_depth + 1): motif.append((-k, above_dx)) for k in range(1, below_depth + 1): motif.append((k, below_dx)) return period, motif _MOTIF_BUILDERS = [ _wave_motif, _diamond_motif, _double_diamond_motif, _long_arm_motif, ] def _pattern_height(motif: Iterable[MotifCell]) -> tuple[int, int]: drs = [dr for dr, _ in motif] return min(drs), max(drs) def _phase_align_motif( motif: list[MotifCell], period: int, target_dx: int ) -> list[MotifCell]: """"""Rotate motif (shift all dx by a constant) so that an axis cell lands on `target_dx`. This guarantees the axis row reaches the wrap-edge column of the input half. If there is no axis cell, the motif is returned unchanged. """""" axis_dxs = [dx for dr, dx in motif if dr == 0] if not axis_dxs: return motif if target_dx in axis_dxs: return motif shift = (target_dx - axis_dxs[0]) % period return [(dr, (dx + shift) % period) for dr, dx in motif] def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() for _ in range(2000): h = rr.randrange(min_h, max_h + 1, 2) # ensure even height w = rr.randint(min_w, max_w) color = rr.choice([1, 2, 3, 4, 6, 7, 8, 9]) wrap_edge = rr.choice([""left"", ""right""]) input_half = rr.choice([""upper"", ""lower""]) builder = rr.choice(_MOTIF_BUILDERS) period, motif = builder(rr) # Rotate motif so that the wrap-edge column carries an axis cell. # Under the snake parameterisation, the wrap-edge column always has # x = W - 1 regardless of which side it is on, so the target dx is the # same for both wrap directions. target_dx = (w - 1) % period motif = _phase_align_motif(motif, period, target_dx) dr_min, dr_max = _pattern_height(motif) pattern_h = dr_max - dr_min + 1 half_h = h // 2 if pattern_h > half_h: continue # Choose axis position so the pattern fits inside the input half. rel_axis_min = -dr_min rel_axis_max = half_h - 1 - dr_max if rel_axis_min > rel_axis_max: continue rel_axis = rr.randint(rel_axis_min, rel_axis_max) axis_row = rel_axis if input_half == ""upper"" else rel_axis + half_h # Decide a partial column extent for the input half, anchored at wrap edge. # The pattern must touch the wrap edge but NOT the opposite edge, so we # always leave at least one empty column on the far side. max_extent = max(period + 2, w - 1) max_extent = min(max_extent, w - 1) min_extent = max(period + 2, w - period * 2) min_extent = min(min_extent, max_extent) extent = rr.randint(min_extent, max_extent) if wrap_edge == ""right"": col_lo = w - extent col_hi = w - 1 else: col_lo = 0 col_hi = extent - 1 inp = _empty(h, w) _draw_motif_in_half( inp, color, motif, period, axis_row, wrap_edge, input_half, input_half=input_half, col_extent=(col_lo, col_hi), ) # Sanity 1: axis row must touch the wrap edge inside the input half. axis_in_row = [c for c in range(w) if inp[axis_row][c] == color] if not axis_in_row: continue if wrap_edge == ""right"" and axis_in_row[-1] != w - 1: continue if wrap_edge == ""left"" and axis_in_row[0] != 0: continue # Sanity 2: NO row of the input pattern may touch the opposite edge. any_cells = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == color] if not any_cells: continue all_cols = {c for _, c in any_cells} if wrap_edge == ""right"" and 0 in all_cols: continue if wrap_edge == ""left"" and (w - 1) in all_cols: continue try: out = transform_t18(inp) except ValueError: continue if out == inp: continue # Verify the snake produced extra cells in the other half. new_cells = sum( 1 for r in range(h) for c in range(w) if inp[r][c] == BG and out[r][c] == color ) if new_cells < pattern_h: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t18 instance"") ","""""""Verifier for Test2/t18 horizontal wrap-and-continue rule."""""" from __future__ import annotations from typing import List from generator import transform_t18 Grid = List[List[int]] def verify_t18(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t18(inp) " "t19","[{""input"":[[5,0,0,0,0,8,0,0,0,0],[0,0,0,0,0,8,0,0,0,0],[0,0,0,0,0,8,0,0,0,0],[0,0,0,0,0,8,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,3,3,3,0,0,0,0,0,0],[0,3,0,0,0,0,0,0,0,0],[0,3,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,5]],""output"":[[5,0,0,0,0,8,8,8,8,0],[0,0,0,0,0,8,8,8,8,0],[0,0,0,0,0,8,8,8,8,0],[0,0,0,0,0,8,8,8,8,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,3,3,3,0,0,0,0,0,0],[0,3,3,3,0,0,0,0,0,0],[0,3,3,3,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,5]]},{""input"":[[0,0,0,0,0,0,0,6,0,0,0],[0,0,0,0,0,0,0,0,6,0,0],[0,0,0,2,0,0,0,0,0,6,0],[0,0,2,0,0,8,8,8,0,0,0],[0,2,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0,0,0,5],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,4,4,4,0,0,0]],""output"":[[0,5,5,5,5,5,5,5,5,5,0],[0,5,5,5,5,5,5,5,5,5,0],[0,5,5,5,5,5,5,5,5,5,0],[0,5,5,5,5,5,5,5,5,5,0],[0,5,5,5,5,5,5,5,5,5,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0,0,0,5],[0,0,0,0,0,4,4,4,0,0,0],[0,0,0,0,0,4,4,4,0,0,0],[0,0,0,0,0,4,4,4,0,0,0]]},{""input"":[[0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5,5,0],[5,5,5,5,5,0,0,5,5,5,5,0],[0,0,0,0,0,0,0,5,5,5,5,0],[0,0,0,0,0,0,0,5,5,5,5,0],[0,0,0,0,0,0,5,0,0,0,0,0]]}]}","""""""Generator for Test2/t19: split-by-dots line and side-wise box growth/fill. Rule: - Exactly two gray dots (color 5) lie on two different grid edges. - The (invisible) line through these dots splits the grid into two halves. - Each half is processed independently: * If the half contains multiple shapes (8-connected components), fill the bounding box of all shapes in that half with gray. * If the half contains exactly one shape, grow it to an x*x square in its own color, where x = max(bbox_height, bbox_width) of that shape. - Nothing painted by the transformation may lie on the divider line. """""" from __future__ import annotations import random from collections import deque from typing import Iterable, List, Sequence, Tuple Grid = List[List[int]] Pos = Tuple[int, int] BG = 0 GRAY = 5 NEI8 = [ (-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1), ] def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _is_edge(r: int, c: int, h: int, w: int) -> bool: return r == 0 or c == 0 or r == h - 1 or c == w - 1 def _edge_ids(r: int, c: int, h: int, w: int) -> set[str]: ids: set[str] = set() if r == 0: ids.add(""top"") if r == h - 1: ids.add(""bottom"") if c == 0: ids.add(""left"") if c == w - 1: ids.add(""right"") return ids def _cross(a: Pos, b: Pos, p: Pos) -> int: """"""2D cross product sign for directed line a->b vs point p."""""" ar, ac = a br, bc = b pr, pc = p return (br - ar) * (pc - ac) - (bc - ac) * (pr - ar) def _find_anchor_dots(grid: Grid) -> tuple[Pos, Pos]: h = len(grid) w = len(grid[0]) if h else 0 dots = [(r, c) for r in range(h) for c in range(w) if grid[r][c] == GRAY] if len(dots) != 2: raise ValueError(""expected exactly two gray anchor dots"") a, b = dots if a == b: raise ValueError(""anchor dots must differ"") if not _is_edge(a[0], a[1], h, w) or not _is_edge(b[0], b[1], h, w): raise ValueError(""gray anchor dots must be on edges"") if _edge_ids(a[0], a[1], h, w) & _edge_ids(b[0], b[1], h, w): raise ValueError(""gray anchor dots must be on two different edges"") return a, b def _shape_components(cells: set[Pos]) -> list[set[Pos]]: rem = set(cells) comps: list[set[Pos]] = [] while rem: s = next(iter(rem)) q = deque([s]) rem.remove(s) comp = {s} while q: r, c = q.popleft() for dr, dc in NEI8: rr, cc = r + dr, c + dc if (rr, cc) in rem: rem.remove((rr, cc)) comp.add((rr, cc)) q.append((rr, cc)) comps.append(comp) return comps def _bbox(cells: Iterable[Pos]) -> tuple[int, int, int, int]: xs = list(cells) rs = [r for r, _ in xs] cs = [c for _, c in xs] return min(rs), max(rs), min(cs), max(cs) def _paint_rect(out: Grid, r0: int, r1: int, c0: int, c1: int, color: int) -> None: for r in range(r0, r1 + 1): for c in range(c0, c1 + 1): out[r][c] = color def transform_t19(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") a, b = _find_anchor_dots(inp) # Partition all non-background, non-gray cells by side of divider line. side_cells: dict[int, set[Pos]] = {-1: set(), 1: set()} for r in range(h): for c in range(w): v = inp[r][c] if v in (BG, GRAY): continue s = _cross(a, b, (r, c)) if s == 0: raise ValueError(""shape cell on divider line"") side_cells[-1 if s < 0 else 1].add((r, c)) out = _empty(h, w) out[a[0]][a[1]] = GRAY out[b[0]][b[1]] = GRAY for side in (-1, 1): comps = _shape_components(side_cells[side]) if not comps: continue if len(comps) >= 2: # Multiple shapes: fill aggregate bbox with gray. all_cells = set().union(*comps) r0, r1, c0, c1 = _bbox(all_cells) for rr in range(r0, r1 + 1): for cc in range(c0, c1 + 1): s = _cross(a, b, (rr, cc)) if s == 0: raise ValueError(""multi-shape fill overlaps divider line"") if (-1 if s < 0 else 1) != side: raise ValueError(""multi-shape fill crosses divider"") _paint_rect(out, r0, r1, c0, c1, GRAY) else: # Single shape: grow to x*x square (x = max bbox side). # To avoid ambiguity, select the unique valid square that contains # the shape and is as close as possible to the shape's top-left # bbox corner (i.e., minimal up/left shift). comp = comps[0] colors = {inp[r][c] for r, c in comp} if len(colors) != 1: raise ValueError(""single shape must be monochrome"") color = next(iter(colors)) minr, maxr, minc, maxc = _bbox(comp) x = max(maxr - minr + 1, maxc - minc + 1) r0_lo = max(0, maxr - x + 1) r0_hi = min(minr, h - x) c0_lo = max(0, maxc - x + 1) c0_hi = min(minc, w - x) if r0_lo > r0_hi or c0_lo > c0_hi: raise ValueError(""single-shape square has no in-bounds placement"") candidates: list[tuple[int, int]] = [] for r0 in range(r0_lo, r0_hi + 1): for c0 in range(c0_lo, c0_hi + 1): rr1 = r0 + x - 1 cc1 = c0 + x - 1 ok = True for rr in range(r0, rr1 + 1): for cc in range(c0, cc1 + 1): s = _cross(a, b, (rr, cc)) if s == 0 or (-1 if s < 0 else 1) != side: ok = False break if not ok: break if ok: candidates.append((r0, c0)) if not candidates: raise ValueError(""single-shape square overlaps/crosses divider"") # Prefer maximal r0, then maximal c0: closest to (minr, minc) from # below/left constraints while keeping containment. r0, c0 = max(candidates, key=lambda rc: (rc[0], rc[1])) _paint_rect(out, r0, r0 + x - 1, c0, c0 + x - 1, color) return out def _all_edge_positions(h: int, w: int, edge: str) -> list[Pos]: if edge == ""top"": return [(0, c) for c in range(w)] if edge == ""bottom"": return [(h - 1, c) for c in range(w)] if edge == ""left"": return [(r, 0) for r in range(h)] if edge == ""right"": return [(r, w - 1) for r in range(h)] raise ValueError(""unknown edge"") def _is_direct_connect_pair(a: Pos, b: Pos) -> bool: dr = abs(a[0] - b[0]) dc = abs(a[1] - b[1]) return dr == 0 or dc == 0 or dr == dc def _all_valid_anchor_pairs(h: int, w: int) -> list[tuple[Pos, Pos]]: edges = [""top"", ""bottom"", ""left"", ""right""] points_by_edge = {e: _all_edge_positions(h, w, e) for e in edges} pairs: list[tuple[Pos, Pos]] = [] for e1 in edges: for e2 in edges: if e2 == e1: continue for p1 in points_by_edge[e1]: for p2 in points_by_edge[e2]: if p1 == p2: continue if _edge_ids(p1[0], p1[1], h, w) & _edge_ids(p2[0], p2[1], h, w): continue # Avoid very short separators. if abs(p1[0] - p2[0]) + abs(p1[1] - p2[1]) < max(4, min(h, w) // 2): continue pairs.append((p1, p2)) # De-duplicate reversed pairs. uniq: list[tuple[Pos, Pos]] = [] seen: set[tuple[Pos, Pos]] = set() for a, b in pairs: k = (a, b) if a <= b else (b, a) if k in seen: continue seen.add(k) uniq.append((a, b)) return uniq def _pick_anchors(rr: random.Random, h: int, w: int) -> tuple[Pos, Pos]: pairs = _all_valid_anchor_pairs(h, w) if not pairs: raise ValueError(""no valid anchor pairs"") direct = [p for p in pairs if _is_direct_connect_pair(p[0], p[1])] ambiguous = [p for p in pairs if not _is_direct_connect_pair(p[0], p[1])] # Most samples should be directly connectable (horizontal/vertical/diagonal). use_direct = bool(direct) and (not ambiguous or rr.random() < 0.85) pool = direct if use_direct else ambiguous return rr.choice(pool) def _raster_line_cells(a: Pos, b: Pos) -> set[Pos]: """"""Integer raster cells of the segment using Bresenham."""""" r0, c0 = a r1, c1 = b dr = abs(r1 - r0) dc = abs(c1 - c0) sr = 1 if r0 < r1 else -1 sc = 1 if c0 < c1 else -1 err = dc - dr cells: set[Pos] = set() while True: cells.add((r0, c0)) if r0 == r1 and c0 == c1: break e2 = 2 * err if e2 > -dr: err -= dr c0 += sc if e2 < dc: err += dc r0 += sr return cells def _cells_on_side(h: int, w: int, a: Pos, b: Pos, side: int) -> list[Pos]: out: list[Pos] = [] for r in range(h): for c in range(w): s = _cross(a, b, (r, c)) if s == 0: continue if (-1 if s < 0 else 1) == side: out.append((r, c)) return out def _rect_fits_side(a: Pos, b: Pos, side: int, r0: int, r1: int, c0: int, c1: int) -> bool: for r in range(r0, r1 + 1): for c in range(c0, c1 + 1): s = _cross(a, b, (r, c)) if s == 0: return False if (-1 if s < 0 else 1) != side: return False return True def _random_connected_subset( rr: random.Random, base_cells: Sequence[Pos], min_size: int, max_size: int ) -> set[Pos]: base = set(base_cells) if not base: return set() start = rr.choice(list(base)) target = rr.randint(min_size, max_size) chosen = {start} frontier = {start} while frontier and len(chosen) < target: r, c = rr.choice(list(frontier)) neigh = [] for dr, dc in NEI8: p = (r + dr, c + dc) if p in base and p not in chosen: neigh.append(p) if neigh: p = rr.choice(neigh) chosen.add(p) frontier.add(p) else: frontier.remove((r, c)) if not frontier and len(chosen) < target: # Restart growth from any chosen cell with potential neighbors. frontier = set(chosen) return chosen def _place_single_side( grid: Grid, rr: random.Random, a: Pos, b: Pos, side: int, color: int, ) -> bool: h = len(grid) w = len(grid[0]) if h else 0 # Choose a square target that is entirely on one side and away from divider. for _ in range(120): x = rr.randint(2, min(5, min(h, w) - 1)) r0 = rr.randint(0, h - x) c0 = rr.randint(0, w - x) if not _rect_fits_side(a, b, side, r0, r0 + x - 1, c0, c0 + x - 1): continue # Build one connected non-full shape inside this box with bbox that has # max(height, width)=x, anchored at (r0, c0). # Use either horizontal line, vertical line, or L-shape. pattern = rr.choice([""hline"", ""vline"", ""L""]) cells: set[Pos] if pattern == ""hline"": row = r0 + rr.randint(0, x - 1) cells = {(row, c) for c in range(c0, c0 + x)} elif pattern == ""vline"": col = c0 + rr.randint(0, x - 1) cells = {(r, col) for r in range(r0, r0 + x)} else: arm1 = rr.randint(2, x) arm2 = rr.randint(2, x) cells = {(r0, c0 + dc) for dc in range(arm1)} | {(r0 + dr, c0) for dr in range(arm2)} # Ensure bbox side length is exactly x. if rr.random() < 0.5: cells.add((r0, c0 + x - 1)) else: cells.add((r0 + x - 1, c0)) # Keep exactly one component and avoid touching gray dots/other shapes. if any(grid[r][c] != BG for r, c in cells): continue for r, c in cells: grid[r][c] = color return True return False def _single_side_square_candidates(grid: Grid, a: Pos, b: Pos, side: int) -> list[tuple[int, int, int]]: """"""Return valid square placements (r0, c0, x) for the side's single shape."""""" h = len(grid) w = len(grid[0]) if h else 0 cells = { (r, c) for r in range(h) for c in range(w) if grid[r][c] not in (BG, GRAY) and ((_cross(a, b, (r, c)) < 0) == (side < 0)) } comps = _shape_components(cells) if len(comps) != 1: return [] comp = comps[0] minr, maxr, minc, maxc = _bbox(comp) x = max(maxr - minr + 1, maxc - minc + 1) r0_lo = max(0, maxr - x + 1) r0_hi = min(minr, h - x) c0_lo = max(0, maxc - x + 1) c0_hi = min(minc, w - x) if r0_lo > r0_hi or c0_lo > c0_hi: return [] out: list[tuple[int, int, int]] = [] for r0 in range(r0_lo, r0_hi + 1): for c0 in range(c0_lo, c0_hi + 1): rr1 = r0 + x - 1 cc1 = c0 + x - 1 if _rect_fits_side(a, b, side, r0, rr1, c0, cc1): out.append((r0, c0, x)) return out def _place_multi_side( grid: Grid, rr: random.Random, a: Pos, b: Pos, side: int, colors: Sequence[int], ) -> bool: h = len(grid) w = len(grid[0]) if h else 0 for _ in range(150): bh = rr.randint(3, min(6, h - 1)) bw = rr.randint(3, min(6, w - 1)) r0 = rr.randint(0, h - bh) c0 = rr.randint(0, w - bw) r1 = r0 + bh - 1 c1 = c0 + bw - 1 if not _rect_fits_side(a, b, side, r0, r1, c0, c1): continue # Reserve this bbox region for multiple separated components. if any(grid[r][c] != BG for r in range(r0, r1 + 1) for c in range(c0, c1 + 1)): continue base = [(r, c) for r in range(r0, r1 + 1) for c in range(c0, c1 + 1)] placed: list[set[Pos]] = [] ok = True n_comps = rr.randint(2, 3) for i in range(n_comps): comp = _random_connected_subset(rr, base, min_size=2, max_size=min(6, len(base))) if len(comp) < 2: ok = False break # Keep components separated (including diagonal) to avoid accidental merge. for old in placed: if any(abs(r1_ - r2_) <= 1 and abs(c1_ - c2_) <= 1 for r1_, c1_ in comp for r2_, c2_ in old): ok = False break if not ok: break placed.append(comp) if not ok: continue # Paint components. for i, comp in enumerate(placed): color = colors[i % len(colors)] for r, c in comp: grid[r][c] = color return True return False def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() for _ in range(2500): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) inp = _empty(h, w) a, b = _pick_anchors(rr, h, w) inp[a[0]][a[1]] = GRAY inp[b[0]][b[1]] = GRAY # Ensure both sides are sufficiently populated with available cells. neg_cells = _cells_on_side(h, w, a, b, -1) pos_cells = _cells_on_side(h, w, a, b, 1) if len(neg_cells) < 12 or len(pos_cells) < 12: continue palette = [1, 2, 3, 4, 6, 7, 8, 9] rr.shuffle(palette) # Randomly choose each side as single/multi; force at least one multi for variety. side_mode = { -1: ""single"" if rr.random() < 0.45 else ""multi"", 1: ""single"" if rr.random() < 0.45 else ""multi"", } if side_mode[-1] == ""single"" and side_mode[1] == ""single"": side_mode[rr.choice([-1, 1])] = ""multi"" ok = True color_idx = 0 for side in (-1, 1): if side_mode[side] == ""single"": color = palette[color_idx] color_idx += 1 if not _place_single_side(inp, rr, a, b, side, color): ok = False break else: colors = [palette[color_idx], palette[color_idx + 1], palette[color_idx + 2]] color_idx += 3 if not _place_multi_side(inp, rr, a, b, side, colors): ok = False break if not ok: continue try: out = transform_t19(inp) except ValueError: continue # Reject single-shape sides where square placement is ambiguous. ambiguous_single = False for side in (-1, 1): if side_mode[side] != ""single"": continue cands = _single_side_square_candidates(inp, a, b, side) if len(cands) != 1: ambiguous_single = True break if ambiguous_single: continue if out == inp: continue # Sanity 1: output should not place non-bg on analytic divider line except anchors. bad = False for r in range(h): for c in range(w): if (r, c) in (a, b): continue if _cross(a, b, (r, c)) == 0 and out[r][c] != BG: bad = True break if bad: break if bad: continue # Sanity 2: avoid perceived ambiguity: do not place transformed cells on # Bresenham divider raster cells either (except anchors). raster = _raster_line_cells(a, b) raster.discard(a) raster.discard(b) if any(out[r][c] != BG for r, c in raster): continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t19 instance"") ","""""""Verifier for Test2/t19 split-by-dots line rule."""""" from __future__ import annotations from typing import List from generator import transform_t19 Grid = List[List[int]] def verify_t19(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t19(inp) " "t20","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,2,2,0,2,2,0,2,2,0,2,2],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,2,2,0,2,2,2,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[2,2,2,2,0,0,0,0,2,2,2,2],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,6,0,0,0,0],[0,0,0,6,0,0,0,0,0,0,6,0],[0,0,0,0,0,0,6,0,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,0,0],[0,0,0,0,0,5,5,5,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,2,2,0,2,2,0,0,0,0,2,2],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,2,2,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,0,0],[0,0,0,0,0,5,5,5,0,0,0,0]]},{""input"":[[0,1,1,1,1,1,0,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0],[1,1,1,0,0,0,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,1,1,0,1,1,1,0,0,1,1],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,6,0,0,0,0,0],[0,6,0,0,0,6,0,0,0,0,0],[0,0,0,0,0,0,0,0,6,0,0],[0,0,0,0,0,0,0,0,5,0,0],[0,0,0,0,0,0,0,5,5,5,0]],""output"":[[0,0,0,0,0,0,0,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0],[1,1,1,0,0,0,0,0,0,0,0],[0,0,0,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,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,5,0,0,0,0,0,0,0],[0,5,5,5,0,0,0,0,0,0]]},{""input"":[[2,2,2,0,2,2,2,2,2,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[2,2,2,2,2,2,2,2,2,2,0,0],[2,2,2,0,2,2,0,0,2,2,2,2],[2,2,2,2,2,2,2,2,0,0,2,2],[0,0,0,0,0,0,0,6,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,6,0,0,0,0,0,0,0,0,0],[0,0,0,6,0,0,0,6,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,0,0],[0,0,0,0,0,5,5,5,0,0,0,0]],""output"":[[2,2,2,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,2,2,0,0,2,2,2,2],[0,0,0,0,0,0,0,0,0,0,2,2],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,0,0],[0,0,0,0,0,5,5,5,0,0,0,0]]}]}","""""""Generator for Test2/t20: space-invader style ship destruction. Rule: - Alien ships are foreground components (non-zero, non-gray, non-pink). - Pink cells (6) are shots fired vertically upward. - Shots are processed by shooter row from top to bottom. - Within the same row, shot order is chosen to maximize total ships destroyed eventually (looking ahead to lower rows). Deterministic tie-break: smallest lexicographic column-order permutation. - One shot destroys one whole ship (its entire connected component). - Gray cannon (5) at the bottom remains unchanged. """""" from __future__ import annotations import itertools import random from collections import defaultdict from functools import lru_cache from typing import Dict, Iterable, List, Sequence, Tuple Grid = List[List[int]] Pos = Tuple[int, int] BG = 0 SHOT = 6 CANNON = 5 def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _extract_scene(inp: Grid) -> tuple[list[set[Pos]], dict[int, list[tuple[int, int]]], set[Pos], dict[int, int]]: """"""Return ships, shots grouped by row, cannon cells, and ship color. A ""ship"" is a maximal horizontal run of alien color in a single row. (Rows are independent ship lanes; vertical touching does not merge ships.) """""" h = len(inp) w = len(inp[0]) if h else 0 ships: list[set[Pos]] = [] ship_color: dict[int, int] = {} for r in range(h): c = 0 while c < w: v = inp[r][c] if v in (BG, SHOT, CANNON): c += 1 continue c0 = c while c + 1 < w and inp[r][c + 1] == v: c += 1 comp = {(r, cc) for cc in range(c0, c + 1)} sid = len(ships) ships.append(comp) ship_color[sid] = v c += 1 shots_by_row: dict[int, list[tuple[int, int]]] = defaultdict(list) for r in range(h): for c in range(w): if inp[r][c] == SHOT: shots_by_row[r].append((r, c)) cannon_cells = {(r, c) for r in range(h) for c in range(w) if inp[r][c] == CANNON} if not cannon_cells: raise ValueError(""missing cannon cells"") return ships, dict(shots_by_row), cannon_cells, ship_color def _build_col_targets(ships: Sequence[set[Pos]], w: int) -> dict[int, list[tuple[int, int]]]: """"""For each column, sorted (bottommost_row_of_ship_in_col, ship_id) desc. A vertical shot hits the nearest surviving ship above it, so we compare against each ship's deepest (largest) row in that column. """""" col_to_ship_row: list[dict[int, int]] = [dict() for _ in range(w)] for sid, comp in enumerate(ships): max_row_in_col: dict[int, int] = {} for r, c in comp: prev = max_row_in_col.get(c) if prev is None or r > prev: max_row_in_col[c] = r for c, r in max_row_in_col.items(): col_to_ship_row[c][sid] = r out: dict[int, list[tuple[int, int]]] = {} for c in range(w): pairs = sorted(((r, sid) for sid, r in col_to_ship_row[c].items()), reverse=True) out[c] = pairs return out def _shot_hit_ship(col_targets: dict[int, list[tuple[int, int]]], alive_mask: int, rb: int, c: int) -> int | None: for r_ship, sid in col_targets.get(c, []): if r_ship >= rb: continue if (alive_mask >> sid) & 1: return sid return None def _simulate_row_perm( col_targets: dict[int, list[tuple[int, int]]], alive_mask: int, rb: int, cols_perm: Sequence[int], ) -> tuple[int, int]: """"""Return (new_alive_mask, destroyed_count_in_this_row)."""""" mask = alive_mask destroyed = 0 for c in cols_perm: sid = _shot_hit_ship(col_targets, mask, rb, c) if sid is None: continue if (mask >> sid) & 1: mask &= ~(1 << sid) destroyed += 1 return mask, destroyed def _resolve_shots_optimal( ships: Sequence[set[Pos]], shots_by_row: dict[int, list[tuple[int, int]]], w: int, ) -> tuple[int, int]: """"""Return (final_alive_mask, number_of_optimal_global_orders). number_of_optimal_global_orders is capped at 2 (1 means unique optimum). """""" n = len(ships) alive0 = (1 << n) - 1 col_targets = _build_col_targets(ships, w) rows = sorted(shots_by_row.keys()) row_cols = [tuple(c for _, c in shots_by_row[r]) for r in rows] # Unique permutations per row (handle duplicate columns defensively). row_perms: list[list[tuple[int, ...]]] = [] for cols in row_cols: perms = sorted(set(itertools.permutations(cols))) row_perms.append(perms) @lru_cache(maxsize=None) def dp(i: int, alive_mask: int) -> tuple[int, int]: if i == len(rows): return 0, 1 rb = rows[i] best = -1 ways = 0 for perm in row_perms[i]: nxt_mask, drow = _simulate_row_perm(col_targets, alive_mask, rb, perm) drest, wrest = dp(i + 1, nxt_mask) total = drow + drest if total > best: best = total ways = wrest elif total == best: ways = min(2, ways + wrest) return best, ways def choose(i: int, alive_mask: int) -> int: if i == len(rows): return alive_mask rb = rows[i] best, _ = dp(i, alive_mask) # Deterministic tie-break: lexicographically smallest permutation. for perm in row_perms[i]: nxt_mask, drow = _simulate_row_perm(col_targets, alive_mask, rb, perm) drest, _ = dp(i + 1, nxt_mask) if drow + drest == best: return choose(i + 1, nxt_mask) raise AssertionError(""unreachable"") _, ways = dp(0, alive0) final_alive = choose(0, alive0) return final_alive, ways def _count_tie_rows_along_optimal( ships: Sequence[set[Pos]], shots_by_row: dict[int, list[tuple[int, int]]], w: int, ) -> int: """"""Count row-level ties along the chosen optimal trajectory. For each shooter row on the lexicographically chosen optimal path, count a tie if more than one column-order permutation can still achieve the global optimum from that state. """""" n = len(ships) alive0 = (1 << n) - 1 col_targets = _build_col_targets(ships, w) rows = sorted(shots_by_row.keys()) row_cols = [tuple(c for _, c in shots_by_row[r]) for r in rows] row_perms: list[list[tuple[int, ...]]] = [] for cols in row_cols: perms = sorted(set(itertools.permutations(cols))) row_perms.append(perms) @lru_cache(maxsize=None) def dp(i: int, alive_mask: int) -> tuple[int, int]: if i == len(rows): return 0, 1 rb = rows[i] best = -1 ways = 0 for perm in row_perms[i]: nxt_mask, drow = _simulate_row_perm(col_targets, alive_mask, rb, perm) drest, wrest = dp(i + 1, nxt_mask) total = drow + drest if total > best: best = total ways = wrest elif total == best: ways = min(2, ways + wrest) return best, ways tie_rows = 0 i = 0 alive = alive0 while i < len(rows): rb = rows[i] best, _ = dp(i, alive) optimal_perms: list[tuple[int, ...]] = [] for perm in row_perms[i]: nxt_mask, drow = _simulate_row_perm(col_targets, alive, rb, perm) drest, _ = dp(i + 1, nxt_mask) if drow + drest == best: optimal_perms.append(perm) if len(optimal_perms) > 1: tie_rows += 1 # Deterministic continuation: lexicographically smallest optimal perm. chosen = optimal_perms[0] alive, _ = _simulate_row_perm(col_targets, alive, rb, chosen) i += 1 return tie_rows def transform_t20(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") ships, shots_by_row, cannon_cells, ship_color = _extract_scene(inp) if not ships: raise ValueError(""no ships found"") if not shots_by_row: raise ValueError(""no shots found"") alive_mask, _ways = _resolve_shots_optimal(ships, shots_by_row, w) out = _empty(h, w) for sid, comp in enumerate(ships): if ((alive_mask >> sid) & 1) == 0: continue col = ship_color[sid] for r, c in comp: out[r][c] = col for r, c in cannon_cells: out[r][c] = CANNON return out def _cannon_shape(h: int, w: int, rr: random.Random) -> set[Pos]: c = rr.randint(2, w - 3) r_base = h - 1 cells = {(r_base, c - 1), (r_base, c), (r_base, c + 1), (r_base - 1, c)} return cells def _place_ships(rr: random.Random, h: int, w: int, color: int) -> list[set[Pos]]: ships: list[set[Pos]] = [] used: set[Pos] = set() n_rows = rr.randint(3, 4) row_candidates = list(range(0, max(1, h // 2))) rr.shuffle(row_candidates) row_bases = sorted(row_candidates[:n_rows]) for rb in row_bases: nships = rr.randint(2, 4) starts = list(range(0, w - 1)) rr.shuffle(starts) placed = 0 for c0 in starts: if placed >= nships: break width = rr.randint(2, min(4, w - c0)) comp = {(rb, c) for c in range(c0, c0 + width)} # occasionally use a 2-row ""chunky"" ship if rr.random() < 0.3 and rb + 1 < h // 2: comp |= {(rb + 1, c) for c in range(c0, c0 + width) if rr.random() < 0.6} if any((r, c) in used for r, c in comp): continue # keep some spacing to avoid merges if any(abs(r - rr0) <= 0 and abs(c - cc0) <= 0 for r, c in comp for rr0, cc0 in used): continue ships.append(comp) used |= comp placed += 1 # Ensure enough ships. if len(ships) < 6: raise ValueError(""too few ships"") return ships def _ship_cells(ships: Iterable[set[Pos]]) -> set[Pos]: out: set[Pos] = set() for s in ships: out |= s return out def _place_shots( rr: random.Random, h: int, w: int, ship_cells: set[Pos], cannon: set[Pos], ) -> set[Pos]: shot_rows = list(range(h // 2, h - 2)) if not shot_rows: raise ValueError(""grid too short"") rr.shuffle(shot_rows) n_rows = rr.randint(3, min(5, len(shot_rows))) rows = sorted(shot_rows[:n_rows]) shots: set[Pos] = set() for rb in rows: # Prefer one-shot rows; two-shot rows are rarer (ties become rarer). k = 1 if rr.random() < 0.85 else 2 cols = list(range(w)) rr.shuffle(cols) chosen = 0 for c in cols: p = (rb, c) if p in cannon or p in shots: continue # Prefer columns that can hit at least one ship above. if not any((r, c) in ship_cells for r in range(rb)): if rr.random() < 0.85: continue shots.add(p) chosen += 1 if chosen >= k: break if len(shots) < 4: raise ValueError(""too few shots"") return shots def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() for _ in range(2500): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) ship_color = rr.choice([1, 2, 3, 4, 7, 8, 9]) inp = _empty(h, w) try: ships = _place_ships(rr, h, w, ship_color) except ValueError: continue for comp in ships: for r, c in comp: inp[r][c] = ship_color cannon = _cannon_shape(h, w, rr) if any(inp[r][c] != BG for r, c in cannon): continue for r, c in cannon: inp[r][c] = CANNON try: shots = _place_shots(rr, h, w, _ship_cells(ships), cannon) except ValueError: continue if any(inp[r][c] != BG for r, c in shots): continue for r, c in shots: inp[r][c] = SHOT # Enforce unique optimal resolution to avoid ambiguous transformations. scene_ships, shots_by_row, _cannon_cells, _ship_color = _extract_scene(inp) alive_mask, ways = _resolve_shots_optimal(scene_ships, shots_by_row, w) if ways != 1: continue tie_rows = _count_tie_rows_along_optimal(scene_ships, shots_by_row, w) # Keep some tie cases, but make them uncommon. if tie_rows >= 2: continue if tie_rows == 1 and rr.random() < 0.8: continue # Python 3.9 compatibility: int.bit_count() is 3.10+. destroyed = len(scene_ships) - (bin(alive_mask).count(""1"")) if destroyed < max(3, len(shots) // 2): continue try: out = transform_t20(inp) except ValueError: continue if out == inp: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t20 instance"") ","""""""Verifier for Test2/t20 space-invader shooting rule."""""" from __future__ import annotations from typing import List from generator import transform_t20 Grid = List[List[int]] def verify_t20(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t20(inp) " "t21","[{""input"":[[5,5,4,0,2,0,7,0,8,0],[0,0,4,0,0,0,0,8,0,0],[0,4,0,0,6,0,0,0,8,0],[0,0,0,0,6,6,0,0,0,0],[0,8,8,0,0,0,0,9,0,6],[8,0,0,0,9,5,0,0,0,0],[0,0,2,0,0,0,0,0,3,0],[0,2,0,0,0,0,0,9,0,9],[0,0,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0,0,6,6,6,0,0,9,5],[5,5,5,0,0,0,0,0,6,0,1,1,5]],""output"":[[9,0,9,0,5,0],[0,9,5,0,5,5],[1,1,5,5,5,5],[0,4,0,7,7,7],[0,4,4,7,0,0],[0,0,4,0,0,0]]}]}","""""""Generator for Test2/t21: extract corner blocks and swap diagonally. Rule: - Determine corner size k from input as the bbox side length of the largest corner-assigned 8-connected non-background component. - Extract the four kxk corner patches from input. - Rearrange diagonally: TL <- BR, TR <- BL, BL <- TR, BR <- TL - Output is a 2k x 2k grid assembled from those four patches. Diagonal connectivity is used for component detection. """""" from __future__ import annotations import random from collections import deque from typing import Iterable, List, Tuple Grid = List[List[int]] Pos = Tuple[int, int] BG = 0 NEI8 = [ (-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1), ] def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _copy_patch(src: Grid, r0: int, c0: int, k: int) -> Grid: return [row[c0:c0 + k] for row in src[r0:r0 + k]] def _paste_patch(dst: Grid, patch: Grid, r0: int, c0: int) -> None: for r in range(len(patch)): for c in range(len(patch[0])): dst[r0 + r][c0 + c] = patch[r][c] def _bbox(cells: Iterable[Pos]) -> tuple[int, int]: xs = list(cells) rs = [r for r, _ in xs] cs = [c for _, c in xs] return max(rs) - min(rs) + 1, max(cs) - min(cs) + 1 def _corner_patches(grid: Grid, k: int) -> tuple[Grid, Grid, Grid, Grid]: h = len(grid) w = len(grid[0]) if h else 0 tl = _copy_patch(grid, 0, 0, k) tr = _copy_patch(grid, 0, w - k, k) bl = _copy_patch(grid, h - k, 0, k) br = _copy_patch(grid, h - k, w - k, k) return tl, tr, bl, br def _components8_all_nonzero(grid: Grid) -> list[set[Pos]]: h = len(grid) w = len(grid[0]) if h else 0 rem = {(r, c) for r in range(h) for c in range(w) if grid[r][c] != BG} comps: list[set[Pos]] = [] while rem: s = next(iter(rem)) q = deque([s]) rem.remove(s) comp = {s} while q: r, c = q.popleft() for dr, dc in NEI8: rr, cc = r + dr, c + dc if (rr, cc) in rem: rem.remove((rr, cc)) comp.add((rr, cc)) q.append((rr, cc)) comps.append(comp) return comps def infer_corner_size_k(grid: Grid) -> int: """"""Infer k from largest corner-contained 8-connected component. A component contributes iff it lies fully in one of the four corner regions induced by half-splits of the grid. This matches demonstration behavior and avoids interior components influencing corner size. """""" h = len(grid) w = len(grid[0]) if h else 0 hr = h // 2 wc = w // 2 regions = [ (0, hr, 0, wc), # TL (0, hr, w - wc, w), # TR (h - hr, h, 0, wc), # BL (h - hr, h, w - wc, w), # BR ] best = 0 for comp in _components8_all_nonzero(grid): for r0, r1, c0, c1 in regions: if all(r0 <= r < r1 and c0 <= c < c1 for r, c in comp): bh, bw = _bbox(comp) best = max(best, bh, bw) break if best < 2: raise ValueError(""could not infer corner size"") lim = min(h, w) // 2 return min(best, lim) def transform_t21(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") k = infer_corner_size_k(inp) tl, tr, bl, br = _corner_patches(inp, k) out = _empty(2 * k, 2 * k) # Diagonal swap. _paste_patch(out, br, 0, 0) # TL <- BR _paste_patch(out, bl, 0, k) # TR <- BL _paste_patch(out, tr, k, 0) # BL <- TR _paste_patch(out, tl, k, k) # BR <- TL return out def _random_connected_shape( rr: random.Random, k: int, *, min_side: int, max_side: int ) -> set[Pos]: side = rr.randint(min_side, max_side) h = rr.randint(max(1, side - 2), side) w = rr.randint(max(1, side - 2), side) h = min(h, k) w = min(w, k) r0 = rr.randint(0, k - h) c0 = rr.randint(0, k - w) start = (r0 + rr.randrange(h), c0 + rr.randrange(w)) cells = {start} target = rr.randint(max(2, (h * w) // 4), max(2, (h * w) // 2 + 2)) while len(cells) < target: boundary: list[Pos] = [] for r, c in cells: for dr, dc in NEI8: rr2, cc2 = r + dr, c + dc if r0 <= rr2 < r0 + h and c0 <= cc2 < c0 + w and (rr2, cc2) not in cells: boundary.append((rr2, cc2)) if not boundary: break p = rr.choice(boundary) cells.add(p) # Ensure bbox side at least side by pinning one far cell. if rr.random() < 0.5: cells.add((r0 + h - 1, c0)) else: cells.add((r0, c0 + w - 1)) return cells def _expand_connected_cells(rr: random.Random, cells: set[Pos], k: int, extra_target: int) -> set[Pos]: """"""Expand an existing non-empty cell set while keeping it 8-connected."""""" out = set(cells) for _ in range(max(0, extra_target)): frontier: list[Pos] = [] for r, c in out: for dr, dc in NEI8: rr2, cc2 = r + dr, c + dc if not _in_bounds(k, k, rr2, cc2): continue if (rr2, cc2) in out: continue frontier.append((rr2, cc2)) if not frontier: break out.add(rr.choice(frontier)) return out def _paint_connected_subblob( rr: random.Random, patch: Grid, source_cells: set[Pos], color: int, size_target: int, ) -> None: """"""Recolor a connected subset of existing nonzero cells."""""" if not source_cells: return seed = rr.choice(list(source_cells)) blob = {seed} while len(blob) < size_target: frontier: list[Pos] = [] for r, c in blob: for dr, dc in NEI8: p = (r + dr, c + dc) if p in source_cells and p not in blob: frontier.append(p) if not frontier: break blob.add(rr.choice(frontier)) for r, c in blob: patch[r][c] = color def _make_corner_patch( rr: random.Random, k: int, *, force_side_k: bool, allow_empty: bool, ) -> Grid: patch = _empty(k, k) if allow_empty and rr.random() < 0.10: return patch base_color = rr.choice([1, 2, 3, 4, 5, 6, 7, 8, 9]) min_side = k if force_side_k else 1 max_side = k if force_side_k else max(1, k - 1) cells = _random_connected_shape(rr, k, min_side=min_side, max_side=max_side) # Make corners crowded while preserving single connected component. extra = rr.randint(k // 2, k + 2) if force_side_k else rr.randint(1, k + 1) cells = _expand_connected_cells(rr, cells, k, extra) for r, c in cells: patch[r][c] = base_color # Multi-color within the SAME connected shape: recolor connected subblobs. n_colors = rr.choices([1, 2, 3], weights=[0.25, 0.50, 0.25], k=1)[0] for _ in range(n_colors - 1): c2 = rr.choice([1, 2, 3, 4, 5, 6, 7, 8, 9]) if c2 == base_color: continue sub = rr.randint(2, max(2, min(6, len(cells) // 2 + 1))) _paint_connected_subblob(rr, patch, cells, c2, sub) return patch def _paint_patch_to_corner(grid: Grid, patch: Grid, corner: str) -> None: h = len(grid) w = len(grid[0]) if h else 0 k = len(patch) if corner == ""tl"": r0, c0 = 0, 0 elif corner == ""tr"": r0, c0 = 0, w - k elif corner == ""bl"": r0, c0 = h - k, 0 elif corner == ""br"": r0, c0 = h - k, w - k else: raise ValueError(""unknown corner"") _paste_patch(grid, patch, r0, c0) def _add_connected_middle_noise(grid: Grid, rr: random.Random, k: int) -> None: """"""Add demo-like non-corner noise: many connected blobs, multi-color."""""" h = len(grid) w = len(grid[0]) if h else 0 # Keep a one-cell moat around all corner windows to prevent touching. moat = 1 def allowed(r: int, c: int) -> bool: if not _in_bounds(h, w, r, c): return False if grid[r][c] != BG: return False return not ( (r < k + moat and c < k + moat) or (r < k + moat and c >= w - k - moat) or (r >= h - k - moat and c < k + moat) or (r >= h - k - moat and c >= w - k - moat) ) free = [(r, c) for r in range(h) for c in range(w) if allowed(r, c)] if len(free) < 10: return # Aim near demo density: usually 12-28 noise cells. target_cells = rr.randint(10, min(28, len(free))) painted = 0 attempts = 0 while painted < target_cells and attempts < 80: attempts += 1 color = rr.choice([1, 2, 3, 4, 5, 6, 7, 8, 9]) size_goal = rr.randint(2, 6) seeds = [(r, c) for r, c in free if grid[r][c] == BG] if not seeds: break seed = rr.choice(seeds) blob = {seed} while len(blob) < size_goal: boundary: list[Pos] = [] for br, bc in blob: for dr, dc in NEI8: rr2, cc2 = br + dr, bc + dc if (rr2, cc2) in blob: continue if allowed(rr2, cc2): boundary.append((rr2, cc2)) if not boundary: break blob.add(rr.choice(boundary)) if len(blob) < 2: continue for br, bc in blob: grid[br][bc] = color painted += len(blob) def _is_in_corner_window(r: int, c: int, h: int, w: int, k: int) -> bool: return ( (r < k and c < k) or (r < k and c >= w - k) or (r >= h - k and c < k) or (r >= h - k and c >= w - k) ) def _has_corner_to_noise_bridge(grid: Grid, k: int) -> bool: """"""Return True if a nonzero component spans corner window and non-corner area."""""" h = len(grid) w = len(grid[0]) if h else 0 comps = _components8_all_nonzero(grid) for comp in comps: in_corner = any(_is_in_corner_window(r, c, h, w, k) for r, c in comp) out_corner = any(not _is_in_corner_window(r, c, h, w, k) for r, c in comp) if in_corner and out_corner: return True return False def _corner_windows_have_single_component(grid: Grid, k: int) -> bool: h = len(grid) w = len(grid[0]) if h else 0 windows = [ (0, k, 0, k), (0, k, w - k, w), (h - k, h, 0, k), (h - k, h, w - k, w), ] for r0, r1, c0, c1 in windows: cells = {(r, c) for r in range(r0, r1) for c in range(c0, c1) if grid[r][c] != BG} if not cells: continue rem = set(cells) comps = 0 while rem: comps += 1 s = next(iter(rem)) q = deque([s]) rem.remove(s) while q: r, c = q.popleft() for dr, dc in NEI8: p = (r + dr, c + dc) if p in rem: rem.remove(p) q.append(p) if comps > 1: return False return True def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() corners = [""tl"", ""tr"", ""bl"", ""br""] for _ in range(2500): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) lim = min(h, w) // 2 if lim < 3: continue # Keep some central area for non-corner noise. k_hi = max(3, lim - 1) k = rr.randint(3, k_hi) inp = _empty(h, w) force_corner = rr.choice(corners) empty_corner: str | None = None if rr.random() < 0.12: # Rare empty corner. empty_corner = rr.choice([c for c in corners if c != force_corner]) for c in corners: if c == empty_corner: patch = _empty(k, k) else: patch = _make_corner_patch( rr, k, force_side_k=(c == force_corner), allow_empty=False, ) _paint_patch_to_corner(inp, patch, c) _add_connected_middle_noise(inp, rr, k) # Require meaningful noise like demonstrations. h2 = len(inp) w2 = len(inp[0]) if h2 else 0 noise_cells = sum( 1 for r in range(h2) for c in range(w2) if inp[r][c] != BG and not _is_in_corner_window(r, c, h2, w2, k) ) if noise_cells < 10: continue # Enforce unambiguous corner sizing. try: if _has_corner_to_noise_bridge(inp, k): continue if not _corner_windows_have_single_component(inp, k): continue if infer_corner_size_k(inp) != k: continue out = transform_t21(inp) except ValueError: continue if out == inp: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t21 instance"") ","""""""Verifier for Test2/t21 corner extraction and diagonal swap."""""" from __future__ import annotations from typing import List from generator import transform_t21 Grid = List[List[int]] def verify_t21(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t21(inp) " "t22","[{""input"":[[0,0,6,0,0,0,0,0,5,0,0],[0,0,0,0,0,0,0,0,0,0,0],[5,0,0,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,6],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,0,0,0,0],[0,0,0,1,0,0,0,0,0,0,1],[6,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,0,0,0,0],[0,1,0,0,0,0,0,0,0,5,0]],""output"":[[0,0,6,6,6,6,6,5,5,0,0],[0,0,0,0,0,0,6,0,0,0,0],[5,5,5,1,5,5,6,0,0,0,0],[0,0,0,1,0,0,6,6,6,6,6],[0,0,0,1,0,0,6,0,0,0,0],[0,0,0,1,0,0,6,0,0,0,0],[0,0,0,1,1,1,1,1,1,1,1],[6,6,6,1,6,6,6,0,0,0,0],[0,0,0,1,0,0,6,0,0,0,0],[0,0,0,1,0,0,6,0,0,0,0],[0,1,1,1,0,0,5,5,5,5,0]]},{""input"":[[8,0,0,0,0,0,2,0,0,4,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[2,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,4,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,2],[4,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,2,0,0,0,0],[0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,5,4,9,4,0,0,0],[6,6,0,0,5,5,5,5,0,9,0,0,0,0],[0,6,6,0,0,0,0,0,9,9,0,0,0,0]]}]}","""""""Generator for Test2/t22: center anchor connects to same-color cells. Rule: - For each non-background color, choose its most central cell (nearest to grid center by squared Euclidean distance) as anchor. - Process colors in order of anchor row, top to bottom. - For each target cell of that color, draw an L path from anchor: vertical segment first (same column as anchor), then horizontal segment. - Current color overwrites existing cells, except cells that belong to colors that will be processed later (those are protected until their turn). """""" from __future__ import annotations import random from typing import Dict, List, Tuple Grid = List[List[int]] Pos = Tuple[int, int] BG = 0 def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _center_distance2(r: int, c: int, h: int, w: int) -> float: cr = (h - 1) / 2.0 cc = (w - 1) / 2.0 dr = r - cr dc = c - cc return dr * dr + dc * dc def _color_cells(inp: Grid) -> Dict[int, List[Pos]]: h = len(inp) w = len(inp[0]) if h else 0 out: Dict[int, List[Pos]] = {} for r in range(h): for c in range(w): v = inp[r][c] if v == BG: continue out.setdefault(v, []).append((r, c)) return out def _unique_anchor_for_color(cells: List[Pos], h: int, w: int) -> Pos: ranked = sorted(cells, key=lambda p: (_center_distance2(p[0], p[1], h, w), p[0], p[1])) if len(ranked) >= 2: d0 = _center_distance2(ranked[0][0], ranked[0][1], h, w) d1 = _center_distance2(ranked[1][0], ranked[1][1], h, w) if abs(d0 - d1) < 1e-9: raise ValueError(""ambiguous central cell for color"") return ranked[0] def _draw_path( out: Grid, color: int, anchor: Pos, target: Pos, protected: set[Pos], ) -> None: ar, ac = anchor tr, tc = target # Vertical first along anchor column. step = 1 if tr >= ar else -1 for r in range(ar, tr + step, step): if (r, ac) in protected: continue out[r][ac] = color # Then horizontal along target row. step = 1 if tc >= ac else -1 for c in range(ac, tc + step, step): if (tr, c) in protected: continue out[tr][c] = color def transform_t22(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") by_color = _color_cells(inp) if len(by_color) < 2: raise ValueError(""need at least two colors"") anchor_of: Dict[int, Pos] = {} for col, cells in by_color.items(): anchor_of[col] = _unique_anchor_for_color(cells, h, w) order = sorted(by_color.keys(), key=lambda col: (anchor_of[col][0], anchor_of[col][1], col)) # Avoid ambiguous same-row processing intent. rows = [anchor_of[c][0] for c in order] if len(set(rows)) != len(rows): raise ValueError(""ambiguous color order (anchor-row tie)"") out = [row[:] for row in inp] for i, col in enumerate(order): later_colors = order[i + 1 :] protected = {p for lc in later_colors for p in by_color[lc]} anchor = anchor_of[col] # Stable order of targets; anchor cell included naturally. for tgt in sorted(by_color[col]): _draw_path(out, col, anchor, tgt, protected) return out def _choose_anchor(rr: random.Random, h: int, w: int, used_rows: set[int], occupied: set[Pos]) -> Pos: candidates = [] for r in range(1, h - 1): if r in used_rows: continue for c in range(1, w - 1): if (r, c) in occupied: continue candidates.append((r, c)) if not candidates: raise ValueError(""no anchor candidates"") # Prefer spread over rows. rr.shuffle(candidates) return candidates[0] def _place_points_for_color( rr: random.Random, h: int, w: int, anchor: Pos, n_points: int, occupied: set[Pos], ) -> list[Pos]: ar, ac = anchor ad = _center_distance2(ar, ac, h, w) points = [anchor] occupied.add(anchor) candidates: list[Pos] = [] for r in range(h): for c in range(w): if (r, c) in occupied: continue # Keep anchor uniquely central by only adding farther cells. if _center_distance2(r, c, h, w) <= ad + 0.2: continue candidates.append((r, c)) rr.shuffle(candidates) for p in candidates: if len(points) >= n_points: break points.append(p) occupied.add(p) if len(points) < n_points: raise ValueError(""could not place enough points"") return points def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() palette = [1, 2, 3, 4, 5, 6, 7, 8, 9] for _ in range(2500): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) inp = _empty(h, w) n_colors = rr.randint(3, 5) cols = rr.sample(palette, n_colors) occupied: set[Pos] = set() used_rows: set[int] = set() color_points: Dict[int, list[Pos]] = {} ok = True # Build anchors first so row-order is unambiguous. anchors: Dict[int, Pos] = {} for col in cols: try: a = _choose_anchor(rr, h, w, used_rows, occupied) except ValueError: ok = False break anchors[col] = a used_rows.add(a[0]) if not ok: continue # Add extra points per color. for col in cols: n_points = rr.randint(4, 7) try: pts = _place_points_for_color(rr, h, w, anchors[col], n_points, occupied) except ValueError: ok = False break color_points[col] = pts if not ok: continue for col, pts in color_points.items(): for r, c in pts: inp[r][c] = col try: out = transform_t22(inp) except ValueError: continue if out == inp: continue # Ensure substantial path growth. in_count = sum(1 for r in range(h) for c in range(w) if inp[r][c] != BG) out_count = sum(1 for r in range(h) for c in range(w) if out[r][c] != BG) if out_count - in_count < 10: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t22 instance"") ","""""""Verifier for Test2/t22 center-connect rule."""""" from __future__ import annotations from typing import List from generator import transform_t22 Grid = List[List[int]] def verify_t22(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t22(inp) " "t23","[{""input"":[[1,1,1,0,0,3,3,3,3,0],[1,0,0,0,3,3,0,0,3,3],[1,2,0,3,0,0,0,0,0,3],[1,2,0,3,0,0,4,0,0,0],[0,2,0,3,0,4,4,0,0,0],[0,2,0,3,0,4,0,0,2,0],[4,0,0,0,0,4,0,2,0,0],[4,0,0,0,0,0,2,2,0,0],[4,4,4,0,0,2,2,0,0,0],[0,0,0,3,3,3,3,0,0,1]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,5,5,5,5,5,5,0,0],[0,5,5,5,5,0,0,0,0,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,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,5,5,0,0],[0,0,0,0,0,0,5,0,0,0],[0,0,0,0,0,0,5,0,0,0],[0,0,0,0,0,0,5,0,0,0],[0,0,0,0,5,5,5,0,0,0],[0,0,0,0,0,0,5,0,0,0],[0,0,0,0,0,0,5,0,0,0],[0,0,0,0,0,0,5,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,1,1,1,1],[0,0,0,0,0,0,0,0,0,0],[0,8,8,8,0,0,0,0,0,0],[0,2,2,0,0,0,0,0,0,0],[0,2,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,9,9,0],[0,0,9,9,0,9,9,9,9,0],[0,0,8,0,0,0,0,0,0,0],[0,0,8,8,0,0,0,1,0,0],[0,0,2,0,6,0,1,1,1,0],[0,0,2,2,6,6,6,0,0,0],[0,0,0,0,6,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,5,0,0],[0,0,0,0,0,0,0,5,0,0],[0,0,5,0,0,0,0,5,0,0],[0,0,5,0,0,0,0,5,0,0],[0,0,5,0,0,0,0,5,0,0],[0,0,5,0,5,0,0,5,0,0],[0,0,5,0,0,0,0,5,0,0],[0,0,5,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t23: connect same-color shapes with gray straight lines. Interpretation used here: - Shapes are 8-connected components of equal color (diagonal touch connects). - For each color, every pair of its shapes connects at most once. - A connection is valid only when the endpoint neighborhood orientation matches on both ends of the segment (e.g. horizontal: left-neighbor at start and right-neighbor at end). - Among valid connections, use the shortest orthogonal straight segment. - Draw connections in gray (5), excluding component endpoint cells. - Remove all original colored shapes in the output. """""" from __future__ import annotations import random from collections import defaultdict, deque from typing import Dict, List, Sequence, Set, Tuple Grid = List[List[int]] Pos = Tuple[int, int] Component = Set[Pos] BG = 0 GRAY = 5 NEI8 = [ (-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1), ] NEI4 = [(-1, 0), (1, 0), (0, -1), (0, 1)] def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _components_of_color(grid: Grid, color: int) -> list[Component]: h = len(grid) w = len(grid[0]) if h else 0 vis: set[Pos] = set() out: list[Component] = [] for r in range(h): for c in range(w): if grid[r][c] != color or (r, c) in vis: continue q = deque([(r, c)]) vis.add((r, c)) comp: Component = {(r, c)} while q: rr, cc = q.popleft() for dr, dc in NEI8: nr, nc = rr + dr, cc + dc if _in_bounds(h, w, nr, nc) and grid[nr][nc] == color and (nr, nc) not in vis: vis.add((nr, nc)) comp.add((nr, nc)) q.append((nr, nc)) out.append(comp) return out def _best_horizontal_segment(a: Component, b: Component) -> tuple[int, int, int, int] | None: cands = _pair_connection_candidates(a, b) hs = [(gap, axis, s, e) for gap, typ, axis, s, e in cands if typ == ""H""] return min(hs) if hs else None def _best_vertical_segment(a: Component, b: Component) -> tuple[int, int, int, int] | None: cands = _pair_connection_candidates(a, b) vs = [(gap, axis, s, e) for gap, typ, axis, s, e in cands if typ == ""V""] return min(vs) if vs else None def _pair_connection_candidates(a: Component, b: Component) -> list[tuple[int, str, int, int, int]]: """"""All valid orthogonal straight connection candidates for a shape pair. Returns tuples of the form: (gap, 'H' or 'V', axis_value, start_idx, end_idx) where axis_value is row for H and col for V. """""" rows_a: Dict[int, List[int]] = defaultdict(list) rows_b: Dict[int, List[int]] = defaultdict(list) for r, c in a: rows_a[r].append(c) for r, c in b: rows_b[r].append(c) cands: list[tuple[int, str, int, int, int]] = [] for r in set(rows_a.keys()) & set(rows_b.keys()): a_min, a_max = min(rows_a[r]), max(rows_a[r]) b_min, b_max = min(rows_b[r]), max(rows_b[r]) # A on left, B on right. if a_max < b_min - 1: gap = b_min - a_max - 1 cands.append((gap, ""H"", r, a_max + 1, b_min - 1)) # B on left, A on right. if b_max < a_min - 1: gap = a_min - b_max - 1 cands.append((gap, ""H"", r, b_max + 1, a_min - 1)) cols_a: Dict[int, List[int]] = defaultdict(list) cols_b: Dict[int, List[int]] = defaultdict(list) for r, c in a: cols_a[c].append(r) for r, c in b: cols_b[c].append(r) for c in set(cols_a.keys()) & set(cols_b.keys()): a_min, a_max = min(cols_a[c]), max(cols_a[c]) b_min, b_max = min(cols_b[c]), max(cols_b[c]) # A above, B below. if a_max < b_min - 1: gap = b_min - a_max - 1 cands.append((gap, ""V"", c, a_max + 1, b_min - 1)) # B above, A below. if b_max < a_min - 1: gap = a_min - b_max - 1 cands.append((gap, ""V"", c, b_max + 1, a_min - 1)) return cands def _has_undefined_tie_for_color(grid: Grid, color: int) -> bool: """"""True iff any same-color shape pair has >1 equally-short valid segment."""""" comps = _components_of_color(grid, color) if len(comps) < 2: return False for i in range(len(comps)): for j in range(i + 1, len(comps)): cands = _pair_connection_candidates(comps[i], comps[j]) if not cands: continue best_gap = min(g for g, _, _, _, _ in cands) best = {(t, axis, s, e) for g, t, axis, s, e in cands if g == best_gap} if len(best) > 1: return True return False def transform_t23(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") out = _empty(h, w) colors = sorted({v for row in inp for v in row if v != BG}) for color in colors: shapes = _components_of_color(inp, color) if len(shapes) < 2: continue for i in range(len(shapes)): for j in range(i + 1, len(shapes)): hseg = _best_horizontal_segment(shapes[i], shapes[j]) vseg = _best_vertical_segment(shapes[i], shapes[j]) if hseg is None and vseg is None: continue if hseg is not None and vseg is not None: # Use the shorter straight connection; tie -> horizontal first. use_h = hseg[0] <= vseg[0] else: use_h = hseg is not None if use_h: _, r, c1, c2 = hseg # type: ignore[misc] for c in range(c1, c2 + 1): out[r][c] = GRAY else: _, c, r1, r2 = vseg # type: ignore[misc] for r in range(r1, r2 + 1): out[r][c] = GRAY return out def _paint_component(grid: Grid, cells: Sequence[Pos], color: int) -> None: for r, c in cells: grid[r][c] = color def _random_component( rr: random.Random, h: int, w: int, seed: Pos, max_size: int, *, forbidden: set[Pos] | None = None, ) -> list[Pos]: block = forbidden or set() if seed in block: return [] cells = {seed} target = rr.randint(2, max_size) while len(cells) < target: frontier: list[Pos] = [] for r, c in cells: for dr, dc in NEI4: nr, nc = r + dr, c + dc if _in_bounds(h, w, nr, nc) and (nr, nc) not in cells and (nr, nc) not in block: frontier.append((nr, nc)) if not frontier: break cells.add(rr.choice(frontier)) return sorted(cells) def _place_color_with_two_components( grid: Grid, rr: random.Random, color: int, ) -> bool: h = len(grid) w = len(grid[0]) if h else 0 # Build two components guaranteed to share a row or column for line creation. mode = rr.choice([""row"", ""col""]) for _ in range(120): if mode == ""row"": r = rr.randint(1, h - 2) c1 = rr.randint(0, max(0, w // 3)) c2 = rr.randint(max(c1 + 3, (2 * w) // 3), w - 1) s1 = (r, c1) s2 = (r, c2) else: c = rr.randint(1, w - 2) r1 = rr.randint(0, max(0, h // 3)) r2 = rr.randint(max(r1 + 3, (2 * h) // 3), h - 1) s1 = (r1, c) s2 = (r2, c) if grid[s1[0]][s1[1]] != BG or grid[s2[0]][s2[1]] != BG: continue comp1 = _random_component(rr, h, w, s1, max_size=6) if not comp1: continue block = set(comp1) # keep one-cell moat around first component to avoid diagonal touching for r, c in comp1: for dr, dc in NEI8: block.add((r + dr, c + dc)) comp2 = _random_component(rr, h, w, s2, max_size=6, forbidden=block) if not comp2: continue if any(grid[r][c] != BG for r, c in comp1 + comp2): continue # Under 8-connectivity, these must remain separate shapes. tmp = [row[:] for row in grid] _paint_component(tmp, comp1, color) _paint_component(tmp, comp2, color) if len(_components_of_color(tmp, color)) < 2: continue comps = _components_of_color(tmp, color) if len(comps) != 2: continue if _best_horizontal_segment(comps[0], comps[1]) is None and _best_vertical_segment(comps[0], comps[1]) is None: continue _paint_component(grid, comp1, color) _paint_component(grid, comp2, color) return True return False def _place_single_component_noise(grid: Grid, rr: random.Random, color: int) -> bool: h = len(grid) w = len(grid[0]) if h else 0 for _ in range(100): seed = (rr.randint(0, h - 1), rr.randint(0, w - 1)) if grid[seed[0]][seed[1]] != BG: continue comp = _random_component(rr, h, w, seed, max_size=5) if any(grid[r][c] != BG for r, c in comp): continue _paint_component(grid, comp, color) return True return False def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() palette = [1, 2, 3, 4, 6, 7, 8, 9] for _ in range(2500): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) inp = _empty(h, w) cols = rr.sample(palette, rr.randint(4, 6)) ok = True # Most colors have two components (to create connectable pairs). n_link_colors = rr.randint(3, max(3, len(cols) - 1)) link_cols = cols[:n_link_colors] noise_cols = cols[n_link_colors:] for col in link_cols: if not _place_color_with_two_components(inp, rr, col): ok = False break if not ok: continue for col in noise_cols: if not _place_single_component_noise(inp, rr, col): ok = False break if not ok: continue # Avoid undefined cases: no same-color pair may have a shortest-connection tie. if any(_has_undefined_tie_for_color(inp, c) for c in cols): continue try: out = transform_t23(inp) except ValueError: continue if out == inp: continue gray_count = sum(1 for r in range(h) for c in range(w) if out[r][c] == GRAY) if gray_count < 8: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t23 instance"") ","""""""Verifier for Test2/t23 same-color shape connection rule."""""" from __future__ import annotations from typing import List from generator import transform_t23 Grid = List[List[int]] def verify_t23(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t23(inp) " "t24","[{""input"":[[0,0,0,0,0,0,0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,0,0,0,0,4,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[2,0,2,2,0,0,0,1,1,1,0,0,0,0],[2,0,2,0,0,0,0,0,1,1,0,0,0,0],[2,0,0,0,0,0,0,0,0,1,0,1,1,0],[2,0,0,0,0,0,0,0,0,1,0,1,0,0],[0,0,0,0,0,0,0,8,8,0,0,1,0,0],[0,0,0,0,0,0,8,8,8,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{""input"":[[3,3,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,6,0,0,0],[0,0,1,0,0,0,6,0,0,0,0],[0,0,1,1,0,0,6,0,0,0,0],[0,8,1,0,8,0,0,0,0,0,0],[8,8,8,8,8,0,0,0,6,6,6],[2,0,8,8,8,0,0,0,0,6,0],[0,0,8,8,8,0,0,0,0,0,0],[0,8,8,6,6,0,0,0,0,0,0],[0,0,8,0,0,0,0,0,0,0,0],[0,0,0,0,4,0,0,0,0,0,0],[0,0,0,4,4,4,4,0,0,0,0]],""output"":[[3,3,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,6,6,0,0,0],[0,0,2,0,0,0,6,0,0,0,0],[0,0,2,2,0,0,6,0,0,0,0],[0,2,2,0,2,0,0,0,0,0,0],[2,2,2,2,2,0,0,0,6,6,6],[0,0,2,2,2,0,0,0,0,6,0],[0,0,2,2,2,0,0,0,0,0,0],[0,2,2,2,2,0,0,0,0,0,0],[0,0,2,0,0,0,0,0,0,0,0],[0,0,0,0,2,0,0,0,0,0,0],[0,0,0,2,2,2,2,0,0,0,0]]}]}","""""""Generator for Test2/t24: virus jump-spread recoloring. Rule: - Exactly one red virus cell (color 2) is present; no other red cells exist. - Other cells form colored shapes (4-connected components of same color). - Virus spreads from infected cells to shapes by either: * direct orthogonal adjacency, * orthogonal jump over exactly one black cell, or * direct diagonal adjacency (distance (1,1)). - When a shape is reached, the whole shape becomes infected and can further spread from any of its cells. - Output recolors all infected shapes to red and removes the singular initial virus cell. """""" from __future__ import annotations import random from collections import deque from typing import List, Set, Tuple Grid = List[List[int]] Pos = Tuple[int, int] Component = Set[Pos] BG = 0 RED = 2 NEI4 = [(-1, 0), (1, 0), (0, -1), (0, 1)] def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _components_nonred(inp: Grid) -> list[Component]: h = len(inp) w = len(inp[0]) if h else 0 vis: set[Pos] = set() comps: list[Component] = [] for r in range(h): for c in range(w): col = inp[r][c] if col in (BG, RED) or (r, c) in vis: continue q = deque([(r, c)]) vis.add((r, c)) comp: Component = {(r, c)} while q: rr, cc = q.popleft() for dr, dc in NEI4: nr, nc = rr + dr, cc + dc if ( _in_bounds(h, w, nr, nc) and inp[nr][nc] == col and (nr, nc) not in vis ): vis.add((nr, nc)) comp.add((nr, nc)) q.append((nr, nc)) comps.append(comp) return comps def _jump_reachable(a: Pos, b: Pos, inp: Grid) -> bool: ar, ac = a br, bc = b dr = br - ar dc = bc - ac # Direct orthogonal neighbor if abs(dr) + abs(dc) == 1: return True # Direct diagonal neighbor if abs(dr) == 1 and abs(dc) == 1: return True # Orthogonal jump over exactly one black cell if dr == 0 and abs(dc) == 2: mid = (ar, ac + dc // 2) return inp[mid[0]][mid[1]] == BG if dc == 0 and abs(dr) == 2: mid = (ar + dr // 2, ac) return inp[mid[0]][mid[1]] == BG return False def transform_t24(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") red_cells = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == RED] if len(red_cells) != 1: raise ValueError(""expected exactly one red virus cell"") virus = red_cells[0] comps = _components_nonred(inp) infected = [False] * len(comps) frontier: set[Pos] = {virus} changed = True while changed: changed = False for i, comp in enumerate(comps): if infected[i]: continue reached = False for p in frontier: if reached: break for q in comp: if _jump_reachable(p, q, inp): reached = True break if reached: infected[i] = True frontier |= comp changed = True out = [row[:] for row in inp] # Remove initial singular virus cell. out[virus[0]][virus[1]] = BG # Recolor infected shapes. for i, comp in enumerate(comps): if not infected[i]: continue for r, c in comp: out[r][c] = RED return out def _grow_component( rr: random.Random, h: int, w: int, seed: Pos, size_max: int, occupied: set[Pos] ) -> list[Pos]: if seed in occupied: return [] cells = {seed} target = rr.randint(2, size_max) while len(cells) < target: boundary: list[Pos] = [] for r, c in cells: for dr, dc in NEI4: nr, nc = r + dr, c + dc if _in_bounds(h, w, nr, nc) and (nr, nc) not in cells and (nr, nc) not in occupied: boundary.append((nr, nc)) if not boundary: break cells.add(rr.choice(boundary)) return sorted(cells) def _place_component(grid: Grid, cells: list[Pos], color: int, occupied: set[Pos]) -> None: for r, c in cells: grid[r][c] = color occupied.add((r, c)) def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() palette = [1, 3, 4, 5, 6, 7, 8, 9] # no red for _ in range(3000): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) inp = _empty(h, w) occupied: set[Pos] = set() n_shapes = rr.randint(5, 9) colors = [rr.choice(palette) for _ in range(n_shapes)] ok = True for col in colors: placed = False for _ in range(80): seed = (rr.randint(0, h - 1), rr.randint(0, w - 1)) comp = _grow_component(rr, h, w, seed, size_max=6, occupied=occupied) if len(comp) < 2: continue _place_component(inp, comp, col, occupied) placed = True break if not placed: ok = False break if not ok: continue # Place the singular red virus cell on an empty location. empties = [(r, c) for r in range(h) for c in range(w) if inp[r][c] == BG] if not empties: continue vr, vc = rr.choice(empties) inp[vr][vc] = RED try: out = transform_t24(inp) except ValueError: continue if out == inp: continue # Keep useful variety: at least one infected and one untouched shape. comps = _components_nonred(inp) infected_count = 0 untouched_count = 0 for comp in comps: in_col = inp[next(iter(comp))[0]][next(iter(comp))[1]] out_cols = {out[r][c] for r, c in comp} if out_cols == {RED} and in_col != RED: infected_count += 1 elif out_cols == {in_col}: untouched_count += 1 if infected_count < 2 or untouched_count < 1: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t24 instance"") ","""""""Verifier for Test2/t24 virus jump spread rule."""""" from __future__ import annotations from typing import List from generator import transform_t24 Grid = List[List[int]] def verify_t24(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t24(inp) " "t25","[{""input"":[[0,9,0,9,9,0,0,0,0,0],[9,9,0,0,9,0,9,9,0,0],[0,0,9,9,0,0,9,9,0,0],[0,9,9,0,9,9,0,9,9,9],[9,9,0,0,9,9,9,0,0,9],[0,0,9,9,0,9,0,0,0,0],[9,9,0,9,0,0,0,0,9,0],[9,0,0,0,9,0,0,9,9,0],[0,0,9,0,9,9,0,0,0,9],[0,9,9,0,0,0,9,0,9,9]],""output"":[[0,9,0,9,9,0,0,0,0,0],[9,9,0,0,9,0,0,0,0,0],[0,0,9,9,0,0,0,0,0,0],[0,9,9,0,9,9,0,0,0,0],[9,9,0,0,9,9,9,0,0,0],[0,0,9,9,0,9,0,0,0,0],[9,9,0,9,0,0,0,0,9,0],[9,0,0,0,9,0,0,9,9,0],[0,0,9,0,9,9,0,0,0,9],[0,9,9,0,0,0,0,0,9,9]]},{""input"":[[0,1,0,0,1,1,1,0,0,0],[1,1,1,0,0,1,0,0,1,0],[0,1,1,0,0,0,0,1,1,1],[0,1,1,1,0,0,0,0,1,0],[0,0,1,0,0,1,0,0,0,0],[0,0,0,0,1,1,1,1,0,0],[1,1,1,1,0,1,1,1,1,0],[0,1,1,1,1,0,1,1,0,0],[0,0,0,1,0,1,1,1,0,1],[0,0,0,0,0,0,1,0,1,1]],""output"":[[0,1,0,0,0,0,0,0,0,0],[1,1,1,0,0,0,0,0,1,0],[0,1,1,0,0,0,0,1,1,1],[0,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0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[1,1,1,0,0,0,0,0,0,0,0],[0,1,1,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,9,0,0,0,0,0,0,9,9,9,0],[0,0,9,0,0,0,0,0,0,0,0,0,0],[0,0,9,0,0,0,0,0,0,9,9,0,0],[0,0,0,0,0,9,9,9,0,0,0,0,0],[0,0,0,0,9,0,0,0,0,0,0,0,0],[0,0,0,0,9,9,0,0,0,9,0,0,0],[0,9,9,0,9,9,0,0,0,9,0,0,0],[0,9,9,0,0,9,0,9,0,9,0,9,0],[0,0,9,0,0,0,0,9,0,0,0,9,0],[0,9,0,0,0,0,0,9,0,0,0,9,0],[9,9,9,0,0,0,0,0,0,0,0,0,0],[9,9,9,9,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,9,0,0,0,0,0,0,9,9,9,0],[0,0,9,0,0,0,0,0,0,0,0,0,0],[0,0,9,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,9,9,9,0,0,0,0,0],[0,0,0,0,9,0,0,0,0,0,0,0,0],[0,0,0,0,9,9,0,0,0,9,0,0,0],[0,0,0,0,9,9,0,0,0,9,0,0,0],[0,0,0,0,0,9,0,9,0,9,0,9,0],[0,0,0,0,0,0,0,9,0,0,0,9,0],[0,0,0,0,0,0,0,9,0,0,0,9,0],[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t25: keep prototype-composable shapes, delete others. Interpretation: - Grid contains one foreground color split into multiple 4-connected shapes. - Prototype candidates are present shapes that: (a) cannot be composed from multiple non-overlapping copies of any other present shape (under symmetry), and (b) can compose at least one other present shape. - Among those candidates, the unique largest one is the prototype. - Any shape that can be exactly composed by one or more non-overlapping copies of the prototype (using translation/rotation/reflection) is kept. - All other shapes are removed. """""" from __future__ import annotations import random from collections import deque from typing import Dict, Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Pos = Tuple[int, int] Shape = Set[Pos] BG = 0 NEI4 = [(-1, 0), (1, 0), (0, -1), (0, 1)] def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _in_bounds(h: int, w: int, r: int, c: int) -> bool: return 0 <= r < h and 0 <= c < w def _components_of_color(grid: Grid, color: int) -> list[Shape]: h = len(grid) w = len(grid[0]) if h else 0 vis: set[Pos] = set() comps: list[Shape] = [] for r in range(h): for c in range(w): if grid[r][c] != color or (r, c) in vis: continue q = deque([(r, c)]) vis.add((r, c)) comp: Shape = {(r, c)} while q: rr, cc = q.popleft() for dr, dc in NEI4: nr, nc = rr + dr, cc + dc if _in_bounds(h, w, nr, nc) and grid[nr][nc] == color and (nr, nc) not in vis: vis.add((nr, nc)) comp.add((nr, nc)) q.append((nr, nc)) comps.append(comp) return comps def _normalize(shape: Iterable[Pos]) -> tuple[Pos, ...]: pts = list(shape) r0 = min(r for r, _ in pts) c0 = min(c for _, c in pts) return tuple(sorted((r - r0, c - c0) for r, c in pts)) def _symmetries(norm: tuple[Pos, ...]) -> list[tuple[Pos, ...]]: pts = list(norm) out: set[tuple[Pos, ...]] = set() for rx in (1, -1): for ry in (1, -1): for swap in (False, True): t = [] for r, c in pts: a, b = (c, r) if swap else (r, c) t.append((rx * a, ry * b)) out.add(_normalize(t)) return sorted(out) def _shape_buildable(shape: Shape, proto_variants: list[tuple[Pos, ...]]) -> bool: """"""Exact cover of shape cells by translated prototype variants."""""" n = len(shape) psize = len(proto_variants[0]) if proto_variants else 0 if psize == 0 or n % psize != 0: return False target = set(shape) variants = [set(v) for v in proto_variants] # Precompute placements that fit fully inside target. placements: list[Shape] = [] for v in variants: vr = [r for r, _ in v] vc = [c for _, c in v] v_anchor = min(v) # deterministic anchor cell in variant ar, ac = v_anchor for tr, tc in target: dr, dc = tr - ar, tc - ac placed = {(r + dr, c + dc) for r, c in v} if placed <= target: placements.append(placed) # Deduplicate placements. uniq = [] seen: set[frozenset[Pos]] = set() for p in placements: fp = frozenset(p) if fp in seen: continue seen.add(fp) uniq.append(p) placements = uniq # Inverted index for exact-cover search. by_cell: Dict[Pos, list[int]] = {cell: [] for cell in target} for i, p in enumerate(placements): for cell in p: by_cell[cell].append(i) def backtrack(remaining: set[Pos]) -> bool: if not remaining: return True # choose constrained cell cell = min(remaining, key=lambda x: len(by_cell[x])) for idx in by_cell[cell]: p = placements[idx] if not p <= remaining: continue if backtrack(remaining - p): return True return False return backtrack(set(target)) def _shape_buildable_min_copies( shape: Shape, proto_variants: list[tuple[Pos, ...]], min_copies: int, ) -> bool: psize = len(proto_variants[0]) if proto_variants else 0 if psize == 0: return False if len(shape) % psize != 0: return False if (len(shape) // psize) < min_copies: return False return _shape_buildable(shape, proto_variants) def _infer_prototype(comps: list[Shape]) -> list[tuple[Pos, ...]]: """"""Infer prototype by candidate filtering and largest-shape disambiguation."""""" if not comps: raise ValueError(""no shapes"") norms = [_normalize(c) for c in comps] norms = [n for n in norms if len(n) >= 2] if not norms: raise ValueError(""no valid prototype candidates"") # Deduplicate present shapes by symmetry class. present_by_class: dict[tuple[Pos, ...], tuple[Pos, ...]] = {} for n in norms: canon = min(_symmetries(n)) present_by_class.setdefault(canon, n) present = list(present_by_class.values()) candidates: list[tuple[Pos, ...]] = [] for a in present: a_shape = set(a) composed_from_other = False for b in present: if b == a: continue if _shape_buildable_min_copies(a_shape, _symmetries(b), min_copies=2): composed_from_other = True break if composed_from_other: continue # Additional criterion: candidate prototype must compose at least # one distinct present shape. pvars = _symmetries(a) builds_other = False for b in present: if b == a: continue if _shape_buildable(set(b), pvars): builds_other = True break if builds_other: candidates.append(a) if not candidates: raise ValueError(""no prototype candidates after filtering"") max_size = max(len(c) for c in candidates) largest = [c for c in candidates if len(c) == max_size] if len(largest) != 1: raise ValueError(""ambiguous largest prototype candidate"") return _symmetries(largest[0]) def transform_t25(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") h = len(inp) w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""input grid must be rectangular"") colors = sorted({v for row in inp for v in row if v != BG}) if len(colors) != 1: raise ValueError(""expected exactly one foreground color"") color = colors[0] comps = _components_of_color(inp, color) pvars = _infer_prototype(comps) out = _empty(h, w) for comp in comps: if _shape_buildable(comp, pvars): for r, c in comp: out[r][c] = color return out def _random_connected_shape(rr: random.Random, h: int, w: int, size: int) -> list[Pos]: seed = (rr.randint(0, h - 1), rr.randint(0, w - 1)) cells = {seed} while len(cells) < size: boundary: list[Pos] = [] for r, c in cells: for dr, dc in NEI4: nr, nc = r + dr, c + dc if _in_bounds(h, w, nr, nc) and (nr, nc) not in cells: boundary.append((nr, nc)) if not boundary: break cells.add(rr.choice(boundary)) return sorted(cells) def _translate(shape: Sequence[Pos], dr: int, dc: int) -> list[Pos]: return [(r + dr, c + dc) for r, c in shape] def _place_shape(grid: Grid, shape: Sequence[Pos], color: int) -> bool: h = len(grid) w = len(grid[0]) if h else 0 for r, c in shape: if not _in_bounds(h, w, r, c) or grid[r][c] != BG: return False shape_set = set(shape) # Prevent accidental 4-neighbor merges between nominally separate shapes. for r, c in shape: for dr, dc in NEI4: nr, nc = r + dr, c + dc if (nr, nc) in shape_set: continue if _in_bounds(h, w, nr, nc) and grid[nr][nc] == color: return False for r, c in shape: grid[r][c] = color return True def _compose_from_proto(rr: random.Random, proto: tuple[Pos, ...], copies: int) -> tuple[Pos, ...]: variants = _symmetries(proto) placed: set[Pos] = set(variants[rr.randrange(len(variants))]) for _ in range(copies - 1): var = set(variants[rr.randrange(len(variants))]) # try to place touching existing union without overlap ok = False for _ in range(80): pr, pc = rr.choice(list(placed)) vr, vc = rr.choice(list(var)) dr, dc = pr - vr, pc - vc cand = {(r + dr, c + dc) for r, c in var} if cand & placed: continue # require at least one edge-touch for connectivity touch = any((r + dr4, c + dc4) in placed for r, c in cand for dr4, dc4 in NEI4) if not touch: continue placed |= cand ok = True break if not ok: # fallback: disjoint placement, still valid component only if touching elsewhere later shift = rr.randint(1, 3) cand = {(r + shift, c + shift) for r, c in var} placed |= cand return _normalize(placed) def generate( rng: random.Random | None = None, *, min_h: int = 10, max_h: int = 14, min_w: int = 10, max_w: int = 14, ) -> dict[str, Grid]: rr = rng or random.Random() for _ in range(3500): h = rr.randint(min_h, max_h) w = rr.randint(min_w, max_w) color = rr.choice([1, 3, 7, 9]) inp = _empty(h, w) psize = rr.randint(3, 6) proto_cells = _random_connected_shape(rr, 4, 4, psize) proto = _normalize(proto_cells) # Build keepers from 1..3 prototype copies. keep_shapes: list[tuple[Pos, ...]] = [] keep_shapes.append(proto) for _ in range(rr.randint(2, 4)): copies = rr.choice([1, 2, 2, 3]) keep_shapes.append(_compose_from_proto(rr, proto, copies)) # Build rejectors (size not multiple / random non-composable). reject_shapes: list[tuple[Pos, ...]] = [] for _ in range(rr.randint(2, 4)): sz = rr.randint(2, 10) if sz % len(proto) == 0: sz += 1 rej = _normalize(_random_connected_shape(rr, 5, 5, min(sz, 8))) reject_shapes.append(rej) all_shapes = [(s, True) for s in keep_shapes] + [(s, False) for s in reject_shapes] rr.shuffle(all_shapes) ok = True for shape, _is_keep in all_shapes: placed = False for _ in range(120): maxr = max(r for r, _ in shape) maxc = max(c for _, c in shape) if maxr >= h or maxc >= w: break r0 = rr.randint(0, h - maxr - 1) c0 = rr.randint(0, w - maxc - 1) if _place_shape(inp, _translate(shape, r0, c0), color): placed = True break if not placed: ok = False break if not ok: continue try: out = transform_t25(inp) except ValueError: continue if out == inp: continue # Ensure intended prototype is actually represented as a standalone shape. comps_in = _components_of_color(inp, color) pvars_intended = set(_symmetries(proto)) has_isolated_proto = any(_normalize(c) in pvars_intended for c in comps_in) if not has_isolated_proto: continue # Keep prototype inference unambiguous and aligned with intended class. try: inferred = _infer_prototype(comps_in) except ValueError: continue if min(inferred) != min(_symmetries(proto)): continue # Ensure both kept and removed shapes exist. in_cells = sum(v != BG for row in inp for v in row) out_cells = sum(v != BG for row in out for v in row) if out_cells < 8 or out_cells >= in_cells: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to sample valid t25 instance"") ","""""""Verifier for Test2/t25 prototype composition filter rule."""""" from __future__ import annotations from typing import List from generator import transform_t25 Grid = List[List[int]] def verify_t25(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t25(inp) " "t26","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,4,9,0,4,4,9,9,4,0,0],[0,0,9,0,0,0,0,0,0,9,0,0],[0,0,0,0,8,0,0,0,0,9,0,0],[0,0,4,0,0,8,0,0,0,4,0,0],[0,0,4,0,0,0,8,0,0,4,0,0],[0,0,9,0,0,0,0,8,0,9,0,0],[0,0,9,0,0,0,0,0,0,9,0,0],[0,0,0,9,9,4,0,0,9,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,4,9,0,4,4,9,9,4,0,0],[0,0,9,0,0,0,0,0,0,9,0,0],[0,0,0,0,8,0,0,0,0,9,0,0],[0,0,4,0,0,8,0,0,0,4,0,0],[0,0,4,0,0,0,8,0,0,4,0,0],[0,0,9,0,0,0,0,8,0,9,0,0],[0,0,9,0,0,0,0,0,0,9,0,0],[0,0,4,9,9,4,4,9,9,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,3,2,0,0,0,0,0,0],[0,0,0,3,3,0,0,0,3,3,0,0,0],[0,0,3,0,0,0,0,0,0,0,3,0,0],[0,0,0,0,0,0,8,0,0,0,0,0,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0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,0],[0,0,0,0,0,0,0,4,0,0,0],[0,0,1,0,0,0,0,0,0,0,0],[0,0,0,8,8,8,8,8,0,0,0],[0,0,1,0,0,0,0,0,5,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,5,0,0,0,0],[0,0,0,0,0,0,0,4,0,0,0],[0,0,1,0,0,0,0,0,5,0,0],[0,0,0,8,8,8,8,8,0,0,0],[0,0,1,0,0,0,0,0,5,0,0],[0,0,0,0,0,0,0,4,0,0,0],[0,0,0,0,0,0,5,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t26: fill symmetry-supported gaps in a colored outline. Rule: - The input shows a colored hollow outline plus one or two central cyan lines. - Each cyan line is a line of symmetry (vertical, horizontal, main diagonal, or anti-diagonal). - In the output, any gap position is filled if some other position in its symmetry orbit already contains a non-cyan colored cell. The copied color is the orbit's color. - If every non-line position in an orbit is empty, the orbit remains empty; the task does not complete the shape from global gestalt alone. Generation constraints used to keep examples well-formed and unambiguous: - the final underlying outline is symmetric across the shown line(s); - each symmetry orbit contains at most one non-cyan color in the input/output; - some samples include fully missing orbits (unfillable gaps) so those remain empty in the output; - all generated shapes keep the cyan line markers inside the hollow interior; - both one-line and two-line symmetry examples are generated, including mixed orthogonal+diagonal two-line pairs; - cyan symmetry-line markers are always preserved in the output. """""" from __future__ import annotations import json import random from collections import defaultdict, deque from typing import Dict, Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Coord = Tuple[int, int] Line = Tuple[str, int] # ('h', row), ('v', col), ('d', diff=r-c), ('a', sum=r+c) BG = 0 CYAN = 8 PALETTE = [1, 2, 3, 4, 5, 6, 7, 9] # --------------------------------------------------------------------------- # Basic helpers # --------------------------------------------------------------------------- def _empty(h: int, w: int, fill: int = BG) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _neighbors4(r: int, c: int, h: int, w: int) -> Iterable[Coord]: for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): nr, nc = r + dr, c + dc if 0 <= nr < h and 0 <= nc < w: yield nr, nc def _boundary_of_mask(mask: List[List[int]]) -> Set[Coord]: h, w = len(mask), len(mask[0]) out: Set[Coord] = set() for r in range(h): for c in range(w): if not mask[r][c]: continue if any(mask[nr][nc] == 0 for nr, nc in _neighbors4(r, c, h, w)) or r in (0, h - 1) or c in (0, w - 1): out.add((r, c)) return out # --------------------------------------------------------------------------- # Symmetry line parsing and reflections # --------------------------------------------------------------------------- def _reflect(line: Line, pos: Coord) -> Coord: r, c = pos typ, k = line if typ == 'h': return (2 * k - r, c) if typ == 'v': return (r, 2 * k - c) if typ == 'd': # r - c = k return (c + k, r - k) if typ == 'a': # r + c = k return (k - c, k - r) raise ValueError(f'unknown line type: {typ}') def _on_line(line: Line, pos: Coord) -> bool: r, c = pos typ, k = line if typ == 'h': return r == k if typ == 'v': return c == k if typ == 'd': return r - c == k if typ == 'a': return r + c == k raise ValueError(line) def _candidate_lines_from_cyan(cyan: Set[Coord]) -> List[Line]: if not cyan: return [] rows = defaultdict(int) cols = defaultdict(int) diffs = defaultdict(int) sums = defaultdict(int) for r, c in cyan: rows[r] += 1 cols[c] += 1 diffs[r - c] += 1 sums[r + c] += 1 cands: list[Line] = [] for r, cnt in rows.items(): if cnt >= 3: cands.append(('h', r)) for c, cnt in cols.items(): if cnt >= 3: cands.append(('v', c)) for d, cnt in diffs.items(): if cnt >= 3: cands.append(('d', d)) for s, cnt in sums.items(): if cnt >= 3: cands.append(('a', s)) return cands def _parse_lines(grid: Grid) -> List[Line]: h, w = len(grid), len(grid[0]) cyan = {(r, c) for r in range(h) for c in range(w) if grid[r][c] == CYAN} cands = _candidate_lines_from_cyan(cyan) # Try exact cover by one line, then two lines. for line in cands: cover = {p for p in cyan if _on_line(line, p)} if cover == cyan: return [line] for i in range(len(cands)): for j in range(i + 1, len(cands)): l1, l2 = cands[i], cands[j] cover = {p for p in cyan if _on_line(l1, p) or _on_line(l2, p)} if cover == cyan: return [l1, l2] raise ValueError('could not parse cyan symmetry line(s)') def _orbit(pos: Coord, lines: Sequence[Line], h: int, w: int) -> Set[Coord]: q = deque([pos]) seen = {pos} while q: cur = q.popleft() for line in lines: nxt = _reflect(line, cur) if 0 <= nxt[0] < h and 0 <= nxt[1] < w and nxt not in seen: seen.add(nxt) q.append(nxt) return seen # --------------------------------------------------------------------------- # Transform # --------------------------------------------------------------------------- def transform_t26(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError('input grid must be non-empty and rectangular') h, w = len(grid), len(grid[0]) lines = _parse_lines(grid) out = _empty(h, w, BG) visited: Set[Coord] = set() for r in range(h): for c in range(w): if grid[r][c] == CYAN or (r, c) in visited: continue orb = _orbit((r, c), lines, h, w) visited |= orb colors = {grid[rr][cc] for rr, cc in orb if grid[rr][cc] not in (BG, CYAN)} if len(colors) > 1: raise ValueError(f'conflicting colors in orbit {orb}: {colors}') if len(colors) == 1: color = next(iter(colors)) for rr, cc in orb: if grid[rr][cc] != CYAN: out[rr][cc] = color # Preserve all cyan symmetry-line markers in the output. for r in range(h): for c in range(w): if grid[r][c] == CYAN: out[r][c] = CYAN return out # --------------------------------------------------------------------------- # Generator helpers # --------------------------------------------------------------------------- def _line_cells(line: Line, h: int, w: int, length: int = 5) -> Set[Coord]: typ, k = line cells: Set[Coord] = set() half = length // 2 if typ == 'h': r = k c0 = w // 2 for dc in range(-half, half + 1): c = c0 + dc if 0 <= c < w: cells.add((r, c)) elif typ == 'v': c = k r0 = h // 2 for dr in range(-half, half + 1): r = r0 + dr if 0 <= r < h: cells.add((r, c)) elif typ == 'd': # parameterize around center with equal row/col changes r0, c0 = h // 2, w // 2 # project center to the line by adjusting row to c + k r0 = c0 + k if not (0 <= r0 < h): r0 = h // 2 c0 = r0 - k for t in range(-half, half + 1): r, c = r0 + t, c0 + t if 0 <= r < h and 0 <= c < w and r - c == k: cells.add((r, c)) elif typ == 'a': r0, c0 = h // 2, w // 2 r0 = k - c0 if not (0 <= r0 < h): r0 = h // 2 c0 = k - r0 for t in range(-half, half + 1): r, c = r0 + t, c0 - t if 0 <= r < h and 0 <= c < w and r + c == k: cells.add((r, c)) else: raise ValueError(line) return cells def _filled_rectangle(h: int, w: int, top: int, bottom: int, left: int, right: int) -> List[List[int]]: mask = _empty(h, w, 0) for r in range(top, bottom + 1): for c in range(left, right + 1): mask[r][c] = 1 return mask def _filled_diamond(h: int, w: int, radius: int) -> List[List[int]]: mask = _empty(h, w, 0) cr, cc = h // 2, w // 2 for r in range(h): for c in range(w): if abs(r - cr) + abs(c - cc) <= radius: mask[r][c] = 1 return mask def _filled_octagon(h: int, w: int, R: int, S: int) -> List[List[int]]: mask = _empty(h, w, 0) cr, cc = h // 2, w // 2 for r in range(h): for c in range(w): dr, dc = abs(r - cr), abs(c - cc) if max(dr, dc) <= R and dr + dc <= S: mask[r][c] = 1 return mask def _filled_vert_blob(h: int, w: int, rng: random.Random, mirror_h: bool) -> List[List[int]]: mask = _empty(h, w, 0) cc = w // 2 top = rng.randint(1, h // 3) bottom = rng.randint(2 * h // 3, h - 2) if mirror_h: top = h - 1 - bottom rows = list(range(top, bottom + 1)) if mirror_h: half_rows = [r for r in rows if r <= h // 2] else: half_rows = rows widths: Dict[int, int] = {} cur = rng.randint(max(2, w // 6), max(3, w // 4)) for r in half_rows: cur += rng.choice([-1, 0, 1]) cur = max(2, min((w // 2) - 2, cur)) widths[r] = cur if mirror_h: widths[h - 1 - r] = cur for r in rows: width = widths[r] for c in range(cc - width, cc + width + 1): mask[r][c] = 1 return mask def _outline_from_family(h: int, w: int, lines: Sequence[Line], rng: random.Random) -> Set[Coord]: line_types = {t for t, _ in lines} use_d4 = any(t in ('d', 'a') for t in line_types) for _ in range(500): if use_d4: fam = rng.choice(['square', 'diamond', 'octagon']) if fam == 'square': span = rng.randint(min(h, w) // 3, (min(h, w) // 2) - 1) mask = _filled_rectangle(h, w, h // 2 - span, h // 2 + span, w // 2 - span, w // 2 + span) elif fam == 'diamond': radius = rng.randint(min(h, w) // 3, (min(h, w) // 2) - 1) mask = _filled_diamond(h, w, radius) else: R = rng.randint(min(h, w) // 3, (min(h, w) // 2) - 1) S = R + rng.randint(max(2, R // 2), R) mask = _filled_octagon(h, w, R, S) else: fam = rng.choice(['rectangle', 'diamond', 'vblob']) if fam == 'rectangle': hh = rng.randint(h // 2, h - 3) ww = rng.randint(w // 2, w - 3) top = (h - hh) // 2 if len(lines) == 2 else rng.randint(1, h - hh - 1) bottom = top + hh - 1 left = (w - ww) // 2 right = left + ww - 1 mask = _filled_rectangle(h, w, top, bottom, left, right) elif fam == 'diamond': radius = rng.randint(min(h, w) // 3, (min(h, w) // 2) - 1) mask = _filled_diamond(h, w, radius) else: mask = _filled_vert_blob(h, w, rng, mirror_h=(len(lines) == 2)) outline = _boundary_of_mask(mask) # Remove any cells that lie directly on a cyan symmetry marker. This lets # one- and two-line examples both keep the marker inside the hollow shape # rather than overwriting it with outline cells. outline = {p for p in outline if not any(_on_line(line, p) for line in lines)} if len(outline) < 12: continue # Keep only full symmetry orbits that stay entirely off the cyan lines. # This is especially important for mixed two-line cases such as # vertical+diagonal: some boundary cells may have reflected partners that # land on a symmetry line, and those incomplete orbits must be excluded. filtered: Set[Coord] = set() seen_orbit_cells: Set[Coord] = set() for p in sorted(outline): if p in seen_orbit_cells: continue orb = _orbit(p, lines, h, w) seen_orbit_cells |= orb if orb <= outline: filtered |= orb outline = filtered if len(outline) < 12: continue return outline raise RuntimeError('failed to generate symmetric outline') def _partition_orbits(cells: Set[Coord], lines: Sequence[Line], h: int, w: int) -> List[Set[Coord]]: out: List[Set[Coord]] = [] seen: Set[Coord] = set() for p in sorted(cells): if p in seen: continue orb = _orbit(p, lines, h, w) & cells seen |= orb out.append(orb) return out def _assign_colors(orbits: Sequence[Set[Coord]], rng: random.Random) -> Dict[Coord, int]: n_colors = rng.randint(2, min(5, len(PALETTE))) palette = rng.sample(PALETTE, n_colors) out: Dict[Coord, int] = {} for i, orb in enumerate(orbits): color = palette[i % n_colors] if rng.random() < 0.35 else rng.choice(palette) for p in orb: out[p] = color return out def _line_setup(rng: random.Random, h: int, w: int) -> List[Line]: cr, cc = h // 2, w // 2 # Include both one-line and two-line examples. Two-line cases are weighted # deliberately so the generated sample set reflects the original demos. one_line: List[List[Line]] = [ [('v', cc)], [('h', cr)], [('d', cr - cc)], [('a', cr + cc)], ] two_line: List[List[Line]] = [ [('v', cc), ('h', cr)], [('d', cr - cc), ('a', cr + cc)], [('v', cc), ('d', cr - cc)], [('v', cc), ('a', cr + cc)], [('h', cr), ('d', cr - cc)], [('h', cr), ('a', cr + cc)], ] return rng.choice(two_line if rng.random() < 0.45 else one_line) def generate(rng: random.Random | None = None) -> Dict[str, Grid]: rng = rng or random.Random() for _ in range(4000): # Odd sizes keep all symmetry lines centered cleanly. h = rng.choice([11, 13, 15, 17]) w = h if rng.random() < 0.8 else rng.choice([11, 13, 15, 17]) lines = _line_setup(rng, h, w) try: outline = _outline_from_family(h, w, lines, rng) except RuntimeError: continue orbits = [orb for orb in _partition_orbits(outline, lines, h, w) if len(orb) >= 2] if len(orbits) < 4: continue colors = _assign_colors(orbits, rng) want_unfillable = rng.random() < 0.5 n_partial = rng.randint(1, max(1, min(5, len(orbits) - 1))) partial_orbits = rng.sample(orbits, n_partial) remaining = [orb for orb in orbits if orb not in partial_orbits] full_orbits: List[Set[Coord]] = [] if want_unfillable and remaining: n_full = rng.randint(1, min(3, len(remaining))) full_orbits = rng.sample(remaining, n_full) input_cells: Dict[Coord, int] = {} # Start with the full final outline. for p, color in colors.items(): input_cells[p] = color # Remove full orbits entirely (these remain empty in the output too). for orb in full_orbits: for p in orb: input_cells.pop(p, None) # Remove some but not all cells in selected partial orbits. for orb in partial_orbits: k = rng.randint(1, len(orb) - 1) removed = rng.sample(sorted(orb), k) # Ensure at least one cell remains. for p in removed: input_cells.pop(p, None) # Build input grid. inp = _empty(h, w, BG) line_cells: Set[Coord] = set() for line in lines: line_cells |= _line_cells(line, h, w, length=5) for r, c in line_cells: inp[r][c] = CYAN for (r, c), color in input_cells.items(): if inp[r][c] == CYAN: raise RuntimeError('shape overlapped line marker unexpectedly') inp[r][c] = color out = transform_t26(inp) # Quality checks. if out == inp: continue # Verify at least one fillable gap got restored. restored = sum(1 for r in range(h) for c in range(w) if inp[r][c] == BG and out[r][c] not in (BG, CYAN)) if restored == 0: continue # Ensure requested unfillable case exists when desired. if want_unfillable: still_empty = 0 for orb in full_orbits: for p in orb: if out[p[0]][p[1]] == BG: still_empty += 1 if still_empty == 0: continue return {'input': inp, 'output': out} raise RuntimeError('failed to generate a valid t26 sample') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t26 symmetry-gap-fill task."""""" from __future__ import annotations from typing import List from generator import transform_t26 Grid = List[List[int]] def verify_t26(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('ragged input grid') return transform_t26(inp) " "t27","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0],[0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,1,1,0,0,0,0,3,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Diverse generator for t27_square_anchors. Generated inputs contain several colored anchor shapes. The shapes can be partitioned into one or two square arrangements. Within each arrangement, the member shapes tile a filled 3x3, 4x4, or 5x5 square when rotations are allowed (up to five pieces on a 5x5). For each member shape, the output completes that square around the anchor while keeping that anchor fixed in place and orientation. """""" from __future__ import annotations import random from typing import Dict, Iterable, List, Sequence, Set, Tuple from verifier import _extract_objects, _find_partitions, _shape_signature, verify_t27 Grid = List[List[int]] Cell = Tuple[int, int] Shape = Tuple[Cell, ...] PlacedGroup = Tuple[int, Tuple[Shape, ...]] # ------------------------------ basic helpers ------------------------------ def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _normalize(cells: Iterable[Cell]) -> Shape: pts = list(cells) if not pts: return tuple() min_r = min(r for r, _ in pts) min_c = min(c for _, c in pts) return tuple(sorted((r - min_r, c - min_c) for r, c in pts)) def _dims(shape: Shape) -> Tuple[int, int]: return max(r for r, _ in shape) + 1, max(c for _, c in shape) + 1 def _paint(grid: Grid, shape: Shape, r0: int, c0: int, color: int) -> None: for r, c in shape: grid[r0 + r][c0 + c] = color def _nonzero_count(grid: Grid) -> int: return sum(1 for row in grid for v in row if v != 0) def _input_preserved(inp: Grid, out: Grid) -> bool: return all(v == 0 or out[r][c] == v for r, row in enumerate(inp) for c, v in enumerate(row)) def _rotate(shape: Shape, times: int) -> Shape: pts = list(shape) for _ in range(times % 4): pts = [(c, -r) for r, c in pts] pts = list(_normalize(pts)) return tuple(sorted(pts)) def _unique_rotations(shape: Shape) -> List[Shape]: rots: List[Shape] = [] seen: Set[Shape] = set() for t in range(4): s = _rotate(shape, t) if s not in seen: seen.add(s) rots.append(s) return rots def _placements_for(shape: Shape, k: int) -> List[Shape]: ph, pw = _dims(shape) out: List[Shape] = [] for r0 in range(k - ph + 1): for c0 in range(k - pw + 1): out.append(tuple(sorted((r + r0, c + c0) for r, c in shape))) return out # --------------------- square-partition / orientation logic --------------------- def _random_connected_partition(rr: random.Random, k: int, m: int) -> Tuple[Shape, ...] | None: """"""Randomly partition a k x k square into m connected pieces. This intentionally explores two- through five-piece square decompositions. All pieces are 4-connected. """""" cells = [(r, c) for r in range(k) for c in range(k)] cell_set = set(cells) for _ in range(200): seeds = rr.sample(cells, m) pieces = [{seed} for seed in seeds] unassigned = cell_set - set(seeds) while unassigned: frontier: List[Tuple[int, Cell]] = [] for i, piece in enumerate(pieces): nbrs: Set[Cell] = set() for r, c in piece: for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): q = (r + dr, c + dc) if q in unassigned: nbrs.add(q) frontier.extend((i, q) for q in nbrs) if not frontier: break i, q = rr.choice(frontier) pieces[i].add(q) unassigned.remove(q) if unassigned: continue # Mild size balancing so the pieces are usually all visually present. sizes = sorted(len(p) for p in pieces) if sizes[0] == 1 and k >= 4: continue if sizes[-1] > k * k - (m - 1) * 2: continue shapes = tuple(_normalize(piece) for piece in pieces) sigs = [_shape_signature(s) for s in shapes] if len(set(sigs)) != m: continue return shapes return None def _random_group(rr: random.Random, k: int, m: int) -> PlacedGroup | None: for _ in range(200): shapes = _random_connected_partition(rr, k, m) if shapes is None: continue # Prefer groups containing at least one asymmetric piece, which makes # rotation-based reasoning more common and more visible. if not any(len(_unique_rotations(s)) > 1 for s in shapes): continue return (k, shapes) return None def _tilings_fixed_orientation(shapes: Sequence[Shape], k: int, limit: int = 1) -> int: """"""Number of exact tilings using current orientations only (translations allowed)."""""" target = {(r, c) for r in range(k) for c in range(k)} options: Dict[int, List[Set[Cell]]] = {} for i, shape in enumerate(shapes): opts = [set(p) for p in _placements_for(shape, k)] if not opts: return 0 options[i] = opts solutions = 0 def backtrack(used: Set[Cell], remaining: Set[int]) -> None: nonlocal solutions if solutions >= limit: return if not remaining: if used == target: solutions += 1 return uncovered = target - used coverable: Set[Cell] = set() for idx in remaining: for p in options[idx]: if not (p & used): coverable |= p if uncovered - coverable: return best_idx = None best_valid: List[Set[Cell]] | None = None for idx in remaining: valid = [p for p in options[idx] if not (p & used)] if best_valid is None or len(valid) < len(best_valid): best_idx = idx best_valid = valid if best_valid == []: return assert best_idx is not None and best_valid is not None rem2 = set(remaining) rem2.remove(best_idx) for p in best_valid: backtrack(used | p, rem2) if solutions >= limit: return backtrack(set(), set(range(len(shapes)))) return solutions def _orient_group(rr: random.Random, group: PlacedGroup, force_rotation_need: bool) -> PlacedGroup | None: """"""Randomly rotate each member shape independently. If ``force_rotation_need`` is True, reject orientations that still tile the square with no piece rotation at all. """""" k, shapes = group for _ in range(200): oriented = tuple(_rotate(shape, rr.randrange(4)) for shape in shapes) # Avoid the trivial ""everything shares the same rotation"" cases most of the time. rotable = [i for i, s in enumerate(shapes) if len(_unique_rotations(s)) > 1] if len(rotable) >= 2: rots = [oriented[i] for i in rotable] if len({_shape_signature(s) for s in rots}) == 1 and rr.random() < 0.85: continue if force_rotation_need and _tilings_fixed_orientation(oriented, k, limit=1) > 0: continue return (k, oriented) return None def _choose_group_specs(rr: random.Random) -> List[Tuple[int, int]]: """"""Return one or two (k, piece_count) specs within the allowed constraints."""""" layouts = [ [(3, 3)], [(4, 3)], [(4, 4)], [(5, 3)], [(5, 4)], [(5, 5)], [(3, 2), (3, 2)], [(3, 2), (4, 3)], [(3, 2), (4, 4)], [(3, 2), (5, 3)], [(4, 2), (4, 2)], [(4, 2), (4, 3)], [(4, 2), (5, 3)], [(5, 2), (3, 2)], [(5, 2), (4, 2)], [(5, 2), (4, 3)], [(3, 3), (3, 2)], [(4, 3), (3, 2)], [(4, 3), (4, 2)], [(5, 3), (3, 2)], ] return list(rr.choice(layouts)) def _build_groups(rr: random.Random) -> List[PlacedGroup] | None: specs = _choose_group_specs(rr) base_groups: List[PlacedGroup] = [] used_sigs: Set[Shape] = set() for k, m in specs: for _ in range(250): group = _random_group(rr, k, m) if group is None: continue sigs = [_shape_signature(s) for s in group[1]] if any(sig in used_sigs for sig in sigs): continue # Strongly bias toward examples that require rotation for at least one # arrangement; single-group tasks always require it. force = len(specs) == 1 or rr.random() < 0.8 oriented = _orient_group(rr, group, force_rotation_need=force) if oriented is None: continue osigs = [_shape_signature(s) for s in oriented[1]] if any(sig in used_sigs for sig in osigs): continue base_groups.append(oriented) used_sigs.update(osigs) break else: return None if len(base_groups) == 2: # Ensure at least one group in two-square tasks really needs rotation. needs = [_tilings_fixed_orientation(gs, k, limit=1) == 0 for k, gs in base_groups] if not any(needs): return None return base_groups # ------------------------------ input placement ------------------------------ def _has_clearance(occupied: Set[Cell], shape: Shape, r0: int, c0: int) -> bool: for r, c in shape: rr, cc = r0 + r, c0 + c for dr in (-1, 0, 1): for dc in (-1, 0, 1): if (rr + dr, cc + dc) in occupied: return False return True def _place_shapes(rr: random.Random, shapes: Sequence[Shape], colors: Sequence[int], h: int, w: int) -> Grid | None: grid = _empty(h, w) # Widely separated anchor slots so the completed output squares also remain separated. slots = [ (2, 2), (2, w - 9), (h - 9, 2), (h - 9, w - 9), (2, w // 2 - 4), (h // 2 - 4, 2), (h // 2 - 4, w - 9), (h - 9, w // 2 - 4), ] order = list(range(len(shapes))) rr.shuffle(order) slot_order = slots[:] rr.shuffle(slot_order) placed: Dict[int, Tuple[int, int]] = {} occupied: Set[Cell] = set() for idx, base in zip(order, slot_order): shape = shapes[idx] ph, pw = _dims(shape) for _ in range(120): r0 = base[0] + rr.randint(-1, 1) c0 = base[1] + rr.randint(-1, 1) if r0 < 1 or c0 < 1 or r0 + ph >= h - 1 or c0 + pw >= w - 1: continue if _has_clearance(occupied, shape, r0, c0): placed[idx] = (r0, c0) for r, c in shape: occupied.add((r0 + r, c0 + c)) break else: return None for idx, shape in enumerate(shapes): r0, c0 = placed[idx] _paint(grid, shape, r0, c0, colors[idx]) return grid # ------------------------------ public generator ------------------------------ def generate(rng: random.Random | None = None) -> dict[str, Grid]: rr = rng if rng is not None else random for _ in range(1000): groups = _build_groups(rr) if groups is None: continue shapes = [s for _, gs in groups for s in gs] sigs = [_shape_signature(s) for s in shapes] if len(set(sigs)) != len(sigs): continue total_shapes = len(shapes) h = rr.randint(22, 30) w = rr.randint(22, 30) if total_shapes >= 5: h = max(h, 26) w = max(w, 26) colors = rr.sample(range(1, 10), total_shapes) grid = _place_shapes(rr, shapes, colors, h, w) if grid is None: continue objs = _extract_objects(grid) if len(objs) != len(shapes): continue partitions = _find_partitions(objs) if len(partitions) != 1: continue if sorted(len(g) for g, _ in partitions[0]) != sorted(len(gs) for _, gs in groups): continue out = verify_t27(grid) expected = sum(len(gs) * k * k for k, gs in groups) if _nonzero_count(out) != expected: continue if not _input_preserved(grid, out): continue return {""input"": grid, ""output"": out} raise RuntimeError(""failed to generate a valid t27 sample"") ","""""""Verifier for t27: square completion around each anchor shape. Valid inputs contain several monochrome objects, identified by color. The objects can be partitioned into one or two groups. Within each group (at most five shapes), those shapes can be rotated and packed to form one filled k x k square. For every member shape, the output places a full copy of that square so that the member itself remains fixed in its original input position and orientation. """""" from __future__ import annotations from itertools import combinations from math import isqrt from typing import Dict, Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] Shape = Tuple[Cell, ...] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _normalize(cells: Iterable[Cell]) -> Shape: pts = list(cells) if not pts: return tuple() min_r = min(r for r, _ in pts) min_c = min(c for _, c in pts) return tuple(sorted((r - min_r, c - min_c) for r, c in pts)) def _rotate(shape: Shape, times: int) -> Shape: pts = list(shape) for _ in range(times % 4): pts = [(c, -r) for r, c in pts] pts = list(_normalize(pts)) return tuple(sorted(pts)) def _unique_rotations(shape: Shape) -> List[Shape]: rots: List[Shape] = [] seen: Set[Shape] = set() for t in range(4): s = _rotate(shape, t) if s not in seen: seen.add(s) rots.append(s) return rots def _shape_signature(shape: Shape) -> Shape: return min(_unique_rotations(shape)) def _dims(shape: Shape) -> Tuple[int, int]: if not shape: return (0, 0) return max(r for r, _ in shape) + 1, max(c for _, c in shape) + 1 def _extract_objects(grid: Grid) -> List[dict]: h = len(grid) w = len(grid[0]) if h else 0 by_color: Dict[int, List[Cell]] = {} for r in range(h): for c in range(w): color = grid[r][c] if color: by_color.setdefault(color, []).append((r, c)) objs: List[dict] = [] for color, cells in by_color.items(): norm = _normalize(cells) min_r = min(rr for rr, _ in cells) min_c = min(cc for _, cc in cells) objs.append({""cells"": tuple(sorted(cells)), ""shape"": norm, ""origin"": (min_r, min_c), ""color"": color}) objs.sort(key=lambda o: (o[""origin""], o[""color""], len(o[""cells""]))) return objs def _placements_for(shape: Shape, k: int) -> List[Shape]: ph, pw = _dims(shape) out: List[Shape] = [] for r0 in range(k - ph + 1): for c0 in range(k - pw + 1): out.append(tuple(sorted((r + r0, c + c0) for r, c in shape))) return out def _tilings_for_group(objs: Sequence[dict], group: Sequence[int], k: int, anchor: int | None = None, limit: int = 2) -> List[Dict[int, Shape]]: """"""Find up to ``limit`` exact square tilings for a group. If anchor is supplied, that object must be used in its current orientation (rotation 0), which is the condition required for output reconstruction around that fixed anchor. """""" target = {(r, c) for r in range(k) for c in range(k)} options: Dict[int, List[Shape]] = {} option_sets: Dict[int, List[Set[Cell]]] = {} for idx in group: rotations = [objs[idx][""shape""]] if idx == anchor else _unique_rotations(objs[idx][""shape""]) opts: List[Shape] = [] seen: Set[Shape] = set() for rot in rotations: for placed in _placements_for(rot, k): if placed not in seen: seen.add(placed) opts.append(placed) if not opts: return [] options[idx] = opts option_sets[idx] = [set(o) for o in opts] solutions: List[Dict[int, Shape]] = [] calls = 0 max_calls = 10000 def backtrack(used: Set[Cell], chosen: Dict[int, Shape], remaining: Set[int]) -> None: nonlocal calls calls += 1 if calls > max_calls or len(solutions) >= limit: return if not remaining: if used == target: solutions.append(dict(chosen)) return uncovered = target - used coverable: Set[Cell] = set() for idx in remaining: for pset in option_sets[idx]: if not (pset & used): coverable |= pset if uncovered - coverable: return best_idx = None best_opts: List[int] | None = None for idx in remaining: valid = [j for j, pset in enumerate(option_sets[idx]) if not (pset & used)] if best_opts is None or len(valid) < len(best_opts): best_idx = idx best_opts = valid if best_opts == []: return assert best_idx is not None and best_opts is not None next_remaining = set(remaining) next_remaining.remove(best_idx) for opt_i in best_opts: placed = options[best_idx][opt_i] pset = option_sets[best_idx][opt_i] chosen[best_idx] = placed backtrack(used | pset, chosen, next_remaining) chosen.pop(best_idx, None) if len(solutions) >= limit: return backtrack(set(), {}, set(group)) return solutions def _candidate_groups(objs: Sequence[dict]) -> List[Tuple[Tuple[int, ...], int]]: n = len(objs) cands: List[Tuple[Tuple[int, ...], int]] = [] for m in range(2, min(5, n) + 1): for group in combinations(range(n), m): area = sum(len(objs[i][""shape""]) for i in group) k = isqrt(area) if k * k != area or k < 2: continue ok = True for idx in group: if len(_tilings_for_group(objs, group, k, anchor=idx, limit=2)) != 1: ok = False break if ok: cands.append((tuple(group), k)) return cands def _find_partitions(objs: Sequence[dict]) -> List[List[Tuple[Tuple[int, ...], int]]]: n = len(objs) all_idxs = set(range(n)) cands = _candidate_groups(objs) parts: List[List[Tuple[Tuple[int, ...], int]]] = [] for g, k in cands: s = set(g) if s == all_idxs and len(g) >= 3: parts.append([(g, k)]) rem = all_idxs - s if rem: for g2, k2 in cands: s2 = set(g2) if s2 == rem and min(g) < min(g2): parts.append([(g, k), (g2, k2)]) dedup: List[List[Tuple[Tuple[int, ...], int]]] = [] seen = set() for part in parts: key = tuple(sorted((tuple(sorted(g)), k) for g, k in part)) if key not in seen: seen.add(key) dedup.append(sorted(part, key=lambda x: x[0])) return dedup def verify_t27(grid: Grid) -> Grid: h = len(grid) w = len(grid[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in grid): return [] objs = _extract_objects(grid) if not objs: return _empty(h, w) sigs = [_shape_signature(o[""shape""]) for o in objs] if len(set(sigs)) != len(sigs): return _empty(h, w) partitions = _find_partitions(objs) if not partitions: return _empty(h, w) part = partitions[0] out = _empty(h, w) for group, k in part: for anchor in group: tiling = _tilings_for_group(objs, group, k, anchor=anchor, limit=1)[0] ar0, ac0 = objs[anchor][""origin""] anchor_tile = tiling[anchor] tile_min_r = min(r for r, _ in anchor_tile) tile_min_c = min(c for _, c in anchor_tile) dr = ar0 - tile_min_r dc = ac0 - tile_min_c for idx, placed in tiling.items(): color = objs[idx][""color""] for r, c in placed: rr, cc = r + dr, c + dc if 0 <= rr < h and 0 <= cc < w: out[rr][cc] = color return out " "t28","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,3,0,0],[0,0,0,0,0,0,0,3,3,3,0],[0,0,0,0,0,0,0,3,3,3,0],[0,0,0,3,0,0,0,0,0,0,0],[0,0,3,3,3,0,0,0,0,0,0],[0,3,3,3,3,3,0,0,0,0,0],[0,3,3,3,3,3,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,3,3,3,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0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,5,0],[0,0,0,0,0,0,0,0,0,6,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,3,0,0,0,0,0,0,0,0,0],[0,6,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,3,0,0,0,0,0,0,0,0,0],[0,3,3,3,0,0,0,0,0,0,0,0],[0,0,3,0,0,0,0,0,3,0,3,3],[0,0,0,0,0,0,0,0,3,3,3,3],[0,3,0,0,0,0,0,0,0,0,0,0],[3,3,3,0,0,0,0,0,3,0,0,0],[0,3,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0,0,0,2,0],[0,0,0,0,0,0,2,2,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,2,2,0,0,0,0,0],[0,0,0,0,5,0,0,0,0],[0,0,0,5,0,0,0,0,0],[0,0,1,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,2,0],[0,0,0,0,0,0,2,2,0],[0,0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,2,2,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for t28: breakout-style diagonal bouncing stop. Task rule: - The input contains several obstacle cells/shapes, a single colored moving cell near the bottom, and a 2-cell grey diagonal pointer extending from that cell. - The pointer indicates the moving cell's initial diagonal direction. - Imagine the cell moving one step at a time in that direction, bouncing elastically off the grid walls (45-degree billiard motion). - Movement stops when the *next* step after any required wall-bounce would land on an already colored obstacle cell. The output shows the moving cell at its last empty position, with the original moving cell and grey pointer removed. Generator constraints: - the moving cell color differs from both obstacle color and grey; - the initial pointer is always a length-2 diagonal chain from the start cell; - generated examples are restricted to trajectories requiring at most 3 bounces, except for an occasional 4-bounce example; - an obstacle is always placed on the future path so the motion halts finitely; - extra obstacles are placed away from the early path prefix so the intended stop is unambiguous. """""" from __future__ import annotations import json import random from typing import Dict, Iterable, List, Optional, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] DIRS = [(-1, -1), (-1, 1)] GREY = 5 COLORS = [1, 2, 3, 4, 6, 7, 8, 9] def _empty(h: int, w: int, fill: int = 0) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _diag_dirs() -> list[Cell]: return [(-1, -1), (-1, 1), (1, -1), (1, 1)] def _parse_start_and_direction(grid: Grid) -> tuple[Cell, Cell]: h, w = len(grid), len(grid[0]) # Look for a non-zero/non-grey cell that begins a color-grey-grey diagonal chain. for r in range(h): for c in range(w): if grid[r][c] in (0, GREY): continue for dr, dc in _diag_dirs(): r1, c1 = r + dr, c + dc r2, c2 = r + 2 * dr, c + 2 * dc if 0 <= r2 < h and 0 <= c2 < w: if grid[r1][c1] == GREY and grid[r2][c2] == GREY: # ensure the chain starts here, not earlier in same diagonal rp, cp = r - dr, c - dc if 0 <= rp < h and 0 <= cp < w and grid[rp][cp] == GREY: continue return (r, c), (dr, dc) raise ValueError('Could not find moving cell with 2-cell grey diagonal pointer') def _remove_markers(grid: Grid, start: Cell, direction: Cell) -> tuple[Grid, int]: h, w = len(grid), len(grid[0]) out = [row[:] for row in grid] sr, sc = start color = out[sr][sc] out[sr][sc] = 0 dr, dc = direction for k in (1, 2): rr, cc = sr + k * dr, sc + k * dc if not (0 <= rr < h and 0 <= cc < w and out[rr][cc] == GREY): raise ValueError('Malformed marker line') out[rr][cc] = 0 return out, color def _step_with_bounce(r: int, c: int, dr: int, dc: int, h: int, w: int) -> tuple[int, int, int, int]: nr, nc = r + dr, c + dc if nr < 0 or nr >= h: dr = -dr nr = r + dr if nc < 0 or nc >= w: dc = -dc nc = c + dc return nr, nc, dr, dc def _step_with_bounce_event(r: int, c: int, dr: int, dc: int, h: int, w: int) -> tuple[int, int, int, int, int]: """"""Like _step_with_bounce, but also returns whether this step bounced. A corner reflection counts as a single bounce event for generation purposes. """""" nr, nc = r + dr, c + dc bounced = int(nr < 0 or nr >= h or nc < 0 or nc >= w) if nr < 0 or nr >= h: dr = -dr nr = r + dr if nc < 0 or nc >= w: dc = -dc nc = c + dc return nr, nc, dr, dc, bounced def _simulate_stop(grid: Grid, start: Cell, direction: Cell) -> Cell: h, w = len(grid), len(grid[0]) r, c = start dr, dc = direction seen_states: Set[tuple[int, int, int, int]] = set() while True: state = (r, c, dr, dc) if state in seen_states: raise ValueError('Path cycles without ever reaching an obstacle') seen_states.add(state) nr, nc, dr2, dc2 = _step_with_bounce(r, c, dr, dc, h, w) if grid[nr][nc] != 0: return (r, c) r, c, dr, dc = nr, nc, dr2, dc2 def transform_t28(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError('Input grid must be non-empty and rectangular') start, direction = _parse_start_and_direction(grid) board, ball_color = _remove_markers(grid, start, direction) fr, fc = _simulate_stop(board, start, direction) out = [row[:] for row in board] out[fr][fc] = ball_color return out # --------------------------------------------------------------------------- # Generation helpers # --------------------------------------------------------------------------- _SMALL_SHAPES: list[Set[Cell]] = [ {(0, 0)}, {(0, 0), (0, 1)}, {(0, 0), (1, 0)}, {(0, 0), (0, 1), (0, 2)}, {(0, 0), (1, 0), (1, 1)}, {(0, 1), (1, 0), (1, 1)}, {(0, 0), (0, 1), (1, 0), (1, 1)}, {(0, 1), (1, 0), (1, 1), (1, 2), (2, 1)}, ] def _normalize(shape: Iterable[Cell]) -> Set[Cell]: cells = set(shape) min_r = min(r for r, _ in cells) min_c = min(c for _, c in cells) return {(r - min_r, c - min_c) for r, c in cells} def _rotate(shape: Iterable[Cell]) -> Set[Cell]: cells = set(shape) return _normalize({(c, -r) for r, c in cells}) def _orientations(shape: Set[Cell]) -> list[Set[Cell]]: out = [] cur = _normalize(shape) for _ in range(4): if cur not in out: out.append(cur) cur = _rotate(cur) return out def _empty_path_sequence(h: int, w: int, start: Cell, direction: Cell) -> list[Cell]: """"""Visited positions in an empty board until state repeats (excluding start)."""""" r, c = start dr, dc = direction seen: Set[tuple[int, int, int, int]] = set() seq: list[Cell] = [] while True: state = (r, c, dr, dc) if state in seen: return seq seen.add(state) nr, nc, dr, dc = _step_with_bounce(r, c, dr, dc, h, w) seq.append((nr, nc)) r, c = nr, nc def _empty_path_sequence_with_bounces(h: int, w: int, start: Cell, direction: Cell) -> list[tuple[Cell, int]]: """"""Empty-board path annotated with cumulative bounce count. Each item corresponds to the cell reached after one step and the number of wall-bounce events encountered up to and including that attempted step. """""" r, c = start dr, dc = direction seen: Set[tuple[int, int, int, int]] = set() seq: list[tuple[Cell, int]] = [] bounces = 0 while True: state = (r, c, dr, dc) if state in seen: return seq seen.add(state) nr, nc, dr, dc, bounced = _step_with_bounce_event(r, c, dr, dc, h, w) bounces += bounced seq.append(((nr, nc), bounces)) r, c = nr, nc def _place_shape(board: Grid, cells: Set[Cell], color: int) -> None: for r, c in cells: board[r][c] = color def _can_place(board: Grid, cells: Set[Cell], forbidden: Set[Cell]) -> bool: h, w = len(board), len(board[0]) for r, c in cells: if not (0 <= r < h and 0 <= c < w): return False if board[r][c] != 0 or (r, c) in forbidden: return False return True def _random_blob_through(target: Cell, board: Grid, forbidden: Set[Cell], rng: random.Random) -> Optional[Set[Cell]]: shapes = _SMALL_SHAPES[:] rng.shuffle(shapes) for base in shapes: orients = _orientations(base) rng.shuffle(orients) for shape in orients: anchor_cells = list(shape) rng.shuffle(anchor_cells) for ar, ac in anchor_cells: off_r, off_c = target[0] - ar, target[1] - ac cells = {(off_r + r, off_c + c) for r, c in shape} if _can_place(board, cells, forbidden): return cells # fallback: single-cell obstacle if available if _can_place(board, {target}, forbidden): return {target} return None def _random_blob_anywhere(board: Grid, color: int, forbidden: Set[Cell], rng: random.Random) -> bool: h, w = len(board), len(board[0]) shapes = _SMALL_SHAPES[:] rng.shuffle(shapes) for base in shapes: for shape in _orientations(base): max_r = max(r for r, _ in shape) max_c = max(c for _, c in shape) positions = [(rr, cc) for rr in range(h - max_r) for cc in range(w - max_c)] rng.shuffle(positions) for off_r, off_c in positions: cells = {(off_r + r, off_c + c) for r, c in shape} if _can_place(board, cells, forbidden): _place_shape(board, cells, color) return True return False def generate(rng: random.Random | None = None) -> Dict[str, Grid]: rng = rng or random.Random() for _ in range(4000): h = rng.randint(9, 18) w = rng.randint(9, 18) start_row = h - 1 direction = rng.choice(DIRS) dc = direction[1] if dc == 1: start_col = rng.randint(0, w - 3) else: start_col = rng.randint(2, w - 1) start = (start_row, start_col) grey1 = (start_row - 1, start_col + dc) grey2 = (start_row - 2, start_col + 2 * dc) if not (0 <= grey2[1] < w): continue obstacle_color = rng.choice(COLORS) ball_color = rng.choice([c for c in COLORS if c != obstacle_color]) board = _empty(h, w) # Early-path prefix to protect: no obstacles may appear there, so the chosen # stop location remains the first collision. We also restrict examples to # paths with at most 3 bounces, except for occasional 4-bounce cases. empty_path_info = _empty_path_sequence_with_bounces(h, w, start, direction) empty_path = [cell for cell, _b in empty_path_info] if len(empty_path) < 5: continue bounce_cap = 4 if rng.random() < 0.08 else 3 candidate_indices = [ idx for idx in range(3, len(empty_path_info)) if empty_path_info[idx][1] <= bounce_cap ] if not candidate_indices: continue # Keep the chosen collision reasonably early to avoid overly long traces. upper = max(6, len(empty_path_info) // 2) preferred = [idx for idx in candidate_indices if idx <= upper] pool = preferred if preferred else candidate_indices stop_index = rng.choice(pool) hit_cell = empty_path[stop_index] protected_prefix = set(empty_path[:stop_index]) marker_cells = {start, grey1, grey2} forbidden_for_main = protected_prefix | marker_cells main_blob = _random_blob_through(hit_cell, board, forbidden_for_main, rng) if main_blob is None: continue _place_shape(board, main_blob, obstacle_color) # Additional obstacle blobs for visual richness, kept off the protected prefix. n_extra = rng.randint(1, 6) forbidden_extra = protected_prefix | marker_cells for _k in range(n_extra): _random_blob_anywhere(board, obstacle_color, forbidden_extra, rng) inp = [row[:] for row in board] inp[start[0]][start[1]] = ball_color inp[grey1[0]][grey1[1]] = GREY inp[grey2[0]][grey2[1]] = GREY try: out = transform_t28(inp) except Exception: continue # Sanity-check that the output ball stops exactly at the intended prefix end. expected_stop = empty_path[stop_index - 1] if out[expected_stop[0]][expected_stop[1]] != ball_color: continue # Keep outputs meaningfully changed. if out == inp: continue return {'input': inp, 'output': out} raise RuntimeError('Failed to generate valid t28 example') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for t28 breakout-style bounce-stop task."""""" from __future__ import annotations from typing import List from generator import transform_t28 Grid = List[List[int]] def verify_t28(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('Input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('Input grid must be rectangular') return transform_t28(inp) " "t29","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,3,3,0,0,0,0,6,6,0,0,0,0],[0,0,0,0,3,0,0,0,0,0,0,6,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,4,0,0,0,0,0,0,8,0,0,0,0],[0,0,0,0,4,4,0,0,0,0,8,8,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0],[0,0,0,0,0,0,0,6,0,0,0,0,4,0,0,0],[0,0,0,0,0,0,6,6,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0],[3,0,0,0,0,0,0,0,0,0,6,6,0,0,6,0],[3,3,0,0,0,0,0,0,0,0,0,0,0,0,6,6],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0],[4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,4,0,0,0,4,4,0,0,4,4,0,0,0,0,0],[0,0,0,0,0,0,4,0,0,0,4,0,0,0,0,0]]}]}","""""""Generator for t29: color-directed diagonal motion of V/L-shaped objects. Rule: - Each connected monochrome object moves rigidly in a direction determined only by its color: 6 (magenta): up-right (-1, +1) 3 (green): up-left (-1, -1) 4 (yellow): down-left (+1, -1) 8 (cyan): down-right (+1, +1) - Each object moves as far as possible until moving farther would place some cell outside the grid. Equivalently, it is translated by the maximal nonnegative k such that all translated cells remain inside the grid. - The objects are not rotated or deformed. Generation goals: - objects are usually 3-cell V/L-shapes in a 2x2 box, reflecting the demos; - every generated example contains at least one object of each movement color (magenta, green, yellow, cyan), so all four directions are demonstrated; - most objects are oriented to ""point"" in their movement direction, but every generated example contains at least one object whose orientation does *not* match its movement direction, encouraging the color-based rule; - outputs are generated so translated objects do not overlap. """""" from __future__ import annotations import json import random from collections import deque from typing import Dict, Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] COLOR_TO_DIR: Dict[int, Cell] = { 6: (-1, 1), 3: (-1, -1), 4: (1, -1), 8: (1, 1), } ALLOWED_COLORS = [3, 4, 6, 8] # 2x2 box with one corner missing. We interpret the missing corner as the direction # the V/L-shape ""points"" toward. POINTING_SHAPES: Dict[Cell, Set[Cell]] = { (-1, -1): {(0, 1), (1, 0), (1, 1)}, # missing top-left (-1, 1): {(0, 0), (1, 0), (1, 1)}, # missing top-right (1, -1): {(0, 0), (0, 1), (1, 1)}, # missing bottom-left (1, 1): {(0, 0), (0, 1), (1, 0)}, # missing bottom-right } def _empty(h: int, w: int, fill: int = 0) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _components(grid: Grid) -> list[tuple[int, Set[Cell]]]: h, w = len(grid), len(grid[0]) seen: Set[Cell] = set() out: list[tuple[int, Set[Cell]]] = [] for r in range(h): for c in range(w): col = grid[r][c] if col == 0 or (r, c) in seen: continue q = deque([(r, c)]) seen.add((r, c)) cells: Set[Cell] = set() while q: x, y = q.popleft() cells.add((x, y)) for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)): nx, ny = x + dx, y + dy if 0 <= nx < h and 0 <= ny < w and (nx, ny) not in seen and grid[nx][ny] == col: seen.add((nx, ny)) q.append((nx, ny)) out.append((col, cells)) return out def _max_translation(cells: Set[Cell], direction: Cell, h: int, w: int) -> int: dr, dc = direction if dr == -1: lim_r = min(r for r, _ in cells) else: lim_r = min(h - 1 - r for r, _ in cells) if dc == -1: lim_c = min(c for _, c in cells) else: lim_c = min(w - 1 - c for _, c in cells) return min(lim_r, lim_c) def _translate(cells: Iterable[Cell], direction: Cell, k: int) -> Set[Cell]: dr, dc = direction return {(r + k * dr, c + k * dc) for r, c in cells} def transform_t29(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError('Input grid must be non-empty and rectangular') h, w = len(grid), len(grid[0]) out = _empty(h, w) comps = _components(grid) translated: list[tuple[int, Set[Cell]]] = [] for color, cells in comps: if color not in COLOR_TO_DIR: raise ValueError(f'Unexpected color {color}; allowed colors are {sorted(COLOR_TO_DIR)}') k = _max_translation(cells, COLOR_TO_DIR[color], h, w) translated.append((color, _translate(cells, COLOR_TO_DIR[color], k))) # The intended task distribution forbids all translated collisions. occ: Dict[Cell, int] = {} for color, cells in translated: for cell in cells: if cell in occ: raise ValueError('Translated objects overlap; malformed example') occ[cell] = color for (r, c), color in occ.items(): out[r][c] = color return out # --------------------------------------------------------------------------- # Generation helpers # --------------------------------------------------------------------------- def _bbox(cells: Iterable[Cell]) -> tuple[int, int, int, int]: rs = [r for r, _ in cells] cs = [c for _, c in cells] return min(rs), max(rs), min(cs), max(cs) def _can_place(cells: Set[Cell], occupied: Set[Cell], h: int, w: int, margin: int = 1) -> bool: for r, c in cells: if not (margin <= r < h - margin and margin <= c < w - margin): return False for rr in range(r - 1, r + 2): for cc in range(c - 1, c + 2): if (rr, cc) in occupied: return False return True def generate(rng: random.Random | None = None) -> Dict[str, Grid]: rng = rng or random.Random() for _ in range(5000): h = rng.randint(10, 18) w = rng.randint(10, 18) grid = _empty(h, w) input_occ: Set[Cell] = set() output_occ: Set[Cell] = set() objects: list[tuple[int, Set[Cell], bool]] = [] # color, input cells, is_violation # Ensure every direction/color appears at least once in every example. n_objects = rng.randint(4, 8) colors = ALLOWED_COLORS[:] + [rng.choice(ALLOWED_COLORS) for _ in range(n_objects - len(ALLOWED_COLORS))] rng.shuffle(colors) violate_idx = rng.randrange(n_objects) success = True for i, color in enumerate(colors): move_dir = COLOR_TO_DIR[color] if i == violate_idx: pointing_choices = [d for d in POINTING_SHAPES if d != move_dir] pointing = rng.choice(pointing_choices) is_violation = True else: # Usually point in motion direction, but not always. if rng.random() < 0.8: pointing = move_dir is_violation = False else: pointing_choices = [d for d in POINTING_SHAPES if d != move_dir] pointing = rng.choice(pointing_choices) is_violation = True shape = set(POINTING_SHAPES[pointing]) # Pick a top-left placement such that both input and translated output fit, # and translated outputs do not overlap. max_r = max(r for r, _ in shape) max_c = max(c for _, c in shape) positions = [(r0, c0) for r0 in range(1, h - 1 - max_r) for c0 in range(1, w - 1 - max_c)] rng.shuffle(positions) placed = False for r0, c0 in positions: cells = {(r0 + r, c0 + c) for r, c in shape} if not _can_place(cells, input_occ, h, w, margin=1): continue k = _max_translation(cells, move_dir, h, w) if k <= 0: continue moved = _translate(cells, move_dir, k) # Keep output objects separated and away from touching each other. clash = False for r, c in moved: if not (0 <= r < h and 0 <= c < w): clash = True break for rr in range(r - 1, r + 2): for cc in range(c - 1, c + 2): if (rr, cc) in output_occ: clash = True break if clash: break if clash: break if clash: continue # Also avoid an object's output directly overlapping any existing input # object only for cleanliness of the generated examples. if moved & input_occ: continue for rr, cc in cells: grid[rr][cc] = color input_occ |= cells output_occ |= moved objects.append((color, cells, is_violation)) placed = True break if not placed: success = False break if not success or not objects or not any(v for _, _, v in objects): continue try: out = transform_t29(grid) except Exception: continue if out == grid: continue return {'input': grid, 'output': out} raise RuntimeError('Failed to generate valid t29 example') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for t29: color-directed diagonal motion of objects."""""" from __future__ import annotations from typing import List from generator import transform_t29 Grid = List[List[int]] def verify_t29(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('Input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('Input grid must be rectangular') return transform_t29(inp) " "t30","[{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,4,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,4,0,0],[0,4,0,4,0],[0,0,4,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,4,0,4,0],[4,0,0,0,4],[0,0,0,0,0],[4,0,0,0,4],[0,4,0,4,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,4,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,4,0,0],[0,4,0,4,0],[0,0,4,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,4,0,0],[0,4,0,4,0],[4,0,0,0,4],[0,4,0,4,0],[0,0,4,0,0],[6,6,6,6,6],[0,4,0,4,0],[4,0,0,0,4],[0,0,0,0,0],[4,0,0,0,4],[0,4,0,4,0]]},{""input"":[[0,0,7,0],[0,0,0,0],[0,0,0,0],[0,7,0,0],[6,6,6,6],[0,7,0,0],[0,0,0,0],[0,0,0,0],[0,0,7,0],[6,6,6,6],[7,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,7],[6,6,6,6],[0,0,0,0],[7,0,0,0],[0,0,0,7],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],""output"":[[0,0,7,0],[0,0,0,0],[0,0,0,0],[0,7,0,0],[6,6,6,6],[0,7,0,0],[0,0,0,0],[0,0,0,0],[0,0,7,0],[6,6,6,6],[7,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,7],[6,6,6,6],[0,0,0,0],[7,0,0,0],[0,0,0,7],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,7],[7,0,0,0],[0,0,0,0]]},{""input"":[[0,0,0,0,0],[3,0,0,0,0],[3,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[3,3,3,0,0],[3,0,3,0,0],[3,0,0,0,0],[6,6,6,6,6],[3,3,3,0,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],[0,0,0,0,0],[0,0,5,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,5,0,0],[0,5,0,5,0],[0,0,5,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,5,0,0],[0,5,0,5,0],[5,0,0,0,5],[0,5,0,5,0],[0,0,5,0,0],[6,6,6,6,6],[0,5,0,5,0],[5,0,0,0,5],[0,0,0,0,0],[5,0,0,0,5],[0,5,0,5,0]]},{""input"":[[8,9,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,8,9],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,8],[0,0,0,9],[0,0,0,0],[0,0,0,0],[0,0,0,0]],""output"":[[8,9,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,8,9,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,8,9],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,8],[0,0,0,9],[0,0,0,0],[0,0,0,0],[0,0,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,8,0,0],[0,8,0,8,0],[8,0,0,0,8],[0,8,0,8,0],[0,0,8,0,0],[6,6,6,6,6],[0,8,0,8,0],[8,0,0,0,8],[0,0,0,0,0],[8,0,0,0,8],[0,8,0,8,0],[6,6,6,6,6],[8,0,0,0,8],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,8]],""output"":[[0,0,0,0,0],[0,0,8,0,0],[0,8,0,8,0],[0,0,8,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,8,0,0],[0,8,0,8,0],[8,0,0,0,8],[0,8,0,8,0],[0,0,8,0,0],[6,6,6,6,6],[0,8,0,8,0],[8,0,0,0,8],[0,0,0,0,0],[8,0,0,0,8],[0,8,0,8,0],[6,6,6,6,6],[8,0,0,0,8],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,8]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,2,0,0],[0,2,0,2,0],[0,0,2,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,2,0,0],[0,2,0,2,0],[2,0,0,0,2],[0,2,0,2,0],[0,0,2,0,0],[6,6,6,6,6],[0,2,0,2,0],[2,0,0,0,2],[0,0,0,0,0],[2,0,0,0,2],[0,2,0,2,0],[6,6,6,6,6],[2,0,0,0,2],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,0,0,0,2]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,2,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,2,0,0],[0,2,0,2,0],[0,0,2,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,2,0,0],[0,2,0,2,0],[2,0,0,0,2],[0,2,0,2,0],[0,0,2,0,0],[6,6,6,6,6],[0,2,0,2,0],[2,0,0,0,2],[0,0,0,0,0],[2,0,0,0,2],[0,2,0,2,0],[6,6,6,6,6],[2,0,0,0,2],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,0,0,0,2]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,3,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,3,0,0],[0,3,0,3,0],[3,0,0,0,3],[0,3,0,3,0],[0,0,3,0,0],[6,6,6,6,6],[0,3,0,3,0],[3,0,0,0,3],[0,0,0,0,0],[3,0,0,0,3],[0,3,0,3,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,3,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,3,0,0],[0,3,0,3,0],[0,0,3,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,3,0,0],[0,3,0,3,0],[3,0,0,0,3],[0,3,0,3,0],[0,0,3,0,0],[6,6,6,6,6],[0,3,0,3,0],[3,0,0,0,3],[0,0,0,0,0],[3,0,0,0,3],[0,3,0,3,0]]},{""input"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[1,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[1,1,0,0,0,0],[1,0,0,0,0,0],[1,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,1,1,1,1,0],[1,1,0,0,1,1],[1,0,0,0,0,0],[1,0,0,0,0,0]],""output"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[1,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[1,1,0,0,0,0],[1,0,0,0,0,0],[1,0,0,0,0,0],[6,6,6,6,6,6],[0,1,1,1,0,0],[1,1,0,0,0,0],[1,0,0,0,0,0],[1,0,0,0,0,0],[6,6,6,6,6,6],[0,1,1,1,1,0],[1,1,0,0,1,1],[1,0,0,0,0,0],[1,0,0,0,0,0]]},{""input"":[[0,0,0,0,3],[0,0,0,0,3],[0,0,0,0,3],[0,0,0,0,3],[0,0,0,0,3],[0,0,0,0,3],[6,6,6,6,6],[0,0,0,3,0],[0,0,0,3,0],[0,0,0,3,0],[0,0,0,3,0],[0,0,0,3,0],[0,0,0,3,0],[6,6,6,6,6],[0,0,3,0,0],[0,0,3,0,0],[0,0,3,0,0],[0,0,3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,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,2,2,2,2],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,2,2,2,2]],""output"":[[2,2,2,2,2],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[2,2,2,2,2],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[2,2,2,2,2],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,2,2,2,2],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,2,2,2,2]]},{""input"":[[0,0,0,0,0,0],[0,0,0,0,0,5],[0,0,0,0,0,0],[0,0,0,9,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,5],[0,0,9,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,9,0,0,0,5],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0],[0,0,0,0,0,5],[0,0,0,0,0,0],[0,0,0,9,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,5],[0,0,9,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,9,0,0,0,5],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[9,0,0,0,5,0]]},{""input"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,3],[0,0,0,0,3,0],[0,0,0,3,0,0],[0,0,3,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,3],[0,0,0,0,3,0],[0,0,0,3,0,0],[0,0,3,0,0,0],[0,3,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,3],[0,0,0,0,3,0],[0,0,0,3,0,0],[0,0,3,0,0,0],[0,3,0,0,0,0],[3,0,0,0,0,0]],""output"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,3],[0,0,0,0,3,0],[0,0,0,3,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,3],[0,0,0,0,3,0],[0,0,0,3,0,0],[0,0,3,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,3],[0,0,0,0,3,0],[0,0,0,3,0,0],[0,0,3,0,0,0],[0,3,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,3],[0,0,0,0,3,0],[0,0,0,3,0,0],[0,0,3,0,0,0],[0,3,0,0,0,0],[3,0,0,0,0,0]]},{""input"":[[0,0,2,0],[0,0,0,2],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,2,0,0],[0,0,2,0],[0,0,0,2],[0,0,0,0],[6,6,6,6],[2,0,0,0],[0,2,0,0],[0,0,2,0],[0,0,0,2],[6,6,6,6],[0,0,0,0],[2,0,0,0],[0,2,0,0],[0,0,2,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],""output"":[[0,0,2,0],[0,0,0,2],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,2,0,0],[0,0,2,0],[0,0,0,2],[0,0,0,0],[6,6,6,6],[2,0,0,0],[0,2,0,0],[0,0,2,0],[0,0,0,2],[6,6,6,6],[0,0,0,0],[2,0,0,0],[0,2,0,0],[0,0,2,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[2,0,0,0],[0,2,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,5,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,5,0,0],[0,5,0,5,0],[5,0,0,0,5],[0,5,0,5,0],[0,0,5,0,0],[6,6,6,6,6],[0,5,0,5,0],[5,0,0,0,5],[0,0,0,0,0],[5,0,0,0,5],[0,5,0,5,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,5,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,5,0,0],[0,5,0,5,0],[0,0,5,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,5,0,0],[0,5,0,5,0],[5,0,0,0,5],[0,5,0,5,0],[0,0,5,0,0],[6,6,6,6,6],[0,5,0,5,0],[5,0,0,0,5],[0,0,0,0,0],[5,0,0,0,5],[0,5,0,5,0]]},{""input"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[8,0,0,0],[8,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[8,0,0,0],[8,8,8,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,8],[0,0,0,8],[8,0,0,8],[8,8,8,8]],""output"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[8,0,0,0],[8,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[8,0,0,0],[8,8,8,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[8,0,0,8],[8,8,8,8],[6,6,6,6],[0,0,0,0],[0,0,0,8],[0,0,0,8],[8,0,0,8],[8,8,8,8]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,7,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,7,0,0],[0,7,0,7,0],[7,0,0,0,7],[0,7,0,7,0],[0,0,7,0,0],[6,6,6,6,6],[0,7,0,7,0],[7,0,0,0,7],[0,0,0,0,0],[7,0,0,0,7],[0,7,0,7,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,7,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,7,0,0],[0,7,0,7,0],[0,0,7,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,7,0,0],[0,7,0,7,0],[7,0,0,0,7],[0,7,0,7,0],[0,0,7,0,0],[6,6,6,6,6],[0,7,0,7,0],[7,0,0,0,7],[0,0,0,0,0],[7,0,0,0,7],[0,7,0,7,0]]},{""input"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1],[0,0,0,1],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,1,1],[0,0,0,1],[0,0,0,1],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,1,1,1],[0,1,0,1],[1,1,0,1]],""output"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1],[0,0,0,1],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,1,1],[0,0,0,1],[0,0,0,1],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,1,1,1],[0,1,0,1],[0,0,0,1],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,1,1,1],[0,1,0,1],[1,1,0,1]]},{""input"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,3,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,3,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,3]],""output"":[[3,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,3,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,3,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,3]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,4],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,4,0],[0,0,4,4,0],[0,0,4,0,0],[0,0,4,4,4],[6,6,6,6,6],[0,0,0,0,4],[0,0,0,4,4],[0,0,0,4,0],[0,0,4,4,0],[0,0,4,0,0],[0,0,4,4,4]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,4],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,4,0,0],[0,0,4,4,4],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,4,0],[0,0,4,4,0],[0,0,4,0,0],[0,0,4,4,4],[6,6,6,6,6],[0,0,0,0,4],[0,0,0,4,4],[0,0,0,4,0],[0,0,4,4,0],[0,0,4,0,0],[0,0,4,4,4]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,2,0,0,0],[0,2,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,2,0,0],[0,2,2,0,0],[0,2,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,2,2,0],[0,2,2,0,0],[0,2,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,2,0,0,0],[0,2,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,2,2,0,0],[0,2,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,2,0,0],[0,2,2,0,0],[0,2,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,2,2,0],[0,2,2,0,0],[0,2,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]},{""input"":[[0,0,0,0,3,3],[0,0,0,0,3,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,3,3,0],[0,0,0,3,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,3,3,0,0,0],[0,3,0,0,0,0],[0,0,0,0,0,0]],""output"":[[0,0,0,0,3,3],[0,0,0,0,3,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,3,3,0],[0,0,0,3,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,3,3,0,0],[0,0,3,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,3,3,0,0,0],[0,3,0,0,0,0],[0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,7],[0,0,0,7,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,7],[0,0,0,7,0],[0,0,7,0,0],[0,7,0,0,0],[6,6,6,6,6],[0,0,0,7,0],[0,0,7,0,0],[0,7,0,0,0],[7,0,0,0,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,7],[0,0,0,7,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,7],[0,0,0,7,0],[0,0,7,0,0],[6,6,6,6,6],[0,0,0,0,7],[0,0,0,7,0],[0,0,7,0,0],[0,7,0,0,0],[6,6,6,6,6],[0,0,0,7,0],[0,0,7,0,0],[0,7,0,0,0],[7,0,0,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,1,0,0],[0,1,0,1,0],[0,0,1,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],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,0],[0,0,0,0,0],[3,3,3,3,3]]},{""input"":[[3,0,0,0,0,0],[0,3,0,0,0,0],[0,0,3,0,0,0],[0,0,0,3,0,0],[0,0,0,0,3,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[3,0,0,0,0,0],[0,3,0,0,0,0],[0,0,3,0,0,0],[0,0,0,3,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[3,0,0,0,0,0],[0,3,0,0,0,0]],""output"":[[3,0,0,0,0,0],[0,3,0,0,0,0],[0,0,3,0,0,0],[0,0,0,3,0,0],[0,0,0,0,3,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[3,0,0,0,0,0],[0,3,0,0,0,0],[0,0,3,0,0,0],[0,0,0,3,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[3,0,0,0,0,0],[0,3,0,0,0,0],[0,0,3,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[3,0,0,0,0,0],[0,3,0,0,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,0],[8,0,0,0,0],[8,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[8,8,8,8,0],[8,0,0,8,0],[8,0,0,0,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,0],[8,0,0,0,0],[8,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[8,8,8,0,0],[8,0,0,0,0],[8,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[8,8,8,8,0],[8,0,0,8,0],[8,0,0,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0],[6,6,6,6,6],[0,1,0,1,0],[1,0,0,0,1],[0,0,0,0,0],[1,0,0,0,1],[0,1,0,1,0],[6,6,6,6,6],[1,0,0,0,1],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[1,0,0,0,1]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,1,0,0],[0,1,0,1,0],[0,0,1,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0],[6,6,6,6,6],[0,1,0,1,0],[1,0,0,0,1],[0,0,0,0,0],[1,0,0,0,1],[0,1,0,1,0],[6,6,6,6,6],[1,0,0,0,1],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[1,0,0,0,1]]},{""input"":[[2,2,2,2,2,2],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[2,2,2,2,2,2],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[2,2,2,2,2,2],[0,0,0,0,0,0],[0,0,0,0,0,0]],""output"":[[2,2,2,2,2,2],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[2,2,2,2,2,2],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[2,2,2,2,2,2],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[2,2,2,2,2,2],[0,0,0,0,0,0],[0,0,0,0,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,8,0,0],[0,8,0,8,0],[0,0,8,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,8,0,0],[0,8,0,8,0],[8,0,0,0,8],[0,8,0,8,0],[0,0,8,0,0],[6,6,6,6,6],[0,8,0,8,0],[8,0,0,0,8],[0,0,0,0,0],[8,0,0,0,8],[0,8,0,8,0],[6,6,6,6,6],[8,0,0,0,8],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,8]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,8,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,8,0,0],[0,8,0,8,0],[0,0,8,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,8,0,0],[0,8,0,8,0],[8,0,0,0,8],[0,8,0,8,0],[0,0,8,0,0],[6,6,6,6,6],[0,8,0,8,0],[8,0,0,0,8],[0,0,0,0,0],[8,0,0,0,8],[0,8,0,8,0],[6,6,6,6,6],[8,0,0,0,8],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[8,0,0,0,8]]},{""input"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,4],[0,0,0,0],[0,0,0,1],[5,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,4],[5,0,0,0],[0,0,0,1],[0,0,0,0],[6,6,6,6],[0,0,0,0],[5,0,0,0],[0,0,0,4],[0,0,0,0],[0,0,0,1],[6,6,6,6],[5,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,4],[0,0,1,0]],""output"":[[0,0,4,0],[0,0,0,1],[0,0,0,0],[0,0,0,0],[5,0,0,0],[6,6,6,6],[0,0,0,4],[0,0,0,0],[0,0,0,1],[5,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,4],[5,0,0,0],[0,0,0,1],[0,0,0,0],[6,6,6,6],[0,0,0,0],[5,0,0,0],[0,0,0,4],[0,0,0,0],[0,0,0,1],[6,6,6,6],[5,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,4],[0,0,1,0]]},{""input"":[[0,8,5,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,8,5],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,8],[0,0,0,5],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,8],[0,0,0,5],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,5,8]],""output"":[[0,8,5,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,8,5],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,8],[0,0,0,5],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[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[2,0,0,0,2],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,0,0,0,2]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,2,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,2,0,0],[0,2,0,2,0],[0,0,2,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,2,0,0],[0,2,0,2,0],[2,0,0,0,2],[0,2,0,2,0],[0,0,2,0,0],[6,6,6,6,6],[0,2,0,2,0],[2,0,0,0,2],[0,0,0,0,0],[2,0,0,0,2],[0,2,0,2,0],[6,6,6,6,6],[2,0,0,0,2],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,0,0,0,2]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,9,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,9,0,0],[0,9,0,9,0],[9,0,0,0,9],[0,9,0,9,0],[0,0,9,0,0],[6,6,6,6,6],[0,9,0,9,0],[9,0,0,0,9],[0,0,0,0,0],[9,0,0,0,9],[0,9,0,9,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,9,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,9,0,0],[0,9,0,9,0],[0,0,9,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,9,0,0],[0,9,0,9,0],[9,0,0,0,9],[0,9,0,9,0],[0,0,9,0,0],[6,6,6,6,6],[0,9,0,9,0],[9,0,0,0,9],[0,0,0,0,0],[9,0,0,0,9],[0,9,0,9,0]]},{""input"":[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[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0,0,0,2,0,0],[0,2,0,0,0,0,0,2,0],[0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,2,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[6,6,6,6,6,6,6,6,6],[0,0,0,0,2,0,0,0,0],[0,0,0,2,0,2,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[6,6,6,6,6,6,6,6,6],[0,0,0,0,2,0,0,0,0],[0,0,0,2,0,2,0,0,0],[0,0,2,0,0,0,2,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[6,6,6,6,6,6,6,6,6],[0,0,0,0,2,0,0,0,0],[0,0,0,2,0,2,0,0,0],[0,0,2,0,0,0,2,0,0],[0,2,0,0,0,0,0,2,0],[0,0,0,0,0,0,0,0,0]]},{""input"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[7,2,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[7,0,0,0],[2,0,0,0],[0,0,0,0],[6,6,6,6],[7,0,0,0],[2,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,2,7,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],""output"":[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[7,2,0,0],[6,6,6,6],[0,0,0,0],[0,0,0,0],[7,0,0,0],[2,0,0,0],[0,0,0,0],[6,6,6,6],[7,0,0,0],[2,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,2,7,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[6,6,6,6],[0,0,0,2],[0,0,0,7],[0,0,0,0],[0,0,0,0],[0,0,0,0]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,9,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,9,0,0],[0,9,0,9,0],[9,0,0,0,9],[0,9,0,9,0],[0,0,9,0,0],[6,6,6,6,6],[0,9,0,9,0],[9,0,0,0,9],[0,0,0,0,0],[9,0,0,0,9],[0,9,0,9,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,9,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,9,0,0],[0,9,0,9,0],[0,0,9,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,9,0,0],[0,9,0,9,0],[9,0,0,0,9],[0,9,0,9,0],[0,0,9,0,0],[6,6,6,6,6],[0,9,0,9,0],[9,0,0,0,9],[0,0,0,0,0],[9,0,0,0,9],[0,9,0,9,0],[6,6,6,6,6],[9,0,0,0,9],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[9,0,0,0,9]]},{""input"":[[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,1,0,0],[0,0,0,0,0,0],[0,0,0,0,0,8],[0,0,0,0,0,0],[6,6,6,6,6,6],[0,0,0,0,1,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,8],[6,6,6,6,6,6],[0,0,0,0,0,1],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,8,0],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,1],[0,0,0,0,0,0],[0,0,0,8,0,0]],""output"":[[0,0,1,0,0,0],[0,0,0,0,0,8],[0,0,0,0,0,0],[0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,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,2,0,0],[0,2,0,2,0],[2,0,0,0,2],[0,2,0,2,0],[0,0,2,0,0],[6,6,6,6,6],[0,2,0,2,0],[2,0,0,0,2],[0,0,0,0,0],[2,0,0,0,2],[0,2,0,2,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],""output"":[[0,0,0,0,0],[0,0,2,0,0],[0,2,0,2,0],[0,0,2,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,2,0,0],[0,2,0,2,0],[2,0,0,0,2],[0,2,0,2,0],[0,0,2,0,0],[6,6,6,6,6],[0,2,0,2,0],[2,0,0,0,2],[0,0,0,0,0],[2,0,0,0,2],[0,2,0,2,0],[6,6,6,6,6],[2,0,0,0,2],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[2,0,0,0,2]]},{""input"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,7,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,7,0,0],[0,7,0,7,0],[0,0,7,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,7,0,7,0],[7,0,0,0,7],[0,0,0,0,0],[7,0,0,0,7],[0,7,0,7,0],[6,6,6,6,6],[7,0,0,0,7],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[7,0,0,0,7]],""output"":[[0,0,0,0,0],[0,0,0,0,0],[0,0,7,0,0],[0,0,0,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,0,0,0],[0,0,7,0,0],[0,7,0,7,0],[0,0,7,0,0],[0,0,0,0,0],[6,6,6,6,6],[0,0,7,0,0],[0,7,0,7,0],[7,0,0,0,7],[0,7,0,7,0],[0,0,7,0,0],[6,6,6,6,6],[0,7,0,7,0],[7,0,0,0,7],[0,0,0,0,0],[7,0,0,0,7],[0,7,0,7,0],[6,6,6,6,6],[7,0,0,0,7],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[7,0,0,0,7]]}]}","""""""Generator for t30_missing_progression_frames. Creates vertical frame sequences with blank missing frames. The output fills those frames by continuing a simple visual progression. """""" from __future__ import annotations import random from typing import Dict, Iterable, List, Sequence, Set, Tuple from verifier import ( SEP, _anti_diag_cells, _border_path, _col_cells, _diag_cells, _frame_from_cells, _frame_from_colored, _join_frames, _row_cells, _square_filled_cells, _square_outline_cells, verify_t30, ) Grid = List[List[int]] Cell = Tuple[int, int] MAX_DIM = 30 def _max_frames_for_height(frame_h: int) -> int: # total stacked height is n * frame_h + (n - 1) separators return max(1, (MAX_DIM + 1) // (frame_h + 1)) def _dims_ok_grid(grid: Grid) -> bool: h = len(grid) w = len(grid[0]) if h else 0 return h <= MAX_DIM and w <= MAX_DIM FAMILY_NAMES = [ ""diamond_rings"", ""v_growth"", ""border_motion"", ""path_prefix"", ""translation"", ""line_sweep"", ] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _hide_some( rr: random.Random, frames: Sequence[Grid], min_visible: int = 2, exact_k: int | None = None, keep: Set[int] | None = None, ) -> list[Grid]: n = len(frames) keep = set() if keep is None else set(keep) candidates = [i for i in range(n) if i not in keep] rr.shuffle(candidates) max_hide = max(1, n - min_visible) if exact_k is None: k = rr.randint(1, min(3, max_hide)) else: k = min(exact_k, max_hide) hide = set(candidates[:k]) h, w = len(frames[0]), len(frames[0][0]) return [_empty(h, w) if i in hide else [row[:] for row in f] for i, f in enumerate(frames)] def _cells_to_frame(h: int, w: int, cells: Iterable[Cell], color: int) -> Grid: return _frame_from_cells(h, w, cells, color) def _all_nonempty(frames: Sequence[Grid]) -> bool: return all(any(v != 0 for row in f for v in row) for f in frames) def _input_frame_constraints_ok(inp_frames: Sequence[Grid]) -> bool: return len(inp_frames) >= 4 and sum(any(v != 0 for row in f for v in row) for f in inp_frames) >= 3 # ------------------------------ progression families ------------------------------ def _diamond_ring_cells(h: int, w: int, cr: int, cc: int, radius: int) -> Set[Cell]: return {(r, c) for r in range(h) for c in range(w) if abs(r - cr) + abs(c - cc) == radius} def _make_diamond_rings(rr: random.Random) -> tuple[list[Grid], list[Grid]]: size = 5 max_n = min(5, size, _max_frames_for_height(size)) n = rr.randint(4, max_n) color = rr.choice([c for c in range(1, 10) if c != SEP]) cr = cc = size // 2 start = rr.randint(0, 1) frames = [_cells_to_frame(size, size, _diamond_ring_cells(size, size, cr, cc, start + i), color) for i in range(n)] inp = _hide_some(rr, frames, min_visible=3) return inp, frames def _v_cells(h: int, w: int, cc: int, level: int) -> Set[Cell]: cells: Set[Cell] = set() for r in range(0, min(h, level + 1)): for c in (cc - r, cc + r): if 0 <= c < w: cells.add((r, c)) return cells def _make_v_growth(rr: random.Random) -> tuple[list[Grid], list[Grid]]: h = rr.choice([4, 5, 6]) w = 2 * h - 1 max_n = min(h, _max_frames_for_height(h)) n = rr.randint(4, max_n) color = rr.choice([c for c in range(1, 10) if c != SEP]) cc = w // 2 frames = [_cells_to_frame(h, w, _v_cells(h, w, cc, i), color) for i in range(n)] inp = _hide_some(rr, frames, min_visible=3) return inp, frames def _make_border_motion(rr: random.Random) -> tuple[list[Grid], list[Grid]]: """"""Multicolor border motion with exactly one missing frame."""""" h = rr.randint(4, 6) w = rr.randint(4, 7) max_n = min(6, _max_frames_for_height(h)) n = rr.randint(4, max_n) path = _border_path(h, w) L = len(path) count = rr.randint(2, min(4, len(path) // 4)) step = rr.choice([s for s in (1, 2) if s < L]) base = rr.sample(range(L), count) colors = rr.sample([c for c in range(1, 10) if c != SEP], count) frames: list[Grid] = [] for i in range(n): cells: Dict[Cell, int] = {} for color, p in zip(colors, base): cells[path[(p + step * i) % L]] = color frames.append(_frame_from_colored(h, w, cells)) inp = _hide_some(rr, frames, min_visible=n - 1, exact_k=1) return inp, frames def _random_path(rr: random.Random, h: int, w: int, length: int) -> list[Cell] | None: for _ in range(300): start = (rr.randrange(h), rr.randrange(w)) path = [start] used = {start} while len(path) < length: r, c = path[-1] nbrs = [(r + 1, c), (r - 1, c), (r, c + 1), (r, c - 1)] rr.shuffle(nbrs) found = False for q in nbrs: qr, qc = q if not (0 <= qr < h and 0 <= qc < w) or q in used: continue near_old = 0 for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): if (qr + dr, qc + dc) in used: near_old += 1 if near_old != 1: continue path.append(q) used.add(q) found = True break if not found: break if len(path) == length: return path return None def _make_path_prefix(rr: random.Random) -> tuple[list[Grid], list[Grid]]: h = rr.randint(4, 6) w = rr.randint(4, 6) max_n = min(5, _max_frames_for_height(h)) n = rr.randint(4, max_n) step = rr.randint(1, 3) start_len = rr.randint(1, 2) total = min(h * w - 2, start_len + step * (n - 1)) path = _random_path(rr, h, w, total) if path is None: return _make_v_growth(rr) color = rr.choice([c for c in range(1, 10) if c != SEP]) frames: list[Grid] = [] for i in range(n): m = min(total, start_len + step * i) frames.append(_cells_to_frame(h, w, path[:m], color)) inp = _hide_some(rr, frames, min_visible=n - 1, exact_k=1, keep={0, n - 1}) return inp, frames def _make_translation(rr: random.Random) -> tuple[list[Grid], list[Grid]]: h = rr.randint(4, 6) w = rr.randint(4, 6) max_n = min(5, _max_frames_for_height(h)) n = rr.randint(4, max_n) dr, dc = rr.choice([(1, 0), (-1, 0), (0, 1), (0, -1), (1, 1), (1, -1), (-1, 1), (-1, -1)]) shape_opts = [ {(0, 0)}, {(0, 0), (0, 1)}, {(0, 0), (1, 0)}, {(0, 0), (1, 0), (1, 1)}, {(0, 1), (1, 0), (1, 1)}, {(0, 0), (0, 1), (1, 0)}, {(0, 0), (1, 0), (2, 0), (2, 1)}, ] shape = rr.choice(shape_opts) max_r = max(r for r, _ in shape) max_c = max(c for _, c in shape) rmin = max(0, -(n - 1) * dr) rmax = min(h - 1 - max_r, h - 1 - max_r - max(0, (n - 1) * dr)) cmin = max(0, -(n - 1) * dc) cmax = min(w - 1 - max_c, w - 1 - max_c - max(0, (n - 1) * dc)) if rmin > rmax or cmin > cmax: return _make_diamond_rings(rr) r0 = rr.randint(rmin, rmax) c0 = rr.randint(cmin, cmax) color = rr.choice([c for c in range(1, 10) if c != SEP]) frames = [] for i in range(n): cells = {(r0 + dr * i + r, c0 + dc * i + c) for r, c in shape} frames.append(_cells_to_frame(h, w, cells, color)) inp = _hide_some(rr, frames, min_visible=3) return inp, frames def _make_line_sweep(rr: random.Random) -> tuple[list[Grid], list[Grid]]: h = rr.randint(4, 6) w = rr.randint(4, 6) families = [] if h >= 4: families.append((list(range(h)), lambda p: _row_cells(h, w, p))) if w >= 4: families.append((list(range(w)), lambda p: _col_cells(h, w, p))) families.append((list(range(-(h - 1), w)), lambda p: _diag_cells(h, w, p))) families.append((list(range(h + w - 1)), lambda p: _anti_diag_cells(h, w, p))) params, fn = rr.choice(families) if len(params) < 4: return _make_translation(rr) step = rr.choice([1, -1]) max_n = min(5, len(params), _max_frames_for_height(h)) n = rr.randint(4, max_n) if step == 1: start = rr.randint(params[0], params[-1] - (n - 1)) else: start = rr.randint(params[0] + (n - 1), params[-1]) color = rr.choice([c for c in range(1, 10) if c != SEP]) frames = [_cells_to_frame(h, w, fn(start + step * i), color) for i in range(n)] inp = _hide_some(rr, frames, min_visible=3) return inp, frames def _make_square_growth(rr: random.Random, filled: bool) -> tuple[list[Grid], list[Grid]]: # Keep the largest square strictly inside the frame so the progression never # saturates into repeated full-frame images. size = rr.choice([7, 9]) max_rad = size // 2 - 1 valid_starts = [start for start in (0, 1) if max_rad - start + 1 >= 3] start = rr.choice(valid_starts) max_n = min(6, max_rad - start + 1, _max_frames_for_height(size)) n = rr.randint(3, max_n) color = rr.choice([c for c in range(1, 10) if c != SEP]) cr = cc = size // 2 fn = _square_filled_cells if filled else _square_outline_cells frames = [_cells_to_frame(size, size, fn(size, size, cr, cc, start + i), color) for i in range(n)] inp = _hide_some(rr, frames, min_visible=2) return inp, frames def _make_square_outline_growth(rr: random.Random) -> tuple[list[Grid], list[Grid]]: return _make_square_growth(rr, filled=False) def _make_square_filled_growth(rr: random.Random) -> tuple[list[Grid], list[Grid]]: return _make_square_growth(rr, filled=True) FAMILY_MAKERS = { ""diamond_rings"": _make_diamond_rings, ""v_growth"": _make_v_growth, ""border_motion"": _make_border_motion, ""path_prefix"": _make_path_prefix, ""translation"": _make_translation, ""line_sweep"": _make_line_sweep, ""square_outline_growth"": _make_square_outline_growth, ""square_filled_growth"": _make_square_filled_growth, } def generate(rng: random.Random | None = None, family: str | None = None) -> dict[str, Grid]: rr = rng if rng is not None else random names = [family] if family is not None else FAMILY_NAMES[:] if family is None: rr.shuffle(names) for _ in range(120): for name in names: maker = FAMILY_MAKERS[name] inp_frames, out_frames = maker(rr) if not _all_nonempty(out_frames): continue if not _input_frame_constraints_ok(inp_frames): continue w = len(out_frames[0][0]) inp = _join_frames(inp_frames, w) out = _join_frames(out_frames, w) if not (_dims_ok_grid(inp) and _dims_ok_grid(out)): continue if verify_t30(inp) == out: return {""input"": inp, ""output"": out} if family is None: rr.shuffle(names) raise RuntimeError(""failed to generate valid t30 sample"") ","""""""Verifier for t30: fill missing frames in a simple progression. The grid is a vertical strip of equal-size frames separated by a full row of 6s. Blank frames are missing. Supported progression families are deliberately simple and natural: expanding diamond rings, growing V outlines, constant-speed border motion, cumulative path drawing, moving rigid shapes, sweeping lines, and growing square outlines / filled squares. """""" from __future__ import annotations from typing import Dict, Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] SEP = 6 # ------------------------------ generic helpers ------------------------------ def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _split_frames(grid: Grid) -> tuple[list[Grid], int] | None: h = len(grid) w = len(grid[0]) if h else 0 if h == 0 or w == 0 or any(len(row) != w for row in grid): return None sep_rows = [i for i, row in enumerate(grid) if all(v == SEP for v in row)] if not sep_rows: return None starts = [0] + [r + 1 for r in sep_rows] ends = sep_rows + [h] frames = [grid[s:e] for s, e in zip(starts, ends) if e > s] if not frames: return None fh = len(frames[0]) if fh == 0 or any(len(f) != fh for f in frames): return None return frames, w def _join_frames(frames: Sequence[Grid], w: int) -> Grid: out: Grid = [] for i, f in enumerate(frames): out.extend([row[:] for row in f]) if i != len(frames) - 1: out.append([SEP] * w) return out def _cells(frame: Grid) -> Set[Cell]: return {(r, c) for r, row in enumerate(frame) for c, v in enumerate(row) if v and v != SEP} def _colored(frame: Grid) -> Dict[Cell, int]: return {(r, c): v for r, row in enumerate(frame) for c, v in enumerate(row) if v and v != SEP} def _colors(frames: Sequence[Grid]) -> Set[int]: return {v for f in frames for row in f for v in row if v and v != SEP} def _single_color(frames: Sequence[Grid]) -> int | None: vals = list(_colors(frames)) return vals[0] if len(vals) == 1 else None def _frame_from_cells(h: int, w: int, cells: Iterable[Cell], color: int) -> Grid: g = _empty(h, w) for r, c in cells: if 0 <= r < h and 0 <= c < w: g[r][c] = color return g def _frame_from_colored(h: int, w: int, cells: Dict[Cell, int]) -> Grid: g = _empty(h, w) for (r, c), color in cells.items(): if 0 <= r < h and 0 <= c < w: g[r][c] = color return g def _visible(frames: Sequence[Grid]) -> list[tuple[int, Set[Cell]]]: return [(i, _cells(f)) for i, f in enumerate(frames) if _cells(f)] def _visible_colored(frames: Sequence[Grid]) -> list[tuple[int, Dict[Cell, int]]]: return [(i, _colored(f)) for i, f in enumerate(frames) if _colored(f)] def _fit_line(vals: list[tuple[int, int]]) -> tuple[int, int] | None: if not vals: return None if len(vals) == 1: i, y = vals[0] return y - i, 1 (i0, y0), (i1, y1) = vals[0], vals[1] den = i1 - i0 if den == 0 or (y1 - y0) % den != 0: return None b = (y1 - y0) // den a = y0 - b * i0 if all(a + b * i == y for i, y in vals): return a, b return None def _check_preserve(frames: Sequence[Grid], filled: Sequence[Grid]) -> bool: return all((not _cells(frames[i])) or frames[i] == filled[i] for i in range(len(frames))) # ---------------------------- expanding ring family ---------------------------- def _ring_cells(h: int, w: int, cr: int, cc: int, radius: int) -> Set[Cell]: return {(r, c) for r in range(h) for c in range(w) if abs(r - cr) + abs(c - cc) == radius} def _try_diamond_rings(frames: Sequence[Grid]) -> list[Grid] | None: h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible(frames) if len(vis) < 2: return None col = _single_color(frames) if col is None: return None for cr in range(h): for cc in range(w): vals: list[tuple[int, int]] = [] ok = True for i, cells in vis: ds = {abs(r - cr) + abs(c - cc) for r, c in cells} if len(ds) != 1: ok = False break rad = next(iter(ds)) if cells != _ring_cells(h, w, cr, cc, rad): ok = False break vals.append((i, rad)) if not ok: continue line = _fit_line(vals) if line is None: continue a, b = line if b <= 0: continue out: list[Grid] = [] valid = True for i in range(n): rad = a + b * i if rad < 0: valid = False break out.append(_frame_from_cells(h, w, _ring_cells(h, w, cr, cc, rad), col)) if valid: return out return None # --------------------------- growing V / triangle family -------------------------- def _v_cells(h: int, w: int, cc: int, level: int) -> Set[Cell]: cells: Set[Cell] = set() for r in range(0, min(h, level + 1)): for c in (cc - r, cc + r): if 0 <= c < w: cells.add((r, c)) return cells def _try_v_growth(frames: Sequence[Grid]) -> list[Grid] | None: h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible(frames) if len(vis) < 2: return None col = _single_color(frames) if col is None: return None for cc in range(w): vals: list[tuple[int, int]] = [] ok = True for i, cells in vis: matching = [lev for lev in range(h) if cells == _v_cells(h, w, cc, lev)] if len(matching) != 1: ok = False break vals.append((i, matching[0])) if not ok: continue line = _fit_line(vals) if line is None: continue a, b = line if b <= 0: continue out: list[Grid] = [] valid = True for i in range(n): lev = a + b * i if lev < 0 or lev >= h: valid = False break out.append(_frame_from_cells(h, w, _v_cells(h, w, cc, lev), col)) if valid: return out return None # ------------------------- growing square outline / filled ------------------------ def _square_outline_cells(h: int, w: int, cr: int, cc: int, rad: int) -> Set[Cell]: return {(r, c) for r in range(h) for c in range(w) if max(abs(r - cr), abs(c - cc)) == rad} def _square_filled_cells(h: int, w: int, cr: int, cc: int, rad: int) -> Set[Cell]: return {(r, c) for r in range(h) for c in range(w) if max(abs(r - cr), abs(c - cc)) <= rad} def _try_square_growth(frames: Sequence[Grid], filled_mode: bool) -> list[Grid] | None: h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible(frames) if len(vis) < 2: return None col = _single_color(frames) if col is None: return None cell_fn = _square_filled_cells if filled_mode else _square_outline_cells for cr in range(h): for cc in range(w): vals: list[tuple[int, int]] = [] ok = True for i, cells in vis: matching = [rad for rad in range(max(h, w)) if cells == cell_fn(h, w, cr, cc, rad)] if len(matching) != 1: ok = False break vals.append((i, matching[0])) if not ok: continue line = _fit_line(vals) if line is None: continue a, b = line if b <= 0: continue out: list[Grid] = [] valid = True for i in range(n): rad = a + b * i if rad < 0: valid = False break out.append(_frame_from_cells(h, w, cell_fn(h, w, cr, cc, rad), col)) if valid: return out return None def _try_square_outline_growth(frames: Sequence[Grid]) -> list[Grid] | None: return _try_square_growth(frames, filled_mode=False) def _try_square_filled_growth(frames: Sequence[Grid]) -> list[Grid] | None: return _try_square_growth(frames, filled_mode=True) # ------------------------------ line sweep family ------------------------------ def _row_cells(h: int, w: int, rr: int) -> Set[Cell]: return {(rr, c) for c in range(w)} if 0 <= rr < h else set() def _col_cells(h: int, w: int, cc: int) -> Set[Cell]: return {(r, cc) for r in range(h)} if 0 <= cc < w else set() def _diag_cells(h: int, w: int, d: int) -> Set[Cell]: return {(r, c) for r in range(h) for c in range(w) if c - r == d} def _anti_diag_cells(h: int, w: int, s: int) -> Set[Cell]: return {(r, c) for r in range(h) for c in range(w) if r + c == s} def _try_line_sweep(frames: Sequence[Grid]) -> list[Grid] | None: h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible(frames) if len(vis) < 2: return None col = _single_color(frames) if col is None: return None families = [ (range(h), _row_cells), (range(w), _col_cells), (range(-(h - 1), w), _diag_cells), (range(h + w - 1), _anti_diag_cells), ] for domain, fn in families: vals: list[tuple[int, int]] = [] ok = True for i, cells in vis: matches = [p for p in domain if cells == fn(h, w, p)] if len(matches) != 1: ok = False break vals.append((i, matches[0])) if not ok: continue line = _fit_line(vals) if line is None: continue a, b = line if b == 0: continue out: list[Grid] = [] valid = True params = list(domain) lo, hi = min(params), max(params) for i in range(n): p = a + b * i if p < lo or p > hi: valid = False break cells = fn(h, w, p) if not cells: valid = False break out.append(_frame_from_cells(h, w, cells, col)) if valid: return out return None # --------------------------- rigid translation family -------------------------- def _shift_cells(cells: Set[Cell], dr: int, dc: int) -> Set[Cell]: return {(r + dr, c + dc) for r, c in cells} def _shift_colored(cells: Dict[Cell, int], dr: int, dc: int) -> Dict[Cell, int]: return {(r + dr, c + dc): col for (r, c), col in cells.items()} def _candidate_shifts(base: Set[Cell], target: Set[Cell]) -> Set[Tuple[int, int]]: if len(base) != len(target) or not base: return set() out: Set[Tuple[int, int]] = set() for r0, c0 in base: for r1, c1 in target: dr, dc = r1 - r0, c1 - c0 if _shift_cells(base, dr, dc) == target: out.add((dr, dc)) return out def _try_translation(frames: Sequence[Grid]) -> list[Grid] | None: h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible_colored(frames) if len(vis) < 2: return None # Same color multiset across visible frames. color_sets = [sorted(c.values()) for _, c in vis] if any(cs != color_sets[0] for cs in color_sets[1:]): return None base_i, base = vis[0] base_positions = set(base.keys()) deltas_r: list[tuple[int, int]] = [] deltas_c: list[tuple[int, int]] = [] chosen: Dict[int, Tuple[int, int]] = {base_i: (0, 0)} for i, cur in vis[1:]: cur_pos = set(cur.keys()) shifts = [] for dr, dc in _candidate_shifts(base_positions, cur_pos): shifted = _shift_colored(base, dr, dc) if shifted == cur: shifts.append((dr, dc)) if len(shifts) != 1: return None dr, dc = shifts[0] chosen[i] = (dr, dc) deltas_r.append((i, dr)) deltas_c.append((i, dc)) line_r = _fit_line(deltas_r) line_c = _fit_line(deltas_c) if line_r is None or line_c is None: return None ar, br = line_r ac, bc = line_c if br == 0 and bc == 0: return None out: list[Grid] = [] valid = True for i in range(n): dr = ar + br * i dc = ac + bc * i shifted = _shift_colored(base, dr, dc) if not all(0 <= r < h and 0 <= c < w for r, c in shifted): valid = False break out.append(_frame_from_colored(h, w, shifted)) if valid: return out return None # ------------------------------ moving border family ----------------------------- def _border_path(h: int, w: int) -> list[Cell]: if h == 1: return [(0, c) for c in range(w)] if w == 1: return [(r, 0) for r in range(h)] path: list[Cell] = [] path += [(0, c) for c in range(w)] path += [(r, w - 1) for r in range(1, h)] path += [(h - 1, c) for c in range(w - 2, -1, -1)] path += [(r, 0) for r in range(h - 2, 0, -1)] return path def _try_border_motion(frames: Sequence[Grid]) -> list[Grid] | None: # Original monochrome family retained for compatibility with provided examples. h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible(frames) if len(vis) < 3: return None sizes = {len(c) for _, c in vis} if len(sizes) != 1 or next(iter(sizes)) == 0: return None path = _border_path(h, w) pos = {cell: i for i, cell in enumerate(path)} L = len(path) if any(any(cell not in pos for cell in cells) for _, cells in vis): return None col = _single_color(frames) if col is None: return None base_i, base_cells = vis[0] base_indices = {pos[c] for c in base_cells} for step in range(1, L): ok = True for i, cells in vis[1:]: pred = {(p + step * (i - base_i)) % L for p in base_indices} got = {pos[c] for c in cells} if pred != got: ok = False break if ok: out: list[Grid] = [] for i in range(n): inds = {(p + step * (i - base_i)) % L for p in base_indices} out.append(_frame_from_cells(h, w, [path[j] for j in inds], col)) return out return None def _try_border_motion_multicolor(frames: Sequence[Grid]) -> list[Grid] | None: h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible_colored(frames) if len(vis) < 3: return None path = _border_path(h, w) pos = {cell: i for i, cell in enumerate(path)} L = len(path) # Same colors visible in every nonblank frame and exactly one cell per color. color_set = set(vis[0][1].values()) if len(color_set) != len(vis[0][1]) or len(color_set) < 2: return None for _, cur in vis: if set(cur.values()) != color_set: return None if any(cell not in pos for cell in cur): return None first_i, first = vis[0] base_by_color = {color: cell for cell, color in first.items()} base_idx = {color: pos[cell] for color, cell in base_by_color.items()} for step in range(1, L): ok = True for i, cur in vis[1:]: expected = {} for color, p0 in base_idx.items(): p = (p0 + step * (i - first_i)) % L expected[path[p]] = color if expected != cur: ok = False break if ok: out: list[Grid] = [] for i in range(n): cells: Dict[Cell, int] = {} for color, p0 in base_idx.items(): p = (p0 + step * (i - first_i)) % L cells[path[p]] = color out.append(_frame_from_colored(h, w, cells)) return out return None # ---------------------------- cumulative path family ---------------------------- def _neighbors(cell: Cell) -> list[Cell]: r, c = cell return [(r + 1, c), (r - 1, c), (r, c + 1), (r, c - 1)] def _order_path(cells: Set[Cell], first_cells: Set[Cell]) -> list[Cell] | None: if not cells or not first_cells <= cells: return None adj = {p: [q for q in _neighbors(p) if q in cells] for p in cells} if any(len(v) > 2 for v in adj.values()): return None endpoints = [p for p, v in adj.items() if len(v) <= 1] if not endpoints: return None for start in endpoints: order: list[Cell] = [] prev: Cell | None = None cur: Cell | None = start seen: Set[Cell] = set() while cur is not None: order.append(cur) seen.add(cur) nxts = [q for q in adj[cur] if q != prev] nxt = nxts[0] if nxts else None prev, cur = cur, nxt if cur in seen: return None if len(order) != len(cells): continue m = len(first_cells) if set(order[:m]) == first_cells: return order rev = list(reversed(order)) if set(rev[:m]) == first_cells: return rev return None def _try_path_prefix(frames: Sequence[Grid]) -> list[Grid] | None: h, w, n = len(frames[0]), len(frames[0][0]), len(frames) vis = _visible(frames) if len(vis) < 2: return None for (_, a), (_, b) in zip(vis, vis[1:]): if not a <= b: return None final_i, final = vis[-1] first_i, first_cells = vis[0] if first_i != 0 or final_i != n - 1: return None order = _order_path(final, first_cells) if order is None: return None length_vals = [(i, len(cells)) for i, cells in vis] best_step = None for step in range(1, max(2, len(final) + 1)): ok = True start_len = len(first_cells) for i, cells in vis: pred_len = min(len(final), start_len + step * i) if pred_len != len(cells) or set(order[:pred_len]) != cells: ok = False break if ok: best_step = step break if best_step is None: return None col = _single_color(frames) if col is None: return None out: list[Grid] = [] for i in range(n): pred_len = min(len(final), len(first_cells) + best_step * i) out.append(_frame_from_cells(h, w, order[:pred_len], col)) return out # --------------------------------- main verifier -------------------------------- def verify_t30(grid: Grid) -> Grid: split = _split_frames(grid) if split is None: return [] frames, w = split if not any(not _cells(f) for f in frames): return [row[:] for row in grid] solvers = ( _try_v_growth, _try_diamond_rings, _try_square_outline_growth, _try_square_filled_growth, _try_line_sweep, _try_border_motion_multicolor, _try_border_motion, _try_translation, _try_path_prefix, ) for solver in solvers: filled = solver(frames) if filled is None: continue if _check_preserve(frames, filled): return _join_frames(filled, w) return [row[:] for row in grid] " "t31","[{""input"":[[0,0,0,0,0,0,0,3,0,0,0,0,0,0,0],[0,4,4,0,0,0,0,3,0,0,0,0,0,0,0],[0,4,4,0,0,0,0,3,0,0,0,0,0,0,0],[0,0,0,8,8,0,0,3,0,0,0,4,4,0,0],[0,0,0,8,8,0,0,3,0,0,0,4,4,0,0],[0,0,0,0,0,0,0,3,0,0,0,0,0,0,0],[0,0,7,7,0,0,0,3,0,0,0,0,0,0,0],[0,0,7,7,0,0,0,3,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,3,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,3,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,3,0,4,4,0,0,0,0],[0,0,0,0,0,0,0,3,0,4,4,0,0,0,0],[0,0,0,8,8,0,0,3,0,0,0,4,4,0,0],[0,0,0,8,8,0,0,3,0,0,0,4,4,0,0],[0,0,0,0,0,0,0,3,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,3,0,0,7,7,0,0,0],[0,0,0,0,0,0,0,3,0,0,7,7,0,0,0],[0,0,0,0,0,0,0,3,0,0,0,0,0,0,0]]},{""input"":[[0,6,6,0,0,0,0,0,3,0,0,0,0,0,0,0,0],[0,6,6,0,0,2,2,0,3,0,0,0,0,1,1,0,0],[0,0,0,0,0,2,2,0,3,0,0,0,0,1,1,0,0],[0,0,0,0,0,0,0,0,3,0,4,4,0,0,0,0,0],[0,0,0,0,0,0,0,0,3,0,4,4,0,0,1,1,0],[0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,6,6,0,0,0,0,0,0],[0,0,0,0,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0],[0,2,2,0,6,6,0,0,0,3,0,5,5,0,2,2,0,0,0],[0,2,2,0,6,6,0,0,0,3,0,5,5,0,2,2,0,0,0]],""output"":[[0,0,0,0,0,0,4,4,0,3,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,4,4,0,3,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,8,8,0,3,0,0,0,0,0,0,7,7,0],[0,0,0,0,0,0,8,8,0,3,0,0,0,0,0,0,7,7,0],[0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0],[0,0,0,0,9,9,0,0,0,3,0,5,5,0,0,0,0,0,0],[0,0,0,0,9,9,0,0,0,3,0,5,5,0,0,0,0,0,0],[0,6,6,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0],[0,6,6,0,0,0,0,0,0,3,0,0,0,0,0,1,1,0,0],[0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,1,0,0],[0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0],[0,2,2,0,6,6,0,0,0,3,0,5,5,0,2,2,0,0,0],[0,2,2,0,6,6,0,0,0,3,0,5,5,0,2,2,0,0,0]]}]}","""""""Generator for t31: mirror 2x2 blocks across a green divider unless blocked. Rule: - The grid is split into equal left/right halves by a full-height green vertical line. - Each non-green object is a solid 2x2 block. - Each block has a corresponding 2x2 target position on the opposite half at the same row and same within-half column. - A block moves to its target unless that target would cause a collision. - Collision is determined from target cells: if a target overlaps any original block cell, or if multiple blocks have overlapping targets, the involved block stays in its original position. All other blocks move. - The divider is preserved. Generation constraints: - all non-green objects are 2x2 blocks; - at least one block moves and at least one block stays in most examples; - both halves have the same dimensions; - generated outputs contain no overlapping moved blocks. """""" from __future__ import annotations import json import random from collections import deque from typing import Dict, Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] GREEN = 3 BG = 0 COLORS = [1, 2, 4, 5, 6, 7, 8, 9] class Block: def __init__(self, idx: int, color: int, cells: Set[Cell], top: int, left: int, side: str, rel_col: int): self.idx = idx self.color = color self.cells = set(cells) self.top = top self.left = left self.side = side self.rel_col = rel_col def _empty(h: int, w: int, fill: int = BG) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _find_divider(grid: Grid) -> int: h, w = len(grid), len(grid[0]) divs = [c for c in range(w) if all(grid[r][c] == GREEN for r in range(h))] if len(divs) != 1: raise ValueError('expected exactly one full-height green divider') div = divs[0] if div * 2 + 1 != w: raise ValueError('halves must have equal width') return div def _component_cells(grid: Grid) -> list[tuple[int, Set[Cell]]]: h, w = len(grid), len(grid[0]) seen: Set[Cell] = set() comps: list[tuple[int, Set[Cell]]] = [] for r in range(h): for c in range(w): color = grid[r][c] if color in (BG, GREEN) or (r, c) in seen: continue q = deque([(r, c)]) seen.add((r, c)) cells: Set[Cell] = set() while q: x, y = q.popleft() cells.add((x, y)) for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)): nx, ny = x + dx, y + dy if 0 <= nx < h and 0 <= ny < w and (nx, ny) not in seen and grid[nx][ny] == color: seen.add((nx, ny)) q.append((nx, ny)) comps.append((color, cells)) return comps def _parse_blocks(grid: Grid) -> tuple[int, list[Block]]: if not _rectangular(grid): raise ValueError('input grid must be non-empty and rectangular') div = _find_divider(grid) blocks: list[Block] = [] for idx, (color, cells) in enumerate(_component_cells(grid)): if len(cells) != 4: raise ValueError('each object must be a solid 2x2 block') rs = sorted({r for r, _ in cells}) cs = sorted({c for _, c in cells}) if len(rs) != 2 or len(cs) != 2 or rs[1] != rs[0] + 1 or cs[1] != cs[0] + 1: raise ValueError('each object must be a solid 2x2 block') if cells != {(rs[0], cs[0]), (rs[0], cs[1]), (rs[1], cs[0]), (rs[1], cs[1])}: raise ValueError('malformed block') if div in cs: raise ValueError('block overlaps divider') if cs[1] < div: side = 'L' rel_col = cs[0] elif cs[0] > div: side = 'R' rel_col = cs[0] - div - 1 else: raise ValueError('block crosses divider') blocks.append(Block(idx, color, cells, rs[0], cs[0], side, rel_col)) return div, blocks def _target_cells(block: Block, div: int) -> Set[Cell]: if block.side == 'L': left = div + 1 + block.rel_col else: left = block.rel_col r = block.top return {(r, left), (r, left + 1), (r + 1, left), (r + 1, left + 1)} def transform_t31(grid: Grid) -> Grid: div, blocks = _parse_blocks(grid) h, w = len(grid), len(grid[0]) original_occ: Dict[Cell, int] = {} for b in blocks: for cell in b.cells: original_occ[cell] = b.idx targets = {b.idx: _target_cells(b, div) for b in blocks} blocked: Set[int] = set() # Any target overlapping an original block causes that moving block to stay. for b in blocks: if any(cell in original_occ for cell in targets[b.idx]): blocked.add(b.idx) # If multiple targets overlap, all involved blocks stay. cell_to_targeters: Dict[Cell, list[int]] = {} for b in blocks: for cell in targets[b.idx]: cell_to_targeters.setdefault(cell, []).append(b.idx) for ids in cell_to_targeters.values(): if len(ids) > 1: blocked.update(ids) out = _empty(h, w) for r in range(h): out[r][div] = GREEN placed: Dict[Cell, int] = {} for b in blocks: dest = b.cells if b.idx in blocked else targets[b.idx] for cell in dest: if cell in placed: raise ValueError('output collision in malformed input') placed[cell] = b.color for (r, c), color in placed.items(): out[r][c] = color return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _cells_for_block(top: int, left: int) -> Set[Cell]: return {(top, left), (top, left + 1), (top + 1, left), (top + 1, left + 1)} def _can_place(cells: Set[Cell], occupied: Set[Cell], h: int, w: int, gap: bool = True) -> bool: for r, c in cells: if not (0 <= r < h and 0 <= c < w): return False if (r, c) in occupied: return False if gap: for rr in range(r - 1, r + 2): for cc in range(c - 1, c + 2): if (rr, cc) in occupied: return False return True def _place_block(grid: Grid, top: int, left: int, color: int) -> None: for r, c in _cells_for_block(top, left): grid[r][c] = color def _add_pair_collision(grid: Grid, occupied: Set[Cell], h: int, half: int, rng: random.Random, colors: list[int]) -> bool: """"""Add one left and one right block at matching coordinates, so both stay."""""" candidates = [(r, c) for r in range(h - 1) for c in range(half - 1)] rng.shuffle(candidates) div = half for top, rel in candidates: lcells = _cells_for_block(top, rel) rcells = _cells_for_block(top, div + 1 + rel) if _can_place(lcells, occupied, h, 2 * half + 1) and _can_place(rcells, occupied, h, 2 * half + 1): c1 = colors.pop() if colors else rng.choice(COLORS) c2 = colors.pop() if colors else rng.choice(COLORS) _place_block(grid, top, rel, c1) _place_block(grid, top, div + 1 + rel, c2) occupied.update(lcells | rcells) return True return False def _add_moving_block(grid: Grid, occupied: Set[Cell], h: int, half: int, rng: random.Random, colors: list[int]) -> bool: div = half candidates: list[tuple[str, int, int]] = [] for side in ('L', 'R'): for top in range(h - 1): for rel in range(half - 1): left = rel if side == 'L' else div + 1 + rel target_left = div + 1 + rel if side == 'L' else rel candidates.append((side, top, rel)) rng.shuffle(candidates) for side, top, rel in candidates: left = rel if side == 'L' else div + 1 + rel target_left = div + 1 + rel if side == 'L' else rel cells = _cells_for_block(top, left) target = _cells_for_block(top, target_left) if _can_place(cells, occupied, h, 2 * half + 1) and not (target & occupied): color = colors.pop() if colors else rng.choice(COLORS) _place_block(grid, top, left, color) occupied.update(cells) return True return False def generate(rng: random.Random | None = None) -> dict[str, Grid]: rng = rng or random.Random() for _ in range(5000): h = rng.randint(6, 14) half = rng.randint(5, 9) w = 2 * half + 1 grid = _empty(h, w) for r in range(h): grid[r][half] = GREEN occupied: Set[Cell] = {(r, half) for r in range(h)} colors = COLORS[:] rng.shuffle(colors) # Ensure at least one collision pair and at least one moving block. if not _add_pair_collision(grid, occupied, h, half, rng, colors): continue if not _add_moving_block(grid, occupied, h, half, rng, colors): continue # Add a few more blocks, with a mix biased toward movable blocks. for _k in range(rng.randint(1, 6)): if rng.random() < 0.35: _add_pair_collision(grid, occupied, h, half, rng, colors) else: _add_moving_block(grid, occupied, h, half, rng, colors) try: out = transform_t31(grid) except Exception: continue if out == grid: continue # Require both moved and stayed blocks in generated examples. _, blocks = _parse_blocks(grid) moved = stayed = 0 div = half for b in blocks: if any(out[r][c] == b.color for r, c in _target_cells(b, div)) and not all(out[r][c] == b.color for r, c in b.cells): moved += 1 else: stayed += 1 if moved == 0 or stayed == 0: continue return {'input': grid, 'output': out} raise RuntimeError('Failed to generate valid t31 example') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for t31 mirror-block transfer task."""""" from __future__ import annotations from typing import List from generator import transform_t31 Grid = List[List[int]] def verify_t31(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('input grid must be rectangular') return transform_t31(inp) " "t32","[{""input"":[[3,3,3,0,8,8,8],[3,3,3,0,8,8,8],[2,2,2,0,4,4,4],[2,2,2,0,4,4,4],[1,1,1,0,3,3,3],[1,1,1,0,3,3,3],[7,7,7,0,9,9,9],[7,7,7,0,9,9,9],[5,5,5,5,5,5,5],[2,2,2,0,0,0,0],[1,1,1,0,0,0,0],[1,1,1,0,0,0,0],[1,1,1,0,0,0,0],[3,3,3,0,0,0,0],[7,7,7,0,0,0,0],[7,7,7,0,0,0,0],[2,2,2,0,0,0,0],[2,2,2,0,0,0,0],[7,7,7,0,0,0,0],[3,3,3,0,0,0,0]],""output"":[[3,3,3,0,8,8,8],[3,3,3,0,8,8,8],[2,2,2,0,4,4,4],[2,2,2,0,4,4,4],[1,1,1,0,3,3,3],[1,1,1,0,3,3,3],[7,7,7,0,9,9,9],[7,7,7,0,9,9,9],[5,5,5,5,5,5,5],[2,2,2,0,4,4,4],[1,1,1,0,3,3,3],[1,1,1,0,3,3,3],[1,1,1,0,3,3,3],[3,3,3,0,8,8,8],[7,7,7,0,9,9,9],[7,7,7,0,9,9,9],[2,2,2,0,4,4,4],[2,2,2,0,4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,6,6,0,8,8,8],[1,1,1,0,7,7,7],[1,1,1,0,7,7,7]]},{""input"":[[4,4,4,0,6,6,6],[6,6,6,0,3,3,3],[1,1,1,0,4,4,4],[9,9,9,0,8,8,8],[8,8,8,0,2,2,2],[5,5,5,5,5,5,5],[6,6,6,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,2,2,2],[0,0,0,0,2,2,2],[0,0,0,0,2,2,2],[0,0,0,0,0,0,0],[1,1,1,0,0,0,0],[1,1,1,0,0,0,0],[0,0,0,0,8,8,8],[0,0,0,0,8,8,8]],""output"":[[4,4,4,0,6,6,6],[6,6,6,0,3,3,3],[1,1,1,0,4,4,4],[9,9,9,0,8,8,8],[8,8,8,0,2,2,2],[5,5,5,5,5,5,5],[6,6,6,0,3,3,3],[0,0,0,0,0,0,0],[8,8,8,0,2,2,2],[8,8,8,0,2,2,2],[8,8,8,0,2,2,2],[0,0,0,0,0,0,0],[1,1,1,0,4,4,4],[1,1,1,0,4,4,4],[9,9,9,0,8,8,8],[9,9,9,0,8,8,8]]},{""input"":[[1,1,0,1,1],[6,6,0,8,8],[2,2,0,6,6],[9,9,0,9,9],[3,3,0,7,7],[7,7,0,3,3],[4,4,0,2,2],[5,5,5,5,5],[3,3,0,0,0],[4,4,0,0,0],[0,0,0,0,0],[1,1,0,0,0],[1,1,0,0,0],[0,0,0,0,0],[0,0,0,6,6],[0,0,0,6,6],[0,0,0,0,0],[4,4,0,0,0],[4,4,0,0,0],[0,0,0,9,9],[0,0,0,9,9]],""output"":[[1,1,0,1,1],[6,6,0,8,8],[2,2,0,6,6],[9,9,0,9,9],[3,3,0,7,7],[7,7,0,3,3],[4,4,0,2,2],[5,5,5,5,5],[3,3,0,7,7],[4,4,0,2,2],[0,0,0,0,0],[1,1,0,1,1],[1,1,0,1,1],[0,0,0,0,0],[2,2,0,6,6],[2,2,0,6,6],[0,0,0,0,0],[4,4,0,2,2],[4,4,0,2,2],[9,9,0,9,9],[9,9,0,9,9]]},{""input"":[[4,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5,5,5,5],[0,0,0,8,8],[0,0,0,8,8],[9,9,0,0,0],[9,9,0,0,0],[0,0,0,0,0],[8,8,0,0,0],[8,8,0,0,0],[0,0,0,0,0],[6,6,0,0,0],[6,6,0,0,0],[6,6,0,0,0],[0,0,0,0,0],[0,0,0,1,1],[0,0,0,1,1]],""output"":[[7,7,0,6,6],[7,7,0,6,6],[4,4,0,8,8],[4,4,0,8,8],[3,3,0,1,1],[3,3,0,1,1],[9,9,0,4,4],[9,9,0,4,4],[8,8,0,3,3],[8,8,0,3,3],[6,6,0,7,7],[6,6,0,7,7],[5,5,5,5,5],[4,4,0,8,8],[4,4,0,8,8],[9,9,0,4,4],[9,9,0,4,4],[0,0,0,0,0],[8,8,0,3,3],[8,8,0,3,3],[0,0,0,0,0],[6,6,0,7,7],[6,6,0,7,7],[6,6,0,7,7],[0,0,0,0,0],[3,3,0,1,1],[3,3,0,1,1]]},{""input"":[[6,6,6,0,4,4,4],[2,2,2,0,1,1,1],[7,7,7,0,8,8,8],[3,3,3,0,9,9,9],[5,5,5,5,5,5,5],[0,0,0,0,4,4,4],[0,0,0,0,4,4,4],[0,0,0,0,4,4,4],[7,7,7,0,0,0,0],[7,7,7,0,0,0,0],[7,7,7,0,0,0,0],[3,3,3,0,0,0,0],[0,0,0,0,0,0,0],[7,7,7,0,0,0,0],[0,0,0,0,1,1,1],[0,0,0,0,1,1,1]],""output"":[[6,6,6,0,4,4,4],[2,2,2,0,1,1,1],[7,7,7,0,8,8,8],[3,3,3,0,9,9,9],[5,5,5,5,5,5,5],[6,6,6,0,4,4,4],[6,6,6,0,4,4,4],[6,6,6,0,4,4,4],[7,7,7,0,8,8,8],[7,7,7,0,8,8,8],[7,7,7,0,8,8,8],[3,3,3,0,9,9,9],[0,0,0,0,0,0,0],[7,7,7,0,8,8,8],[2,2,2,0,1,1,1],[2,2,2,0,1,1,1]]},{""input"":[[6,6,6,0,7,7,7],[1,1,1,0,4,4,4],[9,9,9,0,8,8,8],[3,3,3,0,2,2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7,7,7],[8,8,8,0,3,3,3],[4,4,4,0,8,8,8],[2,2,2,0,4,4,4],[5,5,5,5,5,5,5],[3,3,3,0,1,1,1],[0,0,0,0,0,0,0],[4,4,4,0,8,8,8],[4,4,4,0,8,8,8],[2,2,2,0,4,4,4],[2,2,2,0,4,4,4],[0,0,0,0,0,0,0],[8,8,8,0,3,3,3],[3,3,3,0,1,1,1],[3,3,3,0,1,1,1],[1,1,1,0,7,7,7]]},{""input"":[[7,7,0,4,4],[6,6,0,8,8],[9,9,0,7,7],[3,3,0,6,6],[1,1,0,2,2],[8,8,0,9,9],[5,5,5,5,5],[0,0,0,8,8],[0,0,0,8,8],[0,0,0,0,0],[7,7,0,0,0],[7,7,0,0,0],[0,0,0,9,9],[0,0,0,8,8],[0,0,0,8,8],[0,0,0,8,8],[0,0,0,9,9],[0,0,0,0,0],[9,9,0,0,0],[0,0,0,8,8],[0,0,0,8,8]],""output"":[[7,7,0,4,4],[6,6,0,8,8],[9,9,0,7,7],[3,3,0,6,6],[1,1,0,2,2],[8,8,0,9,9],[5,5,5,5,5],[6,6,0,8,8],[6,6,0,8,8],[0,0,0,0,0],[7,7,0,4,4],[7,7,0,4,4],[8,8,0,9,9],[6,6,0,8,8],[6,6,0,8,8],[6,6,0,8,8],[8,8,0,9,9],[0,0,0,0,0],[9,9,0,7,7],[6,6,0,8,8],[6,6,0,8,8]]},{""input"":[[1,1,1,0,3,3,3],[2,2,2,0,2,2,2],[7,7,7,0,9,9,9],[6,6,6,0,8,8,8],[3,3,3,0,6,6,6],[9,9,9,0,7,7,7],[4,4,4,0,4,4,4],[5,5,5,5,5,5,5],[0,0,0,0,2,2,2],[1,1,1,0,0,0,0],[1,1,1,0,0,0,0],[1,1,1,0,0,0,0],[7,7,7,0,0,0,0],[7,7,7,0,0,0,0],[0,0,0,0,0,0,0],[1,1,1,0,0,0,0],[0,0,0,0,4,4,4],[0,0,0,0,4,4,4]],""output"":[[1,1,1,0,3,3,3],[2,2,2,0,2,2,2],[7,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4,4,4,4],[0,0,0,0,0,4,4,4,4],[7,7,7,7,0,0,0,0,0],[7,7,7,7,0,0,0,0,0],[9,9,9,9,0,0,0,0,0],[9,9,9,9,0,0,0,0,0],[9,9,9,9,0,0,0,0,0]],""output"":[[6,6,6,6,0,8,8,8,8],[6,6,6,6,0,8,8,8,8],[9,9,9,9,0,2,2,2,2],[9,9,9,9,0,2,2,2,2],[3,3,3,3,0,4,4,4,4],[3,3,3,3,0,4,4,4,4],[7,7,7,7,0,1,1,1,1],[7,7,7,7,0,1,1,1,1],[5,5,5,5,5,5,5,5,5],[3,3,3,3,0,4,4,4,4],[3,3,3,3,0,4,4,4,4],[6,6,6,6,0,8,8,8,8],[3,3,3,3,0,4,4,4,4],[3,3,3,3,0,4,4,4,4],[7,7,7,7,0,1,1,1,1],[7,7,7,7,0,1,1,1,1],[9,9,9,9,0,2,2,2,2],[9,9,9,9,0,2,2,2,2],[9,9,9,9,0,2,2,2,2]]}]}","""""""Generator for t32: bidirectional color mapping across a horizontal separator. Rule: - The grid is divided into a top and bottom section by a full grey row. - Above the grey row, each row encodes a color correspondence: the uniform color on the left half maps to the uniform color on the right half. The mapping is two-way. - Below the grey row are colored blocks placed entirely on either the left half or the right half. - In the output, every bottom block is preserved in place and also recreated on the opposite half using the mapped color while keeping the same shape and row positions. Generator constraints / ambiguity controls: - The grid width is odd, with equal-sized left/right halves and a black center column. - The top mapping is a bijection: each left-side mapping color is unique and each right-side mapping color is unique. - The mapping rows all have the same thickness within a given example, making the upper section read more clearly as a code/table rather than an object layout. - Bottom blocks are solid rectangles that span the full width of one half, closely matching the reference distribution. - Every generated example contains at least one block on each side so both mapping directions are demonstrated. - Block colors on the two sides are chosen from mostly disjoint mapping pairs when possible, reducing outputs with unnecessarily large same-colored regions. Within each side, colors are distributed to increase diversity and reduce repetition. - No copied block overlaps any original or copied block on the opposite side. """""" from __future__ import annotations import json import random from typing import Dict, List, Tuple Grid = List[List[int]] COLORS = [1, 2, 3, 4, 6, 7, 8, 9] GREY = 5 BLACK = 0 def _empty(h: int, w: int, fill: int = 0) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _find_separator_row(grid: Grid) -> int: rows = [r for r, row in enumerate(grid) if set(row) == {GREY}] if len(rows) != 1: raise ValueError('Expected exactly one full grey separator row') return rows[0] def _uniform_nonzero(vals: List[int]) -> int: s = set(vals) if len(s) != 1: raise ValueError('Expected a uniform color block') v = vals[0] if v in (BLACK, GREY): raise ValueError('Expected a non-black, non-grey color') return v def _extract_mapping(grid: Grid) -> Tuple[int, int, Dict[int, int], Dict[int, int]]: if not _rectangular(grid): raise ValueError('Input grid must be non-empty and rectangular') h, w = len(grid), len(grid[0]) if w % 2 != 1: raise ValueError('Grid width must be odd') mid = w // 2 sep = _find_separator_row(grid) if sep < 1 or sep >= h - 1: raise ValueError('Separator must split non-empty top and bottom sections') l2r: Dict[int, int] = {} r2l: Dict[int, int] = {} for r in range(sep): if grid[r][mid] != BLACK: raise ValueError('Center divider above separator must be black') left = _uniform_nonzero(grid[r][:mid]) right = _uniform_nonzero(grid[r][mid + 1:]) if left in l2r and l2r[left] != right: raise ValueError('Inconsistent left-to-right mapping') if right in r2l and r2l[right] != left: raise ValueError('Inconsistent right-to-left mapping') l2r[left] = right r2l[right] = left if len(l2r) != len(r2l): raise ValueError('Mapping must be bijective') return sep, mid, l2r, r2l def transform_t32(grid: Grid) -> Grid: sep, mid, l2r, r2l = _extract_mapping(grid) h, w = len(grid), len(grid[0]) out = [row[:] for row in grid] for r in range(sep + 1, h): if grid[r][mid] != BLACK: raise ValueError('Center divider below separator must be black') # left -> right copies for c in range(mid): color = grid[r][c] if color in (BLACK, GREY): continue if color not in l2r: raise ValueError(f'Bottom left color {color} not in mapping') tc = c + mid + 1 new_color = l2r[color] existing = out[r][tc] if existing not in (BLACK, new_color): raise ValueError('Copied block would collide on the right side') out[r][tc] = new_color # right -> left copies for c in range(mid + 1, w): color = grid[r][c] if color in (BLACK, GREY): continue if color not in r2l: raise ValueError(f'Bottom right color {color} not in mapping') tc = c - (mid + 1) new_color = r2l[color] existing = out[r][tc] if existing not in (BLACK, new_color): raise ValueError('Copied block would collide on the left side') out[r][tc] = new_color return out def _place_block(grid: Grid, start_r: int, height: int, side: str, color: int, mid: int) -> None: cols = range(0, mid) if side == 'L' else range(mid + 1, len(grid[0])) for r in range(start_r, start_r + height): for c in cols: grid[r][c] = color def _diverse_color_sequence(n: int, pool: List[int], rng: random.Random) -> List[int]: """"""Return n colors from pool with good diversity and limited repetition. Tries to cover as many distinct colors as possible on a side before reusing, and avoids immediate repeats when the pool has size > 1. """""" if n <= 0: return [] if not pool: raise ValueError('color pool must be non-empty') seq: List[int] = [] counts = {c: 0 for c in pool} remaining_unseen = set(pool) for _ in range(n): # Prefer colors not used yet on this side; otherwise prefer currently least-used. if remaining_unseen: candidates = list(remaining_unseen) else: min_count = min(counts.values()) candidates = [c for c in pool if counts[c] == min_count] # Avoid immediate repetition when possible. if seq and len(candidates) > 1 and seq[-1] in candidates: candidates = [c for c in candidates if c != seq[-1]] color = rng.choice(candidates) seq.append(color) counts[color] += 1 remaining_unseen.discard(color) return seq def generate(rng: random.Random | None = None) -> Dict[str, Grid]: rng = rng or random.Random() for _ in range(5000): half_w = rng.randint(2, 4) w = 2 * half_w + 1 # 4-7 mapping pairs. All mapping rows use the same height within an example. n_pairs = rng.randint(4, min(7, len(COLORS))) left_colors = rng.sample(COLORS, n_pairs) remaining = [c for c in COLORS if c not in left_colors] # choose right colors distinct from left side when possible; if not enough, # allow overlap across sides but keep uniqueness within each side. if len(remaining) >= n_pairs: right_colors = rng.sample(remaining, n_pairs) else: right_colors = rng.sample(COLORS, n_pairs) map_row_height = rng.choice([1, 2]) pair_heights = [map_row_height for _ in range(n_pairs)] top_h = sum(pair_heights) # bottom blocks: 4-9 rectangles, each full half-width and height 1-3. # Require at least one left block and one right block. n_blocks = rng.randint(4, 9) sides = ['L', 'R'] + [rng.choice(['L', 'R']) for _ in range(n_blocks - 2)] rng.shuffle(sides) block_heights = [rng.choice([1, 1, 2, 2, 3]) for _ in range(n_blocks)] gap_after = [rng.choice([0, 1]) for _ in range(n_blocks - 1)] bottom_h = sum(block_heights) + sum(gap_after) h = top_h + 1 + bottom_h if not (10 <= h <= 30): continue grid = _empty(h, w, BLACK) mid = w // 2 # top mapping rows l2r: Dict[int, int] = {} r2l: Dict[int, int] = {} rr = 0 for lc, rc, ph in zip(left_colors, right_colors, pair_heights): if lc in l2r or rc in r2l: # enforce uniqueness within each side; regenerate on rare failure break l2r[lc] = rc r2l[rc] = lc for _ in range(ph): for c in range(0, mid): grid[rr][c] = lc for c in range(mid + 1, w): grid[rr][c] = rc rr += 1 else: sep = rr for c in range(w): grid[sep][c] = GREY # Bias block-color choices to use disjoint mapping-pair subsets on the two # sides when possible, reducing outputs with large same-colored regions. pair_indices = list(range(n_pairs)) rng.shuffle(pair_indices) # Keep both side-specific pools reasonably large when possible. if n_pairs >= 4: split = rng.randint(2, n_pairs - 2) else: split = rng.randint(1, n_pairs - 1) left_pool_idx = pair_indices[:split] right_pool_idx = pair_indices[split:] left_pool = [left_colors[i] for i in left_pool_idx] right_pool = [right_colors[i] for i in right_pool_idx] # Pre-assign colors with stronger within-side diversity. left_block_count = sum(1 for s in sides if s == 'L') right_block_count = sum(1 for s in sides if s == 'R') left_seq = _diverse_color_sequence(left_block_count, left_pool if left_pool else list(l2r.keys()), rng) right_seq = _diverse_color_sequence(right_block_count, right_pool if right_pool else list(r2l.keys()), rng) li = ri = 0 # place bottom blocks while avoiding row overlap across sides, so copies do not collide. curr = sep + 1 ok = True for i, (side, bh) in enumerate(zip(sides, block_heights)): if side == 'L': color = left_seq[li] li += 1 else: color = right_seq[ri] ri += 1 _place_block(grid, curr, bh, side, color, mid) curr += bh if i < len(gap_after): curr += gap_after[i] # basic check that both sides are present has_left = any(any(v not in (BLACK, GREY) for v in row[:mid]) for row in grid[sep + 1:]) has_right = any(any(v not in (BLACK, GREY) for v in row[mid + 1:]) for row in grid[sep + 1:]) if not (has_left and has_right): ok = False if not ok: continue try: out = transform_t32(grid) except Exception: continue if out == grid: continue return {'input': grid, 'output': out} raise RuntimeError('Failed to generate valid t32 example') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for t32: bidirectional color mapping across a horizontal separator."""""" from __future__ import annotations from typing import List from generator import transform_t32 Grid = List[List[int]] def verify_t32(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('Input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('Input grid must be rectangular') return transform_t32(inp) " "t33","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,3,3,3,0,7,7,0,0],[0,0,0,3,0,0,0,7,7,0,0],[0,0,3,3,0,0,0,7,0,0,0],[0,0,0,3,0,0,0,7,0,0,0],[0,0,0,0,0,0,0,7,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[8,8,8,0,0,0,6,0,5,5,5],[8,0,0,0,6,6,6,0,0,5,0],[8,8,8,0,0,0,0,0,0,0,0],[0,0,0,0,1,0,1,0,1,0,0],[0,0,0,0,1,1,1,1,1,0,0]],""output"":[[8,8,8],[8,0,0],[8,8,8]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0],[0,2,2,0,0,0,0,0,0,3,0],[0,0,2,0,0,0,0,0,0,3,0],[0,0,2,0,0,0,3,3,3,3,0],[0,2,2,0,0,0,0,0,0,0,0],[0,2,2,0,4,0,0,0,0,0,0],[0,0,0,0,4,0,4,0,0,0,0],[0,0,0,0,4,4,4,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,8,8,8,8,0,0,0,0,0,0],[0,0,8,8,8,0,0,0,0,0,0],[0,0,8,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0]],""output"":[[2,2],[0,2],[0,2],[2,2],[2,2]]},{""input"":[[0,0,0,0,0,0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,0,0,1,0,7,7,7,7,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[1,1],[0,1],[0,1]]},{""input"":[[0,0,0,2,2,2,0,0,0,0,0,0,0,0],[0,2,2,2,2,2,0,0,0,0,0,0,0,0],[0,2,2,2,0,2,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,5,0,0,0,0,0,0,0,0],[0,0,5,5,5,5,5,0,0,0,0,0,0,0],[0,0,5,5,5,5,5,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,9,9,0,0,0,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,1,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[1],[1],[1]]}]}","""""""Generator for t33: odd one out rectangle."""""" from __future__ import annotations import json import random from pathlib import Path from typing import Dict, Iterable, List, Sequence, Set, Tuple from verifier import _extract_objects, _normalize, _odd_candidates, verify_t33 Grid = List[List[int]] Cell = Tuple[int, int] Shape = Tuple[Cell, ...] MAX_DIM = 22 # intentionally smaller than the global 30x30 cap def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _dims(shape: Shape) -> Tuple[int, int]: if not shape: return (0, 0) return max(r for r, _ in shape) + 1, max(c for _, c in shape) + 1 def _paint(grid: Grid, shape: Shape, r0: int, c0: int, color: int) -> None: for r, c in shape: grid[r0 + r][c0 + c] = color def _shape_to_grid(shape: Shape, color: int) -> Grid: h, w = _dims(shape) g = _empty(h, w) _paint(g, shape, 0, 0, color) return g def _shape_signature(shape: Shape) -> Shape: return _normalize(shape) def _random_connected_partition(rr: random.Random, H: int, W: int, m: int) -> Tuple[Shape, ...] | None: cells = [(r, c) for r in range(H) for c in range(W)] cell_set = set(cells) min_piece_area = 2 if H * W < m * min_piece_area: return None for _ in range(500): seeds = rr.sample(cells, m) pieces = [{s} for s in seeds] unassigned = cell_set - set(seeds) while unassigned: frontier = [] sizes = [len(p) for p in pieces] min_size = min(sizes) for i, piece in enumerate(pieces): nbrs = set() for r, c in piece: for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): q = (r + dr, c + dc) if q in unassigned: nbrs.add(q) # bias toward growing smaller pieces weight = 3 if len(piece) == min_size else 1 frontier.extend([(i, q)] * weight for q in nbrs) flat = [item for sub in frontier for item in sub] if not flat: break i, q = rr.choice(flat) pieces[i].add(q) unassigned.remove(q) if unassigned: continue sizes = [len(p) for p in pieces] if min(sizes) < min_piece_area: continue # keep pieces reasonably balanced if max(sizes) > H * W - (m - 1) * min_piece_area: continue shapes = tuple(_normalize(piece) for piece in pieces) if len({_shape_signature(s) for s in shapes}) != m: continue return shapes return None def _random_connected_shape(rr: random.Random, area: int, max_h: int = 6, max_w: int = 6) -> Shape | None: for _ in range(300): cells = {(0, 0)} frontier = {(0, 1), (1, 0), (-1, 0), (0, -1)} while len(cells) < area and frontier: cell = rr.choice(list(frontier)) frontier.remove(cell) cells.add(cell) r, c = cell for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): q = (r + dr, c + dc) if q not in cells: frontier.add(q) shape = _normalize(cells) h, w = _dims(shape) if len(shape) == area and h <= max_h and w <= max_w: return shape return None def _has_clearance(occupied: Set[Cell], shape: Shape, r0: int, c0: int, h: int, w: int) -> bool: for r, c in shape: rr, cc = r0 + r, c0 + c if not (0 <= rr < h and 0 <= cc < w): return False for dr in (-1, 0, 1): for dc in (-1, 0, 1): if (rr + dr, cc + dc) in occupied: return False return True def _place_shapes(rr: random.Random, shapes: Sequence[Shape], colors: Sequence[int], h: int, w: int) -> Grid | None: grid = _empty(h, w) occupied: Set[Cell] = set() slots = [ (1, 1), (1, w - 8), (h - 8, 1), (h - 8, w - 8), (1, w // 2 - 3), (h // 2 - 3, 1), (h // 2 - 3, w - 8), (h - 8, w // 2 - 3), ] rr.shuffle(slots) order = list(range(len(shapes))) rr.shuffle(order) positions: Dict[int, Tuple[int, int]] = {} for idx, base in zip(order, slots): shape = shapes[idx] sh, sw = _dims(shape) placed = False for _ in range(150): r0 = max(0, min(h - sh, base[0] + rr.randint(-1, 1))) c0 = max(0, min(w - sw, base[1] + rr.randint(-1, 1))) if _has_clearance(occupied, shape, r0, c0, h, w): positions[idx] = (r0, c0) for r, c in shape: occupied.add((r0 + r, c0 + c)) placed = True break if not placed: return None for idx, shape in enumerate(shapes): r0, c0 = positions[idx] _paint(grid, shape, r0, c0, colors[idx]) return grid def _dims_ok(grid: Grid) -> bool: return len(grid) <= MAX_DIM and len(grid[0]) <= MAX_DIM def _make_case(rr: random.Random) -> dict[str, Grid] | None: # Strongly favor 4 total pieces: odd one out + 3 rectangle pieces. # Keep some 5-piece cases and only rare 6-piece cases for variety. total_pieces = rr.choices([4, 5, 6], weights=[72, 25, 3])[0] rect_piece_count = total_pieces - 1 rect_dims = [(3, 4), (3, 5), (4, 4), (4, 5), (5, 5), (4, 6)] rr.shuffle(rect_dims) rect_shapes: Tuple[Shape, ...] | None = None chosen_dims = None for H, W in rect_dims: rect_shapes = _random_connected_partition(rr, H, W, rect_piece_count) if rect_shapes is not None: chosen_dims = (H, W) break if rect_shapes is None: return None rect_sigs = {_shape_signature(s) for s in rect_shapes} total_rect_area = sum(len(s) for s in rect_shapes) odd_shape = None for _ in range(500): area = rr.randint(3, min(8, total_rect_area - 1)) cand = _random_connected_shape(rr, area) if cand is None: continue if _shape_signature(cand) in rect_sigs: continue odd_shape = cand break if odd_shape is None: return None shapes = list(rect_shapes) + [odd_shape] colors = rr.sample(range(1, 10), len(shapes)) max_h = max(_dims(s)[0] for s in shapes) max_w = max(_dims(s)[1] for s in shapes) grid_h = rr.randint(max(10, max_h + 4), min(MAX_DIM, 16 + (1 if total_pieces >= 5 else 0))) grid_w = rr.randint(max(10, max_w + 4), min(MAX_DIM, 16 + (1 if total_pieces >= 5 else 0))) grid = _place_shapes(rr, shapes, colors, grid_h, grid_w) if grid is None: return None if not _dims_ok(grid): return None out = verify_t33(grid) if not out: return None objs = _extract_objects(grid) if len(objs) != len(shapes): return None # Explicit single-solution constraint: exactly one removable object must make # the rest translatable into a rectangle, and it must be the intended odd one. if len(_odd_candidates(objs)) != 1: return None if out != _shape_to_grid(odd_shape, colors[-1]): # verifier chose a different odd object or failed orientation return None return {""input"": grid, ""output"": out} def generate(rng: random.Random | None = None) -> dict[str, Grid]: rr = rng if rng is not None else random for _ in range(1500): ex = _make_case(rr) if ex is not None and verify_t33(ex[""input""]) == ex[""output""]: return ex raise RuntimeError(""failed to generate valid t33 sample"") ","""""""Verifier for t33: odd one out rectangle. The input contains several colored objects. Exactly one object is the odd one out. If that object is removed, the remaining objects can be translated (without rotation) to tile one filled rectangle. The output is the odd object alone, cropped to its bounding box and preserving its original orientation and color. """""" from __future__ import annotations from itertools import combinations from math import isqrt from typing import Dict, Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] Shape = Tuple[Cell, ...] def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _normalize(cells: Iterable[Cell]) -> Shape: pts = list(cells) if not pts: return tuple() min_r = min(r for r, _ in pts) min_c = min(c for _, c in pts) return tuple(sorted((r - min_r, c - min_c) for r, c in pts)) def _dims(shape: Shape) -> Tuple[int, int]: if not shape: return (0, 0) return max(r for r, _ in shape) + 1, max(c for _, c in shape) + 1 def _paint(grid: Grid, shape: Shape, r0: int, c0: int, color: int) -> None: for r, c in shape: grid[r0 + r][c0 + c] = color def _extract_objects(grid: Grid) -> List[dict]: h = len(grid) w = len(grid[0]) if h else 0 seen: Set[Cell] = set() objs: List[dict] = [] for r in range(h): for c in range(w): color = grid[r][c] if color == 0 or (r, c) in seen: continue stack = [(r, c)] seen.add((r, c)) cells: List[Cell] = [] while stack: rr, cc = stack.pop() cells.append((rr, cc)) for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): q = (rr + dr, cc + dc) qr, qc = q if 0 <= qr < h and 0 <= qc < w and q not in seen and grid[qr][qc] == color: seen.add(q) stack.append(q) min_r = min(rr for rr, _ in cells) min_c = min(cc for _, cc in cells) shape = _normalize(cells) objs.append({ ""color"": color, ""cells"": tuple(sorted(cells)), ""origin"": (min_r, min_c), ""shape"": shape, ""area"": len(cells), }) objs.sort(key=lambda o: (o[""origin""], o[""color""], o[""area""])) return objs def _factor_pairs(area: int) -> List[Tuple[int, int]]: out: List[Tuple[int, int]] = [] for h in range(2, isqrt(area) + 1): if area % h == 0: w = area // h out.append((h, w)) if h != w: out.append((w, h)) return out def _placements_for(shape: Shape, H: int, W: int) -> List[Shape]: ph, pw = _dims(shape) out: List[Shape] = [] if ph > H or pw > W: return out for r0 in range(H - ph + 1): for c0 in range(W - pw + 1): out.append(tuple(sorted((r0 + r, c0 + c) for r, c in shape))) return out def _can_tile_rectangle(shapes: Sequence[Shape]) -> bool: area = sum(len(s) for s in shapes) if len(shapes) < 2: return False for H, W in _factor_pairs(area): target = {(r, c) for r in range(H) for c in range(W)} options: Dict[int, List[Set[Cell]]] = {} valid = True for i, shape in enumerate(shapes): opts = [set(p) for p in _placements_for(shape, H, W)] if not opts: valid = False break options[i] = opts if not valid: continue def backtrack(used: Set[Cell], remaining: Set[int]) -> bool: if not remaining: return used == target uncovered = target - used coverable: Set[Cell] = set() for idx in remaining: for p in options[idx]: if not (p & used): coverable |= p if uncovered - coverable: return False best_idx = None best_valid: List[Set[Cell]] | None = None for idx in remaining: val = [p for p in options[idx] if not (p & used)] if best_valid is None or len(val) < len(best_valid): best_idx = idx best_valid = val if best_valid == []: return False assert best_idx is not None and best_valid is not None rem2 = set(remaining) rem2.remove(best_idx) for p in best_valid: if backtrack(used | p, rem2): return True return False if backtrack(set(), set(range(len(shapes)))): return True return False def _odd_candidates(objs: Sequence[dict]) -> List[int]: out: List[int] = [] n = len(objs) for odd in range(n): shapes = [objs[i][""shape""] for i in range(n) if i != odd] if _can_tile_rectangle(shapes): out.append(odd) return out def _shape_to_grid(shape: Shape, color: int) -> Grid: h, w = _dims(shape) g = _empty(h, w) _paint(g, shape, 0, 0, color) return g def verify_t33(grid: Grid) -> Grid: objs = _extract_objects(grid) if len(objs) < 3: return [] cands = _odd_candidates(objs) if len(cands) != 1: return [] odd = objs[cands[0]] return _shape_to_grid(odd[""shape""], odd[""color""]) " "t34","[{""input"":[[9,0,0,7,0,0,3,0,0,4,0,0],[0,9,0,0,7,0,0,3,0,0,4,0],[0,0,9,0,0,7,0,0,3,0,0,4],[1,0,0,9,0,0,7,0,0,3,0,0],[0,1,0,0,9,0,0,7,0,0,3,0],[0,0,1,0,0,8,8,8,8,2,0,3],[5,0,0,1,0,8,8,8,8,8,0,0],[0,5,0,0,1,8,8,8,8,8,7,0],[0,0,5,0,0,8,8,8,8,8,0,7],[6,0,0,5,0,8,8,8,8,8,0,0],[0,6,0,0,5,0,0,1,0,0,9,0],[0,0,6,0,0,5,0,0,1,0,0,9]],""output"":[[0,7,0,0,9],[7,0,0,9,0],[0,0,9,0,0],[0,9,0,0,1],[9,0,0,1,0]]},{""input"":[[0,0,0,0,0,0,0,0,7,0,3,0,7,0,0],[7,7,7,8,8,8,8,7,7,0,3,0,7,7,7],[0,0,0,8,8,8,8,0,0,0,3,0,0,0,0],[3,3,3,8,8,8,8,3,3,3,3,3,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7,7,7,7,7,7,7,7,8,8,8,8,8,2,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[7,7,7,7,7,7],[6,6,6,6,6,6],[6,6,6,6,6,6],[0,0,0,0,0,0],[0,0,0,0,0,0],[3,3,3,3,3,3]]},{""input"":[[9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9],[9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9],[9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9],[3,3,3,3,3,3,8,8,8,8,8,8,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,8,8,8,8,8,8,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,8,8,8,8,8,8,3,3,3,3,3,3,3,3],[5,5,5,5,5,5,8,8,8,8,8,8,5,5,5,5,5,5,5,5],[5,5,5,5,5,5,8,8,8,8,8,8,5,5,5,5,5,5,5,5],[5,5,5,5,5,5,8,8,8,8,8,2,5,5,5,5,5,5,5,5],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]],""output"":[[5,5,5,5,5,5],[5,5,5,5,5,5],[5,5,5,5,5,5],[3,3,3,3,3,3],[3,3,3,3,3,3],[3,3,3,3,3,3]]}]}","""""""Generator for t34: recover an occluded pattern, then rotate by the red-corner cue. Task rule: - The input contains a cyan square occluder with exactly one red cell at one corner. - The output is the pattern hidden beneath the square, rotated so that the red corner would move to the top-left of the square. * red already top-left -> no rotation * red top-right -> rotate hidden patch 90° counterclockwise * red bottom-left -> rotate hidden patch 90° clockwise * red bottom-right -> rotate hidden patch 180° Solver model classes supported: 1) nested concentric rectangular rings, 2) row-constant stripe fields recoverable by bridging across the square, and 3) diagonal-repeat fields with step (s, s) for small s. Generator constraints / ambiguity controls: - Underlying colors never use cyan (8) or red (2), reserving those for the occluder. - Generated examples come from one of the three supported pattern families. - Examples are filtered so the intended family is the one selected by the verifier. - Generated backgrounds are visually structured rather than noisy: diagonal examples use regular stripe/band patterns, row examples use coherent horizontal bands, and ring examples use concentric frames. - The occluded patch is non-trivial (contains at least one non-black cell and some visible context exists around it). """""" from __future__ import annotations import json import random from typing import Dict, List, Optional, Tuple Grid = List[List[int]] Cell = Tuple[int, int] PALETTE = [0, 1, 3, 4, 5, 6, 7, 9] NONZERO_PALETTE = [1, 3, 4, 5, 6, 7, 9] CYAN = 8 RED = 2 def _empty(h: int, w: int, fill: int = 0) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rot_ccw(m: Grid) -> Grid: return [list(row) for row in zip(*m)][::-1] def _rot_cw(m: Grid) -> Grid: return [list(row) for row in zip(*m[::-1])] def _rot_180(m: Grid) -> Grid: return [row[::-1] for row in m[::-1]] def _copy_grid(g: Grid) -> Grid: return [row[:] for row in g] def _find_square(grid: Grid) -> tuple[int, int, int, int, str]: pts = [(r, c) for r, row in enumerate(grid) for c, v in enumerate(row) if v in (CYAN, RED)] if not pts: raise ValueError('No cyan/red occluder found') rs = [r for r, _ in pts] cs = [c for _, c in pts] r0, r1, c0, c1 = min(rs), max(rs), min(cs), max(cs) if r1 - r0 != c1 - c0: raise ValueError('Occluder must be a square') size = r1 - r0 + 1 if size < 2: raise ValueError('Occluder square too small') red_cells = [(r, c) for r, c in pts if grid[r][c] == RED] if len(red_cells) != 1: raise ValueError('Expected exactly one red direction cell') red = red_cells[0] for r in range(r0, r1 + 1): for c in range(c0, c1 + 1): if grid[r][c] not in (CYAN, RED): raise ValueError('Occluder square must contain only cyan/red cells') corner_map = { (r0, c0): 'tl', (r0, c1): 'tr', (r1, c0): 'bl', (r1, c1): 'br', } if red not in corner_map: raise ValueError('Red direction cell must be at a corner of the cyan square') return r0, r1, c0, c1, corner_map[red] def _orient_hidden(hidden: Grid, corner: str) -> Grid: if corner == 'tl': return hidden if corner == 'tr': return _rot_ccw(hidden) if corner == 'bl': return _rot_cw(hidden) if corner == 'br': return _rot_180(hidden) raise ValueError(f'Unknown corner {corner}') def _ring_candidate(grid: Grid) -> Optional[Grid]: h, w = len(grid), len(grid[0]) r0, r1, c0, c1, _ = _find_square(grid) depth_color: Dict[int, int] = {} for r in range(h): for c in range(w): if r0 <= r <= r1 and c0 <= c <= c1: continue d = min(r, c, h - 1 - r, w - 1 - c) v = grid[r][c] if d in depth_color and depth_color[d] != v: return None depth_color[d] = v hidden: Grid = [] for r in range(r0, r1 + 1): row: List[int] = [] for c in range(c0, c1 + 1): d = min(r, c, h - 1 - r, w - 1 - c) if d not in depth_color: return None row.append(depth_color[d]) hidden.append(row) return hidden def _row_bridge_candidate(grid: Grid) -> Optional[Grid]: h, w = len(grid), len(grid[0]) r0, r1, c0, c1, _ = _find_square(grid) if c0 == 0 or c1 == w - 1: return None hidden: Grid = [] for r in range(r0, r1 + 1): lv = grid[r][c0 - 1] rv = grid[r][c1 + 1] if lv != rv: return None hidden.append([lv] * (c1 - c0 + 1)) return hidden def _diag_candidate(grid: Grid, step: int) -> Optional[Grid]: h, w = len(grid), len(grid[0]) r0, r1, c0, c1, _ = _find_square(grid) groups: Dict[Tuple[int, int], int] = {} for r in range(h): for c in range(w): if r0 <= r <= r1 and c0 <= c <= c1: continue key = (r - c, r % step) v = grid[r][c] if key in groups and groups[key] != v: return None groups[key] = v hidden: Grid = [] for r in range(r0, r1 + 1): row: List[int] = [] for c in range(c0, c1 + 1): key = (r - c, r % step) if key not in groups: return None row.append(groups[key]) hidden.append(row) return hidden def _recover_hidden(grid: Grid) -> tuple[Grid, str]: # Preference order chosen to match the supplied task references. cand = _ring_candidate(grid) if cand is not None: return cand, 'ring' cand = _row_bridge_candidate(grid) if cand is not None: return cand, 'row' for step in (1, 2, 3, 4): cand = _diag_candidate(grid, step) if cand is not None: return cand, f'diag{step}' raise ValueError('Could not infer hidden pattern from supported families') def transform_t34(grid: Grid) -> Grid: if not grid or not grid[0] or any(len(row) != len(grid[0]) for row in grid): raise ValueError('Input grid must be non-empty and rectangular') hidden, _family = _recover_hidden(grid) _r0, _r1, _c0, _c1, corner = _find_square(grid) return _orient_hidden(hidden, corner) # --------------------------------------------------------------------------- # Generation helpers # --------------------------------------------------------------------------- def _overlay_occluder(full: Grid, r0: int, c0: int, size: int, corner: str) -> tuple[Grid, Grid]: hidden = [row[c0:c0 + size] for row in full[r0:r0 + size]] inp = _copy_grid(full) for r in range(r0, r0 + size): for c in range(c0, c0 + size): inp[r][c] = CYAN red_pos = { 'tl': (r0, c0), 'tr': (r0, c0 + size - 1), 'bl': (r0 + size - 1, c0), 'br': (r0 + size - 1, c0 + size - 1), }[corner] inp[red_pos[0]][red_pos[1]] = RED return inp, _orient_hidden(hidden, corner) def _gen_diag(rng: random.Random) -> Optional[tuple[Grid, Grid, str]]: """"""Generate a clear diagonal stripe/band field, not random sparse noise."""""" h = rng.randint(10, 18) w = rng.randint(10, 18) size = rng.randint(4, min(6, h - 2, w - 2)) r0 = rng.randint(1, h - size - 1) c0 = rng.randint(1, w - size - 1) # Step 1 is the clearest; step 2 appears occasionally to match the reference variety. step = rng.choice([1, 1, 1, 2]) period = rng.choice([3, 4]) active_width = rng.choice([1, 1, 2]) stripe_colors = rng.sample(NONZERO_PALETTE, rng.randint(2, 4)) phase = rng.randrange(period) full = _empty(h, w) for r in range(h): for c in range(w): d = r - c + phase if d % period < active_width: # Color changes only by diagonal band and the optional step lane, # producing a regular readable pattern rather than per-cell noise. full[r][c] = stripe_colors[((d // period) + (r % step)) % len(stripe_colors)] else: full[r][c] = 0 hidden = [row[c0:c0 + size] for row in full[r0:r0 + size]] hidden_vals = [v for row in hidden for v in row] if all(v == 0 for v in hidden_vals) or len(set(hidden_vals)) < 2: return None # Ensure row-bridge candidate fails so the intended family is diagonal. if all(full[r][c0 - 1] == full[r][c0 + size] for r in range(r0, r0 + size)): return None corner = rng.choice(['tl', 'tr', 'bl', 'br']) inp, out = _overlay_occluder(full, r0, c0, size, corner) return inp, out, f'diag{step}' def _gen_row(rng: random.Random) -> Optional[tuple[Grid, Grid, str]]: """"""Generate coherent horizontal color bands, not independent random rows."""""" size = rng.randint(3, 6) h = rng.randint(size + 4, size + 10) w = rng.randint(size + 6, size + 14) r0 = rng.randint(1, h - size - 1) c0 = rng.randint(1, w - size - 1) full = _empty(h, w) band_colors = rng.sample(NONZERO_PALETTE, rng.randint(2, 4)) band_height = rng.choice([1, 2, 2, 3]) include_black_gaps = rng.random() < 0.35 phase = rng.randrange(len(band_colors)) for r in range(h): band = (r // band_height + phase) % (len(band_colors) + (1 if include_black_gaps else 0)) color = 0 if include_black_gaps and band == len(band_colors) else band_colors[band] for c in range(w): full[r][c] = color hidden = [row[c0:c0 + size] for row in full[r0:r0 + size]] vals = [hidden[i][0] for i in range(size)] if len(set(vals)) < 2 or all(v == 0 for v in vals): return None corner = rng.choice(['tl', 'tr', 'bl', 'br']) inp, out = _overlay_occluder(full, r0, c0, size, corner) return inp, out, 'row' def _gen_ring(rng: random.Random) -> Optional[tuple[Grid, Grid, str]]: h = rng.randint(9, 17) w = rng.randint(9, 17) max_depth = min(h, w) // 2 if max_depth < 3: return None ring_colors = [rng.choice(NONZERO_PALETTE)] while len(ring_colors) < max_depth + 1: prev = ring_colors[-1] choices = [c for c in NONZERO_PALETTE if c != prev] ring_colors.append(rng.choice(choices)) full = _empty(h, w) for r in range(h): for c in range(w): d = min(r, c, h - 1 - r, w - 1 - c) full[r][c] = ring_colors[d] size = rng.randint(3, min(6, h - 2, w - 2)) # Keep the square away from the border so there is visible context all around. r0 = rng.randint(1, h - size - 1) c0 = rng.randint(1, w - size - 1) hidden = [row[c0:c0 + size] for row in full[r0:r0 + size]] if len(set(v for row in hidden for v in row)) < 2: return None corner = rng.choice(['tl', 'tr', 'bl', 'br']) inp, out = _overlay_occluder(full, r0, c0, size, corner) return inp, out, 'ring' def generate(rng: random.Random | None = None) -> Dict[str, Grid]: rng = rng or random.Random() families = ['diag', 'row', 'ring'] for _ in range(5000): family = rng.choices(families, weights=[0.25, 0.30, 0.45], k=1)[0] made: Optional[tuple[Grid, Grid, str]] if family == 'diag': made = _gen_diag(rng) elif family == 'row': made = _gen_row(rng) else: made = _gen_ring(rng) if made is None: continue inp, out, intended = made try: recovered_hidden, recovered_family = _recover_hidden(inp) _r0, _r1, _c0, _c1, corner = _find_square(inp) predicted = _orient_hidden(recovered_hidden, corner) except Exception: continue if predicted != out: continue # Ensure the verifier selects the intended family type. if intended == 'row' and recovered_family != 'row': continue if intended == 'ring' and recovered_family != 'ring': continue if intended.startswith('diag') and not recovered_family.startswith('diag'): continue return {'input': inp, 'output': out} raise RuntimeError('Failed to generate valid t34 example') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for t34: recover the occluded patch and rotate by the red-corner cue."""""" from __future__ import annotations from typing import List from generator import transform_t34 Grid = List[List[int]] def verify_t34(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('Input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('Input grid must be rectangular') return transform_t34(inp) " "t35","[{""input"":[[0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,4],[0,0,0,0,0,8,0,0,0,4,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0],[0,0,0,0,0,8,0,0,0,0,0,8,0,0,4,0,0,8,0,0,0,0,0,8,0,0,0,0,0],[0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,4,0,0,0,8,0,0,0,0,0],[4,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0]],""output"":[[0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0,4],[0,0,0,0,0,8,0,0,0,0,0,8,0,0,0,0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,0,0,8,1,1,0,0,0,8,1,1,0,0,0],[1,0,0,0,0,8,1,0,0,0,0,8,1,0,0,0,0,8,1,0,0,0,0]]}]}","""""""Generator for Test2/t35: repair the order of frame sequence. Rule: - The input shows a horizontal sequence of same-sized ""image"" frames separated by vertical cyan lines. - In the correct order, the frames show a natural visual progression. - The output reorders the frames into that progression. Generation constraints used to keep examples well-formed and unambiguous: - all frames have the same size and are separated only by cyan columns; - first and last frames are kept in their correct positions; - at least two intermediate frames are out of order; - generated sequences are from a diverse set of simple monotone progression families, so the intended ordering can be recovered deterministically from the frame content; - the output contains exactly the same frames as the input, just reordered. """""" from __future__ import annotations import json import random from typing import List, Sequence, Tuple Grid = List[List[int]] Frame = List[List[int]] Cell = Tuple[int, int] BG = 0 CYAN = 8 COLORS = [1, 2, 3, 4, 5, 6, 7, 9] def _empty(h: int, w: int, fill: int = BG) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _occupied(frame: Frame) -> list[Cell]: return [(r, c) for r, row in enumerate(frame) for c, v in enumerate(row) if v != BG] def _split_frames(grid: Grid) -> list[Frame]: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) sep_cols = [c for c in range(w) if all(grid[r][c] == CYAN for r in range(h))] frames: list[Frame] = [] start = 0 for c in sep_cols + [w]: if c <= start: raise ValueError(""empty frame"") frames.append([row[start:c] for row in grid]) start = c + 1 if len(frames) < 3: raise ValueError(""expected at least three frames"") fh, fw = len(frames[0]), len(frames[0][0]) if any(len(f) != fh or len(f[0]) != fw for f in frames): raise ValueError(""all frames must share the same size"") return frames def _join_frames(frames: Sequence[Frame]) -> Grid: h = len(frames[0]) out: Grid = [] for r in range(h): row: list[int] = [] for i, frame in enumerate(frames): if i: row.append(CYAN) row.extend(frame[r]) out.append(row) return out def _signature(frame: Frame) -> tuple[tuple[int, ...], ...]: return tuple(tuple(row) for row in frame) def _mean_col(frame: Frame) -> float: occ = _occupied(frame) return sum(c for _, c in occ) / len(occ) def _mean_row(frame: Frame) -> float: occ = _occupied(frame) return sum(r for r, _ in occ) / len(occ) def _count(frame: Frame) -> int: return len(_occupied(frame)) def _two_dot_3x3_rank(frame: Frame) -> int | None: """"""Rank the two-dot 3x3 motif that appears in the reference examples."""""" if len(frame) != 3 or len(frame[0]) != 3: return None occ = sorted(_occupied(frame)) rank = { ((0, 1), (2, 0)): 0, ((0, 0), (2, 1)): 1, ((1, 0), (2, 2)): 2, ((1, 2), (2, 0)): 3, ((0, 2), (2, 1)): 4, ((0, 1), (2, 2)): 5, } return rank.get(tuple(occ)) def _frame_sort_key(frame: Frame) -> tuple[float, float, float, float, tuple[tuple[int, ...], ...]]: occ = _occupied(frame) if not occ: raise ValueError(""frames must not be empty"") special = _two_dot_3x3_rank(frame) if special is not None: return (0, special, 0, 0, _signature(frame)) return (1, _mean_col(frame), _count(frame), _mean_row(frame), _signature(frame)) def transform_t35(grid: Grid) -> Grid: frames = _split_frames(grid) ordered = sorted(frames, key=_frame_sort_key) return _join_frames(ordered) # --------------------------------------------------------------------------- # Generator families # --------------------------------------------------------------------------- def _frame_from_cells(h: int, w: int, cells: Sequence[Cell], color: int) -> Frame: f = _empty(h, w) for r, c in cells: if 0 <= r < h and 0 <= c < w: f[r][c] = color return f def _single_dot_sequence(rng: random.Random) -> list[Frame]: h = rng.randint(3, 7) w = rng.randint(5, 7) color = rng.choice(COLORS) if rng.random() < 0.5: cells = [(round((h - 1) * (1 - c / (w - 1))), c) for c in range(w)] else: row = rng.randrange(h) cells = [(row, c) for c in range(w)] return [_frame_from_cells(h, w, [cell], color) for cell in cells] def _growing_triangle_sequence(rng: random.Random) -> list[Frame]: h = rng.randint(4, 6) w = rng.randint(4, 6) n = rng.randint(4, min(6, w + 1)) color = rng.choice(COLORS) frames: list[Frame] = [] for k in range(1, n + 1): width = max(1, round((w * k) / n)) cells: list[Cell] = [] for r in range(h): row_fill = min(width, max(0, h - r)) for c in range(row_fill): cells.append((r, c)) frames.append(_frame_from_cells(h, w, cells, color)) return frames def _sliding_diagonal_sequence(rng: random.Random) -> list[Frame]: """"""A clean grow-to-full-diagonal-then-shrink sequence. The longest middle frame is symmetric and touches both opposite corners, avoiding the odd half-diagonal peak that looked visually arbitrary. """""" size = rng.choice([5, 7]) color = rng.choice(COLORS) frames: list[Frame] = [] for center in range(size): length = 2 * min(center, size - 1 - center) + 1 if center == size // 2: length = size start = center - length // 2 cols = range(start, start + length) cells = [(size - 1 - c, c) for c in cols] frames.append(_frame_from_cells(size, size, cells, color)) return frames def _vertical_bar_sweep_sequence(rng: random.Random) -> list[Frame]: """"""A vertical line propagates horizontally, perpendicular to its orientation."""""" h = rng.randint(4, 7) w = rng.randint(5, 7) color = rng.choice(COLORS) r0 = rng.randint(0, 1) r1 = rng.randint(h - 2, h - 1) cells_by_col = [[(r, c) for r in range(r0, r1 + 1)] for c in range(w)] return [_frame_from_cells(h, w, cells, color) for cells in cells_by_col] def _horizontal_bar_sweep_sequence(rng: random.Random) -> list[Frame]: """"""A horizontal line propagates downward, perpendicular to its orientation."""""" h = rng.randint(5, 7) w = rng.randint(4, 7) color = rng.choice(COLORS) c0 = rng.randint(0, 1) c1 = rng.randint(w - 2, w - 1) cells_by_row = [[(r, c) for c in range(c0, c1 + 1)] for r in range(h)] return [_frame_from_cells(h, w, cells, color) for cells in cells_by_row] def _center_growth_sequence(rng: random.Random) -> list[Frame]: """"""A centered shape grows outward, keeping one consistent shape family. Within a single example, all frames are either diamonds or squares; the shape type does not switch mid-sequence. """""" size = rng.choice([5, 7]) color = rng.choice(COLORS) center = size // 2 shape_kind = rng.choice([""diamond"", ""square""]) frames: list[Frame] = [] for radius in range(0, center + 1): if shape_kind == ""diamond"": cells = [ (r, c) for r in range(size) for c in range(size) if abs(r - center) + abs(c - center) <= radius ] else: cells = [ (r, c) for r in range(center - radius, center + radius + 1) for c in range(center - radius, center + radius + 1) ] frames.append(_frame_from_cells(size, size, cells, color)) return frames def _rightward_fill_sequence(rng: random.Random) -> list[Frame]: """"""A block grows by filling successive columns from left to right."""""" h = rng.randint(3, 6) w = rng.randint(5, 7) color = rng.choice(COLORS) top = rng.randint(0, 1) bottom = rng.randint(h - 2, h - 1) frames: list[Frame] = [] for upto in range(w): cells = [(r, c) for r in range(top, bottom + 1) for c in range(upto + 1)] frames.append(_frame_from_cells(h, w, cells, color)) return frames def _two_dot_cycle_sequence(rng: random.Random) -> list[Frame]: color = rng.choice(COLORS) patterns = [ [(0, 1), (2, 0)], [(0, 0), (2, 1)], [(1, 0), (2, 2)], [(1, 2), (2, 0)], [(0, 2), (2, 1)], [(0, 1), (2, 2)], ] return [_frame_from_cells(3, 3, cells, color) for cells in patterns] def _make_disordered(frames: list[Frame], rng: random.Random) -> list[Frame]: if len(frames) < 4: raise ValueError(""need at least four frames"") middle = frames[1:-1] for _ in range(200): shuffled = middle[:] rng.shuffle(shuffled) if shuffled != middle and sum(1 for a, b in zip(shuffled, middle) if a != b) >= 2: return [frames[0]] + shuffled + [frames[-1]] raise RuntimeError(""could not disorder frames"") def generate(rng: random.Random | None = None) -> dict[str, Grid]: rng = rng or random.Random() for _ in range(2000): family = rng.choices( [ _single_dot_sequence, _growing_triangle_sequence, _sliding_diagonal_sequence, _two_dot_cycle_sequence, _vertical_bar_sweep_sequence, _horizontal_bar_sweep_sequence, _center_growth_sequence, _rightward_fill_sequence, ], # Reduce the old diagonal grow/move/shrink family and add several # clearer perpendicular-motion / growth families for diversity. weights=[2, 3, 1, 1, 4, 3, 3, 3], )[0] ordered = family(rng) if len({_signature(f) for f in ordered}) != len(ordered): continue if sorted(ordered, key=_frame_sort_key) != ordered: continue if len(ordered) < 4: continue inp_frames = _make_disordered(ordered, rng) inp = _join_frames(inp_frames) out = _join_frames(ordered) if transform_t35(inp) != out: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t35 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t35 repair-frame-order task."""""" from __future__ import annotations from typing import List from generator import transform_t35 Grid = List[List[int]] def verify_t35(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t35(inp) " "t36","[{""input"":[[4,0,0,6,1,0,0,9,2,0,0,1,2,0,0,3,1,0,0,8,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,5,1,5,0,5,9,5,0,5,3,5,0,5,1,5,0,5,2,5,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,5,4,5,0,5,6,5,0,5,9,5,0,5,2,5,0,5,3,5,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,5,8,5,0,5,3,5,0,5,1,5,0,5,2,5,0,5,3,5,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,5,1,5,0,5,9,5,0,5,3,5,0,5,1,5,0,5,2,5,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,0,0,0,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,0],[0,5,1,5,0,5,8,4,4,4,4,5,0,5,4,5,0],[0,5,5,5,0,5,5,5,0,5,5,5,0,5,5,5,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t36: follow the GPS-like relative-turn instructions. Rule: - The top row contains a yellow start token, then a sequence of (location color, turn color) pairs, then a cyan end token. - The lower part of the grid is a lattice of gray 3x3 node-tiles separated by blank spacer rows/cols. Each node has a colored center. - Start at the unique yellow node center (4). Move to a neighboring node whose color matches the first location token. There is no direction token for the start node. - At each visited internal node, use the paired direction token to turn relative to the direction you were just traveling: * blue (1) = straight, * red (2) = right, * green (3) = left. - Move one edge in that new direction to the next node. The next node must match the next location token, and after the final internal node, the final turn must take you to the cyan end node (8). - In the output, the top-row instructions are deleted and the taken route is drawn in yellow as a 1-cell-thick polyline through the visited nodes and corridors. The cyan destination center remains cyan. Generation constraints used to keep examples well-formed and unambiguous: - the full instruction sequence (location + turn) yields exactly one valid path; - the first move is unambiguous: exactly one neighbor of the yellow start matches the first location color; - after that, the sequence of location colors alone yields at least two valid candidate paths, so the turn colors are actually needed; - the intended path and at least one alternative color-only path have the same start, end, and length, but differ in their turn pattern; - node colors avoid gray/yellow/cyan except for the unique start/end nodes. """""" from __future__ import annotations import json import random from typing import Dict, Iterable, List, Optional, Sequence, Tuple Grid = List[List[int]] Node = Tuple[int, int] BG = 0 BLUE = 1 # straight RED = 2 # right GREEN = 3 # left YELLOW = 4 GRAY = 5 CYAN = 8 LOC_COLORS = [1, 2, 3, 6, 7, 9] DIRS = { 'U': (-1, 0), 'R': (0, 1), 'D': (1, 0), 'L': (0, -1), } DIR_ORDER = ['U', 'R', 'D', 'L'] TURN_COLOR = {'S': BLUE, 'R': RED, 'L': GREEN} def _empty(h: int, w: int, fill: int = 0) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _neighbors(node: Node, nrows: int, ncols: int) -> list[Node]: r, c = node out: list[Node] = [] for dr, dc in DIRS.values(): nr, nc = r + dr, c + dc if 0 <= nr < nrows and 0 <= nc < ncols: out.append((nr, nc)) return out def _dir_between(a: Node, b: Node) -> str: dr = b[0] - a[0] dc = b[1] - a[1] for d, (rr, cc) in DIRS.items(): if (dr, dc) == (rr, cc): return d raise ValueError('nodes are not orthogonally adjacent') def _turn_from(prev_dir: str, next_dir: str) -> str: i = DIR_ORDER.index(prev_dir) j = DIR_ORDER.index(next_dir) diff = (j - i) % 4 if diff == 0: return 'S' if diff == 1: return 'R' if diff == 3: return 'L' raise ValueError('U-turns are not allowed in generated paths') def _apply_turn(prev_dir: str, turn_color: int) -> str: i = DIR_ORDER.index(prev_dir) if turn_color == BLUE: return prev_dir if turn_color == RED: return DIR_ORDER[(i + 1) % 4] if turn_color == GREEN: return DIR_ORDER[(i - 1) % 4] raise ValueError('invalid turn color') def _node_center(node: Node) -> tuple[int, int]: r, c = node return 3 + 4 * r, 2 + 4 * c def _parse_nodes(grid: Grid) -> tuple[int, int, dict[Node, int]]: h, w = len(grid), len(grid[0]) if (h - 2) % 4 != 0 or (w - 1) % 4 != 0: raise ValueError('grid dimensions do not match the node lattice layout') nrows = (h - 2) // 4 ncols = (w - 1) // 4 colors: dict[Node, int] = {} for r in range(nrows): for c in range(ncols): rr, cc = _node_center((r, c)) colors[(r, c)] = grid[rr][cc] return nrows, ncols, colors def _instruction_tokens(grid: Grid) -> list[int]: return [v for v in grid[0] if v != BG] def _find_unique(colors: dict[Node, int], color: int) -> Node: nodes = [node for node, v in colors.items() if v == color] if len(nodes) != 1: raise ValueError(f'expected exactly one node of color {color}, got {len(nodes)}') return nodes[0] def _count_color_only_paths(colors: dict[Node, int], nrows: int, ncols: int, start: Node, end: Node, locs: list[int]) -> int: k = len(locs) count = 0 used = {start} def dfs(node: Node, idx: int) -> None: nonlocal count if count >= 50: return if idx == k: if end in _neighbors(node, nrows, ncols) and end not in used: count += 1 return target_color = locs[idx] for nb in _neighbors(node, nrows, ncols): if nb in used or colors[nb] != target_color: continue used.add(nb) dfs(nb, idx + 1) used.remove(nb) if k == 0: return 1 if end in _neighbors(start, nrows, ncols) else 0 dfs(start, 0) return count def _first_step_is_unambiguous(colors: dict[Node, int], nrows: int, ncols: int, start: Node, first_loc: int) -> bool: """"""Exactly one adjacent node to the start matches the first location token."""""" return sum(1 for nb in _neighbors(start, nrows, ncols) if colors[nb] == first_loc) == 1 def _full_instruction_paths(colors: dict[Node, int], nrows: int, ncols: int, start: Node, end: Node, locs: list[int], turns: list[int]) -> list[list[Node]]: k = len(locs) out: list[list[Node]] = [] if k != len(turns): raise ValueError('locations and turn counts must match') if k == 0: return [[start, end]] if end in _neighbors(start, nrows, ncols) else [] for first in _neighbors(start, nrows, ncols): if colors[first] != locs[0]: continue prev_dir = _dir_between(start, first) path = [start, first] used = {start, first} cur = first ok = True for i in range(k): out_dir = _apply_turn(prev_dir, turns[i]) dr, dc = DIRS[out_dir] nxt = (cur[0] + dr, cur[1] + dc) if not (0 <= nxt[0] < nrows and 0 <= nxt[1] < ncols): ok = False break if i == k - 1: if nxt != end or nxt in used: ok = False break path.append(end) else: if nxt in used or colors[nxt] != locs[i + 1]: ok = False break path.append(nxt) used.add(nxt) prev_dir = out_dir cur = nxt if ok: out.append(path) return out def transform_t36(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError('input grid must be non-empty and rectangular') tokens = _instruction_tokens(grid) if len(tokens) < 4 or len(tokens) % 2 != 0: raise ValueError('instruction strip must have start, end, and one or more pairs') if tokens[0] != YELLOW or tokens[-1] != CYAN: raise ValueError('instruction strip must start with yellow and end with cyan') locs = tokens[1:-1:2] turns = tokens[2:-1:2] nrows, ncols, colors = _parse_nodes(grid) start = _find_unique(colors, YELLOW) end = _find_unique(colors, CYAN) candidates = _full_instruction_paths(colors, nrows, ncols, start, end, locs, turns) if len(candidates) != 1: raise ValueError(f'expected exactly one full-instruction path, got {len(candidates)}') path = candidates[0] out = [row[:] for row in grid] # Delete the instruction strip. out[0] = [BG] * len(out[0]) # Draw all but the last segment inclusive of both ends. for i in range(len(path) - 2): a = path[i] b = path[i + 1] r1, c1 = _node_center(a) r2, c2 = _node_center(b) if r1 == r2: step = 1 if c2 > c1 else -1 for c in range(c1, c2 + step, step): out[r1][c] = YELLOW else: step = 1 if r2 > r1 else -1 for r in range(r1, r2 + step, step): out[r][c1] = YELLOW # Final segment: stop just before the cyan center. if len(path) >= 2: a = path[-2] b = path[-1] r1, c1 = _node_center(a) r2, c2 = _node_center(b) if r1 == r2: step = 1 if c2 > c1 else -1 for c in range(c1, c2, step): out[r1][c] = YELLOW else: step = 1 if r2 > r1 else -1 for r in range(r1, r2, step): out[r][c1] = YELLOW out[r2][c2] = CYAN return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _random_simple_path(rng: random.Random, nrows: int, ncols: int, length_edges: int) -> Optional[list[Node]]: nodes = [(r, c) for r in range(nrows) for c in range(ncols)] start = rng.choice(nodes) path = [start] used = {start} for _ in range(length_edges): cur = path[-1] options = [nb for nb in _neighbors(cur, nrows, ncols) if nb not in used] if not options: return None nxt = rng.choice(options) path.append(nxt) used.add(nxt) return path def _all_simple_paths_of_length(start: Node, end: Node, nrows: int, ncols: int, length_edges: int, limit: int = 200) -> list[list[Node]]: out: list[list[Node]] = [] used = {start} path = [start] def dfs(node: Node, steps: int) -> None: if len(out) >= limit: return if steps == length_edges: if node == end: out.append(path[:]) return remaining = length_edges - steps # Cheap pruning by Manhattan distance. md = abs(node[0] - end[0]) + abs(node[1] - end[1]) if md > remaining or (remaining - md) % 2 != 0: return for nb in _neighbors(node, nrows, ncols): if nb in used: continue used.add(nb) path.append(nb) dfs(nb, steps + 1) path.pop() used.remove(nb) dfs(start, 0) return out def _instruction_from_path(path: list[Node], node_colors: dict[Node, int]) -> tuple[list[int], list[int], list[int]]: # returns tokens, loc sequence, turns locs = [node_colors[path[i]] for i in range(1, len(path) - 1)] turns: list[int] = [] for i in range(1, len(path) - 1): prev_dir = _dir_between(path[i - 1], path[i]) next_dir = _dir_between(path[i], path[i + 1]) turns.append(TURN_COLOR[_turn_from(prev_dir, next_dir)]) tokens = [YELLOW] for loc, turn in zip(locs, turns): tokens.extend([loc, turn]) tokens.append(CYAN) return tokens, locs, turns def _render_instance(nrows: int, ncols: int, colors: dict[Node, int], tokens: list[int]) -> Grid: h = 2 + 4 * nrows w = 1 + 4 * ncols grid = _empty(h, w, BG) # Top-row instruction strip. grid[0][0] = tokens[0] k = (len(tokens) - 2) // 2 for i in range(k): grid[0][3 + 4 * i] = tokens[1 + 2 * i] grid[0][4 + 4 * i] = tokens[2 + 2 * i] grid[0][3 + 4 * k] = tokens[-1] # Node lattice. for r in range(nrows): for c in range(ncols): top = 2 + 4 * r left = 1 + 4 * c for dc in range(3): grid[top][left + dc] = GRAY grid[top + 2][left + dc] = GRAY for dr in range(3): grid[top + dr][left] = GRAY grid[top + dr][left + 2] = GRAY grid[top + 1][left + 1] = colors[(r, c)] return grid def generate(rng: random.Random | None = None, nrows: int | None = None, ncols: int | None = None) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(10000): rr = nrows if nrows is not None else rng.randint(3, 5) cc = ncols if ncols is not None else rng.randint(3, 5) length_edges = cc # Create intended path P. P = _random_simple_path(rng, rr, cc, length_edges) if P is None: continue start, end = P[0], P[-1] # Need at least one alternative path Q of the same length between same endpoints. all_paths = _all_simple_paths_of_length(start, end, rr, cc, length_edges, limit=500) alts = [q for q in all_paths if q != P] if not alts: continue # Prefer an alternative that is internally disjoint from P for easier color assignment. disjoint_alts = [q for q in alts if set(q[1:-1]).isdisjoint(set(P[1:-1]))] Q = rng.choice(disjoint_alts if disjoint_alts else alts) # Assign node colors. colors: dict[Node, int] = {} for r in range(rr): for c in range(cc): colors[(r, c)] = rng.choice(LOC_COLORS) colors[start] = YELLOW colors[end] = CYAN internal_colors = [rng.choice(LOC_COLORS) for _ in range(1, len(P) - 1)] for i, color in enumerate(internal_colors, start=1): colors[P[i]] = color colors[Q[i]] = color tokens, locs, turns = _instruction_from_path(P, colors) # Extra safety: top strip must fit the width pattern, which is ensured by length_edges == ncols. if len(tokens) != 2 * cc: continue # Check ambiguity / uniqueness constraints. if not _first_step_is_unambiguous(colors, rr, cc, start, locs[0]): continue color_only_count = _count_color_only_paths(colors, rr, cc, start, end, locs) if color_only_count < 2: continue full_paths = _full_instruction_paths(colors, rr, cc, start, end, locs, turns) if len(full_paths) != 1 or full_paths[0] != P: continue inp = _render_instance(rr, cc, colors, tokens) try: out = transform_t36(inp) except Exception: continue if out == inp: continue return {'input': inp, 'output': out} raise RuntimeError('failed to generate a valid t36 sample') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t36 follow-GPS task."""""" from __future__ import annotations from typing import List from generator import transform_t36 Grid = List[List[int]] def verify_t36(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('ragged input grid') return transform_t36(inp) " "t37","[{""input"":[[0,0,0,0,0,1,0,0,8,9,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,4,0,0,0,0,0,0,0],[2,0,0,0,0,0,4,4,4,0,0,0,0,0,0],[0,0,0,0,0,4,4,4,4,4,0,0,0,0,0],[3,0,0,0,4,4,4,4,4,4,4,0,0,0,0],[3,0,0,4,4,4,4,4,4,4,4,4,0,0,0],[0,0,0,0,4,4,4,4,4,4,4,0,0,0,0],[2,0,0,0,0,4,4,4,4,4,0,0,0,0,0],[3,0,0,0,0,0,4,4,4,0,0,0,0,0,0],[0,0,0,0,0,0,0,4,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[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0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t37: row-wise shift with top-row recoloring markers. Rule: - The input contains a large single-color shape away from the top row and left column. - Cells in the left column mark row shifts: * red (2) means shift that row's shape cells right by 1, * green (3) means shift that row's shape cells left by 1. - Cells in the top row mark highlight colors for columns. - For a row that is shifted, every shape cell in that row moves one step in the row's marked direction. Before moving, if the cell's column has a nonzero top-row marker, its color is changed to that top-row marker color. - Shape cells on unmarked rows do not move and are not recolored. - All markers in the top row and left column are removed in the output. Generation constraints used to keep examples well-formed and unambiguous: - the shape is a connected interior blob, usually symmetric and often left clean, with a smaller fraction using light symmetric edge erosion and a minority being irregular; it is kept at least one cell away from all borders so row-shifts stay in bounds; - top-row highlight colors are chosen distinct from the shift-marker colors to reduce confusion; - every top-row highlight marker affects at least one moving shape cell; - there is at least one left-shift row and one right-shift row in most samples; - output rows remain collision-free because each marked row shifts rigidly as a whole. """""" from __future__ import annotations import json import random from collections import deque from typing import List, Sequence, Tuple Grid = List[List[int]] Mask = List[List[int]] BG = 0 RED = 2 GREEN = 3 HIGHLIGHT_COLORS = [1, 4, 5, 6, 7, 8, 9] SHAPE_COLORS = [1, 4, 5, 6, 7, 8, 9] def _empty(h: int, w: int, fill: int = 0) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _neighbors4(r: int, c: int, h: int, w: int): for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): nr, nc = r + dr, c + dc if 0 <= nr < h and 0 <= nc < w: yield nr, nc def _is_connected(mask: Mask) -> bool: h, w = len(mask), len(mask[0]) cells = [(r, c) for r in range(h) for c in range(w) if mask[r][c]] if not cells: return False q = deque([cells[0]]) seen = {cells[0]} while q: r, c = q.popleft() for nr, nc in _neighbors4(r, c, h, w): if mask[nr][nc] and (nr, nc) not in seen: seen.add((nr, nc)) q.append((nr, nc)) return len(seen) == len(cells) def _shape_rows(mask: Mask) -> list[int]: return [r for r, row in enumerate(mask) if any(row)] def _shape_cols(mask: Mask) -> list[int]: h, w = len(mask), len(mask[0]) return [c for c in range(w) if any(mask[r][c] for r in range(h))] def _postprocess_blob_mask(mask: Mask, rng: random.Random, allow_irregular: bool, apply_erosion: bool) -> Mask | None: h, w = len(mask), len(mask[0]) if sum(v for row in mask for v in row) < 12: return None # Optional light random edge erosion while preserving connectivity. For # symmetric masks, erode in mirrored pairs so the overall symmetry is preserved. if apply_erosion: candidates = [] for r in range(1, h - 1): for c in range(1, w - 1): if not mask[r][c]: continue nbrs = sum(mask[nr][nc] for nr, nc in _neighbors4(r, c, h, w)) if 1 <= nbrs <= 3: candidates.append((r, c)) rng.shuffle(candidates) remove_budget = rng.randint(1, min(6 if allow_irregular else 4, len(candidates))) if candidates else 0 used = set() for i in range(remove_budget): if i >= len(candidates): break r, c = candidates[i] if (r, c) in used: continue to_remove = [(r, c)] if not allow_irregular: mr = h - 1 - r mc = w - 1 - c mirrors = {(r, c), (mr, c), (r, mc), (mr, mc)} to_remove = [(rr, cc) for rr, cc in mirrors if 0 <= rr < h and 0 <= cc < w and mask[rr][cc]] for rr, cc in to_remove: mask[rr][cc] = 0 if not _is_connected(mask) or sum(v for row in mask for v in row) < 12: for rr, cc in to_remove: mask[rr][cc] = 1 else: used.update(to_remove) rows = _shape_rows(mask) cols = _shape_cols(mask) if len(rows) < 4 or len(cols) < 4: return None # Avoid empty rows/cols inside the occupied span becoming too fragmented. if max(rows) - min(rows) + 1 > len(rows) + 3: return None if max(cols) - min(cols) + 1 > len(cols) + 3: return None return mask def _generate_symmetric_blob_mask(rng: random.Random, h: int, w: int, apply_erosion: bool) -> Mask | None: bh = rng.randint(max(4, h // 3), max(5, min(h, h - 1))) bw = rng.randint(max(4, w // 3), max(5, min(w, w - 1))) top = rng.randint(0, h - bh) left = rng.randint(0, w - bw) cy = top + (bh - 1) / 2.0 cx = left + (bw - 1) / 2.0 ay = max(1.8, bh / rng.uniform(2.0, 2.7)) ax = max(1.8, bw / rng.uniform(2.0, 2.7)) mode = rng.choice(['ellipse', 'diamond', 'super']) mask = _empty(h, w, 0) for r in range(top, top + bh): for c in range(left, left + bw): dy = (r - cy) / ay dx = (c - cx) / ax if mode == 'ellipse': inside = dx * dx + dy * dy <= 1.0 elif mode == 'diamond': inside = abs(dx) + abs(dy) <= 1.05 else: inside = abs(dx) ** 1.6 + abs(dy) ** 1.6 <= 1.2 if inside: mask[r][c] = 1 return _postprocess_blob_mask(mask, rng, allow_irregular=False, apply_erosion=apply_erosion) def _generate_irregular_blob_mask(rng: random.Random, h: int, w: int) -> Mask | None: bh = rng.randint(max(4, h // 3), max(5, min(h, h - 1))) bw = rng.randint(max(4, w // 3), max(5, min(w, w - 1))) top = rng.randint(0, h - bh) left = rng.randint(0, w - bw) cy = top + (bh - 1) / 2.0 cx = left + (bw - 1) / 2.0 ay = max(1.8, bh / rng.uniform(2.1, 2.8)) ax = max(1.8, bw / rng.uniform(2.1, 2.8)) mode = rng.choice(['ellipse', 'diamond', 'super']) mask = _empty(h, w, 0) for r in range(top, top + bh): for c in range(left, left + bw): dy = (r - cy) / ay dx = (c - cx) / ax if mode == 'ellipse': inside = dx * dx + dy * dy <= 1.0 elif mode == 'diamond': inside = abs(dx) + abs(dy) <= 1.05 else: inside = abs(dx) ** 1.6 + abs(dy) ** 1.6 <= 1.2 if inside: mask[r][c] = 1 return _postprocess_blob_mask(mask, rng, allow_irregular=True, apply_erosion=True) def _generate_blob_mask(rng: random.Random, h: int, w: int) -> Mask: """"""Generate a connected blob inside an h x w interior canvas. About 50% of samples are clean symmetric shapes, 25% are symmetric with light edge erosion, and 25% are more irregular. """""" for _ in range(4000): p = rng.random() if p < 0.50: mask = _generate_symmetric_blob_mask(rng, h, w, apply_erosion=False) elif p < 0.75: mask = _generate_symmetric_blob_mask(rng, h, w, apply_erosion=True) else: mask = _generate_irregular_blob_mask(rng, h, w) if mask is not None: return mask raise RuntimeError('failed to generate blob mask') def transform_t37(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError('input grid must be non-empty and rectangular') h, w = len(grid), len(grid[0]) if h < 3 or w < 3: raise ValueError('grid too small') top_markers = {c: grid[0][c] for c in range(1, w) if grid[0][c] != BG} row_dirs = {} for r in range(1, h): if grid[r][0] == RED: row_dirs[r] = 1 elif grid[r][0] == GREEN: row_dirs[r] = -1 elif grid[r][0] != BG: raise ValueError('left-column markers must be red, green, or blank') out = _empty(h, w, BG) for r in range(1, h): delta = row_dirs.get(r, 0) for c in range(1, w): v = grid[r][c] if v == BG: continue # Treat every nonzero cell outside marker row/col as part of the shape. new_c = c + delta if not (1 <= new_c < w): raise ValueError('shape moved out of bounds') color = top_markers[c] if delta != 0 and c in top_markers else v out[r][new_c] = color return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _render_input(mask: Mask, shape_color: int, row_markers: dict[int, int], col_markers: dict[int, int]) -> Grid: ih, iw = len(mask), len(mask[0]) h, w = ih + 1, iw + 1 grid = _empty(h, w, BG) for c, color in col_markers.items(): grid[0][c] = color for r, color in row_markers.items(): grid[r][0] = color for r in range(ih): for c in range(iw): if mask[r][c]: grid[r + 1][c + 1] = shape_color return grid def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _ in range(5000): hh = h if h is not None else rng.randint(11, 20) ww = w if w is not None else rng.randint(11, 20) if not (8 <= hh <= 30 and 8 <= ww <= 30): continue interior_h, interior_w = hh - 1, ww - 1 # Blob generated in a cropped interior canvas to keep one-cell margin after shifting. small_mask = _generate_blob_mask(rng, interior_h - 2, interior_w - 2) mask = _empty(interior_h, interior_w, 0) for r in range(interior_h - 2): for c in range(interior_w - 2): mask[r + 1][c + 1] = small_mask[r][c] rows = _shape_rows(mask) cols = _shape_cols(mask) if len(rows) < 4 or len(cols) < 4: continue shape_color = rng.choice(SHAPE_COLORS) available_highlights = [c for c in HIGHLIGHT_COLORS if c != shape_color] # Choose marked rows among occupied rows. Prefer both directions. num_marked_rows = rng.randint(2, min(6, len(rows))) marked_rows0 = sorted(rng.sample(rows, num_marked_rows)) row_markers: dict[int, int] = {} if num_marked_rows >= 2: dirs = [RED, GREEN] for _ in range(num_marked_rows - 2): dirs.append(rng.choice([RED, GREEN])) rng.shuffle(dirs) else: dirs = [rng.choice([RED, GREEN])] for rr0, marker in zip(marked_rows0, dirs): row_markers[rr0 + 1] = marker # Columns eligible for top markers are occupied by at least one moving cell. moving_cols0 = sorted({c for r0 in marked_rows0 for c, v in enumerate(mask[r0]) if v}) if len(moving_cols0) < 1: continue num_col_markers = rng.randint(1, min(5, len(moving_cols0), len(available_highlights))) chosen_cols0 = sorted(rng.sample(moving_cols0, num_col_markers)) chosen_colors = rng.sample(available_highlights, num_col_markers) col_markers = {c0 + 1: col for c0, col in zip(chosen_cols0, chosen_colors)} # Make sure each top marker affects at least one moving cell. if not all(any(mask[r0][c0] for r0 in marked_rows0) for c0 in chosen_cols0): continue inp = _render_input(mask, shape_color, row_markers, col_markers) try: out = transform_t37(inp) except Exception: continue if out == inp: continue # Ensure at least one recolor occurs and both directions are often represented. recolor_count = sum( 1 for r0 in marked_rows0 for c0 in chosen_cols0 if mask[r0][c0] ) if recolor_count == 0: continue if RED not in row_markers.values() or GREEN not in row_markers.values(): if rng.random() < 0.8: continue return {'input': inp, 'output': out} raise RuntimeError('failed to generate a valid t37 sample') if __name__ == '__main__': print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t37 row-shift highlight task."""""" from __future__ import annotations from typing import List from generator import transform_t37 Grid = List[List[int]] def verify_t37(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError('input grid must be non-empty') w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError('ragged input grid') return transform_t37(inp) " "t38","[{""input"":[[2,0,0,0,0,0,0,0],[2,2,0,0,0,0,0,0],[8,0,2,0,0,0,0,0],[2,2,2,2,0,0,0,0],[2,0,0,0,2,0,0,0],[2,2,0,0,2,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0,0,0],[0,0,0,6,6,6,0,0,0,0,0,0,6,9,6,0,0,0,0,0,0,6,6,6,0,0,0],[0,6,0,0,6,0,0,6,0,0,6,0,0,6,0,0,6,0,0,6,0,0,6,0,0,6,0],[6,6,6,6,6,9,6,6,6,6,6,6,6,6,6,6,6,6,6,6,9,6,6,6,6,6,6]]","[[0,6,0],[6,9,9]]","{""train"":[{""input"":[[9,0,0,0,0,0,0,0,0],[9,5,9,0,0,0,0,0,0],[0,0,9,0,0,0,0,0,0],[5,0,0,9,0,0,9,0,0],[9,9,9,9,9,9,9,9,9],[0,0,9,0,0,9,0,0,9],[0,0,0,0,0,0,9,0,0],[0,0,0,0,0,0,9,5,5],[0,0,0,0,0,0,0,0,9]],""output"":[[5,0,0],[9,5,5],[0,0,9]]},{""input"":[[3,0,0,0],[3,3,0,0],[3,0,9,0],[3,3,3,3]],""output"":[[9,0],[3,3]]},{""input"":[[1,1,2,1],[0,1,0,1],[0,1,0,1],[1,0,1,0],[0,0,1,1],[0,0,0,1],[0,0,0,1],[0,0,1,0],[0,0,1,1],[0,0,0,1],[0,0,0,1],[0,0,1,0],[1,1,0,0],[0,1,0,0],[0,1,0,0],[1,0,0,0]],""output"":[[2,1],[0,1],[0,1],[1,0]]},{""input"":[[5,5,0,6,6,5,0,5,0,0,0,0,5,5,0,5],[5,0,5,5,5,0,5,5,0,0,0,0,5,0,5,5],[5,0,0,5,5,0,0,6,0,0,0,0,5,0,0,5],[5,5,5,5,5,5,5,5,0,0,0,0,6,5,6,5],[5,5,0,5,0,0,0,0,5,5,0,5,5,5,0,5],[5,0,5,5,0,0,0,0,5,0,5,5,5,0,5,5],[5,0,0,6,0,0,0,0,5,0,0,5,5,0,0,5],[6,5,5,5,0,0,0,0,6,5,5,5,5,5,6,5],[5,5,0,6,0,0,0,0,0,0,0,0,5,5,0,5],[5,0,6,5,0,0,0,0,0,0,0,0,5,0,5,5],[5,0,0,5,0,0,0,0,0,0,0,0,5,0,0,5],[5,5,5,5,0,0,0,0,0,0,0,0,5,5,5,5],[5,5,0,5,5,5,0,5,5,5,0,5,5,5,0,6],[5,0,5,5,5,0,5,5,5,0,5,5,5,0,5,5],[5,0,0,5,5,0,0,5,5,0,0,5,5,0,0,5],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,5]],""output"":[[6,5,0,6],[5,0,6,5],[5,0,0,6],[6,5,6,5]]},{""input"":[[3,3,3,5,3,3,3,3],[5,0,3,0,3,0,3,0],[3,3,0,0,3,3,0,0],[3,0,0,0,3,0,0,0],[3,3,3,3,0,0,0,0],[3,0,3,0,0,0,0,0],[3,3,0,0,0,0,0,0],[3,0,0,0,0,0,0,0]],""output"":[[3,5],[5,0]]},{""input"":[[9,0,0,0],[9,9,0,0],[9,0,0,0],[2,0,9,0],[9,9,9,9],[9,0,9,0],[9,0,0,0],[9,9,0,0],[9,0,0,0]],""output"":[[2,0],[9,9],[9,0]]},{""input"":[[0,0,0,0,0,0,0,8],[0,0,0,0,0,0,8,8],[0,0,0,0,0,2,0,8],[0,0,0,0,8,8,2,8],[0,0,0,8,0,0,0,8],[0,0,8,8,0,0,8,8],[0,8,0,8,0,8,0,8],[8,8,8,8,8,8,8,8]],""output"":[[0,2],[2,8]]},{""input"":[[5,5,5,2],[0,5,0,5],[5,0,5,0],[0,0,2,5],[0,0,0,5],[0,0,5,0],[5,5,0,0],[0,5,0,0],[5,0,0,0]],""output"":[[2,2],[0,5],[5,0]]},{""input"":[[3,0,3,3,0,0,0,0,3,0,3,3,3,0,3,3],[0,0,3,0,0,0,0,0,0,0,3,0,0,0,3,0],[0,3,3,0,0,0,0,0,0,3,3,0,0,3,3,0],[3,3,0,3,0,0,0,0,3,3,0,3,3,3,0,3],[0,0,0,0,0,0,0,0,3,0,7,3,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,3,3,0,0,0,0,0],[0,0,0,0,0,0,0,0,3,3,0,7,0,0,0,0],[0,0,0,0,3,0,3,3,3,0,3,3,0,0,0,0],[0,0,0,0,0,0,3,0,0,0,3,0,0,0,0,0],[0,0,0,0,0,3,3,0,0,3,3,0,0,0,0,0],[0,0,0,0,3,3,0,3,3,3,0,3,0,0,0,0],[3,0,3,3,3,0,3,3,0,0,0,0,3,0,3,3],[0,0,3,0,0,0,3,0,0,0,0,0,0,0,3,0],[0,3,3,0,0,3,3,0,0,0,0,0,0,3,3,0],[3,3,0,3,3,3,0,3,0,0,0,0,3,3,0,3]],""output"":[[3,0,7,3],[0,0,3,0],[0,3,3,0],[3,3,0,7]]},{""input"":[[6,4,4,4,4,4,4,4,4],[0,0,4,0,0,4,0,0,4],[0,0,0,0,0,0,4,4,4],[0,0,0,0,0,0,0,0,4]],""output"":[[6,4,4],[0,0,4]]},{""input"":[[4,4,4,4,4,4,4,4],[4,0,4,0,4,0,4,0],[4,4,0,0,4,3,0,0],[4,0,0,0,4,0,0,0],[3,4,4,4,0,0,0,0],[4,0,4,0,0,0,0,0],[4,4,0,0,0,0,0,0],[4,0,0,0,0,0,0,0]],""output"":[[3,3],[4,0]]},{""input"":[[0,0,0,2],[0,0,2,0],[0,0,2,2],[0,0,2,0],[0,2,0,0],[2,0,0,0],[2,2,0,0],[2,0,0,0],[0,2,0,2],[2,0,2,0],[2,2,2,3],[2,0,2,0],[0,3,0,0],[2,0,0,0],[2,2,0,0],[2,0,0,0]],""output"":[[0,3],[2,0],[2,3],[2,0]]},{""input"":[[8,0,8,0,0,0,8,0,8],[0,8,8,0,0,0,0,8,8],[0,0,8,0,0,0,0,0,8],[0,0,0,8,0,8,8,0,8],[0,0,0,0,8,8,0,8,8],[0,0,0,0,0,8,0,0,2],[0,0,0,0,0,0,8,0,8],[0,0,0,0,0,0,0,8,8],[0,0,0,0,0,0,0,0,8]],""output"":[[8,0,8],[0,8,8],[0,0,2]]},{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7],[0,0,0,0,0,0,0,0,0,0,0,0,0,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,2,2,0,0,0,0,0,0,0,0,0,0,4,2,0],[2,0,0,4,0,0,0,0,0,0,0,0,2,0,0,2]],""output"":[[0,4,2,0],[4,0,0,4]]},{""input"":[[3,3,3,0,3,3,3,0,3,3,3,0,0,0,0,0],[3,0,3,3,3,0,3,3,3,0,3,3,0,0,0,0],[3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0],[3,3,3,0,0,0,0,0,3,3,3,0,6,3,3,0],[3,0,3,3,0,0,0,0,3,0,3,3,3,0,3,3],[3,3,3,3,0,0,0,0,3,6,3,3,3,3,3,3],[3,3,3,0,3,3,3,0,3,3,3,0,3,3,3,0],[3,0,3,3,3,0,3,3,3,0,3,3,3,0,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,6,6,3,3]],""output"":[[6,3,3,0],[3,0,3,3],[6,6,3,3]]},{""input"":[[0,0,0,0,0,0,0,2],[0,0,0,0,0,0,2,1],[0,0,0,0,0,2,0,2],[0,0,0,0,2,2,2,2],[0,0,0,2,0,0,0,2],[0,0,2,2,0,0,2,2],[0,2,0,1,0,2,0,2],[2,2,2,2,2,2,2,2]],""output"":[[0,1],[2,1]]},{""input"":[[0,0,0,9],[0,0,9,9],[0,0,0,9],[0,9,0,9],[9,9,9,9],[0,9,0,9],[0,0,0,5],[0,0,9,9],[0,0,0,9]],""output"":[[0,5],[9,9],[0,9]]},{""input"":[[2,2,2,2],[2,0,2,0],[0,2,0,7],[2,0,2,0],[2,2,0,0],[2,0,0,0],[0,2,0,0],[2,0,0,0],[0,0,2,7],[0,0,2,0],[0,0,0,2],[0,0,2,0],[2,2,0,0],[2,0,0,0],[0,2,0,0],[2,0,0,0]],""output"":[[2,7],[2,0],[0,7],[2,0]]},{""input"":[[7,0,7,0,0,0,7,0,7,0,0,0,0,0,0,0,0,0,7,0,7,0,0,0,7,0,5],[0,7,7,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,7,7],[0,0,0,5,0,7,7,0,7,0,0,0,0,0,0,0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0,0,0,7,7,0,0,0,0],[0,0,0,0,7,0,0,0,0],[0,0,0,7,7,0,0,0,0],[7,2,7,7,7,7,0,0,0],[7,7,0,2,7,0,0,0,0],[0,7,0,0,7,0,0,0,0],[7,7,0,7,7,0,0,0,0]],""output"":[[7,2,7],[2,7,0],[0,7,0],[7,2,0]]},{""input"":[[4,4,0,4,4,0,0,0,0],[4,0,6,4,0,4,0,0,0],[4,4,0,0,0,0,6,4,0],[4,0,4,0,0,0,4,0,4]],""output"":[[6,4,0],[4,0,6]]},{""input"":[[3,0,0,0,0,0,0,0,0],[0,3,3,0,0,0,0,0,0],[0,0,0,3,0,0,4,0,0],[0,0,0,0,3,3,0,3,4]],""output"":[[4,0,0],[0,3,4]]},{""input"":[[4,0,0,0],[0,4,0,0],[0,4,0,0],[0,4,0,0],[0,0,4,0],[0,0,0,4],[0,0,0,4],[0,0,0,4],[0,0,4,0],[0,0,0,4],[0,0,0,4],[0,0,0,4],[0,0,4,0],[0,0,0,4],[0,0,0,4],[0,0,0,2]],""output"":[[4,0],[0,4],[0,4],[0,2]]}]}","""""""Generator for Test2/t38: recover the atomic template from an inverse fractal. Rule: - The input is a self-similar fractal built from a small atomic template. - The atomic template is a binary shape of size HxW. - Starting from a single filled cell, each recursion replaces every filled cell by a copy of the whole template, so after depth n the grid size is H^n x W^n. - Most occupied cells in the final fractal use a base color; a small number of occupied cells use a distinct highlight color. - The output is the atomic template itself, using the base color on occupied template cells, except that a template cell is recolored with the highlight color iff at least one highlighted input cell belongs to that template position's residue class (equivalently: has those coordinates modulo H and W). Generation constraints used to keep examples well-formed and unambiguous: - the atomic template is not all-empty or all-full, has at least two occupied cells, and has no empty rows or columns; - the chosen template is rejected if it admits multiple valid fractal factorizations under the transform used here; - highlight cells are a small minority of the occupied cells; - highlight density is coordinated with template size and fractal size so that very small highlighted template sets do not produce many repeated highlights in the input; - at least one template position is highlighted in the output; - dimensions remain within the ARC 30x30 limit. """""" from __future__ import annotations import json import random from typing import Iterable, List, Optional, Sequence, Tuple Grid = List[List[int]] Mask = List[List[int]] BG = 0 COLORS = [1, 2, 3, 4, 5, 6, 7, 8, 9] def _empty(h: int, w: int, fill: int = 0) -> Grid: return [[fill for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _nonzero_mask(grid: Grid) -> Mask: return [[1 if v != BG else 0 for v in row] for row in grid] def _mask_dims(mask: Mask) -> tuple[int, int]: return len(mask), len(mask[0]) def _mask_equal(a: Mask, b: Mask) -> bool: return a == b def _mask_block(mask: Mask, r0: int, r1: int, c0: int, c1: int) -> Mask: return [row[c0:c1] for row in mask[r0:r1]] def _mask_any(mask: Mask) -> bool: return any(v for row in mask for v in row) def _mask_occupied_positions(mask: Mask) -> list[tuple[int, int]]: return [(r, c) for r, row in enumerate(mask) for c, v in enumerate(row) if v] def _compose_fractal(template: Mask, depth: int) -> Mask: """"""Return the binary fractal mask generated from template at the given depth."""""" cur = [[1]] th, tw = _mask_dims(template) for _ in range(depth): ch, cw = _mask_dims(cur) out = _empty(ch * th, cw * tw, 0) for r in range(ch): for c in range(cw): if cur[r][c] == 0: continue for tr in range(th): for tc in range(tw): if template[tr][tc]: out[r * th + tr][c * tw + tc] = 1 cur = out return cur def _valid_decomposition_levels(mask: Mask, H: int, W: int) -> Optional[Mask]: """"""If mask is a fractal generated from some HxW template, return that template mask. More precisely, this checks whether repeated HxW decomposition yields the same top-level pattern at every level and eventually bottoms out at [[1]]. """""" h, w = _mask_dims(mask) current = [row[:] for row in mask] top_pattern: Optional[Mask] = None while True: ch, cw = _mask_dims(current) if ch == 1 and cw == 1: return top_pattern if current[0][0] == 1 else None if ch % H != 0 or cw % W != 0: return None bh, bw = ch // H, cw // W if bh < 1 or bw < 1: return None pattern = _empty(H, W, 0) rep: Optional[Mask] = None for i in range(H): for j in range(W): block = _mask_block(current, i * bh, (i + 1) * bh, j * bw, (j + 1) * bw) has = _mask_any(block) if not has: pattern[i][j] = 0 else: if rep is None: rep = block elif not _mask_equal(rep, block): return None pattern[i][j] = 1 if rep is None: return None if top_pattern is None: top_pattern = pattern elif not _mask_equal(top_pattern, pattern): return None current = rep def _infer_template_candidates(mask: Mask) -> list[tuple[int, int, Mask]]: h, w = _mask_dims(mask) out: list[tuple[int, int, Mask]] = [] for H in range(2, h + 1): for W in range(2, w + 1): template = _valid_decomposition_levels(mask, H, W) if template is None: continue out.append((H, W, template)) return out def _choose_base_and_highlight(grid: Grid) -> tuple[int, int]: nonzero = [v for row in grid for v in row if v != BG] colors = sorted(set(nonzero)) if len(colors) != 2: raise ValueError(""expected exactly two nonzero colors"") counts = {c: nonzero.count(c) for c in colors} highlight = min(colors, key=lambda c: counts[c]) base = max(colors, key=lambda c: counts[c]) if counts[highlight] >= counts[base]: raise ValueError(""highlight color must be a strict minority"") return base, highlight def transform_t38(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") base, highlight = _choose_base_and_highlight(grid) mask = _nonzero_mask(grid) candidates = _infer_template_candidates(mask) if not candidates: raise ValueError(""no valid template factorization found"") # If multiple factorizations are mathematically possible, use the smallest # atomic template. This matches the intended inverse-fractal interpretation # and the provided task examples. H, W, template = min(candidates, key=lambda x: (x[0] * x[1], x[0], x[1])) out = _empty(H, W, BG) for r, c in _mask_occupied_positions(template): out[r][c] = base for r, row in enumerate(grid): for c, v in enumerate(row): if v == highlight: rr, cc = r % H, c % W if template[rr][cc]: out[rr][cc] = highlight return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _random_template(rng: random.Random, H: int, W: int) -> Mask: for _ in range(5000): mask = [[1 if rng.random() < 0.45 else 0 for _ in range(W)] for _ in range(H)] occ = sum(v for row in mask for v in row) if occ < 2 or occ == H * W: continue # Require every row and every column to contain at least one occupied cell, # so the atomic template has no empty rows or columns. if any(sum(mask[r][c] for c in range(W)) == 0 for r in range(H)): continue if any(sum(mask[r][c] for r in range(H)) == 0 for c in range(W)): continue # Avoid degenerate single-row/col occupancy only. occ_rows = {r for r, row in enumerate(mask) for c, v in enumerate(row) if v} occ_cols = {c for r, row in enumerate(mask) for c, v in enumerate(row) if v} if len(occ_rows) == 1 or len(occ_cols) == 1: continue return mask raise RuntimeError(""failed to generate template"") def _render_colored(mask: Mask, base: int, highlight: int, highlighted_positions: set[tuple[int, int]]) -> Grid: h, w = _mask_dims(mask) out = _empty(h, w, BG) for r in range(h): for c in range(w): if not mask[r][c]: continue out[r][c] = highlight if (r, c) in highlighted_positions else base return out def _choose_output_highlight_count(template_occ_count: int, fractal_occ_count: int, depth: int, rng: random.Random) -> int: """"""Choose how many template cells are highlighted in the output. Larger fractals tend to get slightly more highlighted template positions, so tiny highlighted-template sets are less common on big inputs. """""" max_k = min(template_occ_count, max(1, template_occ_count // 2 + 1)) if fractal_occ_count >= 90 or depth >= 4: min_k = min(max_k, 3) elif fractal_occ_count >= 30 or depth >= 3: min_k = min(max_k, 2) else: min_k = 1 return rng.randint(min_k, max_k) def _highlight_leaf_positions( fractal_mask: Mask, H: int, W: int, template_occ: list[tuple[int, int]], desired_output_highlights: set[tuple[int, int]], rng: random.Random, ) -> set[tuple[int, int]]: """"""Choose a sparse set of highlighted leaf cells. Every highlighted template residue is represented at least once. For small highlighted template sets (especially 1-2 cells), avoid repeating the same residue many times across the input fractal, since that can make the template too easy to spot. """""" leaves_by_residue: dict[tuple[int, int], list[tuple[int, int]]] = {(r, c): [] for (r, c) in template_occ} fh, fw = _mask_dims(fractal_mask) for r in range(fh): for c in range(fw): if fractal_mask[r][c]: residue = (r % H, c % W) if residue in leaves_by_residue: leaves_by_residue[residue].append((r, c)) desired_list = sorted(desired_output_highlights) chosen: set[tuple[int, int]] = set() chosen_per_residue: dict[tuple[int, int], int] = {res: 0 for res in desired_list} # Ensure each desired template position gets at least one highlighted leaf. for residue in desired_list: pick = rng.choice(leaves_by_residue[residue]) chosen.add(pick) chosen_per_residue[residue] += 1 k = len(desired_list) occ_count = sum(v for row in fractal_mask for v in row) # Coordinate extra input highlights with template-highlight count and input size. if k <= 2: extras_budget = 0 per_residue_cap = 1 elif k == 3: extras_budget = rng.randint(0, 1 if occ_count < 80 else 2) per_residue_cap = 2 else: size_factor = 0 if occ_count < 40 else (1 if occ_count < 120 else 2) extras_budget = rng.randint(0, min(k - 1 + size_factor, 2 * k)) per_residue_cap = 2 if occ_count < 120 else 3 selectable = [res for res in desired_list if len(leaves_by_residue[res]) > chosen_per_residue[res]] for _ in range(extras_budget): selectable = [ res for res in desired_list if chosen_per_residue[res] < per_residue_cap and len(leaves_by_residue[res]) > chosen_per_residue[res] ] if not selectable: break residue = rng.choice(selectable) candidates = [p for p in leaves_by_residue[residue] if p not in chosen] if not candidates: continue pick = rng.choice(candidates) chosen.add(pick) chosen_per_residue[residue] += 1 return chosen def generate( rng: random.Random | None = None, template_h: int | None = None, template_w: int | None = None, depth: int | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(5000): H = template_h if template_h is not None else rng.randint(2, 4) W = template_w if template_w is not None else rng.randint(2, 4) n = depth if depth is not None else rng.randint(2, 4) if H ** n > 30 or W ** n > 30: continue template = _random_template(rng, H, W) fractal_mask = _compose_fractal(template, n) occ_count = sum(v for row in fractal_mask for v in row) template_occ = _mask_occupied_positions(template) if occ_count <= len(template_occ): continue # Choose colors. base, highlight = rng.sample(COLORS, 2) # Choose a non-empty subset of template positions to appear highlighted in the output, # coordinating this with fractal size so larger inputs tend to have somewhat richer # highlight structure. k = _choose_output_highlight_count(len(template_occ), occ_count, n, rng) desired_output_highlights = set(rng.sample(template_occ, k)) leaf_highlights = _highlight_leaf_positions(fractal_mask, H, W, template_occ, desired_output_highlights, rng) if not leaf_highlights: continue # Keep highlight color a clear minority. if len(leaf_highlights) * 3 >= occ_count * 2: # < 2/3? stronger than necessary; effectively tiny minority here continue inp = _render_colored(fractal_mask, base, highlight, leaf_highlights) out = _render_colored(template, base, highlight, desired_output_highlights) # Reject ambiguous template factorizations under the verifier. try: got = transform_t38(inp) except Exception: continue if got != out: continue candidates = _infer_template_candidates(_nonzero_mask(inp)) fh, fw = len(inp), len(inp[0]) nontrivial = [c for c in candidates if c[0] * c[1] < fh * fw] if not nontrivial: continue best_area = min(c[0] * c[1] for c in nontrivial) best = [c for c in nontrivial if c[0] * c[1] == best_area] if len(best) != 1: continue bH, bW, bT = best[0] if bH != H or bW != W or bT != template: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t38 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t38 inverse fractal template extraction."""""" from __future__ import annotations from typing import List from generator import transform_t38 Grid = List[List[int]] def verify_t38(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t38(inp) " "t39","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,3,3,3,0,0,3,3,3,0,0,3,3,3,0,0,3,3,3,0,0],[0,0,3,4,2,0,0,3,0,2,0,0,3,0,2,0,0,3,0,3,0,0],[0,0,3,2,3,0,0,3,2,3,0,0,3,2,3,0,0,3,2,3,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,3,3,3,0,0,3,3,3,0,0,3,3,3,0,0,3,2,3,0,0],[0,0,3,0,3,0,0,2,0,3,0,0,3,0,3,0,0,3,0,3,0,0],[0,0,3,2,3,0,0,3,2,3,0,0,3,2,3,0,0,3,3,3,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0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,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t39: shortest directed path across cannon-islands. Rule: - The input contains several 3x3 hollow square ""islands"" laid out on a grid. - The island borders use one outline color. - A red cell (color 2) at the midpoint of one side of an island is a one-way cannon, allowing movement from that island to the adjacent island in that direction. - One island center contains a yellow cell (color 4), the source. - One island center contains a cyan cell (color 8), the target. - Follow the unique shortest directed path from source to target. - In the output, every red cannon used on that path is recolored gray (color 5), the source center is cleared to background, and the target center is recolored yellow. Generation constraints used to keep examples well-formed and unambiguous: - islands form a complete rectangular lattice of 2..5 rows and 2..5 columns; - only valid in-bounds one-step directional cannons are used; - there is exactly one source and one target; - a path from source to target exists and the shortest directed path is unique; - generated tasks prefer nontrivial paths of length at least 2; - most islands are given at least one outgoing cannon so red markers are spread more uniformly across the lattice, making the true path less visually obvious; - most generated examples also contain at least one longer alternative directed route from source to target, so the task is not just following the only apparent non-cycling path. """""" from __future__ import annotations import json import random from collections import deque from typing import Dict, List, Tuple Grid = List[List[int]] Node = Tuple[int, int] BG = 0 RED = 2 YELLOW = 4 GRAY = 5 CYAN = 8 OUTLINE_COLORS = [1, 3, 6, 7, 9] DIRS = { 'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1), } OPPOSITE = {'U': 'D', 'D': 'U', 'L': 'R', 'R': 'L'} MID_POS = { 'U': (0, 1), 'D': (2, 1), 'L': (1, 0), 'R': (1, 2), } class Island: def __init__(self, top: int, left: int, center: int, mids: Dict[str, int]): self.top = top self.left = left self.center = center self.mids = dict(mids) def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _is_island_at(grid: Grid, r: int, c: int) -> bool: h, w = len(grid), len(grid[0]) if r + 2 >= h or c + 2 >= w: return False border_positions = [(0,0),(0,1),(0,2),(1,0),(1,2),(2,0),(2,1),(2,2)] for dr, dc in border_positions: if grid[r + dr][c + dc] == BG: return False center = grid[r + 1][c + 1] if center not in (BG, YELLOW, CYAN): return False return True def _parse_islands(grid: Grid) -> tuple[dict[Node, Island], list[int], list[int]]: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) found: list[tuple[int, int]] = [] for r in range(h - 2): for c in range(w - 2): if _is_island_at(grid, r, c): found.append((r, c)) if not found: raise ValueError(""no islands found"") # islands are separated, so every valid top-left is distinct. rows = sorted({r for r, _ in found}) cols = sorted({c for _, c in found}) islands: dict[Node, Island] = {} for r, c in found: ri = rows.index(r) ci = cols.index(c) sub = [grid[r + rr][c:c + 3] for rr in range(3)] center = sub[1][1] mids = {d: sub[dr][dc] for d, (dr, dc) in MID_POS.items()} islands[(ri, ci)] = Island(r, c, center, mids) # Validate a full rectangular lattice. for ri in range(len(rows)): for ci in range(len(cols)): if (ri, ci) not in islands: raise ValueError(""islands must form a complete rectangular lattice"") return islands, rows, cols def _graph_from_islands(islands: dict[Node, Island], nrows: int, ncols: int) -> dict[Node, list[tuple[Node, str]]]: graph: dict[Node, list[tuple[Node, str]]] = {node: [] for node in islands} for (r, c), isl in islands.items(): for d, val in isl.mids.items(): if val != RED: continue dr, dc = DIRS[d] nb = (r + dr, c + dc) if 0 <= nb[0] < nrows and 0 <= nb[1] < ncols: graph[(r, c)].append((nb, d)) return graph def _find_source_target(islands: dict[Node, Island]) -> tuple[Node, Node]: src = [node for node, isl in islands.items() if isl.center == YELLOW] tgt = [node for node, isl in islands.items() if isl.center == CYAN] if len(src) != 1 or len(tgt) != 1: raise ValueError(""expected exactly one yellow source and one cyan target"") return src[0], tgt[0] def _shortest_path_unique(graph: dict[Node, list[tuple[Node, str]]], src: Node, tgt: Node) -> tuple[list[tuple[Node, str]], bool]: dist: dict[Node, int] = {src: 0} count: dict[Node, int] = {src: 1} parent: dict[Node, tuple[Node, str]] = {} q = deque([src]) while q: u = q.popleft() for v, d in graph[u]: nd = dist[u] + 1 if v not in dist: dist[v] = nd count[v] = count[u] parent[v] = (u, d) q.append(v) elif nd == dist[v]: count[v] = min(2, count[v] + count[u]) # keep existing parent for deterministic reconstruction if needed if tgt not in dist: return [], False path: list[tuple[Node, str]] = [] cur = tgt while cur != src: prev, d = parent[cur] path.append((prev, d)) cur = prev path.reverse() return path, count[tgt] == 1 def _has_longer_alternative_path( graph: dict[Node, list[tuple[Node, str]]], src: Node, tgt: Node, shortest_len: int, max_extra: int = 6, ) -> bool: """"""Return whether there exists a simple source->target path longer than the shortest. We only search up to shortest_len + max_extra to keep generation fast. That is sufficient for generating plausible decoy routes. """""" max_len = shortest_len + max_extra def dfs(node: Node, depth: int, seen: set[Node]) -> bool: if depth > max_len: return False if node == tgt: return depth > shortest_len # Even in the best case, we can only increase length from here. If we have # already exceeded the cap, stop. for nxt, _ in graph[node]: if nxt in seen: continue seen.add(nxt) if dfs(nxt, depth + 1, seen): return True seen.remove(nxt) return False return dfs(src, 0, {src}) def transform_t39(grid: Grid) -> Grid: islands, rows, cols = _parse_islands(grid) nrows, ncols = len(rows), len(cols) graph = _graph_from_islands(islands, nrows, ncols) src, tgt = _find_source_target(islands) path, reachable_unique = _shortest_path_unique(graph, src, tgt) if not path: raise ValueError(""no directed path from source to target"") # Provided tasks / generated tasks are unique; if not unique, the generator avoids it. out = [row[:] for row in grid] # Clear source center. src_isl = islands[src] out[src_isl.top + 1][src_isl.left + 1] = BG # Recolor used cannons gray. for node, d in path: isl = islands[node] dr, dc = MID_POS[d] out[isl.top + dr][isl.left + dc] = GRAY # Recolor target center yellow. tgt_isl = islands[tgt] out[tgt_isl.top + 1][tgt_isl.left + 1] = YELLOW return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _grid_graph_neighbors(node: Node, nrows: int, ncols: int) -> list[tuple[Node, str]]: r, c = node out = [] for d, (dr, dc) in DIRS.items(): nr, nc = r + dr, c + dc if 0 <= nr < nrows and 0 <= nc < ncols: out.append(((nr, nc), d)) return out def _add_uniform_background_edges(edges: dict[Node, set[str]], nodes: list[Node], nrows: int, ncols: int, rng: random.Random) -> None: """"""Densify outgoing edges across the whole lattice for visual uniformity."""""" shuffled = nodes[:] rng.shuffle(shuffled) # First pass: give most islands at least one outgoing cannon. for node in shuffled: neighbors = _grid_graph_neighbors(node, nrows, ncols) if not neighbors: continue if len(edges[node]) == 0 and rng.random() < 0.92: # Prefer directions not directly heading toward the target path structure, to create decoys. _, d = rng.choice(neighbors) edges[node].add(d) # Second pass: many islands get a second cannon as well. rng.shuffle(shuffled) for node in shuffled: neighbors = _grid_graph_neighbors(node, nrows, ncols) available = [d for _, d in neighbors if d not in edges[node]] if not available: continue min_desired = 1 max_desired = min(3, len(neighbors)) desired = min_desired if len(neighbors) >= 2 and rng.random() < 0.68: desired = 2 if len(neighbors) >= 3 and rng.random() < 0.18: desired = 3 desired = min(desired, max_desired) while len(edges[node]) < desired and available: d = rng.choice(available) edges[node].add(d) available.remove(d) def _edge_distribution_ok(edges: dict[Node, set[str]], nrows: int, ncols: int) -> bool: nodes = [(r, c) for r in range(nrows) for c in range(ncols)] active_nodes = sum(1 for node in nodes if edges[node]) total_nodes = len(nodes) min_active_ratio = 0.60 if total_nodes <= 9 else 0.72 if active_nodes < int((total_nodes * min_active_ratio) + 0.999999): return False # Avoid visually empty rows/columns in larger lattices. if nrows >= 3: row_active = [sum(1 for c in range(ncols) if edges[(r, c)]) for r in range(nrows)] if min(row_active) < max(1, ncols // 3): return False if ncols >= 3: col_active = [sum(1 for r in range(nrows) if edges[(r, c)]) for c in range(ncols)] if min(col_active) < max(1, nrows // 3): return False return True def _render_instance(nrows: int, ncols: int, gap_r: int, gap_c: int, margin_t: int, margin_l: int, outline: int, edges: dict[Node, set[str]], src: Node, tgt: Node) -> Grid: h = margin_t * 2 + nrows * 3 + (nrows - 1) * gap_r w = margin_l * 2 + ncols * 3 + (ncols - 1) * gap_c grid = _empty(h, w) for r in range(nrows): for c in range(ncols): top = margin_t + r * (3 + gap_r) left = margin_l + c * (3 + gap_c) # outline for dc in range(3): grid[top][left + dc] = outline grid[top + 2][left + dc] = outline for dr in range(3): grid[top + dr][left] = outline grid[top + dr][left + 2] = outline # cannons for d in edges[(r, c)]: dr, dc = MID_POS[d] grid[top + dr][left + dc] = RED # centers if (r, c) == src: grid[top + 1][left + 1] = YELLOW elif (r, c) == tgt: grid[top + 1][left + 1] = CYAN return grid def generate( rng: random.Random | None = None, nrows: int | None = None, ncols: int | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(5000): rr = nrows if nrows is not None else rng.randint(2, 5) cc = ncols if ncols is not None else rng.randint(2, 5) if rr * cc < 4: # still allow 2x2 minimum; no special rejection here pass gap_r = rng.randint(1, 2) gap_c = rng.randint(1, 2) margin_t = rng.randint(1, 2) margin_l = rng.randint(1, 2) h = margin_t * 2 + rr * 3 + (rr - 1) * gap_r w = margin_l * 2 + cc * 3 + (cc - 1) * gap_c if h > 30 or w > 30: continue nodes = [(r, c) for r in range(rr) for c in range(cc)] src, tgt = rng.sample(nodes, 2) edges: dict[Node, set[str]] = {node: set() for node in nodes} # Add a guaranteed random simple path first. cur = src visited = {src} forced_path: list[tuple[Node, str]] = [] # Bias a wandering path toward tgt. for _ in range(rr * cc * 3): if cur == tgt: break choices = _grid_graph_neighbors(cur, rr, cc) # Prefer unvisited neighbors; with some probability prefer moves reducing manhattan distance. unvisited = [x for x in choices if x[0] not in visited] if not unvisited: unvisited = choices def score(item): (nr, nc), _ = item return abs(nr - tgt[0]) + abs(nc - tgt[1]) + rng.random() * 0.35 if rng.random() < 0.7: nxt, d = min(unvisited, key=score) else: nxt, d = rng.choice(unvisited) forced_path.append((cur, d)) edges[cur].add(d) cur = nxt visited.add(cur) if cur != tgt: # Finish with a direct Manhattan walk. while cur != tgt: cr, cc2 = cur if cr < tgt[0]: d = 'D' elif cr > tgt[0]: d = 'U' elif cc2 < tgt[1]: d = 'R' else: d = 'L' edges[cur].add(d) forced_path.append((cur, d)) dr, dc = DIRS[d] cur = (cur[0] + dr, cur[1] + dc) # Add extra background edges so the red markers are visually spread around the whole grid. _add_uniform_background_edges(edges, nodes, rr, cc, rng) if not _edge_distribution_ok(edges, rr, cc): continue graph = {node: [((node[0] + DIRS[d][0], node[1] + DIRS[d][1]), d) for d in sorted(edges[node])] for node in nodes} path, unique = _shortest_path_unique(graph, src, tgt) if not path or not unique: continue if len(path) < 2: continue has_alt = _has_longer_alternative_path(graph, src, tgt, len(path), max_extra=max(4, rr + cc)) # Prefer samples with at least one longer decoy path, but still allow a # minority of simpler cases for variety. if not has_alt and rng.random() < 0.8: continue outline = rng.choice(OUTLINE_COLORS) inp = _render_instance(rr, cc, gap_r, gap_c, margin_t, margin_l, outline, edges, src, tgt) try: out = transform_t39(inp) except Exception: continue if out == inp: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t39 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t39 directed island shortest path."""""" from __future__ import annotations from typing import List from generator import transform_t39 Grid = List[List[int]] def verify_t39(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t39(inp) " "t40","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,7,7,7,7,7,7,0],[0,1,1,1,1,0,7,0,0,0,0,7,0],[0,1,0,0,1,0,7,7,7,7,7,7,0],[0,1,1,1,1,0,0,3,3,3,0,0,0],[0,0,4,4,4,4,4,3,2,3,0,0,0],[0,0,4,0,0,0,4,3,2,3,0,0,0],[0,0,4,4,4,4,4,3,3,3,0,0,0],[0,0,0,0,8,8,8,8,8,0,0,0,0],[0,0,0,0,8,0,0,0,8,0,0,0,0],[0,0,0,0,8,0,0,0,8,0,0,0,0],[0,0,0,0,8,8,8,8,8,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0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3,3,3,3,3,0,0,0,0,0,0,0],[3,0,0,0,0,0,3,0,0,0,0,0,0,0],[3,0,0,0,0,0,3,0,0,0,0,0,0,0],[3,0,0,0,0,0,3,0,0,0,0,0,0,0],[3,0,0,0,0,0,3,0,0,0,0,0,0,0],[3,3,3,3,3,3,3,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t40: remove red-marked hollow blocks and unsupported blocks. Rule: - The input contains several hollow rectangular blocks. - Some blocks are marked red by filling the entire interior of the block with red cells (color 2). - In the output, every red-marked block is removed. - Then any remaining block that is no longer supported is also removed, recursively. - A block is supported if either: * its bottom edge lies on the bottom row of the grid, or * there exists at least one remaining block whose top edge is exactly one row below its bottom edge, with overlapping horizontal span. Generation constraints used to keep examples well-formed and unambiguous: - every object is a single hollow axis-aligned rectangle with size at least 3x3; - blocks do not overlap; blocks on the same level are separated by gaps; - colors are unique across blocks in generated samples to simplify perception; - the full interior of each marked block is filled red; - support relations form a layered DAG, so the cascade is unambiguous. """""" from __future__ import annotations import json import random from collections import deque from dataclasses import dataclass from typing import List, Tuple Grid = List[List[int]] BG = 0 RED = 2 USABLE_COLORS = [1, 3, 4, 5, 6, 7, 8, 9] @dataclass(frozen=True) class Block: color: int r0: int r1: int c0: int c1: int marked: bool @property def width(self) -> int: return self.c1 - self.c0 + 1 @property def height(self) -> int: return self.r1 - self.r0 + 1 def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _outline_cells(r0: int, r1: int, c0: int, c1: int) -> set[tuple[int, int]]: cells: set[tuple[int, int]] = set() for c in range(c0, c1 + 1): cells.add((r0, c)) cells.add((r1, c)) for r in range(r0, r1 + 1): cells.add((r, c0)) cells.add((r, c1)) return cells def _connected_components_of_color(grid: Grid, color: int) -> list[set[tuple[int, int]]]: h, w = len(grid), len(grid[0]) seen: set[tuple[int, int]] = set() comps: list[set[tuple[int, int]]] = [] for r in range(h): for c in range(w): if grid[r][c] != color or (r, c) in seen: continue q = deque([(r, c)]) seen.add((r, c)) comp: set[tuple[int, int]] = set() while q: rr, cc = q.popleft() comp.add((rr, cc)) for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): nr, nc = rr + dr, cc + dc if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and grid[nr][nc] == color: seen.add((nr, nc)) q.append((nr, nc)) comps.append(comp) return comps def _parse_blocks(grid: Grid) -> list[Block]: if not _rectangular(grid): raise ValueError(""grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) blocks: list[Block] = [] colors = sorted({v for row in grid for v in row if v not in (BG, RED)}) for color in colors: for comp in _connected_components_of_color(grid, color): rs = [r for r, _ in comp] cs = [c for _, c in comp] r0, r1, c0, c1 = min(rs), max(rs), min(cs), max(cs) if r1 - r0 + 1 < 3 or c1 - c0 + 1 < 3: raise ValueError(""every block must be at least 3x3"") outline = _outline_cells(r0, r1, c0, c1) if comp != outline: raise ValueError(""non-red component is not a hollow rectangle outline"") marked = any(grid[r][c] == RED for r in range(r0 + 1, r1) for c in range(c0 + 1, c1)) blocks.append(Block(color=color, r0=r0, r1=r1, c0=c0, c1=c1, marked=marked)) # Validate that every red cell lies inside exactly one block interior. red_positions = [(r, c) for r in range(h) for c in range(w) if grid[r][c] == RED] for r, c in red_positions: owners = [b for b in blocks if b.r0 < r < b.r1 and b.c0 < c < b.c1] if len(owners) != 1: raise ValueError(""every red cell must lie in the interior of exactly one block"") return blocks def _supports(lower: Block, upper: Block) -> bool: if lower.r0 != upper.r1 + 1: return False return max(lower.c0, upper.c0) <= min(lower.c1, upper.c1) def transform_t40(grid: Grid) -> Grid: blocks = _parse_blocks(grid) h, w = len(grid), len(grid[0]) removed: set[int] = {i for i, b in enumerate(blocks) if b.marked} changed = True while changed: changed = False for i, blk in enumerate(blocks): if i in removed: continue if blk.r1 == h - 1: continue # rests on ground supported = any(j not in removed and _supports(blocks[j], blk) for j in range(len(blocks)) if j != i) if not supported: removed.add(i) changed = True out = _empty(h, w) for i, blk in enumerate(blocks): if i in removed: continue for r, c in _outline_cells(blk.r0, blk.r1, blk.c0, blk.c1): out[r][c] = blk.color return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _intervals_nonoverlapping(intervals: list[tuple[int, int]]) -> bool: intervals = sorted(intervals) return all(intervals[i][1] < intervals[i + 1][0] for i in range(len(intervals) - 1)) def _choose_red_cells(blk: Block, rng: random.Random) -> list[tuple[int, int]]: del rng # marking is deterministic: mark the whole interior return [(r, c) for r in range(blk.r0 + 1, blk.r1) for c in range(blk.c0 + 1, blk.c1)] def _render_blocks(h: int, w: int, blocks: list[Block], red_cells_by_idx: dict[int, list[tuple[int, int]]]) -> Grid: grid = _empty(h, w) for idx, blk in enumerate(blocks): for r, c in _outline_cells(blk.r0, blk.r1, blk.c0, blk.c1): if grid[r][c] != BG: raise ValueError(""block overlap in render"") grid[r][c] = blk.color for r, c in red_cells_by_idx.get(idx, []): if grid[r][c] != BG: raise ValueError(""red-cell overlap in render"") grid[r][c] = RED return grid def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, num_levels: int | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(4000): hh = h if h is not None else rng.randint(12, 22) ww = w if w is not None else rng.randint(12, 24) levels = num_levels if num_levels is not None else rng.randint(2, 4) if not (6 <= hh <= 30 and 6 <= ww <= 30): continue blocks: list[Block] = [] colors = USABLE_COLORS[:] rng.shuffle(colors) color_idx = 0 # Level 0: base blocks on the ground. level_blocks: list[list[int]] = [] current_level_indices: list[int] = [] num_base = rng.randint(1, 3) x = rng.randint(0, 2) intervals: list[tuple[int, int]] = [] base_top_rows: list[int] = [] for _ in range(num_base): max_base_width = min(8, ww - x - 1) if max_base_width < 4: break width = rng.randint(4, max_base_width) height = rng.randint(3, 6) c0, c1 = x, x + width - 1 r1 = hh - 1 r0 = r1 - height + 1 if r0 < 0: break intervals.append((c0, c1)) if not _intervals_nonoverlapping(intervals): intervals.pop() break blk = Block(color=colors[color_idx], r0=r0, r1=r1, c0=c0, c1=c1, marked=False) color_idx += 1 blocks.append(blk) current_level_indices.append(len(blocks) - 1) base_top_rows.append(r0) x = c1 + rng.randint(1, 3) + 1 if x + 3 >= ww or color_idx >= len(colors): break if not current_level_indices: continue level_blocks.append(current_level_indices) # Higher levels. prev_level = current_level_indices while len(level_blocks) < levels and color_idx < len(colors): parent_top = min(blocks[i].r0 for i in prev_level) if parent_top < 4: break count_here = rng.randint(1, min(2, len(prev_level))) new_level: list[int] = [] used_intervals: list[tuple[int, int]] = [] support_groups = [] shuffled = prev_level[:] rng.shuffle(shuffled) # partition some supports into 1- or 2-block groups while shuffled and len(support_groups) < count_here: take = 1 if len(shuffled) == 1 or rng.random() < 0.65 else 2 grp = sorted(shuffled[:take], key=lambda i: blocks[i].c0) del shuffled[:take] support_groups.append(grp) for grp in support_groups: sup_r0 = min(blocks[i].r0 for i in grp) if len({blocks[i].r0 for i in grp}) != 1: continue upper_height = rng.randint(3, min(5, sup_r0 - 1)) r1 = sup_r0 - 1 r0 = r1 - upper_height + 1 if r0 < 0: continue union_c0 = min(blocks[i].c0 for i in grp) union_c1 = max(blocks[i].c1 for i in grp) max_width = min(8, union_c1 - union_c0 + 1) if max_width < 3: continue width = rng.randint(3, max_width) start_min = union_c0 start_max = union_c1 - width + 1 if start_min > start_max: continue c0 = rng.randint(start_min, start_max) c1 = c0 + width - 1 used_intervals.append((c0, c1)) if not _intervals_nonoverlapping(used_intervals): used_intervals.pop() continue blk = Block(color=colors[color_idx], r0=r0, r1=r1, c0=c0, c1=c1, marked=False) color_idx += 1 blocks.append(blk) new_level.append(len(blocks) - 1) if color_idx >= len(colors): break if not new_level: break level_blocks.append(new_level) prev_level = new_level if len(blocks) < 2: continue # Mark some blocks, preferring non-base blocks but allowing any. candidate_ids = list(range(len(blocks))) non_ground = [i for i, b in enumerate(blocks) if b.r1 < hh - 1] rng.shuffle(candidate_ids) rng.shuffle(non_ground) marked_ids: set[int] = set() if non_ground: marked_ids.add(non_ground[0]) marked_target = rng.randint(1, min(3, max(1, len(blocks) // 2))) for i in candidate_ids: if len(marked_ids) >= marked_target: break if rng.random() < 0.35: marked_ids.add(i) # Create marked versions. rendered_blocks: list[Block] = [] red_cells_by_idx: dict[int, list[tuple[int, int]]] = {} for i, b in enumerate(blocks): marked = i in marked_ids rendered_blocks.append(Block(color=b.color, r0=b.r0, r1=b.r1, c0=b.c0, c1=b.c1, marked=marked)) if marked: red_cells_by_idx[i] = _choose_red_cells(rendered_blocks[-1], rng) try: inp = _render_blocks(hh, ww, rendered_blocks, red_cells_by_idx) out = transform_t40(inp) except Exception: continue if out == inp: continue # Ensure at least one marked block is removed and, ideally, some unmarked cascade occurs. parsed = _parse_blocks(inp) initially_marked = {i for i, b in enumerate(parsed) if b.marked} remaining_out_colors = {(r, c) for r in range(hh) for c in range(ww) if out[r][c] != BG} # Count removed blocks by comparing whether any outline cell remains. removed_ids = set() for i, b in enumerate(parsed): if not any((r, c) in remaining_out_colors for r, c in _outline_cells(b.r0, b.r1, b.c0, b.c1)): removed_ids.add(i) if not initially_marked <= removed_ids: continue if len(removed_ids) < len(initially_marked): continue # Prefer examples with at least one cascade block beyond the marked set. if len(removed_ids - initially_marked) == 0 and rng.random() < 0.8: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t40 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t40 remove unsupported hollow blocks."""""" from __future__ import annotations from typing import List from generator import transform_t40 Grid = List[List[int]] def verify_t40(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t40(inp) " "t41","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,5,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,5,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,3],[0,0,0,0,5,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,5,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t41: refraction through a dotted vertical surface. Rule: - The input contains a vertical dotted gray line (color 5) and a single colored cell to its left. - The colored cell is imagined to move horizontally right, passing through the surface and ending at the far-right edge on the same row. - From the intersection point with the vertical line, a second copy moves diagonally up-right until it hits either the top edge or the right edge. - The output contains the same dotted line and exactly those two resulting colored cells on the right; the original left-side colored cell disappears. Generation constraints used to keep examples well-formed and unambiguous: - exactly one non-gray colored cell appears in the input; - all gray cells lie in one column and form an every-other-row dotted line; - the colored cell is strictly left of the line; - the chosen row is not the top row, so the diagonal copy moves at least one step to the right and yields a distinct second result cell. """""" from __future__ import annotations import json import random from typing import List, Tuple Grid = List[List[int]] Cell = Tuple[int, int] BG = 0 GRAY = 5 COLORS = [1, 2, 3, 4, 6, 7, 8, 9] def _empty(h: int, w: int, color: int = BG) -> Grid: return [[color for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _find_surface_col(grid: Grid) -> int: cols = {c for r, row in enumerate(grid) for c, v in enumerate(row) if v == GRAY} if len(cols) != 1: raise ValueError(""expected all gray cells to lie in a single column"") col = next(iter(cols)) expected_rows = list(range(0, len(grid), 2)) actual_rows = [r for r, row in enumerate(grid) if row[col] == GRAY] if actual_rows != expected_rows: raise ValueError(""gray cells must form a vertical every-other-row dotted line starting at row 0"") return col def _find_colored_cell(grid: Grid) -> tuple[int, Cell]: cells = [(r, c, v) for r, row in enumerate(grid) for c, v in enumerate(row) if v not in (BG, GRAY)] if len(cells) != 1: raise ValueError(""expected exactly one non-gray colored cell"") r, c, color = cells[0] return color, (r, c) def _diag_endpoint(start: Cell, w: int) -> Cell: r, c = start while r - 1 >= 0 and c + 1 < w: r -= 1 c += 1 return (r, c) def transform_t41(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) surf_c = _find_surface_col(grid) color, (r, c) = _find_colored_cell(grid) if c >= surf_c: raise ValueError(""colored cell must be strictly left of the surface"") out = _empty(h, w) for rr in range(0, h, 2): out[rr][surf_c] = GRAY out[r][w - 1] = color dr, dc = _diag_endpoint((r, surf_c), w) out[dr][dc] = color return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, surface_col: int | None = None, color: int | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(1000): hh = h if h is not None else rng.randint(6, 20) ww = w if w is not None else rng.randint(8, 30) if not (2 <= hh <= 30 and 4 <= ww <= 30): continue surf = surface_col if surface_col is not None else rng.randint(1, ww - 2) if not (1 <= surf <= ww - 2): continue # Need a left-side source cell and a non-top row so the diagonal branch moves. src_r = rng.randint(1, hh - 1) src_c = rng.randint(0, surf - 1) col = color if color is not None else rng.choice(COLORS) if col in (BG, GRAY): continue inp = _empty(hh, ww) for rr in range(0, hh, 2): inp[rr][surf] = GRAY inp[src_r][src_c] = col out = transform_t41(inp) # Ensure the two outputs are distinct and both are to the right of the line. positions = [(r, c) for r, row in enumerate(out) for c, v in enumerate(row) if v == col] if len(positions) != 2: continue if not all(c > surf for r, c in positions): continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t41 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t41 refraction-through-surface rule."""""" from __future__ import annotations from typing import List from generator import transform_t41 Grid = List[List[int]] def verify_t41(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t41(inp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,4,4,9],[5,2,5,2,2,9,4,9,9,4],[4,9,9,4,9,3,6,6,3,3],[4,9,4,4,9,3,6,3,3,6],[9,4,9,9,9,6,3,6,6,6],[9,4,9,9,9,6,3,6,6,6],[9,9,9,9,4,6,6,6,6,3],[4,4,4,9,4,3,3,3,6,3],[3,3,6,3,6,8,8,1,8,1],[3,6,6,3,6,8,1,1,8,1],[6,3,6,3,6,1,8,1,1,8],[3,6,3,3,3,8,1,8,8,8],[8,1,8,1,1,2,5,2,5,5],[1,8,1,1,1,5,2,5,5,5],[8,1,8,8,8,2,5,2,2,2],[8,1,8,1,8,2,2,5,2,2]],""output"":[[2,5,2,5,5,4,9,4,9,9],[2,5,5,5,5,4,9,9,9,9],[2,5,5,2,5,4,9,9,4,9],[5,5,2,2,5,9,9,4,4,9],[5,2,5,2,2,9,4,9,4,4],[4,9,9,4,9,3,6,6,3,6],[4,9,4,4,9,3,6,3,3,6],[9,4,9,9,9,6,3,6,6,6],[9,4,9,9,9,6,3,6,6,6],[9,9,9,9,4,6,6,6,6,3],[4,4,4,9,4,3,3,3,6,3],[3,3,6,3,6,8,8,1,8,1],[3,6,6,3,6,8,1,1,8,1],[6,3,6,3,6,1,8,1,8,1],[3,6,3,3,3,8,1,8,8,8],[8,1,8,1,1,2,5,2,5,5],[1,8,1,1,1,5,2,5,5,5],[8,1,8,8,8,2,5,2,2,2],[8,1,8,1,8,2,5,2,5,2]]}]}","""""""Generator for Test2/t42: correct shifted color-scheme pattern copies across sections. Rule: - The grid is split into equal left/right halves. - It is also split into several horizontal sections. - In each section, the left half contains a two-color pattern. - The right half should contain the *same pattern* but recolored using the two colors from the section below (wrapping from bottom to top), except that a small number of cells are incorrect. - The output is the full grid with those right-half mistakes corrected. Generation constraints used to keep examples well-formed and unambiguous: - each section's left half uses exactly two colors, and every row in the section contains both colors, so the section boundaries are recoverable; - adjacent sections use different unordered color pairs; - the right half of each section uses exactly the next section's color pair; - mistakes are sparse and are only flips between the two colors of that right section; - section sizes and half-widths vary, but the total grid stays within ARC size limits. """""" from __future__ import annotations import json import random from typing import List, Sequence Grid = List[List[int]] BG = 0 COLORS = list(range(1, 10)) class Section: def __init__(self, start: int, end: int, colors: tuple[int, int]): self.start = start self.end = end self.colors = colors @property def height(self) -> int: return self.end - self.start def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _group_sections_from_left(grid: Grid) -> list[Section]: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) if w % 2 != 0: raise ValueError(""grid width must be even"") half = w // 2 row_sets: list[set[int]] = [] for r in range(h): colors = set(grid[r][:half]) if not (1 <= len(colors) <= 2): raise ValueError(""each left-half row must use one or two colors"") row_sets.append(colors) sections: list[Section] = [] start = 0 while start < h: union = set(row_sets[start]) end = start + 1 while end < h and len(union | row_sets[end]) <= 2: union |= row_sets[end] end += 1 if len(union) != 2: raise ValueError(""each section must use exactly two colors in total"") sections.append(Section(start, end, tuple(sorted(union)))) start = end if len(sections) < 2: raise ValueError(""expected at least two sections"") return sections def _render_pattern(bits: list[list[int]], colors: tuple[int, int]) -> Grid: a, b = colors return [[a if bit == 0 else b for bit in row] for row in bits] def _section_bits_from_left(grid: Grid, section: Section) -> list[list[int]]: half = len(grid[0]) // 2 a, b = section.colors bits: list[list[int]] = [] for r in range(section.start, section.end): row_bits: list[int] = [] for v in grid[r][:half]: if v == a: row_bits.append(0) elif v == b: row_bits.append(1) else: raise ValueError(""left-half row uses a color outside its section pair"") bits.append(row_bits) return bits def _hamming(a: Grid, b: Grid) -> int: return sum(1 for ra, rb in zip(a, b) for va, vb in zip(ra, rb) if va != vb) def transform_t42(grid: Grid) -> Grid: sections = _group_sections_from_left(grid) w = len(grid[0]) half = w // 2 out = [row[:] for row in grid] for i, section in enumerate(sections): bits = _section_bits_from_left(grid, section) target_colors = sections[(i + 1) % len(sections)].colors cand1 = _render_pattern(bits, target_colors) cand2 = _render_pattern(bits, (target_colors[1], target_colors[0])) actual = [grid[r][half:] for r in range(section.start, section.end)] if _hamming(cand1, actual) <= _hamming(cand2, actual): corrected = cand1 else: corrected = cand2 for rr, r in enumerate(range(section.start, section.end)): out[r][half:] = corrected[rr] return out # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _random_binary_pattern(rng: random.Random, h: int, w: int) -> list[list[int]]: for _ in range(2000): bits = [[1 if rng.random() < 0.5 else 0 for _ in range(w)] for _ in range(h)] # Every row uses both colors so row-wise section detection is easy. if any(len(set(row)) != 2 for row in bits): continue # Avoid trivially repetitive patterns. if len({tuple(row) for row in bits}) == 1: continue if len({bits[r][c] for r in range(h) for c in range(w)}) != 2: continue return bits raise RuntimeError(""failed to generate a nontrivial binary pattern"") def _flip_cells(grid: Grid, colors: tuple[int, int], num_flips: int, rng: random.Random) -> Grid: a, b = colors out = [row[:] for row in grid] cells = [(r, c) for r in range(len(grid)) for c in range(len(grid[0]))] rng.shuffle(cells) for r, c in cells[:num_flips]: out[r][c] = b if out[r][c] == a else a return out def generate( rng: random.Random | None = None, num_sections: int | None = None, half_width: int | None = None, section_heights: Sequence[int] | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(2000): n = num_sections if num_sections is not None else rng.randint(2, 4) if not (2 <= n <= 4): continue hw = half_width if half_width is not None else rng.randint(4, 8) if hw < 2: continue if section_heights is not None: heights = list(section_heights) if len(heights) != n: continue else: heights = [rng.randint(3, 6) for _ in range(n)] total_h = sum(heights) if total_h > 30 or 2 * hw > 30: continue pool = COLORS[:] rng.shuffle(pool) if 2 * n > len(pool): continue section_pairs: list[tuple[int, int]] = [] for i in range(n): section_pairs.append((pool[2 * i], pool[2 * i + 1])) left_sections: list[Grid] = [] for sec_h in heights: left_sections.append(_random_binary_pattern(rng, sec_h, hw)) inp: Grid = [] for i in range(n): left = _render_pattern(left_sections[i], section_pairs[i]) target_pair = section_pairs[(i + 1) % n] right_clean = _render_pattern(left_sections[i], target_pair) area = heights[i] * hw max_flips = max(1, min(3, area // 5)) flips = rng.randint(1, max_flips) right = _flip_cells(right_clean, target_pair, flips, rng) for lrow, rrow in zip(left, right): inp.append(lrow + rrow) out = transform_t42(inp) if out == inp: continue sections = _group_sections_from_left(inp) half = len(inp[0]) // 2 if not all( any(inp[r][half + c] != out[r][half + c] for r in range(sec.start, sec.end) for c in range(hw)) for sec in sections ): continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t42 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t42 shifted section-pattern correction."""""" from __future__ import annotations from typing import List from generator import transform_t42 Grid = List[List[int]] def verify_t42(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t42(inp) " "t43","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,6,6,6,6,0,0,0,0,0,0],[0,0,6,6,6,6,0,0,0,0,0,0],[0,0,6,6,3,3,3,3,3,3,0,0],[0,0,6,6,3,3,3,3,3,3,0,0],[0,0,6,6,3,3,3,3,3,3,0,0],[0,0,0,0,3,3,3,3,3,3,0,0],[0,0,0,0,3,3,3,3,3,3,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,6,6,6,6,0,0,0,0,0,0],[0,0,6,6,6,6,0,0,0,0,0,0],[0,0,6,6,6,6,3,3,3,3,0,0],[0,0,6,6,6,6,3,3,3,3,0,0],[0,0,6,6,6,6,3,3,3,3,0,0],[0,0,0,0,3,3,3,3,3,3,0,0],[0,0,0,0,3,3,3,3,3,3,0,0],[0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,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,1,1,1,0],[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0],[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0],[0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,9,0],[0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,9,0],[0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,9,0],[0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,9,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t43: reverse the front-to-back occlusion order of objects. Rule: - The input shows several recognizable objects stacked/occluding one another. - Their front-to-back order is uniquely identifiable from the visible overlaps. - Reconstruct each full object, then reverse the depth order: the previous backmost object becomes frontmost, and the previous frontmost object becomes backmost. Generation constraints used to keep examples well-formed and unambiguous: - objects come from recognizable families: filled rectangles, rectangle outlines, straight lines, filled diamonds, plus/cross shapes, and exact masks; - hidden parts of an object occur only beneath another non-background object; - the overlap graph induces a unique front-to-back order; - there is at least one true overlap/occlusion; - generated samples reject side-touching-only contacts that can look like mere adjacency rather than occlusion. """""" from __future__ import annotations import json import random from collections import defaultdict, deque from typing import List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] Mask = Set[Cell] BG = 0 COLORS = list(range(1, 10)) NEI4 = [(1, 0), (-1, 0), (0, 1), (0, -1)] def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _visible_cells_by_color(grid: Grid) -> dict[int, Mask]: out: dict[int, Mask] = defaultdict(set) for r, row in enumerate(grid): for c, v in enumerate(row): if v != BG: out[v].add((r, c)) return dict(out) def _bbox(cells: Mask) -> tuple[int, int, int, int]: rs = [r for r, _ in cells] cs = [c for _, c in cells] return min(rs), max(rs), min(cs), max(cs) def _bbox_cells(min_r: int, max_r: int, min_c: int, max_c: int) -> Mask: return {(r, c) for r in range(min_r, max_r + 1) for c in range(min_c, max_c + 1)} def _rect_outline_cells(min_r: int, max_r: int, min_c: int, max_c: int) -> Mask: cells: Mask = set() for c in range(min_c, max_c + 1): cells.add((min_r, c)) cells.add((max_r, c)) for r in range(min_r, max_r + 1): cells.add((r, min_c)) cells.add((r, max_c)) return cells def _diamond_cells(min_r: int, max_r: int, min_c: int, max_c: int) -> Mask: if (max_r - min_r) % 2 != 0 or (max_c - min_c) % 2 != 0: return set() cr = (min_r + max_r) // 2 cc = (min_c + max_c) // 2 radius_r = max_r - cr radius_c = max_c - cc if radius_r != radius_c: return set() rad = radius_r return { (r, c) for r in range(min_r, max_r + 1) for c in range(min_c, max_c + 1) if abs(r - cr) + abs(c - cc) <= rad } def _plus_cells(min_r: int, max_r: int, min_c: int, max_c: int) -> Mask: h = max_r - min_r + 1 w = max_c - min_c + 1 if h < 3 or w < 3: return set() center_rows = {min_r + h // 2} if h % 2 else {min_r + h // 2 - 1, min_r + h // 2} center_cols = {min_c + w // 2} if w % 2 else {min_c + w // 2 - 1, min_c + w // 2} return { (r, c) for r in range(min_r, max_r + 1) for c in range(min_c, max_c + 1) if r in center_rows or c in center_cols } def _right_triangle_outline_cells(min_r: int, max_r: int, min_c: int, max_c: int, orientation: str) -> Mask: """"""Return a square right-triangle outline. Orientations identify the right-angle corner: tl, tr, bl, br. """""" height = max_r - min_r width = max_c - min_c if height != width or height < 2: return set() cells: Mask = set() if orientation == ""tl"": for c in range(min_c, max_c + 1): cells.add((min_r, c)) for r in range(min_r, max_r + 1): cells.add((r, min_c)) cells.add((r, max_c - (r - min_r))) elif orientation == ""tr"": for c in range(min_c, max_c + 1): cells.add((min_r, c)) for r in range(min_r, max_r + 1): cells.add((r, max_c)) cells.add((r, min_c + (r - min_r))) elif orientation == ""bl"": for c in range(min_c, max_c + 1): cells.add((max_r, c)) for r in range(min_r, max_r + 1): cells.add((r, min_c)) cells.add((r, min_c + (max_r - r))) elif orientation == ""br"": for c in range(min_c, max_c + 1): cells.add((max_r, c)) for r in range(min_r, max_r + 1): cells.add((r, max_c)) cells.add((r, max_c - (max_r - r))) else: raise ValueError(orientation) return cells def _extras_are_occluded(mask: Mask, visible: Mask, nonzero: Mask) -> bool: return visible <= mask and (mask - visible) <= (nonzero - visible) def _touches_all_bbox_sides(visible: Mask, min_r: int, max_r: int, min_c: int, max_c: int) -> bool: return ( any(r == min_r for r, _ in visible) and any(r == max_r for r, _ in visible) and any(c == min_c for _, c in visible) and any(c == max_c for _, c in visible) ) def _infer_mask_for_color(visible: Mask, nonzero: Mask) -> Mask: min_r, max_r, min_c, max_c = _bbox(visible) candidates: list[tuple[int, int, str, Mask]] = [] def add(priority: int, name: str, mask: Mask) -> None: if mask and _extras_are_occluded(mask, visible, nonzero): candidates.append((priority, len(mask - visible), name, mask)) if min_r == max_r or min_c == max_c: add(0, ""line"", _bbox_cells(min_r, max_r, min_c, max_c)) rect = _bbox_cells(min_r, max_r, min_c, max_c) if _touches_all_bbox_sides(visible, min_r, max_r, min_c, max_c): add(1, ""filled_rect"", rect) outline = _rect_outline_cells(min_r, max_r, min_c, max_c) if visible <= outline and _touches_all_bbox_sides(visible, min_r, max_r, min_c, max_c): add(1, ""rect_outline"", outline) # Filled diamond. Try the visible bounding box and small one-cell expansions, # since an extremal diamond cell can be hidden by a front object. for er0 in range(max(0, min_r - 1), min_r + 1): for er1 in range(max_r, max_r + 2): for ec0 in range(max(0, min_c - 1), min_c + 1): for ec1 in range(max_c, max_c + 2): diamond = _diamond_cells(er0, er1, ec0, ec1) if diamond and visible <= diamond: add(1, ""diamond"", diamond) plus = _plus_cells(min_r, max_r, min_c, max_c) if plus and visible <= plus and _touches_all_bbox_sides(visible, min_r, max_r, min_c, max_c): add(1, ""plus"", plus) # Right-triangle outlines. These cover examples where an object is a # recognizable triangular outline, with one leg and the diagonal partly # hidden by objects in front. for er0 in range(max(0, min_r - 1), min_r + 1): for er1 in range(max_r, max_r + 2): for ec0 in range(max(0, min_c - 1), min_c + 1): for ec1 in range(max_c, max_c + 2): for orient in (""tl"", ""tr"", ""bl"", ""br""): tri = _right_triangle_outline_cells(er0, er1, ec0, ec1, orient) if tri and visible <= tri: add(1, ""right_triangle"", tri) add(9, ""exact"", set(visible)) if not candidates: raise ValueError(""could not infer a recognizable object mask"") candidates.sort(key=lambda x: (x[0], x[1], x[2])) return set(candidates[0][3]) def _infer_masks(grid: Grid) -> dict[int, Mask]: by_color = _visible_cells_by_color(grid) nonzero = set().union(*by_color.values()) if by_color else set() return {color: _infer_mask_for_color(cells, nonzero) for color, cells in by_color.items()} def _front_order(grid: Grid, masks: dict[int, Mask]) -> list[int]: visible = _visible_cells_by_color(grid) colors = sorted(masks) edges: dict[int, set[int]] = {c: set() for c in colors} indeg = {c: 0 for c in colors} for front_color, cells in visible.items(): for cell in cells: for back_color, mask in masks.items(): if back_color != front_color and cell in mask: if back_color not in edges[front_color]: edges[front_color].add(back_color) indeg[back_color] += 1 order: list[int] = [] ready = sorted([c for c in colors if indeg[c] == 0]) while ready: c = ready.pop(0) order.append(c) for nb in sorted(edges[c]): indeg[nb] -= 1 if indeg[nb] == 0: ready.append(nb) ready.sort() if len(order) != len(colors): raise ValueError(""occlusion order contains a cycle"") return order def _overlap_size(mask_a: Mask, mask_b: Mask) -> int: return len(mask_a & mask_b) def _touching_nonoverlap(mask_a: Mask, mask_b: Mask) -> bool: """"""Return True if two masks side-touch without overlapping. Such contacts are visually ambiguous in this task because they can look like either simple adjacency or an occluded edge. """""" if mask_a & mask_b: return False for r, c in mask_a: for dr, dc in NEI4: if (r + dr, c + dc) in mask_b: return True return False def _adjacent_visible_color_pairs(grid: Grid) -> set[tuple[int, int]]: h, w = len(grid), len(grid[0]) pairs: set[tuple[int, int]] = set() for r in range(h): for c in range(w): a = grid[r][c] if a == BG: continue for dr, dc in ((1, 0), (0, 1)): nr, nc = r + dr, c + dc if 0 <= nr < h and 0 <= nc < w: b = grid[nr][nc] if b != BG and b != a: pairs.add(tuple(sorted((a, b)))) return pairs def _has_ambiguous_contacts(inp: Grid, masks: dict[int, Mask]) -> bool: """"""Heuristic filter for ambiguity. Reject cases where two different objects are visibly side-adjacent but their full masks never overlap. Those are the examples most likely to read as mere touching rather than one object covering another. Also reject very weak overlaps (single-cell intersections) when the pair is visibly adjacent. """""" for a, b in _adjacent_visible_color_pairs(inp): ma, mb = masks[a], masks[b] ov = _overlap_size(ma, mb) if ov <= 1: return True for colors in [(a, b) for a in masks for b in masks if a < b]: a, b = colors if _touching_nonoverlap(masks[a], masks[b]): return True return False def _render(h: int, w: int, masks: dict[int, Mask], paint_order: Sequence[int]) -> Grid: grid = _empty(h, w) for color in paint_order: for r, c in masks[color]: if 0 <= r < h and 0 <= c < w: grid[r][c] = color return grid def transform_t43(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) masks = _infer_masks(grid) # `order` is front-to-back in the input. Painting in that order reverses # the stack because later-painted objects become frontmost. order = _front_order(grid, masks) return _render(h, w, masks, order) # --------------------------------------------------------------------------- # Generator # --------------------------------------------------------------------------- def _make_filled_rect(r0: int, c0: int, h: int, w: int) -> Mask: return {(r, c) for r in range(r0, r0 + h) for c in range(c0, c0 + w)} def _make_rect_outline(r0: int, c0: int, h: int, w: int) -> Mask: return _rect_outline_cells(r0, r0 + h - 1, c0, c0 + w - 1) def _make_line_horizontal(r: int, c0: int, length: int) -> Mask: return {(r, c) for c in range(c0, c0 + length)} def _make_line_vertical(c: int, r0: int, length: int) -> Mask: return {(r, c) for r in range(r0, r0 + length)} def _make_diamond(cr: int, cc: int, radius: int) -> Mask: return { (r, c) for r in range(cr - radius, cr + radius + 1) for c in range(cc - radius, cc + radius + 1) if abs(r - cr) + abs(c - cc) <= radius } def _random_mask(rng: random.Random, h: int, w: int, kind: str) -> Mask: if kind == ""filled_rect"": rh = rng.randint(3, max(3, min(7, h - 2))) rw = rng.randint(3, max(3, min(8, w - 2))) return _make_filled_rect(rng.randint(1, h - rh - 1), rng.randint(1, w - rw - 1), rh, rw) if kind == ""rect_outline"": rh = rng.randint(5, max(5, min(10, h - 2))) rw = rng.randint(5, max(5, min(10, w - 2))) return _make_rect_outline(rng.randint(1, h - rh - 1), rng.randint(1, w - rw - 1), rh, rw) if kind == ""hline"": length = rng.randint(6, max(6, w - 2)) return _make_line_horizontal(rng.randint(1, h - 2), rng.randint(0, w - length), length) if kind == ""vline"": length = rng.randint(6, max(6, h - 2)) return _make_line_vertical(rng.randint(1, w - 2), rng.randint(0, h - length), length) if kind == ""diamond"": rad = rng.randint(2, max(2, min(4, (h - 3) // 2, (w - 3) // 2))) return _make_diamond(rng.randint(rad + 1, h - rad - 2), rng.randint(rad + 1, w - rad - 2), rad) raise ValueError(kind) def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, num_objects: int | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(8000): hh = h if h is not None else rng.randint(12, 22) ww = w if w is not None else rng.randint(12, 22) n = num_objects if num_objects is not None else rng.randint(2, 4) if n < 2: continue colors = rng.sample(COLORS, n) kind_pool = [""filled_rect"", ""rect_outline"", ""hline"", ""vline"", ""diamond""] kinds = [rng.choice(kind_pool) for _ in range(n)] masks: dict[int, Mask] = {} ok = True for color, kind in zip(colors, kinds): try: masks[color] = _random_mask(rng, hh, ww, kind) except Exception: ok = False break if not ok: continue back_to_front = colors[:] rng.shuffle(back_to_front) # Require overlaps and visibility for all objects. overlap_pairs = 0 for i in range(n): for j in range(i + 1, n): if masks[colors[i]] & masks[colors[j]]: overlap_pairs += 1 if overlap_pairs < n - 1: continue inp = _render(hh, ww, masks, back_to_front) if _has_ambiguous_contacts(inp, masks): continue visible = _visible_cells_by_color(inp) if set(visible) != set(colors): continue try: inferred_masks = _infer_masks(inp) if inferred_masks != masks: continue out = transform_t43(inp) except Exception: continue expected = _render(hh, ww, masks, list(reversed(back_to_front))) if out != expected: continue if out == inp: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t43 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t43 reverse occlusion order rule."""""" from __future__ import annotations from typing import List from generator import transform_t43 Grid = List[List[int]] def verify_t43(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t43(inp) " "t44","[{""input"":[[0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,0,0],[0,0,7,0,0,0,0,0,0,0,0,0,0,0,7,0,0],[0,0,7,0,5,5,5,5,5,5,5,5,5,0,7,0,0],[0,0,7,0,5,0,0,0,0,0,0,0,5,0,7,0,0],[0,0,7,0,5,0,4,4,4,4,4,0,5,0,7,0,0],[0,0,7,0,5,0,4,0,0,0,4,0,5,0,7,0,0],[0,0,7,0,0,0,4,0,1,0,0,0,5,0,7,0,0],[0,0,7,0,5,0,4,0,0,0,4,0,5,0,7,0,0],[0,0,7,0,5,0,4,4,4,4,4,0,5,0,7,0,0],[0,0,7,0,5,0,0,0,0,0,0,0,5,0,7,0,0],[0,0,7,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,8,0,0,0,8,0,5,0,3,0,1,0],[0,0,0,0,0,0,3,0,5,0,8,0,4,0,8,0,0,0,3,0,1,0],[0,0,0,0,1,0,3,0,5,0,8,0,0,0,8,0,5,0,3,0,1,0],[0,0,0,0,1,0,3,0,5,0,8,8,0,8,8,0,5,0,3,0,1,0],[0,0,0,0,1,0,3,0,5,0,0,0,0,0,0,0,5,0,3,0,1,0],[0,0,0,0,1,0,3,0,5,5,5,5,5,5,5,5,5,0,3,0,1,0],[0,0,0,0,1,0,3,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0],[0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,0,1,0],[0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0],[0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[8,8,0],[5,5,5],[0,0,0],[1,0,0]]}]}","""""""Generator for Test2/t44: count rotations needed to align outline gaps. Rule: - The input has two cells of one marker color: one at the center of a nest of concentric square outlines, and one on the grid edge aligned horizontally or vertically with the center. - Each square outline has exactly one gap at the midpoint of one side. - Starting from the innermost outline and moving outward, count how many clockwise 90-degree rotations are needed to move that outline's gap to the side facing the edge marker / clear path. - The output has width 3 and one row per outline. A count n in {0,1,2,3} is encoded by filling the first n cells of the row with that outline's color. Generation constraints used to keep examples well-formed and unambiguous: - exactly one marker color appears exactly twice, once at the center and once on an aligned edge; - every outline is a square border centered on the center marker; - every outline has exactly one midpoint-side gap; - outlines are sorted by radius from inner to outer; - same-colored outlines are not adjacent/merged into one component. """""" from __future__ import annotations import json import random from collections import deque from typing import Iterable, List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] BG = 0 COLORS = list(range(1, 10)) NEI4 = [(-1, 0), (1, 0), (0, -1), (0, 1)] SIDE_TO_INDEX = {""top"": 0, ""right"": 1, ""bottom"": 2, ""left"": 3} INDEX_TO_SIDE = {v: k for k, v in SIDE_TO_INDEX.items()} def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _is_edge(cell: Cell, h: int, w: int) -> bool: r, c = cell return r == 0 or c == 0 or r == h - 1 or c == w - 1 def _find_markers(grid: Grid) -> tuple[int, Cell, Cell, str]: """"""Return marker color, center cell, edge cell, and target side."""""" h, w = len(grid), len(grid[0]) by_color: dict[int, list[Cell]] = {} for r in range(h): for c in range(w): v = grid[r][c] if v != BG: by_color.setdefault(v, []).append((r, c)) candidates: list[tuple[int, Cell, Cell, str]] = [] for color, cells in by_color.items(): if len(cells) != 2: continue edge_cells = [p for p in cells if _is_edge(p, h, w)] center_cells = [p for p in cells if not _is_edge(p, h, w)] if len(edge_cells) != 1 or len(center_cells) != 1: continue edge = edge_cells[0] center = center_cells[0] if edge[0] == center[0]: target = ""left"" if edge[1] < center[1] else ""right"" elif edge[1] == center[1]: target = ""top"" if edge[0] < center[0] else ""bottom"" else: continue candidates.append((color, center, edge, target)) if len(candidates) != 1: raise ValueError(""expected exactly one aligned center/edge marker pair"") return candidates[0] def _components(grid: Grid, exclude_color: int) -> list[tuple[int, set[Cell]]]: h, w = len(grid), len(grid[0]) seen: set[Cell] = set() comps: list[tuple[int, set[Cell]]] = [] for r in range(h): for c in range(w): color = grid[r][c] if color in (BG, exclude_color) or (r, c) in seen: continue q = deque([(r, c)]) seen.add((r, c)) cells: set[Cell] = set() while q: rr, cc = q.popleft() cells.add((rr, cc)) for dr, dc in NEI4: nr, nc = rr + dr, cc + dc if ( 0 <= nr < h and 0 <= nc < w and (nr, nc) not in seen and grid[nr][nc] == color ): seen.add((nr, nc)) q.append((nr, nc)) comps.append((color, cells)) return comps def _border_cells(center: Cell, radius: int) -> set[Cell]: cr, cc = center cells: set[Cell] = set() for c in range(cc - radius, cc + radius + 1): cells.add((cr - radius, c)) cells.add((cr + radius, c)) for r in range(cr - radius, cr + radius + 1): cells.add((r, cc - radius)) cells.add((r, cc + radius)) return cells def _gap_side(center: Cell, gap: Cell, radius: int) -> str: cr, cc = center r, c = gap if r == cr - radius and c == cc: return ""top"" if r == cr and c == cc + radius: return ""right"" if r == cr + radius and c == cc: return ""bottom"" if r == cr and c == cc - radius: return ""left"" raise ValueError(""gap is not at the midpoint of a side"") def _parse_outlines(grid: Grid, marker_color: int, center: Cell) -> list[tuple[int, int, str]]: """"""Return outline tuples (radius, color, gap_side), sorted inner to outer."""""" outlines: list[tuple[int, int, str]] = [] for color, cells in _components(grid, marker_color): rows = [r for r, _ in cells] cols = [c for _, c in cells] min_r, max_r = min(rows), max(rows) min_c, max_c = min(cols), max(cols) cr, cc = center if (min_r + max_r) != 2 * cr or (min_c + max_c) != 2 * cc: raise ValueError(""outline is not centered on marker"") radius = max_r - cr if radius <= 0 or radius != cr - min_r or radius != max_c - cc or radius != cc - min_c: raise ValueError(""outline bounding box is not a centered square"") border = _border_cells(center, radius) if not cells <= border: raise ValueError(""outline contains cells away from its square border"") missing = border - cells if len(missing) != 1: raise ValueError(""each outline must have exactly one gap"") side = _gap_side(center, next(iter(missing)), radius) outlines.append((radius, color, side)) if not outlines: raise ValueError(""expected at least one outline"") outlines.sort(key=lambda x: x[0]) if len({r for r, _, _ in outlines}) != len(outlines): raise ValueError(""each outline must have a distinct radius"") return outlines def _count_rotations(gap_side: str, target_side: str) -> int: return (SIDE_TO_INDEX[target_side] - SIDE_TO_INDEX[gap_side]) % 4 def transform_t44(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") marker_color, center, _edge, target_side = _find_markers(grid) outlines = _parse_outlines(grid, marker_color, center) out: Grid = [] for _radius, color, gap in outlines: n = _count_rotations(gap, target_side) out.append([color if c < n else BG for c in range(3)]) return out def _draw_outline(grid: Grid, center: Cell, radius: int, color: int, gap_side: str) -> None: cells = _border_cells(center, radius) cr, cc = center gap_by_side = { ""top"": (cr - radius, cc), ""right"": (cr, cc + radius), ""bottom"": (cr + radius, cc), ""left"": (cr, cc - radius), } gap = gap_by_side[gap_side] for r, c in cells: if (r, c) != gap: grid[r][c] = color def _edge_for_direction(center: Cell, h: int, w: int, target_side: str) -> Cell: r, c = center if target_side == ""top"": return (0, c) if target_side == ""bottom"": return (h - 1, c) if target_side == ""left"": return (r, 0) if target_side == ""right"": return (r, w - 1) raise ValueError(target_side) def generate( rng: random.Random | None = None, num_outlines: int | None = None, target_side: str | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(1000): n = num_outlines if num_outlines is not None else rng.randint(3, 6) target = target_side if target_side is not None else rng.choice([""top"", ""right"", ""bottom"", ""left""]) if target not in SIDE_TO_INDEX: raise ValueError(""target_side must be top/right/bottom/left"") # Use step 1 or 2 between radii; step 2 gives visually separated rings. step = rng.choice([1, 2]) start_radius = rng.randint(1, 2) radii = [start_radius + step * i for i in range(n)] max_r = radii[-1] margin_before = rng.randint(1, 3) margin_after = rng.randint(1, 3) if target in (""top"", ""bottom""): h = max_r + 1 + max_r + margin_before + margin_after + 1 center_r = margin_before + max_r w = 2 * max_r + 1 + rng.randint(2, 5) center_c = rng.randint(max_r, w - max_r - 1) else: w = max_r + 1 + max_r + margin_before + margin_after + 1 center_c = margin_before + max_r h = 2 * max_r + 1 + rng.randint(2, 5) center_r = rng.randint(max_r, h - max_r - 1) center = (center_r, center_c) edge = _edge_for_direction(center, h, w, target) marker_color = rng.choice(COLORS) outline_palette = [c for c in COLORS if c != marker_color] if len(outline_palette) < 2: continue grid = _empty(h, w) prev_color = None outline_specs: list[tuple[int, int, str]] = [] for radius in radii: color_choices = [c for c in outline_palette if c != prev_color] color = rng.choice(color_choices) gap = rng.choice([""top"", ""right"", ""bottom"", ""left""]) outline_specs.append((radius, color, gap)) prev_color = color for radius, color, gap in outline_specs: _draw_outline(grid, center, radius, color, gap) grid[center_r][center_c] = marker_color grid[edge[0]][edge[1]] = marker_color try: out = transform_t44(grid) except Exception: continue # Prefer varied encodings, including at least one zero and one nonzero row. counts = [sum(1 for v in row if v != BG) for row in out] if len(set(counts)) < 2: continue if not any(c == 0 for c in counts): continue if not any(c == 3 for c in counts): continue return {""input"": grid, ""output"": out} raise RuntimeError(""failed to generate a valid t44 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t44 gap-rotation-count rule."""""" from __future__ import annotations from typing import List from generator import transform_t44 Grid = List[List[int]] def verify_t44(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t44(inp) " "t45","[{""input"":[[1,1,1,1,1,1,4,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,2,1,1,1,1,1,1,1,1],[1,1,1,2,1,1,1,1,1,1,1,1,1],[1,1,2,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,3,3,3,3,1,1],[1,1,1,1,1,1,1,3,1,1,3,1,1],[1,1,6,1,1,1,1,3,1,1,3,1,1],[1,6,1,6,1,1,1,3,3,3,3,1,1],[6,1,6,1,6,1,1,1,1,1,1,1,1],[1,6,1,6,1,1,1,1,1,1,1,1,1],[1,1,6,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1]],""output"":[[1,1,1,1,1,1,4,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,2,1,1,1,1,1,1,1,1],[1,1,1,2,0,1,1,1,1,1,1,1,1],[1,1,2,0,0,1,1,1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,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3]],""output"":[[4,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,8,3,8,8,8,3,3],[3,3,3,3,3,3,3,8,8,8,0,0,0,3],[3,3,3,3,3,3,3,3,0,8,0,0,0,0],[3,3,3,3,3,3,3,3,3,0,0,4,0,0],[3,3,3,3,3,3,3,3,3,3,0,0,3,0],[3,3,3,3,3,3,3,3,3,3,3,0,0,3],[3,3,3,3,3,3,3,3,3,3,3,3,0,0],[3,3,3,3,3,3,3,3,3,1,1,3,3,0],[3,3,3,3,3,3,3,3,3,3,0,0,3,3],[3,3,3,3,3,3,3,3,2,3,3,0,0,3],[3,3,3,3,3,3,3,3,2,2,3,3,0,0],[3,9,9,7,7,3,3,3,3,0,0,3,3,0],[9,9,0,7,0,0,3,3,3,3,0,0,3,3],[3,0,0,0,0,0,0,3,3,3,3,0,0,3]]}]}","""""""Generator for Test2/t45: toggle shadow and light from a yellow marker. Rule: - A yellow (4) marker is placed at a corner or the midpoint of one edge. - The grid has a single non-black/non-yellow background color. - Non-background, non-yellow cells cast black shadows away from the marker: * from an edge midpoint, shadows are horizontal/vertical; * from a corner, shadows are diagonal. - Yellow cells do not cast black shadows. - If a yellow cell lies in another object's shadow, it shines light in the same direction instead: consecutive background cells after it are restored to the background color until the ray hits another non-background object. Generation constraints used to keep examples well-formed and unambiguous: - exactly one yellow marker appears at an allowed boundary location; - the background is a single dominant non-black/non-yellow color; - there are at least two non-yellow colored objects; - examples include visible shadows; - many generated examples include shadowed yellow light-cells that clear part of an otherwise black shadow ray. """""" from __future__ import annotations import json import random from collections import Counter from typing import List, Sequence, Tuple Grid = List[List[int]] Cell = Tuple[int, int] BG_OUT = 0 YELLOW = 4 COLORS = list(range(1, 10)) def _empty(h: int, w: int, color: int) -> Grid: return [[color for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _allowed_marker_positions(h: int, w: int) -> list[Cell]: positions = [(0, 0), (0, w - 1), (h - 1, 0), (h - 1, w - 1)] if w % 2 == 1: positions.extend([(0, w // 2), (h - 1, w // 2)]) if h % 2 == 1: positions.extend([(h // 2, 0), (h // 2, w - 1)]) # Deduplicate for very small grids. return sorted(set(positions)) def _find_marker(grid: Grid) -> Cell: h, w = len(grid), len(grid[0]) candidates = [p for p in _allowed_marker_positions(h, w) if grid[p[0]][p[1]] == YELLOW] if len(candidates) != 1: raise ValueError(""expected exactly one yellow marker at a corner or edge midpoint"") return candidates[0] def _direction_from_marker(marker: Cell, h: int, w: int) -> tuple[int, int]: r, c = marker if r == 0 and c == 0: return (1, 1) if r == 0 and c == w - 1: return (1, -1) if r == h - 1 and c == 0: return (-1, 1) if r == h - 1 and c == w - 1: return (-1, -1) if r == 0: return (1, 0) if r == h - 1: return (-1, 0) if c == 0: return (0, 1) if c == w - 1: return (0, -1) raise ValueError(""marker is not at an allowed location"") def _infer_background(grid: Grid) -> int: counts = Counter(v for row in grid for v in row if v not in (BG_OUT, YELLOW)) if not counts: raise ValueError(""expected a non-yellow background color"") return counts.most_common(1)[0][0] def _ray_cells(start: Cell, dr: int, dc: int, h: int, w: int) -> list[Cell]: r, c = start out: list[Cell] = [] r += dr c += dc while 0 <= r < h and 0 <= c < w: out.append((r, c)) r += dr c += dc return out def transform_t45(grid: Grid) -> Grid: if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) marker = _find_marker(grid) dr, dc = _direction_from_marker(marker, h, w) bg = _infer_background(grid) shadowed: set[Cell] = set() for r in range(h): for c in range(w): val = grid[r][c] if val != bg and val != YELLOW: shadowed.update(_ray_cells((r, c), dr, dc, h, w)) out = [row[:] for row in grid] for r, c in shadowed: if grid[r][c] == bg: out[r][c] = BG_OUT # Shadowed yellow cells act as light sources: restore background along the # ray, but only through original background cells. Light does not pass # through colored objects. for r in range(h): for c in range(w): if grid[r][c] == YELLOW and (r, c) in shadowed: for rr, cc in _ray_cells((r, c), dr, dc, h, w): if grid[rr][cc] != bg: break out[rr][cc] = bg return out def _place_cells(grid: Grid, cells: Sequence[Cell], color: int) -> None: h, w = len(grid), len(grid[0]) for r, c in cells: if 0 <= r < h and 0 <= c < w: grid[r][c] = color def _random_object(rng: random.Random, h: int, w: int, max_size: int = 9) -> list[Cell]: start = (rng.randrange(h), rng.randrange(w)) target = rng.randint(1, max_size) cells = {start} while len(cells) < target: frontier = set() for r, c in cells: for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)): nr, nc = r + dr, c + dc if 0 <= nr < h and 0 <= nc < w and (nr, nc) not in cells: frontier.add((nr, nc)) if not frontier: break cells.add(rng.choice(list(frontier))) return sorted(cells) def _choose_marker(rng: random.Random, h: int, w: int) -> Cell: positions = _allowed_marker_positions(h, w) return rng.choice(positions) def _place_light_cell_in_shadow( rng: random.Random, grid: Grid, shadow_source: Cell, dr: int, dc: int, bg: int, ) -> bool: h, w = len(grid), len(grid[0]) ray = _ray_cells(shadow_source, dr, dc, h, w) candidates = [(r, c) for r, c in ray[:-1] if grid[r][c] == bg] rng.shuffle(candidates) for r, c in candidates: # Need at least one background cell after it before another object. rr, cc = r + dr, c + dc if 0 <= rr < h and 0 <= cc < w and grid[rr][cc] == bg: grid[r][c] = YELLOW return True return False def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, background: int | None = None, marker: Cell | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(2000): hh = h if h is not None else rng.randint(8, 23) ww = w if w is not None else rng.randint(8, 23) if hh < 5 or ww < 5: continue bg_choices = [c for c in COLORS if c != YELLOW] bg = background if background is not None else rng.choice(bg_choices) if bg in (BG_OUT, YELLOW): continue grid = _empty(hh, ww, bg) mark = marker if marker is not None else _choose_marker(rng, hh, ww) if mark not in _allowed_marker_positions(hh, ww): continue grid[mark[0]][mark[1]] = YELLOW dr, dc = _direction_from_marker(mark, hh, ww) obj_colors = [c for c in COLORS if c not in (bg, YELLOW)] rng.shuffle(obj_colors) placed_sources: list[Cell] = [] num_objects = rng.randint(3, 7) for i in range(num_objects): color = obj_colors[i % len(obj_colors)] cells = _random_object(rng, hh, ww, max_size=rng.randint(2, 10)) cells = [p for p in cells if p != mark] if not cells: continue _place_cells(grid, cells, color) placed_sources.extend(cells) # Often include a yellow cell in an existing shadow, to demonstrate light. if placed_sources and rng.random() < 0.75: rng.shuffle(placed_sources) for src in placed_sources: if _place_light_cell_in_shadow(rng, grid, src, dr, dc, bg): break # Ensure the boundary marker is still the only allowed-position yellow. for p in _allowed_marker_positions(hh, ww): if p != mark and grid[p[0]][p[1]] == YELLOW: grid[p[0]][p[1]] = bg try: out = transform_t45(grid) except Exception: continue changed = sum( 1 for r in range(hh) for c in range(ww) if out[r][c] != grid[r][c] ) if changed < max(4, (hh * ww) // 25): continue non_bg_colors = {v for row in grid for v in row if v not in (bg, YELLOW)} if len(non_bg_colors) < 2: continue return {""input"": grid, ""output"": out} raise RuntimeError(""failed to generate a valid t45 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t45 toggle shadow/light rule."""""" from __future__ import annotations from typing import List from generator import transform_t45 Grid = List[List[int]] def verify_t45(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t45(inp) " "t46","[{""input"":[[0,0,5,8,0],[0,4,5,0,0],[5,5,5,5,5],[0,0,5,7,0],[3,0,5,0,0]],""output"":[[7,3,5,8,4],[8,4,5,3,7],[5,5,5,5,5],[4,8,5,7,3],[3,7,5,4,8]]},{""input"":[[0,0,5,0,0],[0,1,5,6,0],[5,5,5,5,5],[0,0,5,0,0],[8,0,5,0,9]],""output"":[[6,8,5,9,1],[9,1,5,6,8],[5,5,5,5,5],[1,9,5,8,6],[8,6,5,1,9]]},{""input"":[[7,0,5,0,0],[0,0,5,3,0],[5,5,5,5,5],[0,2,5,0,0],[0,0,5,0,1]],""output"":[[7,3,5,1,2],[2,1,5,3,7],[5,5,5,5,5],[1,2,5,7,3],[3,7,5,2,1]]}]","[[0,0,5,0,8],[0,6,5,0,0],[5,5,5,5,5],[3,0,5,0,0],[0,0,5,4,0]]","[[4,3,5,6,8],[8,6,5,3,4],[5,5,5,5,5],[3,4,5,8,6],[6,8,5,4,3]]","{""train"":[{""input"":[[0,1,5,0,0],[0,0,5,4,0],[5,5,5,5,5],[0,9,5,0,0],[0,0,5,8,0]],""output"":[[4,1,5,9,8],[9,8,5,4,1],[5,5,5,5,5],[8,9,5,1,4],[1,4,5,8,9]]},{""input"":[[0,0,5,0,0],[7,0,5,1,0],[5,5,5,5,5],[0,0,5,0,0],[0,9,5,0,3]],""output"":[[9,1,5,3,7],[7,3,5,1,9],[5,5,5,5,5],[3,7,5,9,1],[1,9,5,7,3]]},{""input"":[[0,0,5,4,0],[3,0,5,0,0],[5,5,5,5,5],[0,0,5,0,1],[0,7,5,0,0]],""output"":[[7,1,5,4,3],[3,4,5,1,7],[5,5,5,5,5],[4,3,5,7,1],[1,7,5,3,4]]},{""input"":[[6,0,5,0,0],[0,0,5,7,0],[5,5,5,5,5],[0,1,5,0,0],[0,0,5,0,4]],""output"":[[6,7,5,4,1],[1,4,5,7,6],[5,5,5,5,5],[4,1,5,6,7],[7,6,5,1,4]]},{""input"":[[0,0,5,6,0],[7,0,5,0,0],[5,5,5,5,5],[0,8,5,0,0],[0,0,5,0,2]],""output"":[[8,2,5,6,7],[7,6,5,2,8],[5,5,5,5,5],[2,8,5,7,6],[6,7,5,8,2]]},{""input"":[[0,0,5,0,0],[0,1,5,6,0],[5,5,5,5,5],[8,0,5,0,9],[0,0,5,0,0]],""output"":[[6,8,5,9,1],[9,1,5,6,8],[5,5,5,5,5],[8,6,5,1,9],[1,9,5,8,6]]},{""input"":[[0,0,5,0,7],[0,6,5,0,0],[5,5,5,5,5],[0,0,5,1,0],[9,0,5,0,0]],""output"":[[1,9,5,6,7],[7,6,5,9,1],[5,5,5,5,5],[6,7,5,1,9],[9,1,5,7,6]]},{""input"":[[0,0,5,0,0],[8,0,5,0,3],[5,5,5,5,5],[0,0,5,0,0],[0,7,5,4,0]],""output"":[[7,3,5,8,4],[8,4,5,7,3],[5,5,5,5,5],[4,8,5,3,7],[3,7,5,4,8]]},{""input"":[[1,0,5,0,0],[0,0,5,2,0],[5,5,5,5,5],[0,0,5,6,0],[8,0,5,0,0]],""output"":[[1,2,5,8,6],[6,8,5,2,1],[5,5,5,5,5],[2,1,5,6,8],[8,6,5,1,2]]},{""input"":[[0,0,5,0,6],[0,8,5,0,0],[5,5,5,5,5],[0,0,5,2,0],[7,0,5,0,0]],""output"":[[2,7,5,8,6],[6,8,5,7,2],[5,5,5,5,5],[8,6,5,2,7],[7,2,5,6,8]]},{""input"":[[9,0,5,0,4],[0,0,5,0,0],[5,5,5,5,5],[0,0,5,0,0],[0,6,5,1,0]],""output"":[[9,1,5,6,4],[6,4,5,9,1],[5,5,5,5,5],[1,9,5,4,6],[4,6,5,1,9]]},{""input"":[[0,6,5,0,7],[0,0,5,0,0],[5,5,5,5,5],[0,0,5,0,0],[1,0,5,9,0]],""output"":[[9,6,5,1,7],[7,1,5,6,9],[5,5,5,5,5],[6,9,5,7,1],[1,7,5,9,6]]},{""input"":[[0,0,5,0,0],[0,2,5,0,3],[5,5,5,5,5],[0,0,5,0,0],[7,0,5,4,0]],""output"":[[3,7,5,2,4],[4,2,5,7,3],[5,5,5,5,5],[2,4,5,3,7],[7,3,5,4,2]]},{""input"":[[1,0,5,0,9],[0,0,5,0,0],[5,5,5,5,5],[0,4,5,6,0],[0,0,5,0,0]],""output"":[[1,6,5,4,9],[4,9,5,1,6],[5,5,5,5,5],[9,4,5,6,1],[6,1,5,9,4]]},{""input"":[[0,0,5,6,0],[0,7,5,0,0],[5,5,5,5,5],[0,0,5,9,0],[0,8,5,0,0]],""output"":[[8,9,5,6,7],[6,7,5,8,9],[5,5,5,5,5],[7,6,5,9,8],[9,8,5,7,6]]},{""input"":[[0,1,5,0,0],[0,0,5,8,0],[5,5,5,5,5],[0,0,5,3,0],[0,7,5,0,0]],""output"":[[8,1,5,7,3],[7,3,5,8,1],[5,5,5,5,5],[1,8,5,3,7],[3,7,5,1,8]]},{""input"":[[9,0,5,0,0],[0,0,5,0,1],[5,5,5,5,5],[7,0,5,0,0],[0,0,5,0,2]],""output"":[[9,1,5,2,7],[2,7,5,9,1],[5,5,5,5,5],[7,2,5,1,9],[1,9,5,7,2]]},{""input"":[[0,0,5,0,0],[0,6,5,0,2],[5,5,5,5,5],[0,0,5,0,0],[7,0,5,4,0]],""output"":[[2,7,5,6,4],[4,6,5,7,2],[5,5,5,5,5],[6,4,5,2,7],[7,2,5,4,6]]},{""input"":[[0,0,5,0,0],[3,0,5,9,0],[5,5,5,5,5],[0,0,5,0,0],[0,4,5,0,2]],""output"":[[4,9,5,2,3],[3,2,5,9,4],[5,5,5,5,5],[2,3,5,4,9],[9,4,5,3,2]]},{""input"":[[0,0,5,0,6],[3,0,5,0,0],[5,5,5,5,5],[0,4,5,0,0],[0,0,5,2,0]],""output"":[[4,2,5,3,6],[3,6,5,4,2],[5,5,5,5,5],[2,4,5,6,3],[6,3,5,2,4]]},{""input"":[[0,7,5,0,0],[0,0,5,6,0],[5,5,5,5,5],[0,0,5,8,0],[0,4,5,0,0]],""output"":[[6,7,5,4,8],[4,8,5,6,7],[5,5,5,5,5],[7,6,5,8,4],[8,4,5,7,6]]},{""input"":[[9,0,5,0,0],[0,0,5,0,8],[5,5,5,5,5],[0,0,5,6,0],[0,7,5,0,0]],""output"":[[9,8,5,7,6],[7,6,5,9,8],[5,5,5,5,5],[8,9,5,6,7],[6,7,5,8,9]]},{""input"":[[0,0,5,2,0],[9,0,5,0,0],[5,5,5,5,5],[0,0,5,0,7],[0,4,5,0,0]],""output"":[[4,7,5,2,9],[9,2,5,7,4],[5,5,5,5,5],[2,9,5,4,7],[7,4,5,9,2]]},{""input"":[[0,0,5,4,0],[0,1,5,0,0],[5,5,5,5,5],[7,0,5,0,0],[0,0,5,0,3]],""output"":[[3,7,5,4,1],[4,1,5,3,7],[5,5,5,5,5],[7,3,5,1,4],[1,4,5,7,3]]},{""input"":[[0,6,5,7,0],[0,0,5,0,0],[5,5,5,5,5],[0,0,5,0,0],[1,0,5,0,4]],""output"":[[4,6,5,7,1],[7,1,5,4,6],[5,5,5,5,5],[6,4,5,1,7],[1,7,5,6,4]]},{""input"":[[2,0,5,0,0],[0,0,5,0,6],[5,5,5,5,5],[4,0,5,0,0],[0,0,5,0,7]],""output"":[[2,6,5,7,4],[7,4,5,2,6],[5,5,5,5,5],[4,7,5,6,2],[6,2,5,4,7]]},{""input"":[[3,0,5,9,0],[0,0,5,0,0],[5,5,5,5,5],[0,7,5,0,6],[0,0,5,0,0]],""output"":[[3,6,5,9,7],[7,9,5,6,3],[5,5,5,5,5],[9,7,5,3,6],[6,3,5,7,9]]},{""input"":[[0,0,5,0,0],[2,0,5,0,7],[5,5,5,5,5],[0,4,5,8,0],[0,0,5,0,0]],""output"":[[4,7,5,2,8],[2,8,5,4,7],[5,5,5,5,5],[7,4,5,8,2],[8,2,5,7,4]]},{""input"":[[4,0,5,0,0],[0,0,5,6,0],[5,5,5,5,5],[0,0,5,2,0],[9,0,5,0,0]],""output"":[[4,6,5,9,2],[2,9,5,6,4],[5,5,5,5,5],[6,4,5,2,9],[9,2,5,4,6]]},{""input"":[[9,0,5,0,0],[0,0,5,0,1],[5,5,5,5,5],[0,0,5,0,3],[7,0,5,0,0]],""output"":[[9,1,5,3,7],[3,7,5,9,1],[5,5,5,5,5],[1,9,5,7,3],[7,3,5,1,9]]},{""input"":[[0,0,5,0,2],[4,0,5,0,0],[5,5,5,5,5],[0,3,5,0,0],[0,0,5,6,0]],""output"":[[3,6,5,4,2],[4,2,5,3,6],[5,5,5,5,5],[6,3,5,2,4],[2,4,5,6,3]]},{""input"":[[0,0,5,7,0],[0,4,5,0,0],[5,5,5,5,5],[0,0,5,0,6],[1,0,5,0,0]],""output"":[[6,1,5,7,4],[7,4,5,6,1],[5,5,5,5,5],[4,7,5,1,6],[1,6,5,4,7]]},{""input"":[[0,0,5,8,0],[7,0,5,0,0],[5,5,5,5,5],[0,0,5,2,0],[4,0,5,0,0]],""output"":[[2,4,5,8,7],[7,8,5,4,2],[5,5,5,5,5],[8,7,5,2,4],[4,2,5,7,8]]},{""input"":[[0,8,5,0,0],[0,0,5,0,9],[5,5,5,5,5],[0,0,5,0,6],[0,3,5,0,0]],""output"":[[9,8,5,6,3],[3,6,5,8,9],[5,5,5,5,5],[8,9,5,3,6],[6,3,5,9,8]]},{""input"":[[0,0,5,0,3],[0,8,5,0,0],[5,5,5,5,5],[7,0,5,0,0],[0,0,5,6,0]],""output"":[[6,7,5,8,3],[3,8,5,7,6],[5,5,5,5,5],[7,6,5,3,8],[8,3,5,6,7]]},{""input"":[[0,0,5,1,0],[0,6,5,0,0],[5,5,5,5,5],[0,0,5,7,0],[0,9,5,0,0]],""output"":[[9,7,5,1,6],[1,6,5,9,7],[5,5,5,5,5],[6,1,5,7,9],[7,9,5,6,1]]},{""input"":[[0,1,5,0,0],[0,0,5,6,0],[5,5,5,5,5],[0,2,5,0,0],[0,0,5,3,0]],""output"":[[6,1,5,2,3],[2,3,5,6,1],[5,5,5,5,5],[3,2,5,1,6],[1,6,5,3,2]]},{""input"":[[8,0,5,3,0],[0,0,5,0,0],[5,5,5,5,5],[0,0,5,0,0],[0,9,5,0,4]],""output"":[[8,4,5,3,9],[9,3,5,4,8],[5,5,5,5,5],[4,8,5,9,3],[3,9,5,8,4]]},{""input"":[[0,0,5,6,0],[0,4,5,0,0],[5,5,5,5,5],[0,3,5,0,0],[0,0,5,8,0]],""output"":[[3,8,5,6,4],[6,4,5,3,8],[5,5,5,5,5],[8,3,5,4,6],[4,6,5,8,3]]},{""input"":[[3,0,5,0,8],[0,0,5,0,0],[5,5,5,5,5],[0,9,5,7,0],[0,0,5,0,0]],""output"":[[3,7,5,9,8],[9,8,5,3,7],[5,5,5,5,5],[8,9,5,7,3],[7,3,5,8,9]]},{""input"":[[0,0,5,0,0],[0,6,5,0,7],[5,5,5,5,5],[0,0,5,0,0],[9,0,5,2,0]],""output"":[[7,9,5,6,2],[2,6,5,9,7],[5,5,5,5,5],[6,2,5,7,9],[9,7,5,2,6]]},{""input"":[[9,0,5,0,0],[0,0,5,4,0],[5,5,5,5,5],[0,0,5,3,0],[8,0,5,0,0]],""output"":[[9,4,5,8,3],[3,8,5,4,9],[5,5,5,5,5],[4,9,5,3,8],[8,3,5,9,4]]},{""input"":[[0,1,5,8,0],[0,0,5,0,0],[5,5,5,5,5],[0,0,5,0,0],[2,0,5,0,3]],""output"":[[3,1,5,8,2],[8,2,5,3,1],[5,5,5,5,5],[1,3,5,2,8],[2,8,5,1,3]]},{""input"":[[0,0,5,0,0],[0,4,5,0,2],[5,5,5,5,5],[7,0,5,3,0],[0,0,5,0,0]],""output"":[[2,7,5,4,3],[3,4,5,7,2],[5,5,5,5,5],[7,2,5,3,4],[4,3,5,2,7]]},{""input"":[[0,0,5,0,3],[9,0,5,0,0],[5,5,5,5,5],[0,7,5,0,0],[0,0,5,1,0]],""output"":[[7,1,5,9,3],[9,3,5,7,1],[5,5,5,5,5],[1,7,5,3,9],[3,9,5,1,7]]},{""input"":[[0,0,5,7,0],[9,0,5,0,0],[5,5,5,5,5],[4,0,5,0,0],[0,0,5,8,0]],""output"":[[8,4,5,7,9],[9,7,5,4,8],[5,5,5,5,5],[4,8,5,9,7],[7,9,5,8,4]]},{""input"":[[6,0,5,0,0],[0,0,5,0,7],[5,5,5,5,5],[0,0,5,0,4],[1,0,5,0,0]],""output"":[[6,7,5,4,1],[4,1,5,6,7],[5,5,5,5,5],[7,6,5,1,4],[1,4,5,7,6]]},{""input"":[[0,8,5,1,0],[0,0,5,0,0],[5,5,5,5,5],[6,0,5,0,7],[0,0,5,0,0]],""output"":[[7,8,5,1,6],[1,6,5,7,8],[5,5,5,5,5],[6,1,5,8,7],[8,7,5,6,1]]},{""input"":[[8,0,5,0,0],[0,0,5,0,2],[5,5,5,5,5],[0,0,5,4,0],[0,3,5,0,0]],""output"":[[8,2,5,3,4],[3,4,5,8,2],[5,5,5,5,5],[2,8,5,4,3],[4,3,5,2,8]]},{""input"":[[0,0,5,2,0],[6,0,5,0,0],[5,5,5,5,5],[0,3,5,0,0],[0,0,5,0,7]],""output"":[[3,7,5,2,6],[6,2,5,7,3],[5,5,5,5,5],[7,3,5,6,2],[2,6,5,3,7]]}]}","""""""Generator for Test2/t46: 4-color sudoku over 2x2 quadrants. Rule: - The grid is always 5x5. - The middle row and middle column are gray (5), splitting the grid into four 2x2 quadrants. - The four non-gray colors must fill the sixteen non-gray cells. - No row, column, or 2x2 quadrant may contain the same color twice. - Inputs reveal exactly four colored cells, one of each color; the output is the unique valid completion. Generation constraints used to keep examples well-formed and unambiguous: - the gray cross is fixed at row 2 and column 2; - exactly four distinct non-gray/non-black colors are used; - exactly four givens are shown, one per color; - the partial puzzle has exactly one valid completion; - generated givens are spread across at least three quadrants when possible. """""" from __future__ import annotations import itertools import json import random from typing import Dict, List, Sequence, Tuple Grid = List[List[int]] Cell = Tuple[int, int] BG = 0 GRAY = 5 NON_GRAY_CELLS: list[Cell] = [ (r, c) for r in (0, 1, 3, 4) for c in (0, 1, 3, 4) ] PALETTE_COLORS = [1, 2, 3, 4, 6, 7, 8, 9] def _empty() -> Grid: grid = [[BG for _ in range(5)] for _ in range(5)] for i in range(5): grid[2][i] = GRAY grid[i][2] = GRAY return grid def _quadrant_index(r: int, c: int) -> int: if r < 2 and c < 2: return 0 if r < 2 and c > 2: return 1 if r > 2 and c < 2: return 2 if r > 2 and c > 2: return 3 raise ValueError(""gray-cross cell has no quadrant"") def _valid_grid_shape(grid: Grid) -> bool: return len(grid) == 5 and all(len(row) == 5 for row in grid) def _check_gray_cross(grid: Grid) -> None: if not _valid_grid_shape(grid): raise ValueError(""grid must be 5x5"") for i in range(5): if grid[2][i] != GRAY or grid[i][2] != GRAY: raise ValueError(""grid must contain a gray center row and column"") def _colors_from_grid(grid: Grid) -> list[int]: colors = sorted({grid[r][c] for r, c in NON_GRAY_CELLS if grid[r][c] not in (BG, GRAY)}) if len(colors) != 4: raise ValueError(""expected exactly four non-gray colors"") return colors def _is_consistent_assignment(assign: Dict[Cell, int]) -> bool: # Rows. for r in (0, 1, 3, 4): vals = [assign[(r, c)] for c in (0, 1, 3, 4) if (r, c) in assign] if len(vals) != len(set(vals)): return False # Columns. for c in (0, 1, 3, 4): vals = [assign[(r, c)] for r in (0, 1, 3, 4) if (r, c) in assign] if len(vals) != len(set(vals)): return False # Quadrants. for q in range(4): vals = [ v for (r, c), v in assign.items() if _quadrant_index(r, c) == q ] if len(vals) != len(set(vals)): return False return True def _solve(colors: Sequence[int], givens: Dict[Cell, int], max_solutions: int = 2) -> list[Dict[Cell, int]]: cells = NON_GRAY_CELLS[:] solutions: list[Dict[Cell, int]] = [] if not _is_consistent_assignment(givens): return [] rows = {r: set() for r in (0, 1, 3, 4)} cols = {c: set() for c in (0, 1, 3, 4)} quads = {q: set() for q in range(4)} assign: Dict[Cell, int] = {} for cell, val in givens.items(): r, c = cell q = _quadrant_index(r, c) if val not in colors or val in rows[r] or val in cols[c] or val in quads[q]: return [] rows[r].add(val) cols[c].add(val) quads[q].add(val) assign[cell] = val def candidates(cell: Cell) -> list[int]: r, c = cell q = _quadrant_index(r, c) return [v for v in colors if v not in rows[r] and v not in cols[c] and v not in quads[q]] def backtrack() -> None: if len(solutions) >= max_solutions: return unfilled = [cell for cell in cells if cell not in assign] if not unfilled: solutions.append(dict(assign)) return cell = min(unfilled, key=lambda x: (len(candidates(x)), x)) for val in candidates(cell): r, c = cell q = _quadrant_index(r, c) assign[cell] = val rows[r].add(val) cols[c].add(val) quads[q].add(val) backtrack() quads[q].remove(val) cols[c].remove(val) rows[r].remove(val) del assign[cell] if len(solutions) >= max_solutions: return backtrack() return solutions def _assignment_to_grid(assign: Dict[Cell, int]) -> Grid: grid = _empty() for (r, c), val in assign.items(): grid[r][c] = val return grid def transform_t46(grid: Grid) -> Grid: _check_gray_cross(grid) colors = _colors_from_grid(grid) givens = {(r, c): grid[r][c] for r, c in NON_GRAY_CELLS if grid[r][c] != BG} sols = _solve(colors, givens, max_solutions=2) if len(sols) != 1: raise ValueError(""input does not have a unique valid completion"") return _assignment_to_grid(sols[0]) def _canonical_solution(symbols: Sequence[int]) -> Dict[Cell, int]: """"""Return a random-symbolized 4x4 sudoku solution. Base pattern is a valid 4x4 Latin sudoku with 2x2 boxes: 0 1 | 2 3 2 3 | 0 1 --------- 1 0 | 3 2 3 2 | 1 0 """""" pattern = [ [0, 1, 2, 3], [2, 3, 0, 1], [1, 0, 3, 2], [3, 2, 1, 0], ] real_rows = [0, 1, 3, 4] real_cols = [0, 1, 3, 4] return { (real_rows[i], real_cols[j]): symbols[pattern[i][j]] for i in range(4) for j in range(4) } def _permute_solution(rng: random.Random, assign: Dict[Cell, int]) -> Dict[Cell, int]: # Permutations that preserve rows/columns/quadrants: # swap rows within top/bottom bands, swap bands, same for columns. row_bands = [[0, 1], [3, 4]] col_bands = [[0, 1], [3, 4]] for band in row_bands: if rng.random() < 0.5: band.reverse() for band in col_bands: if rng.random() < 0.5: band.reverse() if rng.random() < 0.5: row_bands.reverse() if rng.random() < 0.5: col_bands.reverse() row_map = dict(zip([0, 1, 3, 4], row_bands[0] + row_bands[1])) col_map = dict(zip([0, 1, 3, 4], col_bands[0] + col_bands[1])) return {(row_map[r], col_map[c]): v for (r, c), v in assign.items()} def _choose_unique_givens( rng: random.Random, solution: Dict[Cell, int], colors: Sequence[int], ) -> Dict[Cell, int] | None: cells_by_color: dict[int, list[Cell]] = {c: [] for c in colors} for cell, val in solution.items(): cells_by_color[val].append(cell) # One given per color. Try random choices until the completion is unique. for _ in range(2000): chosen: Dict[Cell, int] = {} for color in colors: cell = rng.choice(cells_by_color[color]) chosen[cell] = color if len(chosen) != 4: continue if len({_quadrant_index(*cell) for cell in chosen}) < 3: continue sols = _solve(colors, chosen, max_solutions=2) if len(sols) == 1 and sols[0] == solution: return chosen return None def generate( rng: random.Random | None = None, colors: Sequence[int] | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(1000): cols = list(colors) if colors is not None else rng.sample(PALETTE_COLORS, 4) if len(cols) != 4 or len(set(cols)) != 4 or GRAY in cols or BG in cols: continue rng.shuffle(cols) solution = _canonical_solution(cols) solution = _permute_solution(rng, solution) givens = _choose_unique_givens(rng, solution, cols) if givens is None: continue inp = _empty() for cell, val in givens.items(): r, c = cell inp[r][c] = val out = _assignment_to_grid(solution) if transform_t46(inp) == out: return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t46 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t46 4-color sudoku quadrants rule."""""" from __future__ import annotations from typing import List from generator import transform_t46 Grid = List[List[int]] def verify_t46(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") if len(inp) != 5 or any(len(row) != 5 for row in inp): raise ValueError(""input grid must be 5x5"") return transform_t46(inp) " "t47","[{""input"":[[4,4,2,4,4,4,5,4,4,4,3,4,4],[4,4,2,2,4,4,5,3,4,3,4,4,4],[4,2,4,2,2,4,5,3,4,3,4,4,4],[4,4,4,4,4,4,5,4,4,3,4,3,3],[2,2,4,2,4,4,5,3,4,4,4,4,3],[4,4,4,4,2,2,5,3,3,3,4,4,3]],""output"":[[0,0,2,3,0,0],[3,0,0,2,0,0],[3,2,3,2,2,0],[0,0,3,0,3,3],[0,2,0,2,0,3],[3,3,3,0,2,0]]},{""input"":[[8,8,8,8,7,8,8],[8,8,7,8,8,8,8],[8,7,8,7,8,7,8],[7,7,8,8,8,7,8],[8,8,8,7,8,8,8],[8,7,8,8,7,8,7],[8,7,7,7,8,8,8],[5,5,5,5,5,5,5],[8,8,6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[6,0,6,0,0,0,0,0,0],[8,8,8,6,0,0,8,6,6],[0,0,0,8,6,6,6,6,6],[6,0,0,0,6,0,0,8,0]]},{""input"":[[3,3,4,4,5,3,1,3,3],[3,3,3,4,5,3,1,1,1],[3,3,4,4,5,1,3,3,1],[4,3,3,3,5,3,3,3,3],[4,3,4,3,5,3,3,1,1],[4,4,4,4,5,3,3,1,3]],""output"":[[0,1,4,4],[0,1,1,0],[1,0,4,0],[4,0,0,0],[4,0,0,1],[4,4,0,4]]},{""input"":[[4,3,3,5,1,1,4],[3,3,4,5,4,4,4],[4,3,4,5,1,4,1],[3,4,4,5,1,4,4],[3,4,4,5,4,4,4],[3,3,4,5,1,1,4],[4,3,3,5,1,1,1],[4,3,4,5,1,4,1],[4,4,3,5,4,1,4],[3,3,4,5,4,1,1],[3,3,4,5,4,1,1]],""output"":[[1,0,3],[3,3,0],[1,3,1],[0,0,0],[3,0,0],[0,0,0],[1,0,0],[1,3,1],[0,1,3],[3,0,1],[3,0,1]]},{""input"":[[4,4,2,2,4,2,4,4,4,5,3,3,3,3,4,3,3,3,3],[4,4,2,4,4,4,2,2,4,5,3,4,4,3,3,3,4,4,4],[4,4,2,4,4,2,4,4,2,5,3,3,4,3,3,4,4,3,3],[2,2,4,4,4,2,4,4,2,5,4,4,4,3,3,4,3,3,4],[2,2,2,2,4,4,2,2,4,5,4,4,4,3,4,3,4,3,4]],""output"":[[3,3,0,0,0,0,3,3,3],[3,0,2,3,3,3,2,2,0],[3,3,2,3,3,2,0,3,0],[2,2,0,3,3,2,3,3,2],[2,2,2,0,0,3,2,0,0]]},{""input"":[[7,6,7,5,7,7,7],[7,6,7,5,9,7,9],[6,6,7,5,7,9,7],[6,6,6,5,7,7,9],[6,6,6,5,7,7,7],[6,6,7,5,7,9,9],[6,7,7,5,7,9,9]],""output"":[[0,6,0],[9,6,9],[6,0,0],[6,6,0],[6,6,6],[6,0,9],[6,9,9]]},{""input"":[[3,1,1,1,3],[3,3,1,1,3],[1,3,3,3,3],[3,1,1,1,1],[3,3,3,3,3],[3,3,3,1,1],[1,1,1,3,3],[3,3,1,1,3],[3,1,3,1,1],[1,3,1,3,3],[1,1,3,3,3],[5,5,5,5,5],[3,4,3,3,4],[3,4,4,4,4],[3,4,3,4,4],[4,4,3,3,3],[3,4,4,4,4],[4,4,3,3,3],[3,4,3,3,4],[3,4,3,4,4],[4,4,3,4,4],[4,4,4,3,3],[3,4,4,3,4]],""output"":[[0,0,1,1,4],[0,4,0,0,4],[1,4,0,4,4],[4,0,1,1,1],[0,4,4,4,4],[4,4,0,1,1],[1,0,1,0,4],[0,4,1,0,4],[4,0,0,0,0],[0,4,0,0,0],[1,0,4,0,4]]},{""input"":[[3,1,3,1,3],[3,3,1,1,3],[1,1,3,1,3],[3,1,3,3,1],[3,1,3,1,1],[3,1,1,1,3],[3,1,3,1,1],[5,5,5,5,5],[3,3,3,3,8],[3,3,3,3,3],[3,3,8,3,3],[8,3,8,8,8],[8,3,8,8,3],[8,8,3,8,3],[3,3,8,8,3]],""output"":[[0,1,0,1,8],[0,0,1,1,0],[1,1,8,1,0],[8,1,8,8,0],[8,1,8,0,1],[8,0,1,0,0],[0,1,8,0,1]]},{""input"":[[9,9,9,9,1,1,1,9,1,9],[1,9,1,1,1,9,1,1,1,9],[9,1,1,9,9,1,9,1,1,9],[5,5,5,5,5,5,5,5,5,5],[4,4,1,1,4,1,4,1,1,4],[4,1,4,4,1,1,1,4,1,4],[4,1,1,4,1,4,1,4,4,4]],""output"":[[0,0,9,9,4,0,4,9,0,0],[4,9,4,4,0,9,0,4,0,0],[0,0,0,0,9,4,9,4,4,0]]},{""input"":[[2,2,2,2,2,2,2,1],[1,1,1,1,1,2,1,2],[2,2,2,2,1,1,2,2],[1,2,2,1,1,2,2,2],[1,2,2,1,1,1,1,1],[5,5,5,5,5,5,5,5],[2,7,2,7,7,7,2,2],[2,2,2,2,2,2,7,7],[2,2,7,7,2,2,7,2],[2,7,7,2,7,7,7,2],[7,2,7,7,2,7,7,7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2,3,3],[3,3,3,2],[2,3,2,2],[5,5,5,5],[3,1,1,3],[1,3,3,3],[1,3,1,3],[3,1,3,3],[3,1,1,3],[3,1,1,1],[1,3,3,3],[1,3,3,3],[1,1,3,3],[3,1,3,3]],""output"":[[2,1,0,0],[0,0,0,2],[0,2,0,2],[0,0,2,2],[2,1,0,2],[0,0,1,1],[0,0,0,2],[1,2,0,0],[1,1,0,2],[2,1,2,2]]},{""input"":[[3,6,6,6,3,3,6,3],[3,3,6,3,6,6,3,3],[6,6,6,3,6,3,6,6],[3,3,3,6,3,3,6,3],[5,5,5,5,5,5,5,5],[6,7,7,6,6,7,7,6],[7,6,6,7,7,7,6,7],[7,7,7,7,7,6,6,6],[7,7,7,7,6,6,7,7]],""output"":[[3,7,7,0,3,0,7,3],[0,3,0,0,7,7,3,0],[7,7,7,0,7,3,0,0],[0,0,0,7,3,3,7,0]]},{""input"":[[2,6,6,6,6],[2,2,2,6,6],[6,6,6,2,6],[2,2,6,2,6],[5,5,5,5,5],[6,7,7,6,7],[6,7,7,7,7],[7,7,6,7,6],[7,7,7,6,6]],""output"":[[2,7,7,0,7],[2,0,0,7,7],[7,7,0,0,0],[0,0,7,2,0]]},{""input"":[[3,4,4,3,4,4,3,3,3,4,3,3,5,4,4,9,9,9,9,4,4,9,4,9,9],[4,4,3,4,4,3,4,4,4,4,3,4,5,9,9,4,4,9,9,9,9,4,4,9,9],[4,3,4,4,4,3,4,3,3,4,4,3,5,9,4,9,9,9,9,9,4,9,9,9,4],[3,4,3,3,3,4,3,3,4,3,4,3,5,4,4,4,9,4,9,9,4,9,4,4,4],[3,3,4,4,4,3,4,4,4,4,4,3,5,4,4,9,9,4,9,9,9,4,9,9,9],[3,3,3,4,4,3,4,3,3,3,3,4,5,9,4,9,9,9,4,9,9,9,4,9,4],[3,3,3,3,4,3,4,4,3,3,4,3,5,9,9,9,4,4,4,9,9,4,4,9,9]],""output"":[[3,0,9,0,9,9,3,3,0,0,0,0],[9,9,3,0,9,0,9,9,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8],[8,4,4],[8,8,4],[5,5,5],[8,8,2],[2,2,8],[8,8,2],[8,8,8],[2,2,2],[8,8,8],[2,2,8]],""output"":[[4,4,2],[0,0,0],[4,0,2],[0,0,4],[2,2,2],[0,4,4],[2,2,4]]},{""input"":[[4,8,8],[8,4,8],[8,4,4],[8,8,8],[8,8,4],[4,8,8],[8,8,8],[4,8,8],[8,4,8],[4,4,8],[4,8,4],[5,5,5],[8,6,8],[8,8,8],[8,6,8],[8,6,6],[6,6,8],[8,6,6],[6,6,6],[8,6,6],[6,8,8],[6,6,8],[6,6,8]],""output"":[[4,6,0],[0,4,0],[0,0,4],[0,6,6],[6,6,4],[4,6,6],[6,6,6],[4,6,6],[6,4,0],[0,0,0],[0,6,4]]},{""input"":[[3,6,3,3,6,3,6,6,6,3,5,7,6,6,7,7,6,6,6,6,7],[6,6,3,6,6,6,6,3,6,3,5,7,7,6,7,7,7,7,6,6,7],[6,6,6,3,6,6,6,6,6,6,5,6,6,7,6,7,6,6,6,6,6],[3,6,6,6,3,3,6,3,6,6,5,6,6,7,7,6,6,6,6,6,7],[6,6,6,6,6,3,3,3,6,3,5,7,6,6,6,6,6,6,6,6,7],[3,6,6,6,3,6,6,3,3,6,5,6,7,7,7,6,6,7,6,6,7],[6,3,6,3,3,3,6,6,6,6,5,6,6,7,6,6,6,7,7,7,6]],""output"":[[0,0,3,0,7,3,0,0,0,0],[7,7,3,7,7,7,7,3,0,0],[0,0,7,3,7,0,0,0,0,0],[3,0,7,7,3,3,0,3,0,7],[7,0,0,0,0,3,3,3,0,0],[3,7,7,7,3,0,7,3,3,7],[0,3,7,3,3,3,7,7,7,0]]},{""input"":[[6,8,8,6,8,8,8,6,8,6,8,5,8,4,8,8,8,8,8,4,4,4,4],[8,6,6,6,6,8,6,8,6,6,8,5,8,4,8,8,8,8,8,8,4,8,8],[8,6,8,6,6,6,6,8,8,8,8,5,8,4,8,4,8,8,4,4,4,4,8],[6,8,8,8,6,8,6,6,8,8,8,5,8,8,8,4,4,4,4,8,8,4,8],[6,8,8,8,6,6,8,8,6,6,8,5,4,8,4,8,8,4,8,4,8,8,4],[6,6,6,6,8,6,6,8,6,8,8,5,4,8,8,4,8,8,4,8,4,8,8],[8,6,6,6,8,8,6,8,8,6,6,5,8,4,8,4,8,8,8,4,4,8,4],[8,6,8,6,6,8,8,8,8,8,8,5,4,4,4,4,4,8,8,4,4,4,8],[6,8,6,8,6,6,6,8,6,8,6,5,8,4,4,4,4,8,8,8,4,4,8],[8,8,8,8,6,8,6,6,8,6,6,5,4,8,4,4,4,8,4,4,8,8,8]],""output"":[[6,4,0,6,0,0,0,0,4,0,4],[0,0,6,6,6,0,6,0,0,6,0],[0,0,0,0,6,6,0,4,4,4,0],[6,0,0,4,0,4,0,6,0,4,0],[0,0,4,0,6,0,0,4,6,6,4],[0,6,6,0,0,6,0,0,0,0,0],[0,0,6,0,0,0,6,4,4,6,0],[4,0,4,0,0,0,0,4,4,4,0],[6,4,0,4,0,6,6,0,0,4,6],[4,0,4,4,0,0,0,0,0,6,6]]},{""input"":[[4,4,7,7,5,7,7,9,9],[4,4,4,4,5,9,9,9,7],[7,4,7,4,5,7,9,9,9],[7,7,4,4,5,9,7,7,9],[7,4,7,7,5,7,9,7,9],[4,4,4,4,5,7,7,9,9],[4,7,4,7,5,7,7,9,9],[7,4,7,7,5,9,7,7,7],[7,7,7,4,5,7,9,9,7]],""output"":[[4,4,9,9],[0,0,0,4],[0,0,9,0],[9,0,4,0],[0,0,0,9],[4,4,0,0],[4,0,0,9],[9,4,0,0],[0,9,9,4]]}]}","""""""Generator for Test2/t47: XOR two halves separated by a gray line. Rule: - The input consists of two equal-size halves separated by a full gray (5) line. - The halves share one background color. - Each half has exactly one non-background foreground color. - For each corresponding location, output: - the left/top foreground color if only the first half has foreground there; - the right/bottom foreground color if only the second half has foreground there; - 0 if neither or both halves have foreground there. Generation constraints used to keep examples well-formed and unambiguous: - exactly one full gray separator row or column is present; - the separator splits the grid into two equal-size halves; - both halves use the same background color; - each half has exactly one distinct foreground color; - both foreground colors are different from the background and gray; - generated examples include cells of both foreground colors and some cancellations. """""" from __future__ import annotations import json import random from typing import List Grid = List[List[int]] BG_OUT = 0 GRAY = 5 COLORS = list(range(1, 10)) def _empty(h: int, w: int, color: int = BG_OUT) -> Grid: return [[color for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _find_separator(grid: Grid) -> tuple[str, int]: """"""Return ('vertical', col) or ('horizontal', row) for the unique gray separator."""""" if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") h, w = len(grid), len(grid[0]) vertical = [c for c in range(w) if all(grid[r][c] == GRAY for r in range(h))] horizontal = [r for r in range(h) if all(grid[r][c] == GRAY for c in range(w))] candidates: list[tuple[str, int]] = [] for c in vertical: if c > 0 and w - c - 1 == c: candidates.append((""vertical"", c)) for r in horizontal: if r > 0 and h - r - 1 == r: candidates.append((""horizontal"", r)) if len(candidates) != 1: raise ValueError(""expected exactly one centered full gray separator"") return candidates[0] def _split_halves(grid: Grid) -> tuple[Grid, Grid]: kind, idx = _find_separator(grid) if kind == ""vertical"": left = [row[:idx] for row in grid] right = [row[idx + 1 :] for row in grid] return left, right top = grid[:idx] bottom = grid[idx + 1 :] return [row[:] for row in top], [row[:] for row in bottom] def _infer_colors(a: Grid, b: Grid) -> tuple[int, int, int]: colors_a = {v for row in a for v in row} colors_b = {v for row in b for v in row} shared = (colors_a & colors_b) - {GRAY} if len(shared) != 1: raise ValueError(""expected exactly one shared background color"") bg = next(iter(shared)) fg_a = sorted(colors_a - {bg, GRAY}) fg_b = sorted(colors_b - {bg, GRAY}) if len(fg_a) != 1 or len(fg_b) != 1: raise ValueError(""expected exactly one foreground color per half"") if fg_a[0] == fg_b[0]: raise ValueError(""foreground colors should be distinct"") return bg, fg_a[0], fg_b[0] def transform_t47(grid: Grid) -> Grid: a, b = _split_halves(grid) h, w = len(a), len(a[0]) if len(b) != h or len(b[0]) != w: raise ValueError(""halves must have matching dimensions"") bg, fg_a, fg_b = _infer_colors(a, b) out = _empty(h, w, BG_OUT) for r in range(h): for c in range(w): av = a[r][c] bv = b[r][c] if av not in (bg, fg_a) or bv not in (bg, fg_b): raise ValueError(""unexpected color in half"") has_a = av == fg_a has_b = bv == fg_b if has_a and not has_b: out[r][c] = fg_a elif has_b and not has_a: out[r][c] = fg_b else: out[r][c] = BG_OUT return out def _render_vertical(a: Grid, b: Grid) -> Grid: return [ra + [GRAY] + rb for ra, rb in zip(a, b)] def _render_horizontal(a: Grid, b: Grid) -> Grid: width = len(a[0]) return [row[:] for row in a] + [[GRAY for _ in range(width)]] + [row[:] for row in b] def _choose_colors(rng: random.Random) -> tuple[int, int, int]: bg = rng.choice([c for c in COLORS if c != GRAY]) remaining = [c for c in COLORS if c not in (bg, GRAY)] fg_a, fg_b = rng.sample(remaining, 2) return bg, fg_a, fg_b def _random_pattern( rng: random.Random, h: int, w: int, bg: int, fg_a: int, fg_b: int, ) -> tuple[Grid, Grid]: a = _empty(h, w, bg) b = _empty(h, w, bg) forced = [""a"", ""b"", ""both"", ""none""] cells = [(r, c) for r in range(h) for c in range(w)] rng.shuffle(cells) for state, (r, c) in zip(forced, cells): if state in (""a"", ""both""): a[r][c] = fg_a if state in (""b"", ""both""): b[r][c] = fg_b for r, c in cells[len(forced) :]: state = rng.choices( [""none"", ""a"", ""b"", ""both""], weights=[4, 5, 5, 3], k=1, )[0] if state in (""a"", ""both""): a[r][c] = fg_a if state in (""b"", ""both""): b[r][c] = fg_b return a, b def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, orientation: str | None = None, background: int | None = None, fg_a: int | None = None, fg_b: int | None = None, ) -> dict[str, Grid]: """"""Generate one valid ARC-style example."""""" rng = rng or random.Random() for _attempt in range(1000): hh = h if h is not None else rng.randint(3, 12) ww = w if w is not None else rng.randint(3, 12) if hh < 1 or ww < 1: continue if background is None or fg_a is None or fg_b is None: bg, ca, cb = _choose_colors(rng) if background is not None: bg = background if fg_a is not None: ca = fg_a if fg_b is not None: cb = fg_b else: bg, ca, cb = background, fg_a, fg_b if len({bg, ca, cb, GRAY}) != 4: continue a, b = _random_pattern(rng, hh, ww, bg, ca, cb) orient = orientation if orientation is not None else rng.choice([""vertical"", ""horizontal""]) if orient == ""vertical"": inp = _render_vertical(a, b) elif orient == ""horizontal"": inp = _render_horizontal(a, b) else: raise ValueError(""orientation must be 'vertical' or 'horizontal'"") out = transform_t47(inp) out_colors = {v for row in out for v in row} both_count = sum(1 for r in range(hh) for c in range(ww) if a[r][c] == ca and b[r][c] == cb) neither_count = sum(1 for r in range(hh) for c in range(ww) if a[r][c] == bg and b[r][c] == bg) if ca in out_colors and cb in out_colors and BG_OUT in out_colors and both_count > 0 and neither_count > 0: return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t47 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t47 XOR-halves rule."""""" from __future__ import annotations from typing import List from generator import transform_t47 Grid = List[List[int]] def verify_t47(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t47(inp) " "t48","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,3,3,3,3,3,0,0],[0,0,0,0,3,3,3,3,3,4,4,4,3,0,0],[0,0,0,0,3,6,6,6,3,4,4,4,3,0,0],[0,0,0,0,3,6,6,6,3,4,4,4,3,0,0],[0,0,0,0,3,6,3,3,3,3,4,4,3,0,0],[0,0,0,0,3,6,3,5,5,3,3,3,3,3,0],[0,0,0,0,3,6,3,5,5,3,8,8,8,3,0],[0,0,0,3,3,3,3,3,3,3,8,8,8,3,0],[0,0,0,3,0,0,0,0,3,8,8,8,8,3,0],[0,0,0,3,0,0,0,0,3,3,3,3,3,3,0],[0,0,0,3,0,0,0,0,3,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0,0,0,0,0,0,0],[0,0,0,9,2,2,2,2,9,0,0,0,0,0,0,0,0,0,0],[0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0],[0,0,0,9,4,4,4,4,4,4,4,4,4,4,4,4,9,0,0],[0,0,0,9,4,4,4,4,4,4,4,4,4,4,4,4,9,0,0],[0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0],[0,0,0,9,8,8,8,8,9,2,2,2,9,8,8,8,9,0,0],[0,0,0,9,8,8,8,8,9,2,2,2,9,8,8,8,9,0,0],[0,0,0,9,8,8,8,8,9,2,2,2,9,8,8,8,9,0,0],[0,0,0,9,9,9,9,9,9,9,9,9,9,8,8,8,9,0,0],[0,0,0,9,4,4,4,4,9,6,6,6,9,8,8,8,9,0,0],[0,0,0,9,4,4,4,4,9,6,6,6,9,8,8,8,9,0,0],[0,0,0,9,4,4,4,4,9,6,6,6,9,8,8,8,9,0,0],[0,0,0,9,4,4,4,4,9,6,6,6,9,8,8,8,9,0,0],[0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[2,8,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t48: uniquely completable four-color map coloring. Rule: - The last row begins with four palette colors. - In the map area above, one boundary color (not in the palette) forms the map walls, enclosing several regions. - Some regions are already colored with palette colors; at least one region is left uncolored (0). - Complete the empty regions so that adjacent regions never share a color. Generation constraints used to keep examples well-formed and unambiguous: - exactly four distinct palette colors are shown in the bottom-left legend; - exactly one distinct non-palette color is used as the boundary color; - every interior region is a 4-connected component separated by 1-cell-thick boundary walls; - the map contains at least one hidden region and at least two revealed regions; - the completed map uses all four palette colors at least once; - the partial coloring has exactly one valid completion; - generated maps prefer irregular outer silhouettes rather than always using a full rectangular enclosure. """""" from __future__ import annotations import itertools import json import random from typing import List, Sequence, Set, Tuple Grid = List[List[int]] Cell = Tuple[int, int] CoarseCell = Tuple[int, int] BG = 0 ALL_COLORS = list(range(1, 10)) NEI4 = [(-1, 0), (1, 0), (0, -1), (0, 1)] # --------------------------------------------------------------------------- # Generic transform / solver # --------------------------------------------------------------------------- def _empty(h: int, w: int) -> Grid: return [[0 for _ in range(w)] for _ in range(h)] def _find_palette(grid: Grid) -> list[int]: if not grid or not grid[0]: raise ValueError(""grid must be non-empty"") palette = grid[-1][:4] if len(palette) != 4 or any(v == 0 for v in palette) or len(set(palette)) != 4: raise ValueError(""bottom-left legend must contain four distinct nonzero colors"") return list(palette) def _find_boundary_color(grid: Grid, palette: Sequence[int]) -> int: colors = {v for row in grid[:-1] for v in row if v != 0} candidates = sorted(colors - set(palette)) if len(candidates) != 1: raise ValueError(""expected exactly one non-palette boundary color"") return candidates[0] def _components_non_boundary(grid: Grid, boundary_color: int) -> tuple[list[list[int]], list[set[Cell]]]: """"""Return component-id map and component cell sets for cells != boundary_color. Components include both interior regions and outer background; callers can decide which ones to use. """""" h, w = len(grid), len(grid[0]) comp_id = [[-1 for _ in range(w)] for _ in range(h)] comps: list[set[Cell]] = [] cid = 0 for r in range(h): for c in range(w): if grid[r][c] == boundary_color or comp_id[r][c] != -1: continue stack = [(r, c)] cells: set[Cell] = set() comp_id[r][c] = cid while stack: rr, cc = stack.pop() cells.add((rr, cc)) for dr, dc in NEI4: nr, nc = rr + dr, cc + dc if ( 0 <= nr < h and 0 <= nc < w and grid[nr][nc] != boundary_color and comp_id[nr][nc] == -1 ): comp_id[nr][nc] = cid stack.append((nr, nc)) comps.append(cells) cid += 1 return comp_id, comps class ParsedMap: def __init__( self, palette: Sequence[int], boundary_color: int, regions: list[set[Cell]], region_colors: list[int], adjacency: list[set[int]], ) -> None: self.palette = list(palette) self.boundary_color = boundary_color self.regions = regions self.region_colors = region_colors self.adjacency = adjacency def _parse_map(grid: Grid) -> ParsedMap: palette = _find_palette(grid) boundary = _find_boundary_color(grid, palette) map_grid = [row[:] for row in grid[:-1]] h, w = len(map_grid), len(map_grid[0]) comp_id, comps = _components_non_boundary(map_grid, boundary) # Interior regions are the non-boundary components that do not touch the outer frame. region_ids: list[int] = [] for cid, cells in enumerate(comps): touches_border = any(r == 0 or c == 0 or r == h - 1 or c == w - 1 for r, c in cells) if not touches_border: region_ids.append(cid) if not region_ids: raise ValueError(""no interior map regions found"") id_map = {cid: i for i, cid in enumerate(region_ids)} regions = [comps[cid] for cid in region_ids] region_colors: list[int] = [] for cells in regions: vals = {map_grid[r][c] for r, c in cells} if len(vals) != 1: raise ValueError(""each region must be monochrome or uncolored"") v = next(iter(vals)) if v != 0 and v not in palette: raise ValueError(""region color must be 0 or a legend color"") region_colors.append(v) adjacency: list[set[int]] = [set() for _ in regions] for r in range(h): for c in range(w): if map_grid[r][c] != boundary: continue neigh_ids: set[int] = set() for dr, dc in NEI4: nr, nc = r + dr, c + dc if 0 <= nr < h and 0 <= nc < w: cid = comp_id[nr][nc] if cid in id_map: neigh_ids.add(id_map[cid]) neigh = sorted(neigh_ids) for i in range(len(neigh)): for j in range(i + 1, len(neigh)): a, b = neigh[i], neigh[j] adjacency[a].add(b) adjacency[b].add(a) return ParsedMap(palette, boundary, regions, region_colors, adjacency) def _solve_region_coloring( palette: Sequence[int], adjacency: Sequence[Set[int]], preset: Sequence[int], max_solutions: int = 2, ) -> list[list[int]]: n = len(adjacency) domains = [set(palette) for _ in range(n)] for i, v in enumerate(preset): if v != 0: if v not in palette: return [] domains[i] = {v} for i in range(n): if len(domains[i]) == 1: vi = next(iter(domains[i])) for j in adjacency[i]: if i < j and len(domains[j]) == 1 and next(iter(domains[j])) == vi: return [] solutions: list[list[int]] = [] assign = [0] * n def backtrack() -> None: if len(solutions) >= max_solutions: return unassigned = [i for i in range(n) if assign[i] == 0] if not unassigned: solutions.append(assign[:]) return var = min(unassigned, key=lambda i: (len(domains[i]), -len(adjacency[i]), i)) forbidden = {assign[j] for j in adjacency[var] if assign[j] != 0} choices = sorted(v for v in domains[var] if v not in forbidden) for v in choices: assign[var] = v backtrack() assign[var] = 0 if len(solutions) >= max_solutions: return for i in range(n): if len(domains[i]) == 1: assign[i] = next(iter(domains[i])) for i in range(n): if assign[i] == 0: continue for j in adjacency[i]: if i < j and assign[j] == assign[i] != 0: return [] backtrack() return solutions def transform_t48(grid: Grid) -> Grid: parsed = _parse_map(grid) solutions = _solve_region_coloring(parsed.palette, parsed.adjacency, parsed.region_colors, max_solutions=2) if len(solutions) != 1: raise ValueError(""input does not have a unique valid completion"") sol = solutions[0] out = [row[:] for row in grid] for ridx, cells in enumerate(parsed.regions): color = sol[ridx] for r, c in cells: out[r][c] = color return out # --------------------------------------------------------------------------- # Generation helpers # --------------------------------------------------------------------------- def _shape_connected(shape: set[CoarseCell]) -> bool: if not shape: return False start = next(iter(shape)) stack = [start] seen = {start} while stack: r, c = stack.pop() for dr, dc in NEI4: nb = (r + dr, c + dc) if nb in shape and nb not in seen: seen.add(nb) stack.append(nb) return len(seen) == len(shape) def _shape_hole_free(shape: set[CoarseCell], coarse_h: int, coarse_w: int) -> bool: inactive = {(r, c) for r in range(coarse_h) for c in range(coarse_w) if (r, c) not in shape} if not inactive: return True stack = [cell for cell in inactive if cell[0] in (0, coarse_h - 1) or cell[1] in (0, coarse_w - 1)] seen = set(stack) while stack: r, c = stack.pop() for dr, dc in NEI4: nb = (r + dr, c + dc) if 0 <= nb[0] < coarse_h and 0 <= nb[1] < coarse_w and nb in inactive and nb not in seen: seen.add(nb) stack.append(nb) return seen == inactive def _generate_shape(rng: random.Random, coarse_h: int, coarse_w: int, target_cells: int) -> set[CoarseCell] | None: all_cells = {(r, c) for r in range(coarse_h) for c in range(coarse_w)} start = (rng.randrange(coarse_h), rng.randrange(coarse_w)) shape = {start} frontier = set() for dr, dc in NEI4: nr, nc = start[0] + dr, start[1] + dc if 0 <= nr < coarse_h and 0 <= nc < coarse_w: frontier.add((nr, nc)) while len(shape) < target_cells and frontier: candidates = list(frontier) weighted: list[tuple[int, CoarseCell]] = [] for cell in candidates: r, c = cell deg = sum((r + dr, c + dc) in shape for dr, dc in NEI4) score = 1 + 2 * deg # slight bias away from filling the whole bounding rectangle too early min_r = min(x for x, _ in shape | {cell}) max_r = max(x for x, _ in shape | {cell}) min_c = min(y for _, y in shape | {cell}) max_c = max(y for _, y in shape | {cell}) bbox_area = (max_r - min_r + 1) * (max_c - min_c + 1) if bbox_area > len(shape) + 1: score += 1 weighted.append((score, cell)) total = sum(score for score, _ in weighted) pick = rng.randrange(total) acc = 0 chosen = weighted[-1][1] for score, cell in weighted: acc += score if pick < acc: chosen = cell break shape.add(chosen) frontier.discard(chosen) r, c = chosen for dr, dc in NEI4: nr, nc = r + dr, c + dc if 0 <= nr < coarse_h and 0 <= nc < coarse_w and (nr, nc) not in shape: frontier.add((nr, nc)) if len(shape) != target_cells: return None if not _shape_connected(shape): return None if not _shape_hole_free(shape, coarse_h, coarse_w): return None # Prefer irregular silhouettes when possible. min_r = min(r for r, _ in shape) max_r = max(r for r, _ in shape) min_c = min(c for _, c in shape) max_c = max(c for _, c in shape) bbox_area = (max_r - min_r + 1) * (max_c - min_c + 1) if target_cells >= 5 and bbox_area == len(shape): return None return shape def _partition_shape( rng: random.Random, coarse_h: int, coarse_w: int, shape: set[CoarseCell], target_regions: int, ) -> tuple[list[int], list[int], set[CoarseCell], list[list[int]], list[set[int]]]: """"""Create a merged partition on an irregular connected coarse shape."""""" active_cells = sorted(shape) idx_of = {cell: i for i, cell in enumerate(active_cells)} parent = list(range(len(active_cells))) def find(x: int) -> int: while parent[x] != x: parent[x] = parent[parent[x]] x = parent[x] return x def union(a: int, b: int) -> bool: ra, rb = find(a), find(b) if ra == rb: return False parent[rb] = ra return True edges: list[tuple[int, int]] = [] for r, c in active_cells: a = idx_of[(r, c)] for dr, dc in ((1, 0), (0, 1)): nb = (r + dr, c + dc) if nb in idx_of: edges.append((a, idx_of[nb])) rng.shuffle(edges) region_count = len(active_cells) for a, b in edges: if region_count <= target_regions: break if union(a, b): region_count -= 1 root_to_region: dict[int, int] = {} region_of_cell = [[-1 for _ in range(coarse_w)] for _ in range(coarse_h)] next_id = 0 for r, c in active_cells: root = find(idx_of[(r, c)]) if root not in root_to_region: root_to_region[root] = next_id next_id += 1 region_of_cell[r][c] = root_to_region[root] nregions = next_id adjacency = [set() for _ in range(nregions)] for r, c in active_cells: a = region_of_cell[r][c] for dr, dc in ((1, 0), (0, 1)): nr, nc = r + dr, c + dc if 0 <= nr < coarse_h and 0 <= nc < coarse_w and region_of_cell[nr][nc] != -1: b = region_of_cell[nr][nc] if a != b: adjacency[a].add(b) adjacency[b].add(a) row_sizes = [rng.randint(2, 4) for _ in range(coarse_h)] col_sizes = [rng.randint(2, 4) for _ in range(coarse_w)] return row_sizes, col_sizes, shape, region_of_cell, adjacency def _enumerate_full_colorings( palette: Sequence[int], adjacency: Sequence[Set[int]], max_solutions: int = 10000 ) -> list[list[int]]: return _solve_region_coloring(palette, adjacency, [0] * len(adjacency), max_solutions=max_solutions) def _choose_target_and_revealed( rng: random.Random, palette: Sequence[int], adjacency: Sequence[Set[int]], ) -> tuple[list[int], set[int]] | None: """"""Pick a full coloring and a reveal set with a unique completion."""""" n = len(adjacency) all_colorings = _enumerate_full_colorings(palette, adjacency, max_solutions=10000) if not all_colorings: return None good_targets = [col for col in all_colorings if set(col) == set(palette)] if not good_targets: return None rng.shuffle(good_targets) region_indices = list(range(n)) hidden_sizes = [2, 3, 1] if n >= 5 else [1, 2] for target in good_targets: for hidden_size in hidden_sizes: if hidden_size <= 0 or hidden_size >= n: continue candidates = list(itertools.combinations(region_indices, hidden_size)) rng.shuffle(candidates) for hidden in candidates: hidden_set = set(hidden) revealed = [i for i in region_indices if i not in hidden_set] if len(revealed) < 2: continue filtered = [col for col in all_colorings if all(col[i] == target[i] for i in revealed)] if len(filtered) == 1: return list(target), set(revealed) return None def _render_partition( row_sizes: Sequence[int], col_sizes: Sequence[int], shape: set[CoarseCell], region_of_cell: Sequence[Sequence[int]], full_colors: Sequence[int], revealed: Set[int], boundary_color: int, palette: Sequence[int], top_margin: int, left_margin: int, right_margin: int, gap_above_legend: int, ) -> tuple[Grid, Grid]: coarse_h = len(row_sizes) coarse_w = len(col_sizes) map_h = sum(row_sizes) + coarse_h + 1 map_w = sum(col_sizes) + coarse_w + 1 total_h = top_margin + map_h + gap_above_legend + 1 total_w = max(left_margin + map_w + right_margin, 4) inp = _empty(total_h, total_w) out = _empty(total_h, total_w) for c, v in enumerate(palette): inp[-1][c] = v out[-1][c] = v r0 = top_margin c0 = left_margin row_starts = [] cur = r0 + 1 for hs in row_sizes: row_starts.append(cur) cur += hs + 1 col_starts = [] cur = c0 + 1 for ws in col_sizes: col_starts.append(cur) cur += ws + 1 # Draw each active coarse cell as a local rectangle with walls. for rr, cc in sorted(shape): rid = region_of_cell[rr][cc] fill_in = full_colors[rid] if rid in revealed else 0 fill_out = full_colors[rid] rs = row_starts[rr] cs = col_starts[cc] hs = row_sizes[rr] ws = col_sizes[cc] # Outer local box first (walls + interior). for r in range(rs - 1, rs + hs + 1): for c in range(cs - 1, cs + ws + 1): inp[r][c] = boundary_color out[r][c] = boundary_color # Interior. for r in range(rs, rs + hs): for c in range(cs, cs + ws): inp[r][c] = fill_in out[r][c] = fill_out # Remove walls between same-region neighboring active cells. for rr, cc in sorted(shape): rid = region_of_cell[rr][cc] fill_in = full_colors[rid] if rid in revealed else 0 fill_out = full_colors[rid] rs = row_starts[rr] cs = col_starts[cc] hs = row_sizes[rr] ws = col_sizes[cc] if (rr + 1, cc) in shape and region_of_cell[rr + 1][cc] == rid: wall_r = rs + hs for c in range(cs, cs + ws): inp[wall_r][c] = fill_in out[wall_r][c] = fill_out if (rr, cc + 1) in shape and region_of_cell[rr][cc + 1] == rid: wall_c = cs + ws for r in range(rs, rs + hs): inp[r][wall_c] = fill_in out[r][wall_c] = fill_out return inp, out def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, ) -> dict[str, Grid]: rng = rng or random.Random() for _attempt in range(6000): boundary_color = rng.choice(ALL_COLORS) palette = rng.sample([c for c in ALL_COLORS if c != boundary_color], 4) coarse_h = rng.randint(3, 5) coarse_w = rng.randint(3, 5) max_cells = coarse_h * coarse_w min_cells = min(max_cells, 5) target_cells = rng.randint(min_cells, max_cells - 1 if max_cells >= 6 else max_cells) shape = _generate_shape(rng, coarse_h, coarse_w, target_cells) if shape is None: continue target_regions = rng.randint(4, min(len(shape), 8)) row_sizes, col_sizes, shape, region_of_cell, adjacency = _partition_shape( rng, coarse_h, coarse_w, shape, target_regions ) nregions = len(adjacency) if nregions < 4: continue chosen = _choose_target_and_revealed(rng, palette, adjacency) if chosen is None: continue full_colors, revealed = chosen if len(revealed) >= nregions or len(revealed) < 2: continue top_margin = rng.randint(0, 3) left_margin = rng.randint(0, 3) right_margin = rng.randint(0, 3) gap_above_legend = rng.randint(1, 2) inp, out = _render_partition( row_sizes, col_sizes, shape, region_of_cell, full_colors, revealed, boundary_color, palette, top_margin, left_margin, right_margin, gap_above_legend, ) if h is not None or w is not None: hh = len(inp) ww = len(inp[0]) target_h = h if h is not None else hh target_w = w if w is not None else ww if hh > target_h or ww > target_w: continue pad_top = rng.randint(0, target_h - hh) pad_left = rng.randint(0, target_w - ww) new_inp = _empty(target_h, target_w) new_out = _empty(target_h, target_w) for r in range(hh): for c in range(ww): new_inp[pad_top + r][pad_left + c] = inp[r][c] new_out[pad_top + r][pad_left + c] = out[r][c] inp, out = new_inp, new_out for c, v in enumerate(palette): inp[-1][c] = v out[-1][c] = v try: check = transform_t48(inp) except Exception: continue if check != out: continue return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t48 sample"") if __name__ == ""__main__"": print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t48 uniquely completable four-color map coloring."""""" from __future__ import annotations from typing import List from generator import transform_t48 Grid = List[List[int]] def verify_t48(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t48(inp) " "t49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,0,0,0,0,0,0,0,0,0,0,4,4,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,0,0],[4,4,5,4,4,5,5,5,5,5,5,5,5,4,4,0,0],[4,4,5,4,4,5,5,5,5,5,5,5,5,4,4,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","""""""Generator for Test2/t49: aligned 2x2 nodes connected by an MST. Rule: - The input contains several 2x2 nodes, all in one non-black/non-gray color. - Two nodes can be connected only when their 2x2 blocks have the same top row or the same left column. - The weight of a valid connection is the gap distance between the two blocks, measured in cells between their facing edges. - Draw a minimal spanning tree of the alignment graph using gray (5) cells. Corridors are two cells wide, matching the width/height of the 2x2 nodes. Generation constraints used to keep examples unambiguous: - every colored component is exactly a 2x2 node; - the alignment graph is connected; - the MST is unique; - selected MST corridors do not pass through another colored node; - at least one horizontal and one vertical MST edge appear when possible; - default generation prefers richer multi-row / multi-column topologies rather than simple single-row / single-column chains. """""" from __future__ import annotations import random from collections import Counter from dataclasses import dataclass from typing import List, Sequence, Tuple Grid = List[List[int]] Cell = Tuple[int, int] Node = Tuple[int, int] # top-left row, top-left col BG = 0 GRAY = 5 NODE_COLORS = [1, 2, 3, 4, 6, 7, 8, 9] NEI4 = [(-1, 0), (1, 0), (0, -1), (0, 1)] @dataclass(frozen=True) class Edge: weight: int a: int b: int class DSU: def __init__(self, n: int): self.p = list(range(n)) self.r = [0] * n def find(self, x: int) -> int: while self.p[x] != x: self.p[x] = self.p[self.p[x]] x = self.p[x] return x def union(self, a: int, b: int) -> bool: ra, rb = self.find(a), self.find(b) if ra == rb: return False if self.r[ra] < self.r[rb]: ra, rb = rb, ra self.p[rb] = ra if self.r[ra] == self.r[rb]: self.r[ra] += 1 return True def _empty(h: int, w: int) -> Grid: return [[BG for _ in range(w)] for _ in range(h)] def _rectangular(grid: Grid) -> bool: return bool(grid) and bool(grid[0]) and all(len(row) == len(grid[0]) for row in grid) def _node_cells(node: Node) -> set[Cell]: r, c = node return {(r, c), (r + 1, c), (r, c + 1), (r + 1, c + 1)} def _touch_or_overlap(a: Node, b: Node) -> bool: # True when the two 2x2 blocks overlap or touch by a 4-neighbor edge. ar, ac = a br, bc = b return not (ar + 1 < br - 1 or br + 1 < ar - 1 or ac + 1 < bc - 1 or bc + 1 < ac - 1) def _find_nodes(grid: Grid) -> tuple[int, list[Node]]: """"""Return (foreground color, sorted 2x2 node top-lefts)."""""" if not _rectangular(grid): raise ValueError(""input grid must be non-empty and rectangular"") colors = sorted({v for row in grid for v in row if v not in (BG, GRAY)}) if len(colors) != 1: raise ValueError(""expected exactly one non-gray foreground color"") color = colors[0] h, w = len(grid), len(grid[0]) seen: set[Cell] = set() nodes: list[Node] = [] for r in range(h): for c in range(w): if grid[r][c] != color or (r, c) in seen: continue stack = [(r, c)] comp: set[Cell] = set() while stack: rr, cc = stack.pop() if (rr, cc) in comp or grid[rr][cc] != color: continue comp.add((rr, cc)) for dr, dc in NEI4: nr, nc = rr + dr, cc + dc if 0 <= nr < h and 0 <= nc < w and grid[nr][nc] == color and (nr, nc) not in comp: stack.append((nr, nc)) seen |= comp if len(comp) != 4: raise ValueError(""each foreground component must be a 2x2 node"") rs = [rr for rr, _ in comp] cs = [cc for _, cc in comp] r0, c0 = min(rs), min(cs) if comp != _node_cells((r0, c0)): raise ValueError(""each foreground component must be a filled 2x2 node"") nodes.append((r0, c0)) if not nodes: raise ValueError(""expected at least one node"") return color, sorted(nodes) def _edge_weight(a: Node, b: Node) -> int | None: if a[0] == b[0]: return abs(a[1] - b[1]) - 2 if a[1] == b[1]: return abs(a[0] - b[0]) - 2 return None def _edges(nodes: Sequence[Node]) -> list[Edge]: out: list[Edge] = [] for i in range(len(nodes)): for j in range(i + 1, len(nodes)): wt = _edge_weight(nodes[i], nodes[j]) if wt is not None and wt > 0: out.append(Edge(wt, i, j)) return sorted(out, key=lambda e: (e.weight, nodes[e.a], nodes[e.b])) def _mst_edges(nodes: Sequence[Node]) -> list[Edge]: dsu = DSU(len(nodes)) chosen: list[Edge] = [] for e in _edges(nodes): if dsu.union(e.a, e.b): chosen.append(e) if len(chosen) == len(nodes) - 1: break if len(nodes) > 1 and len(chosen) != len(nodes) - 1: raise ValueError(""alignment graph is disconnected"") return chosen def _has_unique_mst(nodes: Sequence[Node]) -> bool: """"""Kruskal uniqueness test: each equal-weight group must be acyclic after contraction."""""" edges = _edges(nodes) if len(nodes) <= 1: return True if len(_mst_edges(nodes)) != len(nodes) - 1: return False dsu = DSU(len(nodes)) i = 0 while i < len(edges): wt = edges[i].weight group: list[Edge] = [] while i < len(edges) and edges[i].weight == wt: group.append(edges[i]) i += 1 temp = DSU(len(nodes)) for e in group: a, b = dsu.find(e.a), dsu.find(e.b) if a == b: continue if not temp.union(a, b): return False for e in group: dsu.union(e.a, e.b) return True def _corridor_cells(a: Node, b: Node) -> list[Cell]: ar, ac = a br, bc = b cells: list[Cell] = [] if ar == br: lo, hi = sorted((ac, bc)) for c in range(lo + 2, hi): cells.append((ar, c)) cells.append((ar + 1, c)) elif ac == bc: lo, hi = sorted((ar, br)) for r in range(lo + 2, hi): cells.append((r, ac)) cells.append((r, ac + 1)) else: raise ValueError(""nodes are not aligned"") return cells def _corridor_clear(nodes: Sequence[Node], e: Edge) -> bool: occupied: set[Cell] = set() for k, n in enumerate(nodes): if k not in (e.a, e.b): occupied |= _node_cells(n) return all(cell not in occupied for cell in _corridor_cells(nodes[e.a], nodes[e.b])) def transform_t49(grid: Grid) -> Grid: """"""Draw the gray minimal-spanning tree between aligned 2x2 nodes."""""" _color, nodes = _find_nodes(grid) h, w = len(grid), len(grid[0]) out = [list(row) for row in grid] for e in _mst_edges(nodes): for r, c in _corridor_cells(nodes[e.a], nodes[e.b]): if 0 <= r < h and 0 <= c < w and out[r][c] == BG: out[r][c] = GRAY return out def _alignment_connected(nodes: Sequence[Node]) -> bool: if not nodes: return False dsu = DSU(len(nodes)) for e in _edges(nodes): dsu.union(e.a, e.b) root = dsu.find(0) return all(dsu.find(i) == root for i in range(len(nodes))) def _alignment_edge_count(nodes: Sequence[Node]) -> int: return len(_edges(nodes)) def _rich_structure(nodes: Sequence[Node]) -> bool: """"""Prefer nontrivial multi-row / multi-column graphs for default generation."""""" n = len(nodes) rows = Counter(r for r, _ in nodes) cols = Counter(c for _, c in nodes) dr = len(rows) dc = len(cols) repeated_rows = sum(v >= 2 for v in rows.values()) repeated_cols = sum(v >= 2 for v in cols.values()) ecount = _alignment_edge_count(nodes) if n >= 6: return dr >= 3 and dc >= 3 and repeated_rows >= 2 and repeated_cols >= 2 and ecount >= n if n == 5: return dr >= 3 and dc >= 3 and repeated_rows >= 2 and repeated_cols >= 2 and ecount >= n - 1 if n == 4: return dr >= 2 and dc >= 2 and repeated_rows >= 1 and repeated_cols >= 1 and ecount >= n - 1 return dr >= 2 and dc >= 2 def _valid_nodes(nodes: Sequence[Node], h: int, w: int, *, prefer_rich: bool = False) -> bool: if len(set(nodes)) != len(nodes): return False for r, c in nodes: if r < 0 or c < 0 or r + 1 >= h or c + 1 >= w: return False for i in range(len(nodes)): for j in range(i + 1, len(nodes)): if _touch_or_overlap(nodes[i], nodes[j]): return False if not _alignment_connected(nodes): return False try: mst = _mst_edges(nodes) except ValueError: return False if not _has_unique_mst(nodes): return False if not all(_corridor_clear(nodes, e) for e in mst): return False if len(nodes) >= 4: has_h = any(nodes[e.a][0] == nodes[e.b][0] for e in mst) has_v = any(nodes[e.a][1] == nodes[e.b][1] for e in mst) if not (has_h and has_v): return False if prefer_rich and not _rich_structure(nodes): return False return True def _render(h: int, w: int, nodes: Sequence[Node], color: int) -> Grid: grid = _empty(h, w) for r, c in nodes: for rr, cc in _node_cells((r, c)): grid[rr][cc] = color return grid def _sample_axis_positions(rng: random.Random, limit: int, count: int) -> list[int] | None: """"""Sample top-left coordinates with >=3 spacing so same-line nodes never touch."""""" vals = list(range(0, max(0, limit - 1))) rng.shuffle(vals) chosen: list[int] = [] for v in vals: if all(abs(v - u) >= 3 for u in chosen): chosen.append(v) if len(chosen) == count: return sorted(chosen) return None def _grow_nodes_on_lattice( rng: random.Random, rows: Sequence[int], cols: Sequence[int], n: int, ) -> list[Node] | None: """"""Grow a connected set of intersections, biased toward richer topology."""""" if not rows or not cols or n <= 0: return None nodes: set[Node] = set() used_rows: set[int] = set() used_cols: set[int] = set() # Seed with a 2x2 rectangle whenever possible to discourage simple chains. if n >= 4 and len(rows) >= 2 and len(cols) >= 2: rs = rng.sample(list(rows), 2) cs = rng.sample(list(cols), 2) for r in rs: for c in cs: nodes.add((r, c)) used_rows.update(rs) used_cols.update(cs) else: start = (rng.choice(list(rows)), rng.choice(list(cols))) nodes.add(start) used_rows.add(start[0]) used_cols.add(start[1]) while len(nodes) < n: candidates: list[tuple[int, Node]] = [] for r in rows: for c in cols: cand = (r, c) if cand in nodes: continue if r not in used_rows and c not in used_cols: continue # would disconnect the alignment graph row_count = sum(rr == r for rr, _ in nodes) col_count = sum(cc == c for _, cc in nodes) introduces = int(r not in used_rows) + int(c not in used_cols) # Weighted preference: # - new row xor new col expands the graph, # - existing row and existing col densifies it and adds extra alignments, # - candidates on already-populated lines are favored for richer graphs. if introduces == 1: score = 4 + row_count + col_count else: score = 6 + 2 * row_count + 2 * col_count candidates.append((score, cand)) if not candidates: return None total = sum(score for score, _ in candidates) pick = rng.randrange(total) acc = 0 chosen = candidates[-1][1] for score, cand in candidates: acc += score if pick < acc: chosen = cand break nodes.add(chosen) used_rows.add(chosen[0]) used_cols.add(chosen[1]) return sorted(nodes) def _sample_rich_nodes(rng: random.Random, h: int, w: int, n: int) -> list[Node] | None: max_rows = max(1, (h + 1) // 3) max_cols = max(1, (w + 1) // 3) if n >= 6: row_count = min(max_rows, rng.randint(3, min(4, n - 1, max_rows))) col_count = min(max_cols, rng.randint(3, min(4, n - 1, max_cols))) elif n == 5: row_count = min(max_rows, rng.randint(3, min(4, max_rows))) col_count = min(max_cols, rng.randint(3, min(4, max_cols))) elif n == 4: row_count = min(max_rows, rng.randint(2, min(3, max_rows))) col_count = min(max_cols, rng.randint(2, min(3, max_cols))) else: row_count = min(max_rows, rng.randint(2, min(3, max_rows))) col_count = min(max_cols, rng.randint(2, min(3, max_cols))) if row_count < 2 or col_count < 2: return None rows = _sample_axis_positions(rng, h, row_count) cols = _sample_axis_positions(rng, w, col_count) if rows is None or cols is None: return None if row_count * col_count < n: return None return _grow_nodes_on_lattice(rng, rows, cols, n) def _sample_basic_nodes(rng: random.Random, h: int, w: int, n: int) -> list[Node] | None: start = (rng.randint(0, h - 2), rng.randint(0, w - 2)) nodes = [start] for _ in range(n - 1): base = rng.choice(nodes) br, bc = base dirs = [""left"", ""right"", ""up"", ""down""] rng.shuffle(dirs) cand: Node | None = None for direction in dirs: if direction in (""left"", ""right""): max_gap = (bc - 2) if direction == ""left"" else (w - (bc + 2) - 2) else: max_gap = (br - 2) if direction == ""up"" else (h - (br + 2) - 2) if max_gap < 1: continue gaps = list(range(1, max_gap + 1)) rng.shuffle(gaps) for gap in gaps: if direction == ""left"": trial = (br, bc - gap - 2) elif direction == ""right"": trial = (br, bc + gap + 2) elif direction == ""up"": trial = (br - gap - 2, bc) else: trial = (br + gap + 2, bc) if all(not _touch_or_overlap(trial, existing) for existing in nodes): cand = trial break if cand is not None: break if cand is None: return None nodes.append(cand) return sorted(nodes) def generate( rng: random.Random | None = None, h: int | None = None, w: int | None = None, num_nodes: int | None = None, color: int | None = None, ) -> dict[str, Grid]: """"""Generate one valid ARC-style example."""""" rng = rng or random.Random() for attempt in range(6000): hh = h if h is not None else rng.randint(11, 30) ww = w if w is not None else rng.randint(11, 30) if hh < 5 or ww < 5: continue max_nodes = min(10, max(4, (hh * ww) // 28)) min_nodes = 4 if min(hh, ww) < 13 else 5 n = num_nodes if num_nodes is not None else rng.randint(min_nodes, max_nodes) col = color if color is not None else rng.choice(NODE_COLORS) # Prefer richer lattice-grown structures; occasionally fall back to a # simpler construction so the task family still covers a range of cases. use_rich = attempt < 5000 and (num_nodes is None or n >= 4) nodes = _sample_rich_nodes(rng, hh, ww, n) if use_rich else _sample_basic_nodes(rng, hh, ww, n) if nodes is None: continue if not _valid_nodes(nodes, hh, ww, prefer_rich=use_rich): continue inp = _render(hh, ww, nodes, col) out = transform_t49(inp) return {""input"": inp, ""output"": out} raise RuntimeError(""failed to generate a valid t49 sample"") if __name__ == ""__main__"": import json print(json.dumps(generate(rng=random.Random(0)), indent=2)) ","""""""Verifier for Test2/t49 aligned-node minimal-spanning-tree rule."""""" from __future__ import annotations from typing import List from generator import transform_t49 Grid = List[List[int]] def verify_t49(inp: Grid) -> Grid: if not inp or not inp[0]: raise ValueError(""input grid must be non-empty"") w = len(inp[0]) if any(len(row) != w for row in inp): raise ValueError(""ragged input grid"") return transform_t49(inp) " "t50","[{""input"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,5,0,0,5,7,0,5,7,0,5,0,0],[0,0,7,0,0,0,0,0,0,0,0,7,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,5,7,0,5,0,0,3,7,0,5,0,0],[0,0,0,0,0,7,0,0,0,0,0,7,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,5,0,0,5,7,0,5,7,0,5,0,0],[0,0,7,0,0,0,0,0,0,0,0,7,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,5,0,7,5,0,0,5,0,7,5,0,0],[0,0,7,0,0,0,0,0,7,0,0,0,0,0],[0,0,0,0,0,7,0,0,0,0,0,0,0,0],[0,0,5,7,0,5,0,7,5,0,7,5,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0],[0,0,0,4,0,0,5,7,0,5,0,0,5,0,0,5,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],""output"":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,5,7,0,4,4,4,4,0,0,5,7,0,5,0,0,0],[0,0,0,0,0,0,4,0,0,4,0,0,0,0,0,7,0,0,0],[0,0,0,7,0,0,4,0,0,4,0,0,0,0,0,0,0,0,0],[0,0,0,5,0,0,4,0,0,4,0,0,5,7,7,5,0,0,0],[0,0,0,0,0,0,4,0,0,4,0,0,0,0,0,0,0,0,0],[0,0,0,7,0,0,4,0,0,4,0,0,7,0,0,7,0,0,0],[0,0,0,5,0,0,4,4,4,4,0,0,5,0,0,5,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}",""""""" Generator for t50: Functional-graph cycle detection → polygon drawing. Layout ------ Nodes occupy a regular (R_n × C_n) sub-grid inside the pixel grid. Each node sits at pixel position (r0 + ri * s, c0 + ci * s) where (ri, ci) is its 0-based node-grid index, r0/c0 are the top-left offsets, and s is the node spacing (s >= 3). Each node has exactly one outgoing direction (up/down/left/right) stored as a unit vector (dr, dc). The orange (7) indicator is placed one pixel from the node in that direction. The next node is s pixels away in the same direction. Well-formedness constraints enforced at generation time ------------------------------------------------------- 1. Node spacing s >= 3 → orange cells never coincide with other nodes. 2. Directions only point to valid in-grid neighbours → no out-of-bounds arrows; orange cells are always at least 1 pixel inside the grid border. 3. Cycle length >= 4. 4. The highlighted node is NOT in the cycle. 5. The cycle spans >= 2 distinct pixel rows AND >= 2 distinct pixel columns (guarantees a visible polygon, not a degenerate line segment). """""" from __future__ import annotations import random from typing import Dict, List, Optional, Tuple Grid = List[List[int]] # --------------------------------------------------------------------------- # # Internal helpers # # --------------------------------------------------------------------------- # def _empty(rows: int, cols: int) -> Grid: return [[0] * cols for _ in range(rows)] def _node_pixel(r0: int, c0: int, s: int, ri: int, ci: int) -> Tuple[int, int]: """"""Return the pixel coordinate of node-grid position (ri, ci)."""""" return (r0 + ri * s, c0 + ci * s) def _valid_dirs(ri: int, ci: int, R_n: int, C_n: int) -> List[Tuple[int, int]]: """""" Return the list of valid unit-vector directions for the node at node-grid position (ri, ci). A direction is valid if it leads to an in-grid neighbour. """""" result: List[Tuple[int, int]] = [] if ri > 0: result.append((-1, 0)) # up if ri < R_n - 1: result.append(( 1, 0)) # down if ci > 0: result.append(( 0, -1)) # left if ci < C_n - 1: result.append(( 0, 1)) # right return result def _detect_cycle( start: Tuple[int, int], graph: Dict[Tuple[int, int], Tuple[int, int]], ) -> Tuple[List[Tuple[int, int]], List[Tuple[int, int]]]: """""" Follow the functional graph from *start* until a node is revisited. Returns (full_path, cycle) where *cycle* is the list of nodes in the detected cycle, in traversal order, beginning with the first repeated node. Returns an empty cycle list if no cycle is found (malformed graph). """""" path: List[Tuple[int, int]] = [start] visited: Dict[Tuple[int, int], int] = {start: 0} current = start while True: nxt = graph.get(current) if nxt is None: return path, [] if nxt in visited: return path, path[visited[nxt]:] visited[nxt] = len(path) path.append(nxt) current = nxt def _draw_cycle(out: Grid, cycle: List[Tuple[int, int]], color: int) -> None: """""" Draw straight lines between every consecutive pair of cycle nodes (including the wrap-around pair last → first) using *color*. Lines are axis-aligned; both endpoints are included. """""" n = len(cycle) for i in range(n): r1, c1 = cycle[i] r2, c2 = cycle[(i + 1) % n] if r1 == r2: # horizontal for col in range(min(c1, c2), max(c1, c2) + 1): out[r1][col] = color else: # vertical (c1 == c2) for row in range(min(r1, r2), max(r1, r2) + 1): out[row][c1] = color # --------------------------------------------------------------------------- # # Public API # # --------------------------------------------------------------------------- # def generate( R_n: Optional[int] = None, C_n: Optional[int] = None, s: Optional[int] = None, r0: Optional[int] = None, c0: Optional[int] = None, grid_rows: Optional[int] = None, grid_cols: Optional[int] = None, dirs: Optional[Dict[Tuple[int, int], Tuple[int, int]]] = None, highlight_pos: Optional[Tuple[int, int]] = None, highlight_color: Optional[int] = None, rng: Optional[random.Random] = None, ) -> dict: """""" Generate one t50 ARC puzzle pair {""input"": Grid, ""output"": Grid}. Parameters (all optional — omit for random choices) --------------------------------------------------- R_n, C_n : Node-grid dimensions (both >= 2). s : Node spacing in pixels (>= 3; 3 or 4 recommended). r0, c0 : Pixel offset of the top-left node (>= 1). grid_rows/cols : Total pixel-grid dimensions (auto-sized if omitted). dirs : Mapping (ri, ci) -> (dr, dc) for every node. (dr, dc) must be a valid unit direction for that node. highlight_pos : Node-grid (ri, ci) of the highlighted start node. highlight_color : Integer colour for the highlighted node (1–9, ≠ 5, 7). rng : Random source (uses random.Random() if omitted). Raises ------ RuntimeError if no valid sample is found after 500 attempts. ValueError if fixed parameters produce a constraint violation. """""" rr = rng if rng is not None else random.Random() _FIXED = dirs is not None and highlight_pos is not None for attempt in range(500): # ---------------------------------------------------------------- # # Choose layout # # ---------------------------------------------------------------- # rn = R_n if R_n is not None else rr.randint(2, 5) cn = C_n if C_n is not None else rr.randint(2, 5) sp = s if s is not None else rr.choice([3, 4]) row_off = r0 if r0 is not None else rr.randint(1, 3) col_off = c0 if c0 is not None else rr.randint(1, 3) # Grid size: enough room for nodes + at least 1 border pixel on each side min_gr = row_off + (rn - 1) * sp + 2 min_gc = col_off + (cn - 1) * sp + 2 gr = max(grid_rows or 0, min_gr + rr.randint(0, 2)) gc = max(grid_cols or 0, min_gc + rr.randint(0, 2)) # ---------------------------------------------------------------- # # Assign directions # # ---------------------------------------------------------------- # if dirs is not None: chosen_dirs: Dict[Tuple[int, int], Tuple[int, int]] = dirs else: chosen_dirs = {} for ri in range(rn): for ci in range(cn): valid = _valid_dirs(ri, ci, rn, cn) chosen_dirs[(ri, ci)] = rr.choice(valid) # ---------------------------------------------------------------- # # Build the pixel-level functional graph # # ---------------------------------------------------------------- # pixel_graph: Dict[Tuple[int, int], Tuple[int, int]] = {} for (ri, ci), (dr, dc) in chosen_dirs.items(): src = _node_pixel(row_off, col_off, sp, ri, ci) dst = _node_pixel(row_off, col_off, sp, ri + dr, ci + dc) pixel_graph[src] = dst # ---------------------------------------------------------------- # # Choose highlighted node # # ---------------------------------------------------------------- # if highlight_pos is not None: hl_ri, hl_ci = highlight_pos hl_pixel = _node_pixel(row_off, col_off, sp, hl_ri, hl_ci) else: hl_ri = rr.randint(0, rn - 1) hl_ci = rr.randint(0, cn - 1) hl_pixel = _node_pixel(row_off, col_off, sp, hl_ri, hl_ci) # ---------------------------------------------------------------- # # Detect cycle and check constraints # # ---------------------------------------------------------------- # _, cycle = _detect_cycle(hl_pixel, pixel_graph) def _fail(msg: str) -> None: if _FIXED: raise ValueError(msg) if len(cycle) < 4: _fail(""Cycle length < 4."") continue if hl_pixel in cycle: _fail(""Highlighted node is in the cycle."") continue cycle_rows = {r for r, _ in cycle} cycle_cols = {c for _, c in cycle} if len(cycle_rows) < 2 or len(cycle_cols) < 2: _fail(""Cycle does not span >=2 rows and >=2 cols."") continue # ---------------------------------------------------------------- # # Choose highlight colour # # ---------------------------------------------------------------- # if highlight_color is not None: hl_color = highlight_color else: hl_color = rr.choice([v for v in range(1, 10) if v not in (5, 7)]) # ---------------------------------------------------------------- # # Build input grid # # ---------------------------------------------------------------- # inp = _empty(gr, gc) for ri in range(rn): for ci in range(cn): r_px, c_px = _node_pixel(row_off, col_off, sp, ri, ci) inp[r_px][c_px] = hl_color if (r_px, c_px) == hl_pixel else 5 dr, dc = chosen_dirs[(ri, ci)] inp[r_px + dr][c_px + dc] = 7 # orange arrow # ---------------------------------------------------------------- # # Build output grid # # ---------------------------------------------------------------- # out = [row[:] for row in inp] out[hl_pixel[0]][hl_pixel[1]] = 5 # restore start to gray _draw_cycle(out, cycle, hl_color) return {""input"": inp, ""output"": out} raise RuntimeError(""Could not generate a valid t50 sample after 500 attempts."") ",""""""" Verifier for t50: Functional-graph cycle detection → polygon drawing. Rule ---- The input is a pixel grid containing: • Gray (5) nodes arranged on a regular sub-grid. • Exactly one highlighted node (any colour ≠ 0, 5, 7) — the start. • For every node (gray or highlighted) exactly one adjacent (4-connected) orange (7) cell indicating the direction of travel to the next node. Starting from the highlighted node, follow arrows node-to-node until a node is visited for the second time. That revisited node is the first element of the cycle; all nodes from that point up to (but not including) the revisit form the cycle. Output construction ------------------- 1. Copy input. 2. Restore the highlighted node to gray (5); its orange arrow is kept. 3. For each consecutive pair of cycle nodes (including the wrap-around pair last → first), draw a straight horizontal or vertical line through every pixel between them (inclusive) in the highlight colour. This overwrites any content already on those pixels (cycle node markers and their orange arrows are naturally covered by the lines that pass through them). Well-formedness assumptions (the verifier does not validate these): • Every node has exactly one adjacent orange. • Every orange points toward another node that is in-bounds. • The highlighted node is NOT itself a member of the cycle. • The cycle spans at least 4 nodes, at least 2 distinct rows, at least 2 distinct columns — guaranteeing a visible, non-degenerate polygon. """""" from __future__ import annotations from typing import Dict, List, Optional, Tuple Grid = List[List[int]] def verify_t50(grid: Grid) -> Grid: H = len(grid) if H == 0: return [] W = len(grid[0]) if W == 0: return [[] for _ in range(H)] # ------------------------------------------------------------------ # # 1. Locate every node and the unique highlighted node. # # ------------------------------------------------------------------ # node_set: set[Tuple[int, int]] = set() highlight_pos: Optional[Tuple[int, int]] = None highlight_color: Optional[int] = None for r in range(H): for c in range(W): v = grid[r][c] if v == 5: node_set.add((r, c)) elif v not in (0, 7): node_set.add((r, c)) highlight_pos = (r, c) highlight_color = v if highlight_pos is None: return [row[:] for row in grid] # ------------------------------------------------------------------ # # 2. For each node find its direction from the adjacent orange cell. # # ------------------------------------------------------------------ # directions: Dict[Tuple[int, int], Tuple[int, int]] = {} for r, c in node_set: for dr, dc in ((-1, 0), (1, 0), (0, -1), (0, 1)): rr, cc = r + dr, c + dc if 0 <= rr < H and 0 <= cc < W and grid[rr][cc] == 7: directions[(r, c)] = (dr, dc) break # exactly one orange per node # ------------------------------------------------------------------ # # 3. Build the functional graph: each node maps to its successor. # # Walk pixel-by-pixel in the indicated direction until the next # # node is found; this handles any node spacing >= 3 automatically. # # ------------------------------------------------------------------ # graph: Dict[Tuple[int, int], Tuple[int, int]] = {} for (r, c), (dr, dc) in directions.items(): nr, nc = r + dr, c + dc while 0 <= nr < H and 0 <= nc < W and (nr, nc) not in node_set: nr += dr nc += dc if 0 <= nr < H and 0 <= nc < W and (nr, nc) in node_set: graph[(r, c)] = (nr, nc) # ------------------------------------------------------------------ # # 4. Detect the cycle by following the path from the highlighted node.# # ------------------------------------------------------------------ # path: List[Tuple[int, int]] = [highlight_pos] visited: Dict[Tuple[int, int], int] = {highlight_pos: 0} current = highlight_pos cycle: Optional[List[Tuple[int, int]]] = None while True: nxt = graph.get(current) if nxt is None: break # dead end — malformed input if nxt in visited: # nxt is the first repeated node; the cycle starts there cycle = path[visited[nxt]:] break visited[nxt] = len(path) path.append(nxt) current = nxt if cycle is None: return [row[:] for row in grid] # ------------------------------------------------------------------ # # 5. Build the output. # # ------------------------------------------------------------------ # out = [row[:] for row in grid] # Restore the highlighted start node to plain gray out[highlight_pos[0]][highlight_pos[1]] = 5 # Draw the cycle polygon: connect consecutive nodes with straight lines n = len(cycle) for i in range(n): r1, c1 = cycle[i] r2, c2 = cycle[(i + 1) % n] if r1 == r2: # horizontal segment for col in range(min(c1, c2), max(c1, c2) + 1): out[r1][col] = highlight_color else: # vertical segment (c1 == c2) for row in range(min(r1, r2), max(r1, r2) + 1): out[row][c1] = highlight_color return out "