Update TODO: Task 255 ONNX complete (11.570 pts, +4.93 gain)
Browse files- 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: **+
|
| 4 |
-
> Task 285 done (+2.83).
|
| 5 |
|
| 6 |
-
##
|
|
|
|
|
|
|
| 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 |
-
- [
|
| 13 |
-
- [
|
| 14 |
- [ ] Submit to Kaggle
|
| 15 |
|
| 16 |
-
###
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 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 |
-
|
| 46 |
-
-
|
| 47 |
-
-
|
| 48 |
-
-
|
|
|
|
| 49 |
|
| 50 |
-
## Priority
|
| 51 |
|
| 52 |
-
|
| 53 |
-
- [ ] Understand transformation
|
| 54 |
-
- [ ] Rebuild + validate + submit
|
| 55 |
|
| 56 |
-
|
|
|
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
-
-
|
| 62 |
-
-
|
| 63 |
-
-
|
| 64 |
-
-
|
| 65 |
|
| 66 |
-
##
|
| 67 |
|
| 68 |
-
|
| 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 |
|
| 80 |
-
| 319 | 7.92 | ~
|
| 81 |
| **Total needed** | | | **+9.46** | **6055.14** |
|
| 82 |
|
| 83 |
-
Task 255
|
|
|
|
| 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.
|