# Task 319 — Pattern Matching Analysis ## Rule (Partially Cracked: 192/267 = 72%) ### Input Structure - Background (most common color) + 3 colored objects - Input grid: variable size (15-20 × 15-20), output: one-hot [1,10,30,30] ### Pattern 1. One object is a "template" (has repeated row/col structure) 2. Template has groups of identical consecutive rows and columns 3. Downsample template by taking one representative from each row/col group 4. The downsampled pattern appears as a sub-pattern of one of the other two objects 5. Output = that matching object (its full binary pattern with its color) ### Template Identification - Template is NOT always the largest object by area - Template is the object whose downsampled version matches a sub-region of another object - Template must have at least some row or column group > 1 (compression) ### Known Issues (75 failures) - Some templates have non-uniform row/col groups (e.g., [1,2,1,1] or [2,4,2,2]) - The "group identical consecutive rows" approach fails when: - Rows are similar but not identical - The scaling is based on a different criterion than identical rows - The template matching requires considering transposition/rotation ### Current Score - 2709 nodes, 26M memory, 8943 params - Score: 7.92 points - Need: ~12.45 points (memory+params < 282K) ### ONNX Rebuild Approach (if rule is fully cracked) - Small model: just need object segmentation + pattern comparison - Key ops: ReduceSum for object detection, comparison for matching - If rule were simple: ~50-100 nodes possible → score 13+ - But complex rule (3 candidates × variable downsampling × sub-pattern matching) makes it hard to fit in fixed ONNX without loops