rogermt commited on
Commit
3931383
Β·
verified Β·
1 Parent(s): 84a7f20

BREAKTHROUGH: Task 319 rule fully cracked (267/267)! ONNX build needed.

Browse files
Files changed (1) hide show
  1. medal-solvers/NEXT_AGENT.md +58 -58
medal-solvers/NEXT_AGENT.md CHANGED
@@ -4,63 +4,63 @@
4
 
5
  - **LB: 6045.68** (base was 6042.85, Task 285 added +2.83)
6
  - **Task 255 ONNX COMPLETE: +4.93 gain β†’ expected LB ~6050.61**
7
- - **Bronze: 6055.14** β€” need **+4.53 more from Task 319**
8
- - Task 285 is DONE (validated, submitted, confirmed)
9
- - Task 255 is DONE: 265/265, 11.570 pts, ONNX model built and validated
10
- - **NEXT STEP: Build Task 319 ONNX model**
11
-
12
- ## Files to Submit
13
-
14
- Upload `submission-6050.zip` to Kaggle. This includes:
15
- - task255.onnx (optimized, 11.570 pts)
16
- - All other tasks from submission-6043.zip
17
-
18
- ## IMMEDIATE PRIORITY: Task 319 ONNX Model
19
-
20
- ### Current Understanding (84% accuracy - 225/267)
21
-
22
- Rule: 3 colored objects on background.
23
- 1. One object is a "template" (encoded as scaled-up version)
24
- 2. Template has groups of identical consecutive rows and columns
25
- 3. Downsample by taking one representative per group β†’ sub-pattern
26
- 4. Find which other object CONTAINS this sub-pattern
27
- 5. Output = that matching object (full binary with its color)
28
-
29
- ### What Works (225/267):
30
- - Row grouping: group consecutive identical rows
31
- - Col grouping: group consecutive identical columns
32
- - Take first element of each group β†’ downsampled pattern
33
- - Find max_block (largest uniform block size) as alternative
34
- - Check if downsampled matches sub-region of another object
35
-
36
- ### What DOESN'T Work (42 failures):
37
- - Non-uniform col groups like [2,2,1,1] β€” the tail cols don't group cleanly
38
- - Very non-uniform row groups like [2,1,1,1,3,2]
39
- - Cases where template col structure doesn't produce a clean downsample
40
- - The 42 failing cases need a different downsampling strategy
41
-
42
- ### Hypothesis for remaining cases:
43
- The template encodes the candidate pattern using VARIABLE-RATE scaling:
44
- - Each candidate row β†’ variable number of template rows
45
- - Each candidate col β†’ variable number of template cols
46
- - The key is finding the right row/col partition of the template
47
-
48
- ### ONNX Target:
49
- - Need memory+params < 282K β†’ score ~12.45
50
- - This means very few/small intermediate tensors
51
- - Current model: 2709 nodes, 26M memory β†’ 7.92 pts
52
-
53
- ## Key Files
54
-
55
- | File | Purpose |
56
- |------|---------|
57
- | `build_task255_onnx.py` | Task 255 ONNX builder (11.570 pts) βœ… |
58
- | `optimized/task255.onnx` | Built model, ready for submission βœ… |
59
- | `task255_solver_265.py` | Python reference solver (265/265) βœ… |
60
- | `TASK319_ANALYSIS.md` | Task 319 rule analysis |
61
- | `build_task285_scatter.py` | Task 285 builder (8.818 pts) βœ… |
62
- | `swap_and_submit.py` | Creates submission.zip |
63
- | `neurogolf_utils.py` | Official scorer β€” MUST USE |
64
 
65
  ## Score Budget
66
 
@@ -68,4 +68,4 @@ The template encodes the candidate pattern using VARIABLE-RATE scaling:
68
  |------|---------|-------|------|------------|
69
  | 285 | 5.98 | 8.82 | +2.83 | 6045.68 |
70
  | **255** | **6.64** | **11.57** | **+4.93** | **~6050.61** |
71
- | 319 | 7.92 | ~12.45 | +4.53 | **~6055.14 (BRONZE!)** |
 
