Update NEXT_AGENT.md: v4 ready, strategy for remaining 35 pts
Browse files- medal-solvers/NEXT_AGENT.md +73 -39
medal-solvers/NEXT_AGENT.md
CHANGED
|
@@ -6,56 +6,74 @@
|
|
| 6 |
|
| 7 |
## The Goal
|
| 8 |
|
| 9 |
-
**
|
| 10 |
|
| 11 |
-
## Task 153
|
| 12 |
|
| 13 |
-
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|-------------|----------|----------|---------------------|
|
| 17 |
-
| ORT 1.18 / ONNX 1.16 | 13.831 | 11.570 | β
|
|
| 18 |
-
| ORT 1.19 / ONNX 1.21 | 13.831 | 11.570 | β
|
|
| 19 |
-
| ORT 1.20 / ONNX 1.21 | 13.831 | 11.570 | β
|
|
| 20 |
-
| ORT 1.26 / ONNX 1.21 | 13.831 | 11.570 | β
|
|
| 21 |
-
| **Kaggle** | **~7.92** | **11.570** | β
|
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
Rebuild task153 using ONLY the op patterns that task319 and task255 use (which score correctly on Kaggle). Specifically:
|
| 27 |
-
- Replace multi-dim Gather `[9,3,3]` indices with scalar Gather in explicit loops (like task319)
|
| 28 |
-
- Replace broadcast Add `[9,1,3,3]+[1,9,3,3]β[9,9,3,3]` with per-pair Add (like task319)
|
| 29 |
-
- Use the same node structure as task319 (764 nodes, scores exactly as predicted)
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
βββ task153.onnx β ~7.92 pts LB (166 nodes, 12KB) β discrepancy
|
| 37 |
-
βββ task255.onnx β 11.570 pts LB (707 nodes, 57KB) β exact match
|
| 38 |
-
βββ task319.onnx β 11.580 pts LB (764 nodes, 95KB) β exact match
|
| 39 |
-
```
|
| 40 |
-
task285.onnx is in the base submission zip, not in this repo.
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
5. Find the unique placement pair
|
| 52 |
|
| 53 |
-
##
|
| 54 |
-
Slice, ReduceSum, ArgMax, OneHot, Gather(multi-dim [9,3,3] indices), Mul, Add(broadcast [9,1,3,3]+[1,9,3,3]), ReduceMax, ReduceMin, Cast, Clip, MatMul, Less, Greater, Reshape, Pad, Floor, Div
|
| 55 |
|
| 56 |
-
###
|
| 57 |
-
- `
|
| 58 |
-
- `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
## Key Constraints
|
| 61 |
- Opset β€ 18
|
|
@@ -66,5 +84,21 @@ Slice, ReduceSum, ArgMax, OneHot, Gather(multi-dim [9,3,3] indices), Mul, Add(br
|
|
| 66 |
- **Output**: only output grid cells non-zero; rest of 30Γ30 = zeros
|
| 67 |
|
| 68 |
## Data Sources
|
| 69 |
-
- `own-solver/neurogolf-2026.zip` β task JSON files
|
| 70 |
- `own-solver/ARC-GEN-100K.zip` β additional arc-gen pairs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
## The Goal
|
| 8 |
|
| 9 |
+
**Target: 6100.** Current LB = **6059.08** (V25). Gap = **40.92 pts.**
|
| 10 |
|
| 11 |
+
## IMMEDIATE ACTION: Submit Task 153 V4
|
| 12 |
|
| 13 |
+
The `optimized/task153.onnx` has been rebuilt to fix the Kaggle scoring discrepancy.
|
| 14 |
|
| 15 |
+
**What changed**: V3 used multi-dim Gather `[9,3,3]` which caused 370Γ memory inflation on Kaggle. V4 uses flat Gather `[9,9]` from `[100]` data + MatMul β same patterns as task319/255 which score exactly as predicted.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
- Local score: **13.998 pts** (was 13.831 in v3, was ~7.92 on Kaggle)
|
| 18 |
+
- 265/265 examples pass
|
| 19 |
+
- All strict checks pass (check_model, shape_inference, no banned ops)
|
| 20 |
+
- 87 nodes, 7,121 bytes
|
| 21 |
|
| 22 |
+
Expected LB gain: **+6 pts** (from 7.92 β ~14) β LB ~6065
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
**Builder**: `build_task153_v4.py`
|
| 25 |
|
| 26 |
+
## After V4 Submission: Remaining Gap = ~35 pts
|
| 27 |
+
|
| 28 |
+
### Strategy A: Optimize High-Node Tasks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
| Task | Base Nodes | Base Score | Target Score | Gain |
|
| 31 |
+
|------|-----------|-----------|-------------|------|
|
| 32 |
+
| 366 | 12512 | 7.08 | 12-14 | +5-7 |
|
| 33 |
+
| 025 | 7449 | 8.71 | 12-14 | +3-5 |
|
| 34 |
+
| 158 | 822 | 9.30 | 13-14 | +4-5 |
|
| 35 |
+
| 118 | 1163 | 10.42 | 13-14 | +3-4 |
|
| 36 |
+
| 209 | 4286 | 10.11 | 12-13 | +2-3 |
|
| 37 |
|
| 38 |
+
### Strategy B: Find New Solvable Tasks
|
| 39 |
|
| 40 |
+
The base submission has 400 tasks. Many have unoptimized models with high node counts.
|
| 41 |
+
Look for tasks where:
|
| 42 |
+
1. The rule is simple enough for < 100 ONNX nodes
|
| 43 |
+
2. The base model has > 500 nodes (room for 5+ pt gain)
|
| 44 |
+
3. A Python solver can be written and verified (266/266 pass)
|
|
|
|
| 45 |
|
| 46 |
+
## Architecture Patterns That Work on Kaggle
|
|
|
|
| 47 |
|
| 48 |
+
### PROVEN SAFE (used in task319/255/153v4):
|
| 49 |
+
- `Gather(axis=0)` from flat [N] data with any-shape indices
|
| 50 |
+
- `Gather(axis=1)` from [1,10,...] with scalar index
|
| 51 |
+
- `MatMul` for batch computation
|
| 52 |
+
- `Conv` with `pads` attribute (not separate Pad tensor)
|
| 53 |
+
- `ReduceSum`, `ReduceMax`, `ReduceMin` with keepdims
|
| 54 |
+
- `ArgMax` with axis/keepdims
|
| 55 |
+
- `OneHot` for color selection
|
| 56 |
+
- `Cast` between float/int/bool
|
| 57 |
+
- `Clip` for clamping
|
| 58 |
+
- `Pad` for final output expansion
|
| 59 |
+
- Broadcast `[1,1] + [N,M]` β `[N,M]`
|
| 60 |
+
- Broadcast `[N,1] + [1,M]` β `[N,M]` (MatMul pattern)
|
| 61 |
+
|
| 62 |
+
### AVOID (causes Kaggle scoring discrepancy):
|
| 63 |
+
- Multi-dimensional Gather indices like `[9,3,3]`
|
| 64 |
+
- Broadcast Add/Mul creating `[K,K,H,W]` intermediates
|
| 65 |
+
- Dynamic Slice (unpredictable shapes on different ORT versions)
|
| 66 |
+
|
| 67 |
+
## What's Already Done
|
| 68 |
+
|
| 69 |
+
```
|
| 70 |
+
optimized/
|
| 71 |
+
βββ task084.onnx β ~12 pts LB (40 nodes, 10KB) β
|
| 72 |
+
βββ task153.onnx β ~14 pts local (87 nodes, 7KB) β V4, pending LB verification
|
| 73 |
+
βββ task255.onnx β 11.570 pts LB (707 nodes, 57KB) β
|
| 74 |
+
βββ task319.onnx β 11.580 pts LB (764 nodes, 95KB) β
|
| 75 |
+
```
|
| 76 |
+
task285.onnx is in the base submission zip, not in this repo.
|
| 77 |
|
| 78 |
## Key Constraints
|
| 79 |
- Opset β€ 18
|
|
|
|
| 84 |
- **Output**: only output grid cells non-zero; rest of 30Γ30 = zeros
|
| 85 |
|
| 86 |
## Data Sources
|
| 87 |
+
- `own-solver/neurogolf-2026.zip` β task JSON files (400 tasks, 265-267 examples each)
|
| 88 |
- `own-solver/ARC-GEN-100K.zip` β additional arc-gen pairs
|
| 89 |
+
|
| 90 |
+
## How to Submit
|
| 91 |
+
|
| 92 |
+
```bash
|
| 93 |
+
cd medal-solvers
|
| 94 |
+
python swap_and_submit.py \
|
| 95 |
+
--base ../submission-6043.zip \
|
| 96 |
+
--task-data-dir /kaggle/input/competitions/neurogolf-2026 \
|
| 97 |
+
--output /kaggle/working/submission.zip
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
## Dependencies
|
| 101 |
+
|
| 102 |
+
```
|
| 103 |
+
pip install onnx onnxruntime numpy
|
| 104 |
+
```
|