rogermt commited on
Commit
771f64f
Β·
verified Β·
1 Parent(s): e3cf09c

Update TODO: Task 255 ONNX complete (11.570 pts, +4.93 gain)

Browse files
Files changed (1) hide show
  1. medal-solvers/TODO.md +42 -57
medal-solvers/TODO.md CHANGED
@@ -1,83 +1,68 @@
1
  # medal-solvers β€” TODO
2
 
3
- > **Current LB: 6045.68** | Target: 6055.14 | Remaining: **+9.46 pts**
4
- > Task 285 done (+2.83). Need Task 255 + one more.
5
 
6
- ## Priority 1: Task 255 ONNX Build (score 6.64 β†’ ~10-14, gain +3-7 pts)
 
 
7
 
8
  - [x] Analyze model structure (851 nodes, 94M cost, 35 MatMuls)
9
  - [x] Reverse-engineer transformation rule (cross-shaped empty region fill)
10
  - [x] **Verify rule: 265/265 PASS (ALL train+test+arc-gen)** βœ…
11
  - [x] Fix all 4 failing cases ([116],[130],[155],[173],[218])
12
- - [ ] **BUILD ONNX model implementing the rule**
13
- - [ ] Validate with official neurogolf_utils.py (must be 0 failures)
14
  - [ ] Submit to Kaggle
15
 
16
- ### ONNX Build Approach (verified feasible):
17
-
18
- **Key simplification: rect ALWAYS touches at least one grid boundary (265/265 verified).**
19
-
20
- This means no general "largest rectangle in histogram" needed. Instead:
21
-
22
- ```
23
- For each of 4 sides (TOP/BOTTOM/LEFT/RIGHT):
24
- For k = 1..30 (depth from that boundary):
25
- Compute mask: cells empty in ALL k rows/cols from that side
26
- Find longest consecutive run in the mask
27
- Area = k Γ— run_length
28
- Best area for this side = max across all k
29
- Take max across 4 sides β†’ (tr, lc, rh, rw)
30
- ```
31
-
32
- ONNX implementation:
33
- 1. `fg_mask = ReduceSum(input[1:10], axis=1) > 0` β†’ [30Γ—30] binary
34
- 2. `cum_fg_top[k][c] = ReduceMax(fg_mask[0:k, c])` β†’ 1 if any fg in top k rows of col c
35
- 3. `col_ok[k][c] = 1 - cum_fg_top[k][c]` β†’ 1 if col c is empty in top k rows
36
- 4. For consecutive runs: diff + comparison OR prefix-sum trick
37
- 5. Repeat for all 4 sides
38
- 6. ArgMax over areas β†’ get (tr, lc, rh, rw)
39
-
40
- Estimated: ~150-300 nodes for rect finding, ~100-200 for extensions.
41
- Memory: all ops on [30] or [30Γ—30] tensors β†’ ~1-5M total.
42
-
43
- ## Priority 2: Task 319 (score 7.92 β†’ ~11-13, gain +3-5 pts)
44
 
45
- - [x] Analyze model structure (2709 nodes, 26M cost)
46
- - [x] Understand transformation rule (pattern matching: output = small pattern matching template)
47
- - [ ] Design cheaper ONNX architecture
48
- - [ ] Validate + submit
 
49
 
50
- ## Priority 3: Task 366 (score 7.05 β†’ ~10-12, gain +3-5 pts)
51
 
52
- - [ ] Analyze model (12512 nodes, 60M cost)
53
- - [ ] Understand transformation
54
- - [ ] Rebuild + validate + submit
55
 
56
- ## Completed βœ…
 
57
 
58
- ### Task 285 (score 5.98 β†’ 8.82, gain +2.83, confirmed Kaggle LB)
 
 
 
 
 
59
 
60
- - [x] Reverse-engineered: 8-connected tiling with alternating reflections
61
- - [x] Built ONNX model: ScatterElements approach (844 nodes, 247KB)
62
- - [x] Official validation: 4/4 ARC-AGI + 261/261 ARC-GEN = **0 failures**
63
- - [x] Official score: **8.818 points** (memory 10.6M, params 48.7K)
64
- - [x] Submitted to Kaggle: **LB 6045.68** (gain +2.83)
65
 
66
- ### Task 255 Rule (265/265 PASS)
67
 
68
- - [x] Full algorithm with 4 phases (no loops needed)
69
- - [x] Sub-rect extension for wide gaps
70
- - [x] Height/width guards for cascade prevention
71
- - [x] Adjacent no-fg col extension for UP/DOWN runs
72
- - [x] **Python solver at `task255_solver_265.py` β€” VERIFIED 265/265**
73
 