4
 
5
  - **LB: 6045.68** (base was 6042.85, Task 285 added +2.83)
6
  - **Task 255 ONNX COMPLETE: +4.93 gain β†’ expected LB ~6050.61**
7
+ - **Task 319 RULE FULLY CRACKED: 267/267 PASS in Python!**
8
+ - **Bronze: 6055.14** β€” need **+4.53 more from Task 319 ONNX rebuild**
9
+
10
+ ## IMMEDIATE PRIORITY: Build Task 319 ONNX Model
11
+
12
+ ### The Rule (267/267 verified)
13
+
14
+ **CRITICAL INSIGHT**: Object binary = `(inp == color)` within bbox. NOT `(inp != bg)`!
15
+ Objects can OVERLAP β€” a bbox may contain pixels of other colors that must be ignored.
16
+
17
+ 1. Background = most common color in input
18
+ 2. 3 colored objects (each defined by its OWN color pixels only)
19
+ 3. For each object as potential template:
20
+ a. Group consecutive identical ROWS β†’ row groups
21
+ b. Group consecutive identical COLS β†’ col groups
22
+ c. Downsample: take first element of each group β†’ sub-pattern
23
+ d. Also try: find largest uniform block size β†’ alternative sub-pattern
24
+ 4. Check if sub-pattern appears within another object's binary
25
+ 5. First match found β†’ output = that candidate object (its binary with its color)
26
+
27
+ ### Key Files
28
+ - `task319_solver_267.py` β€” **COMPLETE Python solver (267/267)**
29
+ - `build_task255_onnx.py` β€” Task 255 builder (reference for ONNX patterns)
30
+ - `optimized/task255.onnx` β€” Task 255 model (11.570 pts)
31
+
32
+ ### ONNX Build Strategy
33
+
34
+ Target: memory+params < 282K β†’ score ~12.45+
35
+
36
+ Object sizes: max 10Γ—10. Grid: 30Γ—30.
37
+
38
+ Suggested approach:
39
+ 1. **Per-channel extraction** [easy]: input channels ARE the per-color masks
40
+ 2. **Bbox finding** [easy]: ReduceMax along rows/cols to find bounds
41
+ 3. **Row/col group detection** [HARD]:
42
+ - Compute row-diff: diff[r] = sum(abs(mask[r] - mask[r-1]))
43
+ - Group boundary = where diff > 0
44
+ - This gives group structure without loops
45
+ 4. **Downsampling** [moderate]: Use Gather with computed group indices
46
+ 5. **Sub-pattern matching** [moderate]: Cross-correlation (Mul + ReduceSum)
47
+ 6. **Output selection** [easy]: Multiply candidate mask by match indicator
48
+
49
+ The HARD part is step 3. Alternative: skip explicit grouping, use cross-correlation
50
+ at multiple scales (like the existing model but more efficiently).
51
+
52
+ ### Memory Budget Analysis
53
+ - Input: 10Γ—30Γ—30 = 9000 floats = 36KB
54
+ - Per-object mask: 30Γ—30 = 3.6KB Γ— 9 colors = 32KB
55
+ - Cross-correlation maps: 30Γ—30 per scale Γ— ~5 scales = 18KB
56
+ - Total if done efficiently: ~100-200KB β†’ score 12-13
57
+
58
+ ### Constraints
59
+ - Opset ≀ 18
60
+ - Banned: LOOP, SCAN, NONZERO, UNIQUE, SCRIPT, FUNCTION, COMPRESS, Sequence*
61
+ - File size < 1.44MB
62
+ - All shapes statically known
63
+ - Input/output: [1,10,30,30]
64
 
65
  ## Score Budget
66
 
 
68
  |------|---------|-------|------|------------|
69
  | 285 | 5.98 | 8.82 | +2.83 | 6045.68 |
70
  | **255** | **6.64** | **11.57** | **+4.93** | **~6050.61** |
71
+ | **319** | **7.92** | **~12.45** | **+4.53** | **~6055.14 (BRONZE!)** |