# medal-solvers ## ⚠️ NEW AGENT: Read these files IN ORDER before doing anything: 1. **LEARNING.md** — scoring rules, what works, what doesn't 2. **TODO.md** — THE ordered task list with base scores 3. **NEXT_AGENT.md** — current state, instructions, priorities 4. **BULK_SCAN.md** — all 400 tasks profiled with base scores --- ## What This Is Hand-crafted ONNX models that solve ARC-like tasks more efficiently than the competition's base models. Each model that scores higher than the base adds points to our Kaggle leaderboard score. ## Current Score: 6072.59 (v66, rank ~150) | Target: 6500 (silver) ## How It Works 1. Each task has a rule (input grid → output grid) 2. The competition provides a base ONNX model per task (usually a learned Conv net) 3. We hand-craft smaller ONNX models that implement the rule in fewer nodes/params 4. Run **onnxsim** on every model (proven +0.01 to +0.77 per model) 5. Smaller model = lower memory = higher score (see scoring formula in LEARNING.md) 6. **ALWAYS verify score > base before uploading** ## Quick Start ```bash pip install onnx onnxruntime onnxsim numpy # Score a model vs base: python score_model.py --model optimized/task200.onnx --task-num 200 --task-data-dir task-data/ python score_model.py --model ../base-models/task200.onnx --task-num 200 --task-data-dir task-data/ # Build submission: python build_submission.py --base ../submission-6043.zip --optimized-dir optimized --output submission.zip ``` ## Current Models (15 tasks, ~+32 pts) | Task | Gain | Method | |------|------|--------| | 025 | +1.86 | Hand-craft + onnxsim | | 028 | +1.48 | Hand-craft + onnxsim | | 062 | +0.51 | Hand-craft + onnxsim | | 084 | +2.69 | Hand-craft + onnxsim | | 153 | +4.19 | Hand-craft + onnxsim | | 200 | +4.32 | Hand-craft + onnxsim | | 209 | +0.35 | onnxsim on base | | 217 | +0.90 | Hand-craft + onnxsim | | 255 | +4.21 | Hand-craft + onnxsim | | 277 | +1.59 | Hand-craft + onnxsim | | 285 | +2.85 | Hand-craft + onnxsim | | 319 | +3.96 | Hand-craft + onnxsim | | 323 | +0.01 | onnxsim on base | | 367 | +0.10 | onnxsim on base | | 387 | +0.70 | Hand-craft + onnxsim | ## Key Rules ```python # ALWAYS before saving any model: from onnxsim import simplify model_simp, ok = simplify(model) del model_simp.graph.value_info[:] model_simp = onnx.shape_inference.infer_shapes(model_simp, strict_mode=True) onnx.save(model_simp, output_path) # ALWAYS score vs base before uploading: my_score = score_model(my_path, task_num, task_data_dir) base_score = score_model(base_path, task_num, task_data_dir) assert my_score > base_score, "Don't upload - worse than base!" ``` ## Resources - `michaelhodel-arc-dsl.txt` — ARC Domain Specific Language (primitives for cracking rules) - `onnx-neural-compressor.txt` — Quantization docs (doesn't work with scorer, don't use) - `submission-6043.zip` — All 400 base models for comparison - `own-solver/neurogolf-2026.zip` — All 400 task JSON files