74
  ## Score Budget
75
 
76
  | Task | Current | After Fix | Gain | Running Total |
77
  |------|---------|-----------|------|---------------|
78
  | 285 | 5.98 | 8.82 | **+2.83** | 6045.68 |
79
- | 255 | 6.64 | ~10-14 | +3.5-7.4 | ~6049-6053 |
80
- | 319 | 7.92 | ~11-13 | +3-5 | ~6052-6058 |
81
  | **Total needed** | | | **+9.46** | **6055.14** |
82
 
83
- Task 255 ONNX + Task 319 should be enough for bronze.
 
1
  # medal-solvers β€” TODO
2
 
3
+ > **Current LB: 6045.68** | After Task 255: ~6050.61 | Target: 6055.14 | Remaining: **+4.53 pts**
4
+ > Task 285 done (+2.83). Task 255 done (+4.93). Need Task 319.
5
 
6
+ ## COMPLETED βœ…
7
+
8
+ ### Task 255 (score 6.64 β†’ 11.570, gain +4.93, pending Kaggle submit)
9
 
10
  - [x] Analyze model structure (851 nodes, 94M cost, 35 MatMuls)
11
  - [x] Reverse-engineer transformation rule (cross-shaped empty region fill)
12
  - [x] **Verify rule: 265/265 PASS (ALL train+test+arc-gen)** βœ…
13
  - [x] Fix all 4 failing cases ([116],[130],[155],[173],[218])
14
+ - [x] **BUILD ONNX model implementing the rule**
15
+ - [x] Validate with official neurogolf_utils.py (265/265, 0 failures)
16
  - [ ] Submit to Kaggle
17
 
18
+ ### Architecture: Boundary-anchored rect + cross extensions
19
+ 1. fg_mask from input channels 1-9
20
+ 2. Depth vectors from 4 sides using CumSum
21
+ 3. Largest rect via sparse table (5 doubling steps per side)
22
+ 4. Erosion β†’ core mask
23
+ 5. Phase 1: RIGHT/LEFT extensions (eroded eligible rows)
24
+ 6. Phase 2: Sub-rect (MaxPool propagation for per-run fg_max, threshold >= 4)
25
+ 7. Phase 3: DOWN/UP extensions (dynamic result height check)
26
+ 8. Phase 4: Second RIGHT/LEFT pass (width >= 3 guard)
27
+ 9. Mask to background + color 3 output
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ ### Results
30
+ - Nodes: 707
31
+ - Memory: 676,878 bytes + 2,986 params
32
+ - Score: 11.570 points
33
+ - File: medal-solvers/optimized/task255.onnx
34
 
35
+ ## Priority 1: Task 319 ONNX Build (score 7.92 β†’ ~12-13, gain +4-5 pts)
36
 
37
+ **Status: Rule partially understood, NOT built**
 
 
38
 
39
+ Rule: 3 colored objects on background. One is a "template" (scaled-up version).
40
+ Output = the small pattern that matches the template.
41
 
42
+ Key findings:
43
+ - Template is the largest object (by pixel count)
44
+ - Template has block structure (rows in groups of 2)
45
+ - Scaling is NOT uniform (may differ per row/col)
46
+ - Template shows a PARTIAL view of the matching pattern
47
+ - The matching candidate's binary pattern contains the template's downsampled pattern
48
 
49
+ ### Needed:
50
+ - Full understanding of the scaling rule (non-uniform, possibly different per dimension)
51
+ - Understanding of why template shows partial pattern (4 of 5 rows in train[0])
52
+ - ONNX implementation: likely Conv2D-based pattern matching
53
+ - Target: memory+params < 282K β†’ score ~12.45
54
 
55
+ ## Task 285 β€” COMPLETE βœ…
56
 
57
+ Score 5.98 β†’ 8.82, gain **+2.83 confirmed on Kaggle LB**.
 
 
 
 
58
 
59
  ## Score Budget
60
 
61
  | Task | Current | After Fix | Gain | Running Total |
62
  |------|---------|-----------|------|---------------|
63
  | 285 | 5.98 | 8.82 | **+2.83** | 6045.68 |
64
+ | 255 | 6.64 | 11.57 | **+4.93** | ~6050.61 |
65
+ | 319 | 7.92 | ~12-13 | +4-5 | ~6054-6056 |
66
  | **Total needed** | | | **+9.46** | **6055.14** |
67
 
68
+ Task 255 + Task 319 should reach bronze.