Skip to content

Latest commit

 

History

History
1847 lines (1671 loc) · 143 KB

File metadata and controls

1847 lines (1671 loc) · 143 KB

NeuroGolf 2026 — Strategy & Pattern Library

Living document. Updated as we discover what works. Every agent should read §ONNX Patterns before building.


0. CURRENT FOCUS (read first)

Detailed historical session logs were moved to logs/strategy_history.md. Keep this file for reusable strategy, not chronology.

Current operating rule: method > architecture > detail. If the method itself has fewer conceptual steps, it usually beats a clever architecture around a worse method. For sub-20 tasks, first ask whether the rule can be implemented more directly; then shrink/crop/dtype; only then shave individual nodes.

Current hard-ban override: do not use TopK, even where older historical entries record LB-verified TopK solutions. Do not use sparse ONNX initializers; every initializer must be dense. This current rule overrides all older task-specific tricks below.

Scorer-compatibility hard ban: do not use If or any ONNX node with a GRAPH or GRAPHS subgraph attribute. Both local_score.py and tools/score_task.py reject such graphs before costing; subgraph activations are not a valid way to hide memory.

Cost-ledger gate: before writing a candidate, name the largest counted tensor you are trying to delete and fill this ledger: shape/dtype/bytes, semantic payload, producer/consumers, cheaper representation, expected removed cost, added tensors/params, net score estimate, and hidden-risk label. If the candidate cannot say what tensor it removes, it is not a real round.

Round policy: try at least 3 real rounds per task. If any round improves the deployable best, keep going; switch only after 3 consecutive rounds fail to improve.

Priority: raise the floor. Every task below 18.5 has target headroom; every task below 14.6 has guaranteed LB-headroom versus the leader's hardest task.

Default build path: understand rule -> fresh rule-specific baseline and patch existing best -> crop/one-dimensionalize early -> use uint8/bool label tails -> sentinel Pad before final Equal -> exact local score -> update knowledge/solution.

Representation-rephrase menu: try these before node shaving: free input overlay, scalar/uint8 label, row/column vector, bbox or endpoint descriptor, selected-candidate id, patch/sparse writer, static relation table, direct output writer, and tiny classifier only after collision audit. One-hot is usually best only when it stays on the free input or a tiny witness; full spatial one-hot intermediates are usually accidental.

For learned tiny heads, audit exact separability before spending many restarts: enumerate the distinct feature/action rows and test basis ablations. If every three-of-four basis subset has collisions or persistent sign errors, further optimizer tuning cannot replace a method rewrite.

Bundle discipline: submissions/best is verified/deployable only. Local wins that have not passed LB go into submissions/best-unvarified via tools/update_best.py without --verified; upload that bundle as the probe. If it succeeds, promote with tools/best_unvarified.py promote --all --lb-total <LB>.

Task1-20 verified batch lesson (LB 7167.36): the useful gains came from method-level or dataflow-level compression, not cosmetic node shaving: scalar-label front ends, uint8 crop-render tails, one-channel weighted marker matching, and tiny live-kernel slicing. Continue task1-20 by attacking the biggest remaining intermediates per task, especially full branch stacks or full-grid deltas, and only then do initializer/node cleanup.

Task1-20 next push toward 390: current canonical local sum is 350.3232, so the gap to 390 is 39.6768. An average score of 19.5 means average cost near 245; most remaining low tasks are still 5k-36k cost, so ordinary cleanup cannot close the gap. The bottleneck is memory, not params: tasks 001,002,004,005,008,009,010,011,012,013, 014,017,018,019,020 are all dominated by charged intermediates. Next optimization rounds should explicitly trade runtime and small params for lower memory:

  • Replace full-grid propagation with scalar, row-vector, column-vector, interval, or bbox descriptors wherever possible. Recompute descriptors multiple times if that avoids caching a 2D/10-channel canvas.
  • For candidate-table tasks, shrink the witness and renderer jointly. A bigger tiny table is acceptable if it removes a full sampled patch, one-hot branch stack, or label canvas.
  • Push 10-channel one-hot to the final output boundary. Inside the graph, prefer one uint8/bool label plane, small packed marker codes, or selected color scalars.
  • Materialize only the winning branch. If several candidates are built and then selected, first try selecting the candidate id from cheap evidence, then render exactly one branch.
  • For tasks already under cost 1500, params and memory must be optimized together: direct output writers, static gather maps, or tiny lookup renderers are more promising than removing individual nodes.

External 7166.06 merge lesson (LB 7172.30): 45 merged task wins promoted after LB verification. The reusable signal is that large gains came from different methods, not just smaller constants. First look for a lower-dimensional rule expression, then spend tiny params if they remove full-grid intermediates:

  • For geometric crop/resize/frame tasks, test GridSample or direct bbox sampling before manual GatherND/TopK/Mod index machinery; tasks 205 and 396 showed this can remove long arithmetic pipelines.
  • For lattice/gap/periodic fill tasks, try prefix/CumSum algebra before flood/MaxPool propagation when the structure is row/column separable; task198 is the reference.
  • For tiny object composition or quadrant/orientation maps, use fixed orientation codes, compact Einsum/Gather renderers, and final padding instead of branchy object assembly; tasks 218/247/253/274 are the reference family.
  • Spending extra small initializer tables is often profitable if it collapses boolean branch stacks or repeated full-grid masks. Score counts elements/bytes, not node count; task215 gained most by using direct scalar reductions plus lookup constants.
  • For hidden-risk tasks, structural correctness beats apparent cost. Task219 fixed a failing/fragile path by avoiding brittle OneHot/Where style rendering even though the node count did not simply shrink.
  • If public and local op sets are nearly identical but public wins, inspect initializer shapes, stale value_info, and crop extents. Same-looking methods can hide layout savings worth real score, especially around tasks 165/233/255/377.

Task021-100 distilled update (LB-proven 2026-07-07): recent GPT/teammate/totest imports were valuable, but only after exact local scoring and full-bundle LB probes. Keep strategy-level lessons here; put per-task chronology in knowledge/task_XXX/insights.md.

  • Import discipline: score every ONNX in a received zip, reject runtime-bad siblings first (TopK(11), unsupported Where dtypes/opsets, Sqrt hazards), and promote only the exact runnable ONNX that was LB-probed. If no builder exists, make solution.py a hash-checked replay until the method is reconstructed.
  • Direct-output renderers are the main source of large gains: zero-memory Einsum, direct Conv/QLinearConv, ConvInteger channel expanders, and padded final convs often beat elegant label-canvas pipelines because graph output is free. After reaching zero memory, optimize params by low-rank/factored tables (U@V, shared coordinate bases, feature-flat encodings) rather than changing the method.
  • Rephrase to descriptors before rendering: divider counts, row/column prefix masks, endpoint vectors, scalar bbox geometry, 1D row/column fingerprints, and black-remapped labels repeatedly beat full 30x30 masks. Recompute tiny descriptors if that avoids caching a spatial tensor.
  • Prefer uint8/bool label pipelines with delayed one-hot: Where(..., u8, u8), ReduceMax on uint8, Equal(label, colors_u8), sentinel padding, and direct bool output are reliable when locally validated. Do not assume ReduceSum(uint8), ReduceMax(bool), or Where(bool,bool,bool) works; use fp16 casts or uint8 selectors only on the tiny scoring path when required.
  • Sparse edit tasks should try direct writers before canvas renderers: preserve the free input, compute sparse coordinates/roles or a small crop, then use ScatterElements, ScatterND, final ConvInteger, or final padded conv once. This paid off for small crop recolor, marker edit, row/column edit, and sparse border/frame variants.
  • Revisit claimed "floors". Task098 moved from a 900-param no-memory conv floor to a 270-param no-memory solution, showing that representation changes can invalidate architecture-level lower-bound guesses. Treat floors as method-local unless all plausible rephrases are ruled out.
  • Hidden-risk guardrail: local ARC-GEN pass is insufficient for connectivity/flood shortcuts, ConvTranspose probes, moment/hash/fingerprint keys, and ultra-low-cost distribution-specific direct kernels. Task048, task082, and task096 hidden-zeroed despite local pass. Keep such wins in best-unvarified only, preferably as isolated single-task probes, until LB confirms.

Witness/table compression: candidate-table solvers often spend both params and memory on exact per-feature matching. Before dropping witness points, try grouping correlated features into small integer hashes and keep tolerant group-count scoring. Task017 improved by replacing a [106,9] candidate witness table with five grouped fp16 hashes while keeping the same selected candidate on train/test/ARC-GEN. Guardrail: exact full-signature hashing is unsafe when visible pixels can be corrupted; require generated-data selection equivalence, and keep metamorphic regressions in best-unvarified only. Stronger guardrail after LB: task017 grouped witness hashing hidden-scored 0 even though it passed ARC-GEN, so any witness compression with worse metamorphic profile must be treated as a diagnostic/local ceiling until an isolated LB probe verifies it.

Safety rules: keep explicit black unless task-specific tests prove zero-hot padding; visible-set fingerprints are local ceilings unless generator coverage is proven or LB confirms; use full 400-file one-task-swap bundles for hidden-zero probes; avoid Sqrt and guard any data-derived Div/Mod divisor.

Candidate labels: classify every nontrivial local win as SAFE_WIN, SAFE_PROBE, LOCAL_ONLY, or REJECT. SAFE_WIN requires a general structural rule, exact local pass, no known hidden-risk shortcut, and an artifact/builder. Generator-only crop bounds, visible fingerprints, learned/hash selectors without key-space proof, and unsupported dtype/op routes are probes at best.

Recent direct-writer and factorization lessons (2026-07-15):

  • Rephrase sparse paths and reflected rays as a compact vertex/edge relation, then render in one final output-boundary contraction. This can remove coordinate lists, path vectors, and ScatterND tails; axis scatter over a flattened canvas often materializes tensors larger than the state it replaces.
  • Treat execution time as part of feasibility. A repeated-input polynomial Einsum may have zero charged memory and an excellent theoretical score yet become unusable with ORT graph optimization disabled. Benchmark one small-degree member early; isolate slow candidates as runtime probes rather than promoting them into the accumulated bundle.
  • A quantized binary patch with values {0,2} and zero point 1 can double as signed {-1,+1} writer data. Combine it with a scalar color index and scatter only a tiny channel weight before a final ConvInteger; this avoids separate foreground/background bitmaps.
  • In homogeneous-coordinate writers, rescale the coordinate system before deleting nodes. The rescaling can make an existing scalar serve as a movement cap or threshold and remove redundant shifts without changing geometric margins.
  • For zero-memory parameter-bound graphs, matricize tiny dense cores and compare factor row spaces with every existing initializer after semantic permutations. Reusing an existing factor is a real parameter win; constructing a factored Conv weight at runtime is usually a loss because the dense weight becomes charged memory.
  • Corpus-perfect direct filters are not automatically structural. Stress relation tasks with periodic/drift collisions and geometry tasks with transformed endpoints before promotion; direct ConvTranspose candidates can pass every repository example while failing most of the valid relation domain.
  • Replace cached spatial one-hot features with scalar labels whenever the downstream rule only needs equality or a small feature word. In task201 this removed the dominant label payload; decode at the output boundary instead of carrying color planes through the matcher.
  • A wrapped color index can be a complete compact state for periodic/palette rules. Prove the wrap range and collisions first, then let a tiny selector/render word replace separate color, phase, and branch tensors; task205 is the reference pattern.
  • Search existing initializers for algebraic aliases before adding a new moment/gate vector. Reinterpreting one initializer as another exact moment saved task207, while deduplicating and sharing identical branch constants produced a larger task208 win with no activation cost.
  • Boundary-safe whole-scale sampling can beat a crop-and-resize chain, but audit the right and bottom edges explicitly. Shrinking a Slice to the visible support can silently change the sampler's boundary semantics; task209 required retaining the structural boundary behavior.
  • Narrowing an initializer from int64 to int32 does not necessarily reduce score cost: the scorer charges initializer element count, not serialized byte width. Task210's 30-element Gather index tied after dtype narrowing; change the representation, not just its dtype.
  • Tiny gate vectors can sometimes be recreated as matrix words already present in a direct output Einsum. Task211 removed standalone gates by selecting rows/columns of an existing basis, reducing params without introducing charged intermediates.
  • For ranked bars or ordered objects, encode rank directly from structural position and combine it with a size invariant in the final sign gate. Task213 used floor(position/3), grey area N^2, and an exact extent polynomial to remove repeated selector tables; exhaustive rank and orientation audits are mandatory.
  • Threshold-before-stamp shortcuts for incomplete frames are unsafe: a locally plausible pixel score may still accept many one-pixel defects. Audit the full legal defect domain before replacing explicit completeness checks, as task204 demonstrated.

Useful commands:

python tools/list_tasks.py --bottom 30
python tools/list_tasks.py --range 0 14.6
python tools/score_task.py 233 submissions/best/onnx/task233.onnx

Extra overfit stress: after normal train/test/arc-gen scoring, run the pre-generated metamorphic suite when hidden-risk, overfit, fingerprint, fixed-coordinate, or fixed-color assumptions are plausible. The cached suite lives at candidates/stress/metamorphic_v1_2048/taskXXX.json.gz and targets 2048 cases per task. It contains D4 geometry cases first, then color/remap stress cases to fill coverage. Only use transforms that preserve the task rule as authoritative; color-stress failures on a fixed-color task are a risk signal, not automatic proof that the model is wrong. Good default:

python tools/metamorphic_validate.py 166 submissions/best/onnx/task166.onnx --cases candidates/stress/metamorphic_v1_2048/task166.json.gz

For shape-equivariant-only validation, inspect the per-transform output and require the D4 rows to pass. For tasks whose rule is color-renaming invariant, the fullcolor and geom+fullcolor rows should also pass.

Optimizer Skill

For task optimization sessions, use the repo skill at skills/neurogolf-optimizer/SKILL.md. It keeps the invariant workflow short and moves the 201-400 trick library into references so agents can load only the relevant method patterns.

High-value 201-400 additions:

  • Direct output-writing ops can beat smaller decompositions because intermediates are charged and input/output are free (Gather, grouped Conv, depthwise ConvTranspose).
  • Count/rank tasks should reduce to scalar flags or TopK before rendering tiny outputs.
  • Dynamic color-conditioned stencils can use code-matrix kernels instead of kernel banks.
  • ConvInteger, MatMulInteger, and QLinearConv are valid candidates for exact small-integer pipelines after local validation.
  • Symmetry/object tasks should select one branch/crop in feature space, then render once.

Time-For-Space Patterns

The score counts params plus the sum of intermediate bytes, not node count. Spending more runtime can be profitable when it removes a large tensor:

  • Prefer many tiny static Slice/Max/Concat fragments over a general paint canvas when the rule has fixed local geometry. Task005's high-LB solver improved by assembling ray fragments as 1-9 byte tensors and rendering one label canvas at the end.
  • Use static relation tensors when they replace multi-step spatial propagation. Task009's interval Einsum computes row/column span fills in 10x10 block space and beats cumulative MaxPool chains despite extra params.
  • Candidate-table solvers should shrink witnesses by selection consistency, not by uniqueness alone. A reduced witness must choose the same parameter row on train/test/arc-gen; task017 showed 7/8 point subsets can be injective over candidate rows but still select wrong rows on corrupted examples.
  • For candidate-table renderers, remove output label offsets when the output alphabet permits it. Task017 eliminated pattern0 + 1 and shifted the final channel comparison constants instead, saving a full 21x21 fp16 label plane. This is safe only when the removed offset does not collide with a real output color/padding sentinel.
  • For small output alphabets, test polynomial scalar features plus a final QLinearConv instead of Equal(label, arange) one-hot expansion. Task010 encoded each live cell as [P, P^2] where P=1 was black and P=2..5 were rank colors; the final quantized 1x1 conv classified labels and padded to the graph output, dropping cost from 1011 to 536. This is strongest when a [C,H,W] one-hot tail is the largest remaining tensor.
  • After candidate selection, recompute derivable scalar params instead of storing them per row. Task017 dropped half from a [106,4] table and rebuilt it as Floor(length/2), saving 106 parameter elements for only scalar memory.
  • After the witness set is minimal, cost the sampler itself. If GatherND uses a large multidimensional index initializer to sample only a few scalar pixels from the free input, unroll those samples as static Slice -> ArgMax/Cast lanes. Task017 removed the [10,9,4] sample_nd_idx table this way; memory rose slightly from tiny slices, but params dropped enough for a net win.
  • Direct output writers are high leverage but hidden-risk if they encode generator quirks. A one-node Conv that writes output may look excellent locally; promote only if the weights encode the structural rule, not a visible/local distribution shortcut.
  • For fixed stencil transforms over one-hot input, a direct grouped Conv can be the optimal time/param-for-space trade. Task082 writes the full output with one group=10 Conv: color channels share a 6x3 expansion stencil and channel 0 has its own background kernel, giving cost 190 with zero counted memory. Test this before building label tails when the rule is linear and output is the standard full canvas.
  • For tiny fixed canvases, opset-10 Pad with negative pads can serve as multiple static crop lanes without slice-parameter initializers. Task003 cropped four 1x3 rows from the free input, compared compact 3-bit row codes, derived the missing periodic rows, then used final ConvInteger to write/pad the full output at cost 123.
  • For periodic residue-class tiling, try algebraic direct-output Einsum before crop/render pipelines. Task007 encodes the 3-cycle as 2D real basis vectors and a tiny bilinear cyclic addition tensor, then writes the full 10-channel output in one Einsum with zero counted memory. This is the high-value "rephrase beats architecture" pattern for diagonal/cyclic fill tasks.
  • For self-product/fractal motif expansions, test low-rank algebraic gates in a single direct-output Einsum. Task001 uses a two-column background/nonbackground basis plus a sign vector to encode the mask product and channel sign, eliminating all renderer memory. When the input space is small, exhaustively validate all masks/colors before promotion.
  • For fixed split-half logical tasks, a direct dilated Conv can encode the truth table and write the full output for zero memory. Task006 uses dilations=[1,4] to read corresponding left/right cells across the separator and logits for black/red intersection cases, avoiding both half slices and final Pad.
  • LB-verified task021-030 follow-up: direct-output or near-direct-output rewrites are now a proven safe class when they preserve the structural rule and pass the full bundle probe. Task021 showed scalar divider counts plus row/column prefix masks can beat a compact Einsum baseline even with slightly more params. Task024/028 confirmed that zero-memory single-Einsum renderers can be improved further by factorizing small color tables rather than changing the method. Task025 confirmed that project-generated structural candidates with unsupported-op siblings should be filtered by runtime first, then promoted only from the exact runnable ONNX. For future GPT/project imports: score every candidate in the zip, keep the exact best runnable ONNX, and full-bundle probe before marking canonical.
  • For block-grid tasks that ultimately expand scalar block labels to the full canvas, test compact subpixel source renderers plus Resize instead of a many-role DepthToSpace tail. Task009 uses a 2x2 source (content, vertical separator, horizontal separator, corner) -> DepthToSpace 20x20 -> nearest Resize 30x30, cutting renderer memory. Pair this with small row/column invalid sentinels and variadic Max to avoid full valid-cell masks.
  • After TopK/rank selection, avoid int64 scalar label tails when labels are just selected colors. Task086 replaced Gather(index) -> Add(1) -> Cast with a tiny uint8 label LUT gathered by the TopK indices, saving a little memory for 9 params. This is small but safe when TopK returns color indices 0..8 for colors 1..9.
  • Time-for-space is only a win when the added tiny tensors plus params are cheaper than the removed large intermediates. Avoid replacing a 20x20 propagation chain with a 20x20x20 relation tensor unless it removes enough repeated full-grid tensors to pay for itself.
  • Extreme time-for-space should convert a large representation into descriptors, not just split it into many same-size pieces. Useful tests:
    • Branch stack -> selector scalar -> one renderer. Replace [K,H,W] candidate tensors with tiny evidence scores, select k, then render only that branch. This is the right mental target for task018 delta [1,8,24,24], but only if exact same-color pairing survives.
    • Full mask -> row descriptor + column descriptor + local exceptions. For rectangles, stripes, spans, and separators, carry [H,1], [1,W], bbox endpoints, or interval endpoints, then reconstruct once. This beats a 2D mask only when the exception set is tiny.
    • Large table -> factorized tiny tables. Try decomposing [A,B,C] relation tensors into two or three skinny factors consumed by QLinearMatMul, GatherElements, or broadcast comparisons. This can replace large static interval/candidate tables when relations are low-rank, monotone, or separable.
    • Many bool masks -> packed uint8 role code. Store bit flags as 1/2/4/8/..., propagate or match with uint8 ops, and unpack with BitShift/BitwiseAnd only at the boundary. This is better than parallel masks when consumers can test dot-products or bit predicates directly.
    • Full sparse canvas -> coordinate list + sparse writer. If only a few pixels/fragments change, compute coordinates and values, then use ScatterElements/ScatterND once. Account for int64 index cost for ScatterND; this wins only if it removes several full canvases.
    • Full dynamic patch -> static fragment library + dynamic offsets. For ray, cross, frame, or repeated motif tasks, predefine small fragments as initializers, shift/slice only the active fragments, then merge. Task005-style assemblers win because fragments are 1-9 bytes, not because there are many nodes.
    • Full one-hot -> scalar label plus delayed equality. Keep labels uint8 and use final Equal(label, channel_ids) only at output. If an intermediate op requires one-hot, test whether a smaller witness one-hot is enough, or whether QLinearMatMul/QLinearConv can score scalar-coded features directly.
    • Full count map -> saturated small-count signal. If only zero/nonzero, threshold, or capped count matters, use QLinearConv/QLinearMatMul into uint8 plus Clip/Less instead of fp16/int32 exact counts. Exact counts are expensive; capped semantic counts often suffice.
    • Recomputed descriptor -> no cached canvas. If two branches share a 30x30 canvas only to derive a scalar or vector, recompute the scalar/vector twice from the free input or tiny crop. Total tiny recomputation can be cheaper than one cached spatial tensor. Guardrail: because scoring sums all intermediate bytes, unrolling only helps when each unrolled unit is much smaller than the removed tensor. Ten 18x18 uint8 fragments cost more than one 30x30 uint8 canvas; ten scalar/row fragments may win.
  • Recompute scalars, 1D vectors, and tiny crops instead of caching a 2D/10-channel canvas for multiple branches. A few duplicate scalar ops are usually cheaper than one shared 30x30 intermediate.
  • For connectivity/flood tasks, first test whether the rule admits a larger semantic step such as row/column segment closure, interval fill, or component descriptor propagation. Then cost the ONNX expression: naive all-pairs segment relations often explode memory, so prefer prefix/doubling scans or small static witnesses if they can stay 1D/2D.
  • For enclosed-region fills, test a cheap superset before full flood fill. Task002 improved by computing open & wall_left & wall_right & wall_up & wall_down with four directional MaxPools, then flood-filling only false-positive bays inside that candidate set. The superset alone overfilled, but seven candidate-domain 4-connected rounds replaced twenty full-open rounds and cut cost from about 20.1k to 14.1k.
  • For marker-template alignment, encode anchor identity as bit slots before matching. Task018 replaced three full marker planes plus three kernel planes with a one-channel slot map: marker slots are 1/2/4, kernel slots are 1/2/4, and a single QLinearConv tests the dot-product target 1*1 + 2*2 + 4*4 = 21. This preserves exact slot matching while removing large [1,3,30,30] and [8,3,K,K] intermediates.
  • When a packed dynamic kernel contains both control bits and payload bits, test whether the payload consumer can use the packed kernel directly with quantization scaling. Task018 stamped fill from kern8 itself by setting the second QLinearConv output scale so fill value 8 rounds to 1 and anchor values 1/2/4 round to 0, removing a separate BitShift(kern8, 3) fill-kernel tensor. Do not apply this to matchers unless payload bits are provably harmless; task018 matching failed when fill bits entered the dot product.
  • For block-grid span fills, sample a scalar color label first, then recreate one-hot only if an op requires it. Task009 improved by replacing a direct [1,9,10,10] float color slice with Conv -> uint8 label -> Equal -> fp16, keeping interval Einsum unchanged but shrinking the sampled front end.
  • Audit Conv samplers for dead taps. Task009's block sampler used a 2x2 stride-3 Conv, but only the top-left tap contributed, so a 1x1 stride-3 Conv preserved semantics and saved params. This is a cheap check whenever Conv is acting as a structured sampler rather than a real local filter.
  • For padded block grids whose active cells form a rectangle, derive validity from full-input row/column presence and slice that down to block space. Task009 removed a separate sampled-black branch this way while keeping the interval solver unchanged.
  • For separator/cross rendering in block grids, prefer bool Pad tails and reuse an existing colored separator label for intersections. Task009 removed explicit false-row/false-column concat constants and a dedicated cross mask by computing the intersection label as Where(v_sep_mask, h_sep_u8, sentinel).
  • For dynamic crop renderers, keep the selected mask/label in uint8 through row/column reductions and write the color label directly with multiplication when the mask is already binary. Task014 saved a small but repeatable 18x18 bool/Where stage this way.
  • For bbox max-index detection, prefer ArgMax(select_last_index=1) over reverse-index Gather scaffolding when the input is already a 1D/axis occupancy mask and ORT supports the dtype. Task014 saved params while keeping the safer full 18x18 render canvas.
  • Treat crop-size reductions as method changes, not cleanup. Task004 looked like it could save a few hundred cost by shrinking 16x16 to 16x15, 15x16, or 15x15, but each variant failed ARC-GEN. Once a crop is generator-tight, switch to tail/intermediate compression instead of repeating nearby crop guesses.
  • For tiny kernel transforms, prefer direct reverse Slice over Reshape -> Split -> Concat -> Reshape chains. Task005 kept memory unchanged but shaved params by flipping a live 3x3 template kernel with one reverse slice and reusing an existing zero initializer.
  • When a small dynamic template mask is already live, test a tiny QLinearConv probe against an input patch before writing multiple aligned Slice -> Max probes. Task005 used QLinearConv(color_anchor, template_present) -> ReduceMax to replace a two-slice center-color branch and saved both memory and params.
  • Static time-for-space assemblers can still have local duplicate fragments after a structural win. Task005 improved by aliasing exact duplicate Slice/Max/Concat ray fragments, but treat these as LB-probe candidates unless the equivalence follows from the rule rather than only train/test/ARC-GEN coverage.
  • For masked flood fill, larger convolution jumps are not equivalent to multiple small masked steps unless intermediate obstacles cannot matter. Task002 5x5/7x7 diamond jumps lowered cost but failed badly because they skipped blocked cells. Shrink the domain first; do not skip path-faithful 4-connected rounds without proof.
  • For directional-predicate front ends, do not assume smaller spatial output is cheaper. Task002 direct 18x18 wall predicates were correct but worse because MaxPool alignment required slice-pool-slice per direction, then cand18 had to be padded back to 20x20 for seed adjacency. Shrink these front ends only when the operator naturally emits the target shape or downstream consumers no longer need the wider frame.
  • If a bool selector feeds an index op, test uint8 as the narrow supported dtype. ORT rejects some bool consumers such as ArgMax(bool), but Cast(bool -> uint8) -> ArgMax can replace a float cast and save memory, as in task011.
  • For uint8 binary masks, use variadic Min(mask1, mask2, ...) as an AND/intersection operator instead of chained Mul when all values are 0/1. Task002 removed three full 20x20 intermediates by computing the candidate mask in one variadic Min.
  • Before attempting a dtype rewrite, run tools/op_support_matrix.py and check the real ORT support path. Current ORT 1.24.4 findings: Pad(bool) works only from opset13 upward, while opset11/12 bool Pad fails; ReduceSum accepts int32/fp16/fp32 but rejects bool/uint8/int8; ReduceMax and MaxPool accept uint8/int8 but reject bool; arithmetic and Bitwise ops accept uint8/int8 but not bool; logical And/Or/Xor are bool-only; ScatterElements reduction max/min works for uint8/int8/int32/fp32 but not bool; QLinearConv(uint8) outputs uint8, while ConvInteger(uint8) outputs int32 and is usually memory-expensive. QLinearMatMul accepts uint8/int8 inputs and returns uint8/int8; MatMulInteger returns int32. Plain MatMul rejects uint8/int8 and accepts int32/fp16/fp32. Einsum rejects uint8/int8 but accepts int32/fp16/fp32. For interval/table solvers like task009, fp16 one-hot is usually the lowest viable Einsum representation unless the method can be rewritten to one or more QLinearMatMul passes or away from matrix multiplication entirely. For bilinear same-color span equations such as left_color[c,a] * right_color[c,b] * interval[a,b,x], do not assume QLinearMatMul is a drop-in replacement: a naive rewrite first materializes the dynamic [c,a,b] endpoint-pair tensor, which is usually larger than the fp16 Einsum path. Upgrading an opset12 graph only to use bool Pad can lose because Reduce/Unsqueeze axes become initializers and explicit value_info may be required for scorer cost inference.
  • New op-level search ideas from the support matrix:
    • Try QLinearMatMul for binary witness/candidate scoring, relation-table closures, and small count-threshold tests. With scale=1/zero=0 it can compute tiny integer dot products into uint8, avoiding fp16 Mul -> ReduceSum or int32 MatMulInteger when counts stay below 255 or only a saturated/nonzero signal is needed. Guardrail: do not one-hot-expand a compact scalar candidate table just to use QLinearMatMul. Task017 exact one-hot scoring removed two [1,106,9] match tensors but expanded params from 954 scalar labels to 9,540 one-hot table entries, losing badly. QLinearMatMul wins when the table is naturally binary/factorized, not when it creates a dense one-hot parameter blowup.
    • OneHot is not a bool/uint8 shortcut in this runtime. It only worked for int64 indices with fp16/fp32 values in the tested cases. It can also force extra 8-byte index tensors before producing the table, so Equal(label, arange) remains the preferred bool/uint8 one-hot tail unless the indexed table is tiny.
    • GatherElements works on bool/uint8/int8/fp16/fp32 with int32 or int64 indices. Use it for row-wise/column-wise remaps when the index tensor has the same rank as the data; it can replace heavier GatherND maps and avoid int64 where int32 is accepted.
    • GridSample works for fp16/fp32 input but not uint8/int8 in this ORT build. It can help crop/resize tasks while the data is still float/fp16, but is not a direct scalar-label renderer unless the uint8 label map is widened.
    • BitShift(uint8) works. Use packed role/color/code labels when multiple flags travel through the same spatial tensor, then unpack only at the consumer boundary.
    • ArgMax works on uint8/int8/int32/fp16/fp32 but not bool. For bool occupancy, cast to uint8 before ArgMax instead of widening to float.
    • TopK rejects uint8/int8 but works on int32/fp16/fp32. It is a niche option for very small selector tables; avoid it when it would require widening a large uint8 score map.
    • CumSum rejects uint8/int8 but works on int32/fp16/fp32. It is worth testing on 1D row/column prefix problems only when the vector is small or already widened; for large binary masks, MaxPool(uint8) or QLinearConv(uint8) usually stays cheaper.
    • Clip works on uint8/int8/int32/fp16/fp32. This is useful for saturating small uint8 counts after QLinearConv/QLinearMatMul instead of casting through float.
    • Where works for uint8/int32/fp16/fp32 payloads, but not bool or int8 payloads. For bool selection, use logical ops or cast the payload to uint8; for int8 labels, prefer uint8 labels unless negative sentinels are essential.
    • Tile works on bool/uint8/int8/fp16/fp32. It can be a useful static repetition primitive for tiny motifs, but compare against Expand and DepthToSpace because output-size tensors are still charged unless they are final output.
    • DepthToSpace works on uint8/fp16/fp32 but not bool/int8. For block assembly, prefer uint8 scalar labels before DepthToSpace when possible; task009 already benefits from this shape.
    • Resize(nearest) works on uint8/int8/fp16/fp32, not bool. This is a niche substitute for manual Tile/ConvTranspose when scaling a scalar label map or small mask.
    • QuantizeLinear can turn fp32 into uint8/int8, but DequantizeLinear only produced fp32 in the tested path, not fp16. Use quantization to enter uint8 pipelines; do not expect cheap fp16 dequantization.
    • GatherND/ScatterND require int64 indices in this ORT path; int32 indices are rejected. With int64 indices, ScatterND works for uint8/int8 with add/max/min reductions, for float32 with reductions, and for bool only without max/min. fp16 ScatterND works only for the no-reduction case. If the index tensor has the same rank as data, try GatherElements first to keep int32 viable. Treat ScatterND as a sparse-point writer, not a medium-patch writer: task008's correct 25-cell patch rewrite lost badly because generated 4D int64 coordinates outweighed the removed 16x16 shift planes. It wins when point count is tiny or coordinates are already available.

2026-06-17 Task001-010 Retest Lessons

  • Tiny fixed-output tasks can still have method wins after prior golfing: task003 improved by dropping the parallel background branch and replacing fp16 arithmetic period checks with uint8 Equal -> ReduceMin flags, then deriving black from Not(foreground).
  • Bool compact tails are high leverage when explicit black can be preserved: task006 improved by carrying only [black, zero, red] before final Pad instead of a wider float/uint8 tail.
  • For output masking, direct sentinel Where(valid, label, 255) can beat arithmetic offset masks when the valid mask already exists (task009).
  • For variable-size padded inputs, black-channel presence is not the same as open/background when padding is zero-hot. Task002 black-open shortcut failed because exterior padding must be reachable even though channel 0 is false there.
  • Old-opset attribute savings must be checked against dtype support. Task001 needed opset14 to keep uint8 arithmetic while using attribute-form ReduceMax.

2026-06-17 Task011-020 Retest Lessons

  • Reuse existing labels before adding detectors. Task011 improved by deriving color-8 tile presence from the uint8 label map (Equal(label, 8) -> MaxPool) instead of running another color-channel Conv.
  • Prefer direct scalar gathers over selector-mask ladders. Task013 improved by replacing Equal -> Cast -> Mul -> ReduceSum endpoint-color extraction with direct Gather from existing 1D color traces.
  • Keep crop pipelines in their native rank. Task014 improved by doing bbox/crop gathers on [1,1,H,W] tensors directly; the old 2D reshape path looked simpler but paid two extra materialized buffers.
  • Period/model selection only needs a witness, not a full validation crop. Task017 improved by shrinking the period scoring window from 10x10 to 5x3, validated against ARC-GEN, then selecting with chained Max/Where from a real candidate instead of a zero seed buffer.
  • After a static small crop is proven, move all metadata inference onto it. Task019 improved by reusing the 6x6 crop for H/W detection and label Conv; full-width row/col presence vectors were dead weight.
  • For overfit-risk tasks, separate local ceilings from deployable best. Task018 has a small local structural trim, but it depends on stamp binary/non-overlap assumptions, so it stays as a local candidate until hidden/LB confidence exists.

2026-06-18 Task021-040 Retest Lessons

  • Method-level label renderers beat optimized one-hot tails when the spatial rule can be expressed as a scalar label field. Tasks 028, 031, 033, 034, 035, and 040 improved by sampling colors once, rendering one-channel labels/masks, and doing a single final Equal(label, arange10) or bool Pad.
  • Do not pay for full 30x30 encoding if the active task canvas is fixed. Task039 replaced a full non-background Conv bbox detector with Slice(ch0, 10x10) -> ReduceMin -> ArgMin; task040 replaced full-canvas label Conv with three corner samples plus a green mask.
  • Output-tail dtype is still high leverage even on strong solutions: bool Pad (tasks 026, 038), uint8 Equal tails (022, 032, 035), and fp16-only scoring paths (027) produced safe wins without changing the rule.
  • Sentinel labels are preferable to arithmetic background reconstruction when an inside/valid mask exists. Task025 and task030 both improved by using Where(valid, label, 255) before Equal instead of maintaining extra background arithmetic branches.
  • Hidden-risk bounded crops need discipline. Task029 23x23 gather is a local win from ARC-GEN maxima but was not promoted because hidden outputs may be larger; generator-bounded shrinkage needs either proof from rule/source or LB confirmation.
  • Fractional/probability-like intermediate fills cannot always be label-compressed. Task037's diagonal fill uses fp16 products where positive fractional values carry the mask; direct cast-to-label loses the signal. Preserve threshold/sign semantics before attempting label tails.

2026-06-18 Task041-050 Retest Lessons

  • Prefer direct graph-output writers when the last large tensor exists only for rendering. A three-factor Einsum(selector, row_mask, col_mask) can write a colored rectangle directly to the output and avoid materializing the full spatial rectangle mask. The same check applies to direct Gather, grouped Conv, and ConvTranspose: output memory is free, intermediates are not.
  • When a rule depends only on border samples, never encode the full active canvas first. Slice endpoint columns/rows, convert them to scalar labels, decide the row/column action, and render once. A single ScatterElements can place multiple endpoint labels more cheaply than separate Pad/Add branches.
  • Row-wise span fill can be a one-channel propagation problem. Encode colors once, propagate the nearest nonzero label from both directions, and fill where the propagated labels agree. This can replace per-color left/right masks even when the old graph already uses compact booleans.
  • For exact binary morphology or connectivity, test uint8 for the repeated spatial body. MaxPool(uint8) and exact Add/Mul pipelines can substantially reduce flood-fill memory; cast only the final count path to a ReduceSum-supported dtype. ReduceSum(uint8/bool) remains unsupported in the tested ORT path.
  • Simplify geometry using invariants before expanding masks. If two marker-generated lines have distinct rows and columns, their special intersection can be line_a And line_b instead of constructing both cross terms separately.
  • Derive the valid canvas from all input channels when padding is zero-hot. A full-input row/column ReduceMax can replace an explicit background-channel slice and remains correct even when black is a valid in-grid color.
  • Do not promote color-index-specific signature pruning without a rule-level reason. If removing height/width statistics only works for particular visible colors, record it as a local ceiling; ARC color identities are usually symmetric, so hidden tests may permute the ambiguous case.

2026-06-18 Task051-060 Retest Lessons

  • For fixed separator boards, do not slice separator channels unless the separator itself varies. Static separator masks can render the grey grid, and cell counts can often be derived from black/background alone. Task059 improved by using count = cell_area - black_count, avoiding a 9-channel crop and then avoiding the separator slice entirely.
  • Prefer masked channel histograms plus ArgMax when each example has one active non-background color. This can replace weighted-average Mul -> ReduceSum -> Div color extraction while still staying structural and color-general.
  • Delay color materialization until the final write. Task057 kept the motif as bool until one Where(mask, color, 0); task059 rendered winners as uint8 labels instead of carrying float color maps. This usually beats Cast -> Mul(color) chains over spatial masks.
  • Gate only the component that actually needs gating. In endpoint row-fill tasks, endpoint expansions are already zero on inactive rows; only the inserted separator column needed the active-row mask. Moving the gate from an entire row label to a 1-column separator saved a full row-label intermediate in task060.
  • Static 2D masks can beat generated 1D masks when the generated version creates a full spatial intermediate. Compare params saved versus new bool memory; for an 11x11 separator, a 121-param static mask beat 1D row/col masks plus an Or.
  • Very small zero-intermediate tasks may already be at the practical floor. For shift/pad-like tasks, verify whether shifted-in cells are in-grid black one-hot or exterior zero-hot before replacing a Gather permutation with Pad/Conv.

2026-06-18 Task061-065 Retest Lessons

  • Fixed active-canvas color encoders are not always stuck with full 30x30 Conv output. If the maximum useful crop is fixed, test dense crop-conv first (kernel = 30 - crop + 1, only the top-left kernel cell nonzero). Task064 improved by replacing full label -> cast -> slice with a dense 7x7 crop-conv for the 24x24 working canvas.
  • When dense crop-conv has too many params, test separable crop-conv plus slicing. Task063 and task065 improved by using a one-dimensional crop-conv (17x1 or 16x1) followed by Slice, because the extra row-crop intermediate was cheaper than thousands of dense kernel params.
  • In separable crop pipelines, cast before the final slice when the full row/column crop can safely become uint8. Conv fp32 -> Cast row/col crop to uint8 -> Slice beat Conv -> Slice fp32 -> Cast in tasks063 and 065.
  • Label-tail output can beat 10-channel one-hot tails for small overlay/reflection tasks when the final valid canvas is compact and the output needs zero-hot padding. Task062 improved by writing a 1-channel uint8 label (Where(fg, color, bg)) and sentinel-padding before final Equal.
  • Dynamic Gather reflection needs safe indices for every branch because ORT evaluates unselected Where branches. If one branch can go out of bounds, either keep a matrix/Pad method or account for clamp+valid-mask memory before assuming Gather is cheaper.
  • Count-based object color selection is attractive but tie-prone. Task064's "largest non-background count is rectangle color" passed 261/262 ARC-GEN but failed when marker and rectangle counts tied. Promote count selectors only with a structural tie-breaker, such as a proven block/frame signal.
  • Do not derive active-size presence from compact labels if background can be color 0; zero-hot padding and real color-0 cells collapse. Use full one-hot presence or an explicit valid mask.

2026-06-18 Task066-070 Retest Lessons

  • Choose a route/branch in scalar or 1D feature space before rendering. Task066 replaced four spatial route hypotheses plus ScatterND with endpoint traces, four scalar/vector feasibility checks, one selected L-path, and a final Where(path, new_color, input).
  • For proportional fixed crops, reduce valid size once to a scalar and render a threshold mask. Task067 inferred the first-third width with one scalar column count and threshold vector, then masked the free input directly.
  • Full-input reductions can replace expensive active-channel crops. Task068 counted all colors directly from the free input, selected the singleton with ConvInteger, and used a separable crop-conv only for the spatial label map. Do not materialize [active_colors,H,W] merely to obtain both counts and labels.
  • Exact count == 1 is usually simpler than a Clip triangle when Equal is supported. For tiny integer selectors, test ConvInteger on uint8 flags before fp16 Conv/MatMul.
  • Connected-component rank propagation can stay uint8 when zero is a safe outside sentinel. Task069 used ranks 100-index, uint8 MaxPool/Where, and reused that rank grid for both component anchors and the template anchor. This halves repeated flood tensors and can remove a second index initializer.
  • Dynamic Gather indices should use int32 when values are small; Gather rejects int16 but accepts int32, which reduced task069 coordinate and index-vector memory.
  • If only one color channel drives row/column geometry, slice that channel to the fixed active canvas before reducing. Task070's direct 17x17 cyan slice plus two reductions beat two full 10-channel ReduceMax outputs by about 1,200 cost.
  • fp16 CumSum is supported in the tested ORT path and can shrink short axis traces; uint8 CumSum is rejected. Cast after spatial reduction, not before, so the cast tensor stays one-dimensional.

2026-06-18 Task071-095 Retest Lessons

  • A singleton-channel label can write a bool graph output directly with broadcasting: Equal(label_u8 [1,1,H,W], colors_u8 [1,10,1,1]) -> output. This avoids Reshape -> Cast -> OneHot tails when the scorer accepts bool output, as in task091.
  • For identity-plus-edits outputs, test direct input writing before rebuilding labels or channels. Task094 reduced box hits to center-row/column vectors, padded only the one-channel crosshair mask, then used Where(mask, six_color, input) as the graph output. Input/output are free, so this beat both sparse channel Concat and a compact label renderer.
  • For band/frame rules, infer top/bottom/left/right once and render from 1D row/column vectors. Task093 replaced four full-canvas side MaxPools and four distance Convs with bbox scalars, reduced dot counts, and broadcast comparisons; the remaining tail was uint8 label -> Pad(255) -> Equal(colors).
  • For frame/interior extraction tasks, keep frame detection in descriptor space but crop content on a scalar label canvas, not on 10 one-hot channels. Task029 kept the perimeter-based frame-color detector, then replaced 10-channel bool interior gather with label_u8 -> Gather rows/cols -> sentinel Where -> Equal(colors10), cutting cost from about 31k to 12k.
  • Strong full-canvas CumSum solutions may have little tail headroom once bool output is already used. For pair-connection tasks like task092, further gains likely require selecting endpoints or line spans in row/column feature space before any full 30x30 CumSum.
  • Zero-intermediate single Conv solutions can be real floors. For local-neighborhood tasks like task095, replacing a 900-param direct Conv with explicit Slice/MaxPool/render intermediates is worse unless the parameter count can drop below the first full [1,1,30,30] buffer.
  • For trained direct Conv solvers, search anisotropic receptive fields before replacing the method. Task099 preserved 261/261 ARC-GEN while shrinking 7x7 to 7x5; narrower 7x3 and shorter 5x5 kernels exposed the actual geometric radius and failed.
  • Slicing away an unwanted class is not always cheapest after a reduction. Task100 kept all ten compact color vectors and excluded black with one broadcast bias before ArgMax, saving more intermediate memory than the extra constants cost.
  • For 14x14/15x15 fixed canvases, compare "label then Equal" against channel Concat even when the output is already bool. Concat materializes the whole 10-channel active canvas; label renderers often trade a few 1-channel masks for fewer sparse-channel staging tensors.

0.1 Tag Playbooks for Tasks 001-200

The 2026-06-16 scan read all 200 knowledge/task_XXX/description.md files. Tasks 001-200 now have semantic multi-label Category Tags and a filled one-line Transformation Rule. Use the tag playbooks below to choose the cheapest method before touching graph details.

Universal Tag Triage

For any tag family, classify the rule in this order:

  1. Output geometry: same-size, fixed tiny output, cropped variable output, expanded/tiled output, or full-canvas render.
  2. Parameter source: constants, sampled colors, row/column counts, marker location, separators, bounding box, component shape, or exemplar match.
  3. Renderer: direct recolor, patch placement, 1D broadcast, region fill, morphology, template expansion, quadrant merge, or D4 transform.
  4. Representation: scalar/vector first, then 1-channel label grid, then active-color channels, full 10-channel one-hot only at the end.

Default optimization pipeline:

  • Build a fresh rule-specific baseline for sub-20 tasks. Old graphs often preserve an expensive generic method.
  • Crop before expensive ops; if a rule is row/column driven, reduce to 1D vectors before rendering.
  • Prefer uint8/bool labels with sentinel padding, then final Equal(label, arange10).
  • Keep explicit black in final one-hot unless the specific graph proves zero-hot padding is accepted.
  • One lossless cleanup after a structural win is worthwhile; two identical cleanups means return to method/architecture, not node shaving.

Color and Palette Tags

Tags: color_replace, color_substitution, palette_mapping, same_color_fill, label_output, compact_label, label_sampling, bool_output, compact_bool, single_color, active_channels_4_8.

Optimization direction:

  • If the rule is pure recolor/remap, test a direct 1x1 Conv or small Gather color bank first. For spatially unchanged grids, this often beats any label encode/decode path.
  • If colors are symbolic and used by multiple spatial ops, encode once to labels and keep labels until the final output.
  • For sampled palettes, sample colors into tiny tensors first. Render a region id or pattern id, then Gather colors from the palette bank.
  • If only a few output colors are possible, compute an active-color tail and pad channels only in the output. Do not carry 10 channels through the renderer.
  • For bool_output/compact_bool, verify ORT accepts bool at the relevant op. If Pad is needed, pad a uint8 sentinel label first, then compare to produce bool/float one-hot.
  • For same_color_fill and single_color, separate mask detection from painting: produce one bool mask, then multiply/select the sampled foreground color once.

Useful tricks:

  • Sentinel labels (255) are safer than zero labels because they make inactive area zero-hot after Equal(arange10).
  • A label-tail wins once more than one spatial operation follows color selection; direct Conv wins when the task is only color remapping.

Crop, Size, and Variable Output Tags

Tags: crop, crop_to_4x4, frame_interior, size_change, variable_size, oversize_local_skip.

Optimization direction:

  • Crop at the earliest static or generator-bounded point. If the output is a known interior, slice the interior directly rather than detecting the frame generically.
  • For crop_to_4x4 and other tiny fixed outputs, avoid bounding-box discovery if the source quadrants/cells are fixed by the generator.
  • For size_change/variable_size, keep the value/mask variable but the tensor shape static. Render into the smallest maximum canvas and sentinel-pad to 30x30 as the final output.
  • oversize_local_skip means local validation can include examples larger than the deployable compact path. Gate the optimized path only if the skipped oversized cases are impossible on hidden or already handled by the scorer/task harness.

Useful tricks:

  • Static Slice usually beats dynamic Gather chains when the generator has fixed offsets.
  • Final Pad into graph output is effectively free; intermediate pad/reshape is not.

Object and Component Tags

Tags: object_detect, connected_component_filter, morphology, denoise, keep_supported_pixels, 2x2_block_filter.

Optimization direction:

  • First check whether "object" can be replaced by a local condition, separator structure, row/col projection, or fixed bounding box. Full connected components are a last resort.
  • For morphology/denoise, produce a bool support mask first; keep color rendering as a separate label/color tail.
  • For 2x2_block_filter, use small Conv/MaxPool kernels on a cropped foreground mask. Avoid materializing each direction separately; combine neighbor support with the original mask.
  • For connected_component_filter, if the generator restricts components to rectangles, lines, or separated bands, detect that structural invariant directly instead of unrolled propagation.
  • If propagation is unavoidable, unroll only over the cropped maximum H/W and mask with foreground each round.

Risk:

  • Component/morphology solutions are hidden-risk when they only match visible topology. Validate on 50+ ARC-GEN examples when available, especially for hidden-zero tasks.

Grid, Split, and Quadrant Tags

Tags: grid_split, cross_split, quadrant_mapping, quadrant_merge, overlay_layers, fixed_priority, block_color_extract, compact_table, reduce_max.

Optimization direction:

  • Convert separators into row/column selector vectors. Combine selectors into a small cell/region id only at the renderer.
  • For quadrant_merge/overlay_layers, slice quadrants/layers first and apply fixed priority by ordered label overwrite (Where high priority over low priority), not arithmetic blending.
  • For block_color_extract, reduce each block to one sampled color using ReduceMax/ArgMax only inside the block. Then assemble a compact table; do not keep per-pixel block tensors.
  • For compact_table, render table labels directly and final-pad. Table extraction should be block-level, not full-canvas.
  • reduce_max is the default projection for "any colored pixel in this block/row/col"; prefer it over summing when counts are irrelevant.

Useful tricks:

  • A quadrant/cross task often has only 2D selection plus palette lookup. If the graph contains large 10-channel masks for every region, rewrite to region labels plus one final color Gather.

Counting, Size, Frequency, and Area Tags

Tags: count_pixels, block_counting, cell_counting, grid_cell_count, frequency_compare, histogram_choice, mode_color, minority_color, majority_color, size_compare, component_size, area_argmax, largest_rectangle, maximal_rectangle, minimal_rectangle, size_sort.

Optimization direction:

  • Collapse the problem to the smallest exact count domain first: color histogram, row/column vector, fixed cell board, component degree, bbox width/height, or scalar area. Render only after the count/choice is known.
  • For mode/minority/majority tasks, count per color and select a single color id with ArgMax/ArgMin/TopK; avoid carrying one candidate mask per color or quadrant.
  • For fixed grids and separator boards, count per cell/block with a stride Conv or block reduce, select a compact cell mask, then expand once. Do not reconstruct every cell at full resolution.
  • For count-to-pattern tasks, prefer threshold tables or tiny output banks after one scalar count. Greater(count, thresholds) and small Gather banks beat spatial renderers.
  • For area/size comparisons, derive descriptors (width, height, pixel count, bbox extent, degree count) and compare scalar areas. Full per-cell four-direction fields are a last resort.
  • For component size, first try topology: local degree counts can classify small connected components more cheaply than enumerating templates or unrolling connected-component propagation.
  • For variable-size count renderers, infer size first, render at native size, then final-pad.

Useful tricks:

  • Zero-hot inactive padding can make full-input reductions cheaper than slicing a tiny crop (task129). Verify that inactive cells are truly all-false before relying on this.
  • If the count has already produced an integer label/color id, test Equal(label, arange10) as the final one-hot renderer. It can beat fp16 OneHot and often keeps the output bool (task100, task129). ORT bool OneHot is not implemented in this environment.
  • Bool Pad support is opset/type dependent. It works in opset17 with an explicit bool pad value on task129/184, but fails for older Pad schemas and some OneHot-derived graphs. Always score locally before promoting.
  • ReduceMax is presence; ReduceSum is count. Use ReduceSum only when exact cardinality changes the output.
  • For rectangle area_argmax, Relu(ReduceMax(x)) = ReduceMax(Relu(x)) can avoid materializing full candidate validity masks before scalar scoring.

High-value transfer targets:

  • 096/145/090 need method changes, not cleanup: reduce frame/rectangle enumeration to scalar or corner descriptors before rendering.
  • 014/059/079/100/129 show the reusable tail pattern: count/select as a scalar or tiny mask, then bool/uint8 label render with final padding.
  • Task096-specific direction: local solver shows (pixel_count, bbox_h, bbox_w, max_run_in_bbox) is enough to recover frame size across train+ARC-GEN, then frame_mask_from_run(size, run) renders the nested composite. This is promising for replacing template matching, but a descriptor LUT is hidden-risk until key-space coverage is proven.

Pattern, Tile, and Expansion Tags

Tags: fixed_pattern, repeated_pattern, pattern_expand, matrix_expand, kronecker_product, block_downsample, rotation_tile, d4_transform, expand_3x3_to_6x6, tiny_grid.

Optimization direction:

  • Keep motifs as 1-channel labels or bool occupancy. Expand labels with row/column Gather indices, fixed matrices, or exact Resize only if cheaper.
  • For block_downsample, reduce each source block to one bit/color before expansion; never expand full-resolution one-hot then downsample.
  • For kronecker_product/matrix_expand, use fixed row/column expansion matrices or repeat-index Gather. Paint colors after expansion.
  • For rotation_tile/d4_transform, use Transpose, reversed Gather, and quadrant Concat; avoid Conv unless it truly combines colors.
  • For fixed_pattern/tiny_grid, reduce input to scalars or a tiny patch and construct the output pattern directly.

Stop condition:

  • Once the largest intermediate is the active tiny motif/expanded label grid and final one-hot is direct, additional graph surgery is usually low-value.

Symmetry and Reflection Tags

Tags: symmetry_completion, pattern_reflection, centroid_reflection, multi_copy_symmetry, rotational_symmetry, d4_symmetry, d4_transform, rotation_overlay, mirror_tile, mirror_tiling, symmetry_select, horizontal_mirror, vertical_mirror, transpose.

Optimization direction:

  • First classify the symmetry renderer: fixed tiny mirror tile, dynamic axis reflection, D4 completion, overlay-only completion, or symmetry-based object selection. The cheapest method is different for each; do not start by materializing all mirrored candidates.
  • Fixed tiny mirror/rotation tiles should be a single label plane plus Gather/Transpose/Concat, then bool or uint8 Pad. Avoid 30x30 GridSample unless it is genuinely parameter-free and the label path is proven more expensive.
  • Dynamic reflections should infer axis/center as scalars or 1D vectors first. Build row/column index vectors, clamp with one Clip, gather the source once per required reflected copy, then render labels.
  • D4 completion should work on active colors only when black can be derived later. Use 9-channel or 1-channel labels; compute center from row/column presence, then add the minimal orbit generators (usually axis flips plus one transpose/shift) instead of all eight full variants.
  • Overlay-only symmetry tasks can often stay bool: original occupancy, rotated occupancy, add-mask, and background are bool, with only the overlap score cast to float if ReduceSum(bool/uint8) is unsupported. Pad bool output directly when the scorer only checks >0.
  • For fp16-heavy stamp/copy/mirror renderers, test whether the final fp16 concat can be padded directly as graph output. If the scorer only thresholds positive values, a final fp16-to-fp32 cast is pure cost.
  • Output-tail dtype pass: scan for Equal/Concat bool -> Cast(float/uint8) -> output/Pad. If the tensor is already one-hot/bool, make it graph output directly or Pad bool with false. This produced safe wins on tasks 029, 092, 130, 174, 183, and 189. Do not apply across the task-id boundary requested by the current optimization scope.
  • Symmetry-select tasks should test symmetry on projections or the few meaningful mirror-pair columns/rows before building the final crop. Choose the winner as a scalar/index, then render one crop once.

Useful tricks:

  • ORT limitations matter: ReduceSum(uint8) and Where(bool,bool,bool) may fail; use float only for reductions and temporary uint8 for selected bool masks.
  • GreaterOrEqual(x,0) is cheaper than Not(Less(x,0)); Clip(x,lo,hi) is cheaper than Min(Max(x,lo),hi).
  • Constant node outputs count as intermediate memory. In small symmetry graphs, prefer initializers for slice/pad/range constants unless a Constant node is required by the builder.
  • For D4 center algebra, if S=(CR-CC)/2, then D=S+CC; this avoids the separate (CR+CC)/2 chain.
  • If a graph keeps full 10-channel candidates through every transform, try active-channel labels or bool masks first. Final one-hot should be the last step.
  • Share repeated Slice axes constants. The gain is small, but it is free after structural wins.

Row, Column, Marker, and Ray Tags

Tags: row_pattern, first_occurrence, single_pixel, single_marker, marker_gate, stripe_fill, row_overlay, parity_fill, vertical_shift, diagonal_ray, conv_mask, count_pixels.

Optimization direction:

  • Collapse to 1D row/column vectors immediately. Do thresholding, parity, first/last occurrence, and marker coordinate logic in vector/scalar space.
  • For single_pixel/single_marker, extract (row, col, color) once; render with coordinate masks and sampled color.
  • For stripe_fill/parity_fill, precompute coordinate parity masks and gate by marker/scalar. Use Mod only with constant nonzero divisors; clamp data-derived divisors.
  • For vertical_shift, prefer Pad+Slice on a 1-channel mask or label grid.
  • For diagonal_ray, precompute diagonal coordinate masks for the fixed canvas and gate them by detected tails/markers.
  • For first_occurrence, avoid dynamic loops: compare the pattern row to each candidate color, use prefix/triangular masks or fixed ArgMax-style selection when dimensions are bounded.
  • For count_pixels, reduce to a scalar count first, then index/select a fixed output pattern.

Useful tricks:

  • Many row/marker tasks should not materialize 2D tensors until the final renderer. If most nodes are 30x30, the method is probably wrong.

Mirror, Deduplicate, and Copy Tags

Tags: mirror_patch, deduplicate_half.

Optimization direction:

  • For mirror_patch, use static reversed Gather indices over the cropped patch. Gate the chosen orientation with the marker scalar; do not build both full-canvas candidates unless necessary.
  • For deduplicate_half, detect orientation by comparing half sizes or blank separator structure. Then slice left/top half directly. If orientation is generator-fixed per case, branch at tiny metadata scale and only render the selected half.

Lattice and Frame-Fill Tags

Tags: lattice_decode, frame_interior, cross_split, grid_split.

Optimization direction:

  • Decode lattice intersections as a compact table. Sample at intersection centers rather than processing every wall pixel.
  • For lattice repair/fill tasks, separate wall preservation, exterior fill, and interior/true-gap fill masks. Use sentinel walls and bounded propagation only on the cropped lattice canvas.
  • If the output is the lattice's logical cells, compute cell indices/table entries directly; avoid rendering or scoring the visual grid.

Self-Inferred Multi-Tag Classes for Placeholder Descriptions

When Category Tags is still the placeholder, assign multiple inferred tags yourself before building. A task is often a combination, e.g. object_detect + spatial_shift + compact_label, or border_fill + morphology + label_output. Use all applicable classes; the combined pipeline should be the intersection of their cheapest representations.

This taxonomy was checked by four subagent range reads over tasks 001-050, 051-100, 101-150, and 151-200 using description.md, insights.md, and available solution.py. The recurring lesson is consistent across ranges: most placeholder tasks are structural multi-tag tasks, not pure color_replace.

Inferred class: object_extract / crop_extract_summarize / bbox_crop

  • Signals: isolate a salient object, crop a patch/interior, summarize a grid into tiny output, or emit only a bbox-derived region.
  • Pipeline: derive bounds from row/column projections, slice once, keep the active crop as labels or active channels, and final-pad. If output is tiny, summarize directly instead of reconstructing the original canvas.
  • Avoid: dynamic bbox logic when generator offsets are fixed; full 10-channel crops when only foreground/color id is needed.

Inferred class: spatial_shift

  • Signals: object/dot/patch moves without changing shape; direction comes from marker, nearest object, centroid offset, row/column relation, guide/barrier, or fixed displacement.
  • Pipeline: detect source mask and shift scalar/vector first; shift a 1-channel mask/label with Pad+Slice, reversed Gather, or tiny coordinate masks. Paint color after the shift.
  • Avoid: shifting a full 10-channel 30x30 image unless the task is literally full-canvas.

Inferred class: pattern_tile / periodic_extend

  • Signals: input is a prefix or one/two copies of a repeated motif; output extends, tiles, or continues the motif.
  • Pipeline: find period in 1D/2D at tiny size; build repeat indices; Gather rows/cols or use fixed expansion matrices. Recolor after tiling when possible.
  • Avoid: ConvTranspose for simple periodic repetition; it usually materializes too much.

Inferred class: scale_expand_tile / matrix_expand

  • Signals: motif is upscaled, each input cell maps to a block, or a small pattern becomes a larger matrix.
  • Pipeline: downsample/summarize first if needed, expand labels with fixed row/col indices or Kronecker-style matrices, then paint colors. Pick the scale branch before materializing output.
  • Avoid: expanding full one-hot tensors and then selecting colors.

Inferred class: small_grid_lookup / count_decode / count_or_majority_classify

  • Signals: result depends on a few cells, a scalar count, mode/majority, or fixed symbolic code.
  • Pipeline: reduce to scalar/count/code first, then direct LUT/Gather/Where into a tiny label output. Full-input reductions can be cheaper than charged crops when zero padding is harmless.
  • Avoid: generic object logic for fixed 3x3/4x4/1x1 symbolic outputs.

Inferred class: separator_grid / block_abstraction

  • Signals: divider rows/cols, fence lines, blank separators, or grid cells define independent blocks.
  • Pipeline: convert separators to row/col segment ids, work in block/cell space, extract one color/label per block, then render compact table or selected block.
  • Avoid: full 2D zone masks for every cell. Hierarchical row-then-column extraction is usually cheaper.

Inferred class: border_fill / flood_fill

  • Signals: fill exterior/interior/background regions around walls, frames, lattices, or enclosed areas.
  • Pipeline: crop to max canvas; encode walls as bool; seed border/exterior; bounded propagation with small Conv/MaxPool; paint enclosed/exterior labels at the end.
  • Avoid: treating zero-hot padding as black background. Use sentinel labels so scorer padding stays all-false.

Inferred class: span_fill / line_projection / line_ray_fill

  • Signals: fill between endpoints, extend color along rows/cols/diagonals, draw connectors, crosshairs, rays, bounces, or repeated rings.
  • Pipeline: after anchors/endpoints are known, reduce to row/col/diagonal vectors. Use prefix, suffix, CumSum/CumMax, or coordinate masks, then broadcast once at final render.
  • Avoid: 2D flood fill when the rule is really directional projection.

Inferred class: template_stamp / exemplar_match

  • Signals: one shape/template controls where other copies/stamps are drawn or which candidate is recolored.
  • Pipeline: split detector from renderer. Detector should reduce to small match bits/scalars; renderer should use native-size labels, fixed orientation branches, and final padding.
  • Avoid: whole-scene fingerprints unless used only as a diagnostic local ceiling.

Inferred class: template_match_select / orientation_search

  • Signals: choose one candidate/template/orientation/branch from several hypotheses.
  • Pipeline: score candidates in compact feature space; select the winning index/scalar first; only materialize the selected branch. If all branches must exist, keep them as tiny labels/bools.
  • Avoid: branch-merging full 10-channel canvases.

Inferred class: bbox_region / rectangle_reasoning

  • Signals: rectangles, frames, red/grey separator lines, corners, or side reflection define a region.
  • Pipeline: derive row/col intervals or corner scalars; reconstruct region once with coordinate masks; paint through label tail.
  • Avoid: four-direction per-cell run-length fields until a direct interval method fails.

Inferred class: frame_border / frame_interior / scaled_interior_render

  • Signals: hollow rectangles, frames, concentric borders, interior extraction, or frame-referenced motif scaling.
  • Pipeline: infer frame bounds/inside dimensions from row/col projections or known corners. Work at native interior size, render labels there, then pad once. For hollow rectangles, perimeter/row counts can replace explicit corner tracing.
  • Avoid: propagating colors through the full frame when the output is just the interior or a small scaled motif.

Inferred class: row_col_projection

  • Signals: row counts, column counts, longest row, first occurrence, stripe columns, table rows, or separator rows/cols determine the answer.
  • Pipeline: reduce to row/col vectors immediately; do all logic in 1D; broadcast once at render.
  • Avoid: per-pixel masks for every candidate row/column when a segment id vector is enough.

Inferred class: ray_line_path_draw

  • Signals: diagonals, ring paths, bounces, or rays from compact geometry.
  • Pipeline: precompute coordinate/distance/parity masks for the bounded canvas; gate them by detected anchors. Prefer 1D distance/modulo chains when possible.
  • Avoid: full 2D derived fields for each possible ray unless the canvas is tiny.

Inferred class: shape_cleanup

  • Signals: remove noise, keep supported pixels, filter broken components, or recolor clean shapes.
  • Pipeline: local support masks first (Conv/MaxPool on foreground); only escalate to component propagation if local criteria cannot distinguish valid/invalid shapes.
  • Avoid: large kernels that jump across nearby objects; hidden tests often include close gaps.

Inferred class: hole_fill_outline / neighbor_propagation

  • Signals: fill holes, complete crosses/outlines, grow local stencils, or repair missing component cells.
  • Pipeline: if the rule is local, use analytical Conv/MaxPool kernels. If it is bounded growth, unroll on a cropped bool/uint8 mask and paint later.
  • Avoid: symbolic component solvers for fixed local neighborhood rules.

Inferred class: palette_or_priority_overlay

  • Signals: multiple layers/quadrants/corner palettes map a pattern to output colors; priority is fixed or determined by position.
  • Pipeline: sample palette/layers into tiny tensors; compute region/pattern labels; use ordered Where or Gather color banks at the end.
  • Avoid: carrying one full 10-channel tensor per layer.

Inferred class: symmetry_transform / symmetry_mirror_flip

  • Signals: flip, mirror, transpose, D4 transform, reflection completion, or symmetry choice.
  • Pipeline: infer the transform choice as a scalar/mask, then use explicit Gather index maps and Transpose on cropped labels. For fixed small grids, this is usually the whole solver.
  • Avoid: GridSample/resampler-style generic transforms when static index maps are enough.

Inferred class: symmetry_complete

  • Signals: incomplete pattern must be completed by reflection, rotation, or periodic symmetry.
  • Pipeline: canonicalize to the smallest known half/quadrant/period, then synthesize one completion. Materialize only the selected canonical completion.
  • Avoid: many full-grid hypotheses.

Inferred class: tiny_static

  • Signals: fixed 3x3/4x4/6x6/10x10 outputs, count-to-pattern maps, simple rotations/mirrors, or hard generator bounds.
  • Pipeline: static slices and fixed index vectors; construct the tiny label grid directly.
  • Avoid: dynamic bbox or histogram logic when geometry is fixed by the generator.

Inferred class: guide_marker / marker_guided_recolor

  • Signals: special marker color/line selects the object, operation, replacement color, or stamp location.
  • Pipeline: reduce marker to scalar coordinates/color first; use it to gate a compact rewrite in label space.
  • Avoid: keeping marker as a full 2D one-hot plane after its coordinate/color has been extracted.

Inferred class: multi_object_relation

  • Signals: compare or combine several objects by distance, centroid, bbox relation, containment, alignment, or overlap.
  • Pipeline: reduce each object to a few stats (bbox, centroid, anchor row/col, color id), compute relation scalars, then render one selected/moved/combined mask.
  • Avoid: manipulating all object masks through the entire graph.

Inferred class: lattice_gap_fill / interior_exterior

  • Signals: lattice walls with gaps, exterior/interior classification, or wall-preserving fill.
  • Pipeline: detect wall rows/cols dynamically, block corner gaps from becoming conduits, run bounded flood only on cropped lattice, then paint wall/exterior/interior/gap labels.
  • Avoid: hard thresholds for wall rows/cols unless generator proves them; hidden cases vary.

Multi-tag combination rules:

  • object_detect + spatial_shift: detect object on cropped active channels, shift one mask/label, then compose with stationary objects.
  • object_extract + bbox_crop: row/col projections first, single crop second, final pad last.
  • pattern_tile + color_replace: tile/repeat occupancy first, recolor with direct label/Conv tail.
  • separator_grid + block_abstraction: collapse to block IDs before extracting colors or counts.
  • border_fill + morphology: use morphology to define walls/support, then bounded flood only on the cropped bool grid.
  • span_fill + line_projection: choose endpoint/CumSum path based on whether the fill is between markers or directional extension.
  • symmetry_transform + tiny_static: label encode once, static Gather/Transpose, final Equal.
  • palette_or_priority_overlay + quadrant_mapping: convert quadrants to region ids, then one palette Gather.
  • row_col_projection + compact_table: compute segment ids as row/col vectors, then extract cells hierarchically instead of full 2D zone masks.
  • template_match_select + marker_guided_recolor: score templates/branches compactly, select the branch first, then recolor/render only selected labels.
  • bbox_rectangle_fill + hole_fill_outline: do row/col interval logic in bool/uint8, postpone one-hot with sentinel pad.
  • ray_line_path_draw + geometry: prefer coordinate/parity/distance masks over full 2D propagation.
  • small_grid_lookup + color_logic: direct code/LUT path beats generic vision logic.
  • tiny_static + label_output: direct label construction almost always beats 10-channel one-hot intermediates.

Placeholder Tags and Deferred Classification

Placeholder examples: spatial_shift, pattern_tile, border_fill, plus the template color_replace/object_detect when they appear only inside the example text.

When a task still has placeholder tags:

  • Read Transformation Rule, insights.md, and current solution.py; assign all applicable real or self-inferred tags before starting optimization. A task may and usually should have multiple tags.
  • Record the chosen tags in description.md or insights.md after a successful structural win.
  • Use the universal triage above to choose one of the real playbooks; do not optimize from the placeholder wording alone.

Fingerprint / Lookup Policy

Visible examples can often be keyed by a few cells, but that is not a category tag by itself. Use fingerprinting only as:

  • a diagnostic/local ceiling to estimate renderer cost;
  • a deployable method when generator key-space coverage is proven or LB confirms it.

Keep fingerprints local and semantic: crop only task-relevant cells, never whole-scene hashes as the first approach. Mark visible-set LUT candidates as local-only / hidden-risk in insights.md, do not update best_score.txt/submissions/best without LB confirmation, and probe with a full 400-file bundle containing exactly one swapped task.

Treat an input-derived hash/code followed by Gather from a pattern/action LUT as a fingerprint even when its key is computed from apparently structural features and it passes static and metamorphic checks. It stays LB_PROBE until key-space coverage or an isolated LB probe proves it; a clean banned-op scan is not evidence of hidden-test generalization or practical runtime.

Subagent Prompt Shape for Category Work

To save tokens, pass subagents this compact structure:

  1. invariant header: scorer constraints, banned ops, static IO, method > architecture > detail, crop-first/label-tail defaults, hidden-risk policy;
  2. task-specific block: task id, current score, filled description/insights excerpts, suspected category, owned candidate path, required local score command;
  3. expected output: exact rule hypothesis, candidate path, score/cost delta, hidden-risk notes, and whether to promote or keep under candidates/.

Do not paste whole strategy.md into subagents. Point them to the relevant category section and the task's description.md/insights.md.


1. Competition Meta-Strategy

What actually works (confirmed by top competitors)

  1. Program synthesis, not trained networks. Hard-code the rule as tensor ops. Zero learned parameters is often achievable and gives the best scores.
  2. Understand the exact rule, then minimize its ONNX expression. Don't blindly code a general solution — find the specific structure that matches this task.
  3. Read the ARC-GEN generator (github.com/google/ARC-GEN). It tells you the exact rule, invariants, and fixed colors. Eliminates guessing.
  4. Crop → process small → pad back. Working at the actual object size (e.g., 5×5) instead of 30×30 reduces memory 36× for that intermediate.
  5. ~5 agent passes per task to reach optimum. Don't declare done after the first improvement.

Score improvement math

  • Worst 20 tasks (score 10–13): +3 pts each = +60 total
  • 89 tasks scoring 12–14: +2 pts each = +178 total
  • 162 tasks scoring 14–16: +1 pt each = +162 total
  • Focus on raising the floor — each point on a low-scoring task is worth more than on a high-scoring task (due to log scaling).

Cost targets by score goal

Score 18 → cost < 5,958    (typical achievable minimum for non-trivial tasks)
Score 20 → cost < 799      (requires very compact intermediate tensors)
Score 22 → cost < 107      (near-free solution)
Score 25 → cost = 0        (only tasks 179 and 241 achieve this legitimately)

2. ONNX Patterns Library

Pattern A: Direct Channel Remapping (color replace/permute)

When: Output has same spatial layout as input, just different colors.

# Use 1×1 Conv to remap channels — weight W[out_ch][in_ch][1][1]
# Memory cost: just the conv output = 1×10×H×W bytes
# Example: swap color 2↔3, identity for others
W = np.zeros([10, 10, 1, 1], dtype=np.float32)
for i in range(10):
    W[i][i][0][0] = 1.0  # identity
W[2][3][0][0] = 1.0; W[2][2][0][0] = 0.0  # 3→2
W[3][2][0][0] = 1.0; W[3][3][0][0] = 0.0  # 2→3
# 100 params total

Pattern B: Spatial Shift / Translation

When: Output is the same as input but shifted by (dy, dx).

# Pad then Slice — works without any parameters
# Shift right by dx, down by dy:
# Pad input: left=dx, top=dy, right=0, bottom=0 → then drop the overflow
# Cost: 2 intermediate tensors (both [1,10,30,30]) unless you crop first!

# BETTER: work at the actual image size first, then pad to 30×30
# Step 1: Slice input to actual grid size (H×W, found from data)
# Step 2: Pad/Shift at small size
# Step 3: Pad back to 30×30 (free — this IS the output)

Pattern C: Object Crop → Process → Place Back

When: Task involves finding an object, transforming it, placing it back.

# This is the #1 memory optimization pattern.
# If object is always in a fixed region of the 30×30 → Slice to that region
# Process the small region (cheap)
# Pad back to 30×30 at the end (padding is the output → free)
#
# Cost example: 5×5 region with 10 channels = 5×5×10×4 = 1,000 bytes
# vs 30×30×10×4 = 36,000 bytes — 36× cheaper!

Pattern D: Color-based Logical Operations

When: Output depends on a logical combination of input channels.

# Use Cast to bool (1 byte) then bitwise ops
# Example: "mark cells that are color A OR color B"
# channel_A = Slice(input, axes=[1], starts=[A], ends=[A+1])  # [1,1,30,30]
# channel_B = Slice(input, axes=[1], starts=[B], ends=[B+1])  # [1,1,30,30]
# mask = Or(channel_A > 0, channel_B > 0)  # bool, 1 byte per element
# Cost: 2 small channel slices + 1 bool mask = very cheap

Pattern E: Tiling / Repeating Pattern

When: Output is input tiled/repeated to fill a larger area.

# Use Expand (zero-copy broadcast) or Tile
# Expand is cheaper — it doesn't allocate new memory
# Example: tile 3×3 to 30×30 → Reshape to [1,10,1,1] → Expand to [1,10,30,30]
# (only works if all tiles are identical)

Pattern F: Zero-Parameter Pure Math

When: The transformation is a fixed mathematical operation (rotate, reflect, etc.)

# Use Transpose for permuting dimensions
# Use Slice+Concat for spatial rearrangement
# Use Pad for border operations
# Zero initializers → 0 params → cost = only memory of intermediates
#
# Example: horizontal flip
# Slice input columns in reverse order and Concat
# Or: use Gather with a reversed index (which is a Constant — counts as params!)
# vs: use Slice with step=-1 (no params needed in some opsets)

Pattern G: MaxPool / AvgPool for Spatial Aggregation

When: Need to detect if any pixel in a region has a certain color.

# MaxPool(kernel_size=K, padding=K//2) → detects any active pixel in K×K region
# Cost: 1 intermediate [1,10,30,30] but at actual task grid size if you crop first
# Useful for: "is there color X within N pixels of this cell?"

Pattern H: Where-based Masking

When: Conditionally overwrite some pixels.

# Where(condition, true_value, false_value)
# Condition must broadcast properly — test it!
# Can replace a complex Conv with a simple boolean mask
# Cost: condition + two inputs → 3 intermediates (or reuse input)

Pattern I: ArgMax for Color Detection

When: Need to find which color each cell is.

# ArgMax(input, axis=1, keepdims=0) → [1, 30, 30] int64 (which channel is max)
# Cost: [1,30,30] × 8 bytes = 7,200 bytes (much cheaper than full [1,10,30,30])
# Then use Gather or comparison to re-encode

Pattern J: Bitwise Encoding (memory ×8 savings)

When: Many boolean/color operations needed.

# Encode each color as a bit (1<<color) instead of a one-hot channel
# One int64 tensor [1,1,30,30] = 7,200 bytes vs 10-channel float [1,10,30,30] = 144,000
# Use BitShift + BitAnd for color operations
# Requires ORT 1.24.4 (our env has it ✓)

Pattern K: 1×1 Conv color-encoder (replaces ArgMax, avoids int64) ★session-3

When: You need the color-index of each cell (the inverse of one-hot) as a number.

# ArgMax gives int64 [1,1,H,W] = 8 bytes/elem (expensive). Instead:
W = np.zeros((1,10,1,1), np.float32)
for c in range(10): W[0,c,0,0] = c          # weight = color index
# Conv(input, W) -> [1,1,30,30] float32 (4B/elem), already the encoded grid.
# ORDERING MATTERS: Conv on FULL [1,10,30,30]->[1,1,30,30]=3600B then Slice->[1,1,10,10]=400B
#   is CHEAPER than Slice->[1,10,10,10]=4000B then ArgMax(800B int64)+Cast(400B). (task040)

Pattern K2: Equal-expand (replaces OneHot) ★session-3

When: Re-expand an encoded color-index grid back to a one-hot [1,10,H,W].

# encoded [1,1,H,W] float ; class_idx = arange(10).reshape(1,10,1,1)
# onehot_bool = Equal(encoded, class_idx)   # [1,10,H,W] bool, broadcasts. No OneHot needed.
# Padding trick: Where(grid_mask, encoded, -1.0) first → padding cells equal NO channel → all-false.
# Alt when no encoder available: CumSum+Equal+Cast also synthesizes one-hot (task048).

Pattern L: Flood-fill via MaxPool (connectivity / reachability) ★session-3

When: "is region A connected to region B", spread a seed through passable cells.

# MaxPool(seed, kernel=3, pad=1) expands the seed 1 step in 8 directions (NO params).
# r[i+1] = Mul(MaxPool(r[i],3x3,pad=1), passable_mask)   # restrict to passable cells
# 8-connectivity (3x3) needs FEWER iterations than a 4-connectivity cross-Conv.
#   ~6 iters cover an 8×8 grid. Use float16. Beats Conv+Greater+Where (3 ops→2 ops, no params).
# Seed "first cell in row-major order": rs=ReduceSum(mask,axis=3,keepdims); 
#   F = CumSum(rs,axis=2,exclusive=1) + CumSum(mask,axis=3); seed = Equal(F,1.0).  (task048)

Pattern L2: QLinearConv uint8 for 4-connected flood-fill ★session-5

When: You need 4-connectivity BFS (not 8-conn) and want the cheapest memory per BFS tensor.

# uint8 reach (400B/tensor at 20×20) beats fp16 (800B). Cross kernel gives 4-connectivity.
# cross = [[0,1,0],[1,1,1],[0,1,0]] (uint8)
# c[i] = QLinearConv(r[i], scale=1, zp=0, cross, scale=1, zp=0, scale=1, zp=0, pads=[1,1,1,1])
# r[i+1] = Min(c[i], open_u8)   # open_u8 is the passable-cell mask (0/1 uint8)
# Final detection: Less(c[last], open_u8)  — holes are open cells not yet reached.
# NOTE: with N rounds of BFS tensors, intermediate memory = N*2 * H*W bytes.
#   A 20×20 grid with 20 rounds → 40 * 400B = 16,000B intermediates; keeps cost manageable.
# Candidate tasks: task187/198/193 (flood/morphology) when 4-connectivity is needed.
# ORT 1.24.4 supports QLinearConv (opset 10). (task002 confirmed)

Pattern M: Conv all-ones kernel for windowed counting ★session-3

When: Count active cells in every K×K window (block/shape detection).

# W = ones((1,1,K,K)); Conv(mask, W) -> each cell = count in its K×K window.
# Greater(conv_out, K*K-0.5) marks FULL K×K blocks. (task038: 2×2 block detection)

Pattern N: 1D Conv for periodic/offset masks ★session-4

When: A row/column marker determines repeated stripes, alternating columns, or offset masks.

# Treat a one-hot marker row as a 1D signal: [1,1,1,W].
# Small fp16 Conv kernels with left/right pads generate masks like c, c+2, c+4...
# This can beat coordinate-grid arithmetic and color-bank MatMul forms.
# task200: bottom marker column -> periodic color stripes + gray offset rows.
#
# Practical notes:
# - fp16 Conv is supported and cheaper than fp32 for these binary masks.
# - Cast Conv mask outputs to bool only after the Conv.
# - Keep the result as a label row if the next step is Where(label_color, ...).

Pattern O: Label-first geometry/lattice decoders ★session-4

When: A grid/lattice encodes a tiny output, and non-grid colors at intersections/corners matter.

# Convert the full input to a compact label image once, then operate on labels.
# Best current version if you can afford a Conv:
#   Conv(input, arange10[1,10,1,1]) -> C_f fp32 [1,1,H,W]
#   Cast(C_f) -> C_u uint8 [1,1,H,W]
# This avoids ArgMax(input)'s 8-byte int64 label image.
#
# Older fallback:
#   ArgMax(input) -> C_i int64 [1,H,W]
#   Cast(C_i) -> C uint8 [1,H,W]
#   Equal(C_i, grid_i) -> is_grid      # compare before casting if grid_i is already int64
#   Where(is_grid, 0, C) -> C_not_grid
#
# Then reduce labels before thresholding:
#   row_label = ReduceMax(C_not_grid, axes=[2])  # [1,H] uint8
#   rh_b = Greater(row_label, 0)                 # [1,H] bool
# This avoids a full [H,W] nonzero bool mask when all you need is row/col presence.
# task185 v19: 30x30 lattice -> 3x3 bool output at cost 7,075.

3. Core Optimization Tricks

Full historical trick notes are archived in logs/strategy_history.md. Keep this section short and reusable.

Representation

  • Work at the actual grid/object size. Slice/crop before Conv, CumSum, MatMul, template matching, or flood fill.
  • Collapse to scalars, row/column vectors, or 1-channel labels before 2D rendering.
  • Use uint8/bool for masks/labels. Use fp16 only when ops require numeric arithmetic and exact small integers remain safe.
  • Prefer active-color tails; do not carry 10 channels unless the next op truly needs all colors.
  • Preserve explicit black channel in final one-hot unless the task proves zero-hot padding is accepted.
  • If only one or two selected color masks are needed, dynamic channel Slice(input, [color, y0, x0], [color+1, y1, x1], axes=[1,2,3]) can beat building a full label image. Add explicit static value_info for downstream tensors because ONNX shape inference often leaves these dynamic.
  • If the active window is fixed, slice directly to [channel, active_h, active_w] before casting. Avoid 30x30 -> bool/uint8 -> crop; the full-size cast often costs more than any later cleanup can recover.
  • If propagated colors cannot overlap, propagate a single scalar color label instead of 9/10 one-hot planes. Use ArgMax or a tiny label encoder, do spatial Conv/Gather on the label canvas, then sentinel-pad and final Equal(arange10).
  • When the raw input is free but a crop tensor is counted, collapse colors first if possible. Task018 improved by building a one-channel combo label on full input, then cropping combo to 24x24; cropping [1,10,24,24] input first was worse despite reducing later ops.

Output Tail

  • Final output tensor is free; make the largest unavoidable tensor be the graph output when possible.
  • Sentinel-pad labels (255 or another non-color) before final Equal(arange10) so padded cells are all-false.
  • Bool output from Equal is usually cheaper than fp32 one-hot; verify each op supports bool where used.
  • For label tails, avoid padding with 0 unless channel-0 black is intended inside the valid output.
  • If a graph currently does Equal(label, colors) on a small valid canvas and then Pads the resulting one-hot/bool tensor, test the reverse order: Pad(label, sentinel) first, then make the final Equal the graph output. Task017 improved this way because the free output absorbed the one-hot expansion and removed a [1,10,H,W] intermediate. Use a non-color sentinel like 255; padding with 0 will wrongly light up channel 0.
  • If the label formula must be computed in fp16 but only carries integer color ids at the tail, test Cast(label_fp16 -> uint8) before sentinel Pad. Task017 saved memory because the added 21x21 uint8 cast tensor was cheaper than padding a 30x30 fp16 label tensor.
  • For candidate-table / lookup-style structural solvers, prune witness points by checking injectivity on the candidate family itself, not only on visible examples. Task017 improved again after reducing 16 sampled positions to 9: the kept positions still gave unique signatures for all 106 candidate rows, so params and match tensors shrank without changing the selected candidate on any visible example.
  • For tiny XOR/AND/OR outputs, keep the whole final tail bool (Equal/Not/Concat/Pad) when possible. This can remove fp16 Cast/Sub and halve channel-stack memory.
  • For identity-plus-edits tasks, prefer rendering only the edit mask and writing onto free input with Where(mask, replacement_onehot, input) instead of reconstructing the whole label/output tensor.

Geometry and Selection

  • Static Slice/Gather/Transpose beats generic resamplers for fixed mirror/rotate/shift tasks.
  • For row/column tasks, do logic in 1D (ReduceMax, ReduceSum, CumSum, prefix/suffix masks) and broadcast once.
  • For column-count transfer/sorting tasks, test a shared multi-channel active Slice plus joint ReduceSum before duplicated per-channel pipelines; combine counts into bool row masks and cast only final output planes.
  • When a final full in_grid/valid mask clips the canvas, earlier class masks can often stay as row or column vectors and rely on broadcasting plus override order; avoid materializing separate full 2D masks for bottom rows, left columns, or diagonals if a later mask/Where resolves boundaries.
  • Use separable row/column Conv/Gather when a full 2D index grid is only representing independent row/col logic.
  • For bbox/rectangle/frame tasks, derive intervals/corners first; avoid per-cell four-direction fields unless necessary.
  • For marker/object relation tasks, reduce each object to bbox/centroid/anchor/color scalars before rendering.

Operators

  • 1x1 Conv color encoders often beat ArgMax/int64 label chains; direct 1x1 Conv also wins for pure color remaps.
  • For tiny one-hot patches or scalar witness samples, a one-output 1x1 Conv label encoder (weights = color ids) can beat ArgMax -> Cast because it avoids int64 intermediates. Keep the resulting label rank4 when downstream Pad/Gather can use axes 2/3 directly.
  • But when a label encoder is only used to compare against selected colors, test dynamic channel Slice masks first; it may remove the encoder entirely.
  • ReduceMax is the default presence op; use ReduceSum only when counts matter.
  • MaxPool/small Conv is the default for morphology/support; full connected components are last resort.
  • QLinearConv can replace fp16 integer Conv detectors when uint8 pipelines stay exact.
  • For QLinearConv cleanup, share identical scalar scale/zero-point initializers across x/w/y inputs when the quantization is all scale=1, zp=0; this trims params without changing memory or semantics.
  • For small bool match-count tables, ReduceSum(uint8) is not accepted by ORT, but Equal -> Cast(uint8) -> QLinearMatMul(ones_vec) can exactly count matches in uint8 and beat Cast(fp16) -> ReduceSum. If the right-hand vector is rank-1, MatMul can output [batch, candidates] directly and avoid a reshape.
  • Use opset attr forms for Slice/Pad/reduction axes only when the target opset supports required input dtypes.
  • In opsets where Slice axes/steps are optional and default to full axes/step 1, omit them for scalar/static slices to save initializer params. Also prefer concat-axis broadcasting over reshape when sampled scalars can be arranged to match the candidate-table rank.
  • For older opset graphs, moving reduction axes from tensor inputs back to attributes can save initializer params; pair this with direct Mod/wrap arithmetic when the opset and dtypes support it. Verify ORT dtype coverage: Sub(uint8,uint8) and bool-payload Where can still be rejected in compact graphs.
  • Before inserting Unsqueeze/Reshape to match ranks, test whether the consumer already broadcasts the lower-rank tensor correctly. Where(mask [1,1,H,W], value [1,H,W], scalar) can remove a rank-adjustment tensor when the missing leading dimension is singleton.
  • For local patch-edit tasks, choose the dynamic patch start as the coordinate frame and add small cell offsets to it. This can replace a separate center_vec + signed deltas path and shrink both params and index intermediates.
  • For tiny patch-edit writers, keep dynamic coordinate arithmetic in int32 as long as the consuming ops allow it. Dynamic Slice accepts int32 starts/ends only when axes/steps use the same dtype; ScatterND in this runtime still requires final int64 indices, so cast only at the writer boundary. Task020 saved cost this way after the 5x5 patch solver was already small.
  • Replace small lookup tables with scalar piecewise formulas only when the domain structure is explicit. Task020 removed a 31-entry keep-position table by grouping the 12 candidate cells into three 4-cell orbits with sums 6/22/38, then computing keep = group_sum - missing_sum.
  • When a dynamic Slice is intentionally tiny and static at runtime, add explicit static value_info for its outputs and downstream small tensors. The scorer may reject otherwise correct graphs if shape inference leaves dynamic ranks.
  • For fixed scalar/pixel witness sampling, shrink Slice metadata to only the needed axes when legal. Task017 changed 4D starts/ends to 2D spatial starts/ends and used Flatten(axis=2) for the witness tail, saving params without changing witness semantics.
  • If a task has a proven generator maximum smaller than 30 but requires a dynamic color/channel, combine dynamic channel selection with static spatial crop in one Slice after the first collapse when possible. Task014 improved by slicing input[:, target:target+1, :25, :25] instead of gathering a full 30x30 selected channel. This is safer than shrinking the output canvas when it preserves the full render extent, but still belongs in pending until LB verifies the generator-bound assumption.
  • For flood/fill tasks, after deriving a superset mask, re-check whether the actual flood can run on the strict interior or bbox-only domain. Holes often cannot touch the exterior border; moving propagation from 20x20 to 18x18 saves every flood-state tensor. Seed the smaller domain with a valid convolution from the larger mask when possible, so you do not pay for a full-size seed tensor plus crop.
  • Distance-limited candidate masks can buy back propagation rounds, but only if the repair for missed long corridors is cheaper than the removed round. Task002's within-6 + 6-round candidate was 261/262 and would beat current if exact, while a final 16x16 repair made the graph worse. For flood tasks, inspect the exact missed cases before adding generic cleanup.
  • In masked flood graphs, the final propagation state often has only one consumer: the hole test. If cand is binary, holes = Less(QLinearConv(reach_last), cand) is equivalent to materializing reach_next = Min(QLinearConv(...), cand) and then testing Less(reach_next, cand), but saves one full flood-state tensor. Task002 used this to repair a 261/262 near miss with half the normal final-step cost.
  • Do not replace path-faithful flood with larger-kernel jumps unless the domain has no gaps to jump across. Task002 diamond kernels and task018 7x7/two-5x5 blob split both failed by crossing blocked or disconnected gaps. Bigger kernels are only safe for morphology/support predicates, not connectivity propagation.
  • For fixed-shape target blocks, scalar reconstruction is not automatically cheaper than carrying the full small plane. Task008 showed that rebuilding a 2x2 block from row/col/flat descriptors adds enough masks and reshapes to lose against the direct 16x16 plane. Only do this when the reconstructed object also removes another full-plane consumer.
  • For object relocation with many unique shape masks, row/column descriptors locate the object but cannot reconstruct it. Task008 has 240 unique moving shapes in local visible+ARC-GEN; the full moving-object mask is semantically necessary unless a compact dynamic patch renderer is available. When building such renderers, avoid ORT-unsupported int32 Where clamp paths; use accepted Min/Max/Clip or arithmetic/gather indexing instead.
  • For rank/order tasks with a proven strict total order, do not compute both directed comparisons. Six comparisons over four items plus complements can replace twelve Greater nodes. Task010 used g_ba = 1 - g_ab because nonzero guide-column heights are distinct.
  • Removing a wide branch tensor is only a win if the replacement pairing/rendering primitive is genuinely cheaper. Task018 branch-select attempts removed delta [1,8,24,24] but lost either correctness (cheap top/bottom or left/right marker pairing) or memory (exact code-map pairing). For multi-template marker-alignment tasks, preserve exact same-color pairing first; then search for a selected-transform-only renderer.

Safety and Scorer Rules

  • Banned/crash-prone: Sqrt; data-derived Div/Mod with zero divisor. Guard divisors with Max(divisor, 1).
  • Scorer counts intermediates and raw initializer bytes. Use uint8/int32 initializers where legal.
  • Reshape, Squeeze, Identity, and stale graph.value_info can still cost or confuse tooling; after ONNX surgery, clear stale value_info and rerun scoring before judging the candidate.
  • Sparse initializers are unreliable in this environment; prefer dense tiny tensors unless verified.
  • Visible-signature/fingerprint LUTs are local ceilings unless generator key-space coverage or LB confirms deploy safety.

Search Discipline

  • Fresh baseline plus several real rounds often beats patching an old graph.
  • Add an explicit representation-rephrase pass before shaving details. For each task, ask whether the rule is cheaper as free input one-hot, scalar label map, small one-hot witness, bit-packed role/color code, coordinate/patch writer, candidate-table selector, or static relation tensor. Large wins usually come from changing the problem substrate: task020 became a local missing-cell patch writer instead of D4 full-grid completion; task018 uses packed color|role combo labels; task009 uses a 10x10 interval relation instead of full-grid cumulative fills. One-hot is best when it can stay on the free input or a tiny witness; scalar/packed labels are usually better for full spatial intermediates.
  • After one successful lossless cleanup and one identical re-cleanup, stop shaving and return to method/architecture.
  • If a candidate is correct but worse, log the reason in knowledge/task_XXX/insights.md; do not promote.

Task001-020 representation-rephrase search map

Use this map when restarting the first bucket. The goal is to change the substrate of the problem before shaving ops:

  • 001: current cost is dominated by out9 [1,10,9,9]. Only re-open if the 9x9 output can be generated directly as a label canvas or bool output; scalar-tail variants are likely worse unless they remove the whole 10-channel intermediate.
  • 002: flood fill should be reasoned as connectivity, not morphology. Search for cheaper candidate-domain propagation, final-state skip, or smaller exact domain; avoid jump kernels. Obscure-op angle: Clip(uint8) can saturate neighbor counts; QLinearMatMul is not useful unless the flood is rephrased as a tiny relation-table closure.
  • 003: tiny stripe-period task. Look for direct row gather/Concat schedules; most one-hot intermediates are already small, so only representation changes that remove repeated row tensors matter.
  • 004: shear is currently a 16x16 scalar-code grid plus 30x30 pad. Try a row-vector shift formulation: derive shift per row, then gather rows, instead of materializing full scalar canvases early. Obscure-op angle: test GatherElements(uint8,int32) for per-row shifts before GatherND; it may keep indices smaller if the remap grid matches the data rank.
  • 005: template replication remains high because it carries full 15/21/30 label planes. Rephrase as anchor + direction + repeated local patch writer if the marker fragments only determine a ray; do not fragment-match by visible lookup.
  • 006: already tiny. Rephrase only if the left/right intersection can become a single bool expression directly on the free input and remove both 3x3 float masks.
  • 007: current solution is essentially a static period/rule table. Further wins likely come from a smaller modulo/period encoding, not from changing one-hot representation.
  • 008: moving-object shape is semantically needed. A compact dynamic patch writer is the only likely method win; row/col descriptors alone locate the object but cannot reconstruct arbitrary shapes. Obscure-op angle: prior patch-writer attempts hit Gather/Pad(bool) limits. Retest with GatherElements(uint8,int32) for patch LUT/remap and Resize(uint8)/DepthToSpace(uint8) for fixed block expansion, but keep payloads uint8 because Where(bool) payload fails.
  • 009: interval relation is the right rephrase versus cumulative full-grid fills. Next search: collapse colors_sample_f16/colors_sample_b/scalar_blocks so the 10x10 block label grid is sampled once and reused as scalar labels. Obscure-op angle: Einsum(uint8/int8) fails, but QLinearMatMul(uint8/int8) works. A future method attempt should decompose the interval fill into quantized 2D matmul passes or small uint8 relation-table products instead of direct four-input Einsum.
  • 010: rank/order task. Use strict-order complements and scalar rank maps; avoid returning to full 10-channel one-hot before the final output.
  • 011: missing-cell grid expansion is already a selected-key-cell renderer. Search for a direct 3x3 color/tile gather that avoids the 30x30 scalar pad or the 7x3x3 selected one-hot. Obscure-op angle: ArgMax(uint8) works, so keep selector paths uint8; test GatherElements if direct key-cell gather can replace one-hot selection.
  • 012: plus expansion is a coordinate writer. The 30x30 scalar canvas is the floor unless direct ScatterND to output or late Equal removes it. Obscure-op angle: ScatterND(uint8,int64,max/add) works and may combine overlapping endpoint writers more cheaply than chained Pads/Where. ScatterND int32 indices fail, so account for int64 index params before trying it.
  • 013: alternating stripe task should stay as row/column vectors. Avoid full 30x30 grids until the final output; test vector-only side selection or one shared line generator.
  • 014: minority-quadrant task benefits from selecting the color/plane first, then static spatial crop. Further wins depend on proving smaller max crop bounds or removing the 30x30 class pad.
  • 015: single Conv has no counted intermediates; representation rephrase is unlikely to win because dense 3x3 cross-channel params are the cost floor.
  • 016: fixed color substitution is already near theoretical floor.
  • 017: periodic-gap fill should remain candidate-table + scalar label render. Safe wins are witness-sampling compression and label-tail cleanup; grouped witness hashes are hidden-risk. Obscure-op angle: highest-value target for QLinearMatMul(uint8/int8): replace binary witness-feature scoring or candidate compatibility dot products while keeping output scores uint8. Avoid grouped hashes unless LB-probed.
  • 018: multi-template relocation needs exact marker pairing. The big target is replacing delta [1,8,24,24] with a selected-transform-only matcher/renderer; cheap branch-selects failed because they lost same-color pairing. Obscure-op angle: BitShift(uint8) and Clip(uint8) can help packed role/color matching; QLinearMatMul might score marker slots after flattening tiny witness vectors, but full delta removal still requires exact same-color pairing.
  • 019: 2x tile + diagonal-neighbor recolor is a coordinate/label task. Search for direct 12x12 output writer or late output Equal that avoids the 30x30 value30 tensor.
  • 020: symmetry completion is best viewed as a local missing-cell patch writer, not whole-image D4 reconstruction. Further wins should reduce ScatterND index constants or share color/position indices. Obscure-op angle: ScatterND requires int64 indices but supports uint8/int8 reductions; use it only if it replaces multiple writer tensors. Test GatherElements for small patch remaps when rank-compatible.

4. Task-Type Classification

Use these tags in knowledge/task_XXX/description.md to enable cross-task search.

Tag Description Key ops
color_replace Change one or more colors 1×1 Conv, Where
spatial_shift Translate object N pixels Pad + Slice
object_detect Find specific object by color/shape ArgMax, ReduceSum
object_move Move object to new location Slice + Pad
pattern_tile Tile a small pattern Expand, Tile
border_fill Fill borders with a color Pad, Where
reflect_rotate Spatial reflection/rotation Transpose, Slice+Concat
color_logical AND/OR/XOR over color channels Cast + bitwise or MaxPool
size_change Output size ≠ input size Slice + Pad
gravity Objects fall in a direction Cumulative ops (tricky!)
connected_components Group/label connected regions Hard in ONNX, avoid loops
sorting Sort objects by property Very hard without NonZero
counting Count objects of a type ReduceSum over channels
symmetry Mirror/reflect symmetry Transpose + Where

5. Archived Logs and Debug Notes

Historical per-task score history, hard-task notes, model benchmark notes, detailed Kaggle binary-search transcripts, and long agent run logs now live in logs/strategy_history.md.

Keep new cross-task lessons here only if they are reusable playbook/trick material. Put chronology and per-run outcomes in the log or in knowledge/task_XXX/insights.md.

Reusable Lessons From Recent Runs

  • task229 WIN (20.7805->20.8411, +0.0606): For zero-memory direct-output Einsum graphs, diagonalize a small interaction core with an exact integer Hadamard/gauge transform. Replacing a dense 2x2x2 core by a diagonal 2x2 core saved parameters while preserving a strict sign margin.
  • task227 WIN (20.3948->20.4567, +0.0619): For a fixed stacked-grid Boolean rule, a one-channel signed descriptor plus tiny direct writer can beat a zero-memory dense Conv even after paying a 4x4 intermediate; prove the four local truth states algebraically.
  • task220 WIN (19.1028->19.1829, +0.0800): For direct-output coordinate renderers, factor multiple spatial kernels through a shared low-rank basis before the final Einsum. This can reduce parameters without adding counted memory or changing the exact local rule.
  • task217 WIN (19.7530->20.1797, +0.4267): For direct-output Einsum models, replace dense coordinate tables with a homogeneous quadratic Lagrange basis and bind source mode into the contraction. This removed 66 parameters with zero counted memory while preserving exact structural ma
  • task149 WIN (20.0873->20.2726, +0.1853): Pack finite descriptors and byte-decode only after proving the official generator domain exhaustively; domain proof is part of the method.
  • task148 WIN (19.1681->19.2732, +0.1050): Normalize a symmetric factorization before rank search; symmetry and scale absorption cut the direct writer core 341->307.
  • task147 WIN (19.4627->19.5028, +0.0402): Reuse one convolution weight for analysis and synthesis when the semantic kernel is shared; save params without activations.
  • task142 STALLED (20.9057->20.9057, +0.0000): Exact rank audit shows the 2x30 parameter map is rank-2; rank-1 fails, establishing a method-local 60-cost floor.
  • task138 REJECT (16.0658->16.0658, +0.0000): Apparent BOOL-output gain was rejected; scorer acceptance is not enough when promotion requires static FLOAT32 I/O.
  • task136 WIN (18.5606->19.6155, +1.0549): Express selector, geometry, and rendering as three direct-output Einsum contractions to erase scatter/index state.
  • task132 WIN (18.0922->18.1713, +0.0790): Replace a dense color matrix with a shared affine sign map when the mapping is order/threshold structured.
  • task109 WIN (18.2088->18.2883, +0.0795): Before approximate CP factorization, test whether an existing exact relation tensor already encodes its selector through simple contractions. Algebraic selector recovery removed 68 parameters while preserving raw baseline outputs.
  • task168 WIN (17.8885->17.9124, +0.0239): If output color is globally unique, scalarize the color witness before the writer instead of retaining a 10-element cmax vector; preserve structural D4 filters and validate all color permutations.
  • task167 WIN (20.6825->21.1499, +0.4673): Replace a 10-channel presence vector with an exact scalar modular code only after exhaustive collision and float-precision audit; a small sentinel Where can preserve exact decoding while deleting the 40-byte descriptor.
  • task162 WIN (16.8395->16.8401, +0.0006): When QuantizeLinear only converts bounded integer-valued logits, test a direct INT8 Cast: it can delete scale/zero-point parameters without changing the tensor ledger or rule.
  • task187 WIN (16.6852->16.6864, +0.0012): For rectangle-union interior/exterior tasks, replace TopK surfaces with bit-packed boundary-line descriptors, score only 36 interval pairs in uint8, harden containment and true interior area, then render selected intervals directly. Keep a
  • task186 WIN (21.5343->21.5660, +0.0317): Output dtype need not be FLOAT32: the authoritative scorer thresholds any supported numeric/bool output. Require declared dtype to match runtime dtype, static [1,10,30,30] shape, and exact validation. Under that contract, aliasing scalar QL
  • task188 WIN (20.2726->20.3087, +0.0360): For duplicate-orientation crop tasks, reuse the rank-2 renderer coefficient rows as a quadratic orientation hash instead of adding classifier parameters. Replace doubled-dimension moments with orientation-dependent area denominators, but au
  • task190 STALLED (18.4912->18.4912, +0.0000): Before replacing a boundary-aware renderer with a zero-memory projective writer, run a local-patch collision audit across all anchors and direction states. Foreground-only patches can make outside padding indistinguishable from valid black
  • task106 WIN (19.0811->19.4053, +0.3242): Replace a three-plane [1,x,x^2] categorical classifier with a wrapped two-coordinate UINT8 code. Prove unique positive margins for every legal class and reserve zero for padding; this removed one 6x6 plane and cut cost from 372 to 269.
  • task105 WIN (17.8556->17.8983, +0.0427): Infer redundant sentinel states as differences of guaranteed structural states instead of storing an extra class/column. Validate this by candidate-only regression over the baseline-success domain, not aggregate accuracy alone.
  • task189 WIN (18.4633->18.5833, +0.1200): For quadrant palette rendering, encode the 2x2 palette in a tiny 2D uint8 code space before expansion, resize the descriptor once, gate by the pattern, and make one padded QLinearConv the free output. Alias quantization zero points and use
  • task100 WIN (21.0110->21.0880, +0.0770): In a zero-memory direct-output Einsum, derive an antisymmetric comparator algebraically inside the contraction instead of storing it. Task100 reduced cost 54->50 after exhaustive domain audit.
  • task186 STALLED (21.5343->21.5343, +0.0000): Audit runtime output dtype, not only graph metadata: ConvInteger can emit INT32 behind a FLOAT declaration. For tiny count-to-pattern tasks, zero-intermediate direct output may still lose because fixed 30x30/channel coordinates become hundr
  • task185 WIN (18.5215->18.6579, +0.1364): For small lattice-pattern classifiers, reuse the geometry relation table for bbox extraction, normalize directly in lattice-index space, broadcast candidate labels in NHWC to remove reshape outputs, and make padded QLinearConv the free grap
  • task181 WIN (19.1478->19.9374, +0.7896): For fixed-width identity/reflection/rotation routes, encode coordinates as one projective cycle and share exclusion factors across all group actions. Bind unchanged axes directly in the output Einsum and pay only for a tiny control transfor
  • task184 STALLED (18.2944->18.2944, +0.0000): For dynamic block-table sampling, deleting a 10-channel bool tail is not a win if scalar-label recovery creates several float 3x3 planes. GridSample still materializes all input channels; first find a label-domain sampler or eliminate the s
  • task023 WIN (17.5372->17.5488, +0.0115): For arithmetic-heavy fixed-shape graphs, algebraically fold repeated square/scale multipliers into existing operands to delete counted tiny intermediates. Promote only after independent generator and metamorphic output-parity checks; record
  • task022 WIN (18.5448->18.6047, +0.0599): When a small-label pipeline ends in a counted Equal/padded canvas, test a final QLinearConv as the graph-output writer so the tail tensor disappears; audit quantization zero points, output channels, and bias length explicitly.
  • task018 WIN (15.2158->15.3561, +0.1403): After a structural method is stable, compact coordinate, bbox, Slice-bound, Pad-bound, and rank metadata to int8/uint8; reuse scalar/shape initializers and consolidate cleanup in one pass. Require output-equivalence stress checks and keep i
  • task182 WIN (16.7918->16.7937, +0.0019): Collapse collision-audited scalar conjunctions with a uint8 product key, but preserve broad count overrides and require canonical parity on geometry transforms. Before micro-optimizing overlay solvers, compute the crop-plus-full-condition m
  • task183 WIN (18.7481->18.7754, +0.0273): Keep palette-code arithmetic in uint8 when downstream semantics are modulo 256: cast global sums once, recover labels by wrapped subtraction, and alias duplicate quantization scalars. Exhaustively audit the finite palette domain before prom
  • task098 STALLED (21.3891->21.3891, +0.0000): For zero-memory direct writers, convert the desired score gain to a cost ceiling first; collision-prove whether the operator family can reach it before rank/stencil surgery.
  • task077 STALLED (16.4077->16.4077, +0.0000): Reject broadword multiply/shift closure unless a carry audit proves shifted bit supports are disjoint; overlap means structural invalidity, not a near miss.
  • task100 WIN (20.5457->21.0110, +0.4653): Replace ArgMax/OneHot selector tails with opposite-signed structural logits in one direct-output Einsum when exhaustive order audit proves the comparison invariant.
  • task089 WIN (16.9319->16.9373, +0.0053): Fuse complementary role detectors with sentinel codes only when normalization occurs before the writer; post-write normalization can corrupt overlapping roles.
  • task084 WIN (20.0233->20.0512, +0.0280): Before fitting lower ranks, algebraically eliminate exact identity/diagonal/permutation relays inside a final Einsum; removes params with no activation.
  • task080 WIN (16.6288->16.7221, +0.0933): Dynamic compact stencil: assemble one color-conditioned kernel from descriptors and stamp once; count kernel fragments against every compact map removed.
  • task180 WIN (19.6529->20.2638, +0.6109): Replace dense direct Conv weights with a projective tensor-network Einsum over shared 2D spatial/color factors; zero memory and exhaustive 16-state overlay audit.
  • task178 WIN (19.1740->19.1770, +0.0030): Reuse the existing next-position state instead of materializing a separate one-byte transition helper; exhaustive 4,374-case run-sequence audit preserves the structural renderer.
  • task177 STALLED (20.1637->20.1637, +0.0000): Reject lenient shape-metadata savings: honest runtime [1,10,30,30] value_info turns the apparent 126-cost graph into >36k cost. Shape/accounting warnings are not safe optimization.
  • task176 STALLED (20.6180->20.6180, +0.0000): Zero-memory 80-parameter direct renderer: exact integer rank-2 reparameterization ties; rank-1 spatial or color compression is not separable. Change representation rather than truncate factors.
  • task200 STALLED (19.0236->19.0236, +0.0000): In a zero-memory shared-basis direct Einsum, low-energy singular directions can be sign-critical: spatial rank 6->5 and CP rank 7 failed the complete 90-state domain. Change renderer/operator family instead of further SVD/CP truncation.
  • task199 WIN (18.3907->18.4015, +0.0108): When OneHot indices are exact nonnegative integer-valued floats and the pinned ORT kernel supports them, feeding floats directly can delete int32 Cast activations.
  • task198 WIN (16.7494->16.7850, +0.0356): Factor a dense writer table into a complete-domain rank-3 sign classifier, then quantize after exhaustive state enumeration; rank2 is not separable.
  • task197 STALLED (22.6974->22.6974, +0.0000): A 10-parameter signed basis is a real floor here: moving it to Constant costs memory, while reducing repeated epsilon factors creates extra positive black logits.
  • task196 WIN (16.5922->16.6360, +0.0438): Pack each binary row into uint16 and propagate four-neighbor bad-component bits in vectors; unpack only at the output boundary after a complete geometry audit.
  • task195 WIN (19.1770->19.3232, +0.1463): Replace binary self-product with a linear threshold and use a direct polynomial Kronecker writer; spending small params removed five counted intermediates.
  • task194 WIN (20.1797->20.2293, +0.0496): Synthesize static selector factors from existing operands inside the final Einsum; extra contractions in the free output node removed six initializer elements without intermediates.
  • task193 STALLED (19.8642->19.8642, +0.0000): At zero-memory output-direct Conv, Constant nodes add activation cost; 4x4 boundary terms and explicit bias are necessary for strict positive-channel decoding.
  • task192 WIN (16.4159->17.0210, +0.6051): Select the dynamic color structurally, assemble only a tiny ConvInteger writer kernel, and replace a static color penalty vector with one indexed ScatterElements overwrite.
  • task191 WIN (15.8715->15.8823, +0.0108): Reuse one cropped selector in both projections and the final writer; shared constants removed 99 total cost while preserving the full transform matcher.
  • task190 WIN (18.4764->18.4912, +0.0148): Delete a 10-byte qvec by transposing the existing presence vector and encode black-channel inversion in the final signed scale; exhaustive structural-domain and metamorphic audit passed.
  • task030 WIN (18.2009->18.2666, +0.0657): When a renderer carries a fixed-height float template, prove the generator's maximum sprite extent, dynamically Slice only that tiny patch from the free input, Cast it to int8, then dynamically Pad/crop it into the renderer. Boundary positi
  • task029 WIN (16.5191->16.5712, +0.0521): For GridSample coordinate fields assembled as separate broadcast row/column partials, test a single broadcast selector/Where that emits the two coordinate components directly; this can delete both partial tensors while retaining the final g
  • task027 WIN (18.6301->18.6387, +0.0086): For exact 0/1 float probes, rewrite a AND NOT b as Greater(a,b); this can delete Cast/Not/And intermediates. Require exhaustive binary-domain equivalence before promotion because the identity depends on binary inputs.
  • task015 WIN (18.9887->19.6868, +0.6981): For fixed short path identity/adjacency, replace a large spectral coordinate basis with a small periodic coordinate embedding and products rooted at forbidden distance classes; audit wraparound and full-palette margins, then share the color
  • task010 WIN (20.7805->21.4165, +0.6360): In zero-memory direct-output polynomial renderers, aggressively reuse the same small basis for input and output channels, consume nonsymmetric 2x2 tables in normal/transposed orientations, and reuse repeated polynomial roots; repeated opera
  • task009 WIN (18.0922->18.2373, +0.1450): For direct-output Einsum graphs over small finite semantic-role domains, encode 4-way role/type tables with two bits and reconstruct interval planes from identity plus lower-triangular relations; keep the practical selector dense if deeper
  • task051 WIN (18.4883->18.9912, +0.5029): Factor squared color-distance and selector tables through compact affine bases such as [1,c], and share selector operands before rendering; this can remove multiple descriptors and duplicated coordinate tables while preserving exact margins
  • task070 WIN (20.1637->20.2995, +0.1358): In output-direct Einsum graphs, algebraically inline tiny helper contractions and bind indices known equal on every nonzero core entry; deleting even an 8-byte helper and slicing a diagonal core improves score without adding activations.
  • task057 WIN (19.7583->19.7905, +0.0322): For a nonempty single-color object, the exact squared-color moment sum(cid^2)/sum(cid)=cid can replace separate pixel-count and color branches; guard the denominator and keep the moment scalar until the final writer.
  • task053 WIN (21.5988->22.3609, +0.7621): Dynamic-weight ConvTranspose can be a zero-intermediate data-dependent writer: encode the selected patch/shift directly in the runtime kernel, then use a full-length channel bias to suppress exterior logits; audit ConvTranspose bias length
  • task236 STALLED (20.2995->20.2995, +0.0000): Do not factor a tiny static initializer into a runtime-built dense tensor unless the activation bytes are lower than the parameters removed. In low-cost graphs, recomputing a weight can turn a parameter saving into a larger memory charge.
  • task239 STALLED (18.9936->18.9936, +0.0000): TopK replacement must co-design ranking and rendering. Repeated ArgMax leaves residual vectors and int64 indices; pairwise rank adds comparison planes. Uint8 ArgMax is a safe fallback, not a cost win.
  • task234 WIN (17.9430->18.0724, +0.1295): Default generator bounds are not a hidden-safety proof when explicit parameters admit larger grids. Validate edge dimensions against canonical behavior; prefer guarded inclusive-span ROI geometry over cheaper exclusive endpoints.
  • task021 WIN (20.6056->21.0110, +0.4055): A candidate-selection stack can collapse into a direct weighted-correlation score when an exhaustive generator-domain audit proves strict order preservation; use the smallest power/weight that remains collision-free and render directly to o
  • task018 WIN (15.0390->15.2158, +0.1768): Range-prove descriptor and flattened-index values, then narrow int64/int32 intermediates to int16 before changing the algorithm; this is a structural memory win only after metamorphic geometry and color tests preserve exact matching.
  • task015 WIN (18.1976->18.9887, +0.7911): When the graph can write the free output directly, factor the rule table inside the final Einsum instead of materializing candidate or palette planes; preserve full palette/domain support unless exhaustive coverage proves a narrower basis.
  • task137 WIN (18.0823->18.0863, +0.0040): When an active HxH canvas is one-hot across all ten channels, ReduceL2(input, axes=[1,2,3]) returns H directly. Prefer it over ReduceSum(input)->Sqrt: it deletes the H2 scalar, avoids banned Sqrt, and preserves static standard-domain ONNX.
  • task033 WIN (19.2317->19.4666, +0.2349): Pending local win: direct final-Einsum simplification can beat table factorization. For tiny template/lattice tasks, first try absorbing Concat(template variants) and color/template basis params into one final Einsum; removing one small cou
  • task066 WIN (16.9784->16.9787, +0.0003): Lossless default-argument cleanup is still worth batch-running after external merges: omit explicit Pad defaults/Slice all-one steps, but only register after exact score_task validation because some Pad/Slice surgeries break semantics.
  • task030 WIN (18.1932->18.1943, +0.0011): Lossless scalar initializer aliasing: replace duplicate int8 one constant with an existing initializer and delete the duplicate; tiny but deploy-safe exact param save
  • task074 WIN (19.4165->19.6247, +0.2082): Exact integer column-basis factorization can compress repeated coordinate tables inside a single Einsum; prefer 0/±1 basis over SVD because tiny positive residuals create multi-hot outputs even when argmax is correct
  • task044 WIN (16.8022->16.9102, +0.1080): For small scalar-label canvases with static right/bottom Pad before final Equal, replace Pad+Equal with [active,label,label^2] -> QLinearConv graph output. It removes the charged 30x30 label canvas when active area is small enough; skip dyn
  • task021 WIN (7306.5700->7307.8124, +1.2424): LB verified pending tasks 021/022/024/025/027/028/029/030; reusable lesson: score every imported zip candidate, promote exact runnable ONNX, direct-output/zero-memory table-factorized rewrites are safe only after full-bundle LB probe.
  • task132 WIN (16.6839->16.9032, +0.2193): direct OneHot coefficient tail: replace color-hot cast paths with scalar color OneHot coefficients over row/col rectangle masks
  • task131 WIN (16.7120->16.7279, +0.0159): u8 axis gap/cyan rewrite: keep structural 18x18 mover, but compute shift and gap in uint8 scalar/vector form to shave cost without changing renderer
  • task115 WIN (18.0656->18.0942, +0.0286): LB-verified time-for-space cleanup: replace fp16 OneHot sequence with bool Equal one-hot; keep uint8 tail because Pad rejects bool; +9 params, -36B memory
  • task049 WIN (19.1565->19.1594, +0.0029): LB 7304.94 confirmed task049 no-Sqrt replacement; even tiny score wins are valuable when they remove Kaggle crash-risk ops.
  • task063 WIN (17.4647->21.0110, +3.5463): LB 7303.69 verified bundle promoted 59 task artifacts at once; when verified bundles arrive, preserve exact ONNX snapshots with hash-checked solution replayers, update best from the bundle, and rebase existing best-unvarified pending candid
  • task040 WIN (19.7530->20.3948, +0.6419): LB 7294.99 confirmed task040 cost-100 zero-memory artifact; parameter-only direct renderer is a high-value target pattern.
  • task011 WIN (19.9438->20.1480, +0.2042): Zero-memory direct Einsum can still improve by factoring static relation tables into reusable tiny bases; task011 reduced params 157->128 with gate/coord/r0/r1 sharing and no intermediates.
  • task012 WIN (17.5687->18.2189, +0.6502): for dynamic-color motif expansion, generate compact structure codes first, then gather a tiny dynamic color-map kernel and use final QLinearConv; avoids scalar-label Pad/Equal tails
  • task010 WIN (18.7159->18.9621, +0.2462): for small symbolic outputs, build compact code rows directly and use final padded QLinearConv as renderer; can beat polynomial feature grids by removing intermediate memory
  • task008 WIN (17.3642->17.3729, +0.0087): near-floor mixed-descriptor graph: trim descriptor kernels to save params even if scalar memory rises slightly; net cost wins
  • task012 WIN (17.2751->17.5687, +0.2936): LB-verified: TopK color selection plus uint8 QLinearConv motif writer for plus expansion; tiny label grid avoids 10-channel one-hot intermediates
  • task088 WIN (18.0079->18.1456, +0.1377): for scalar bbox/moment geometry, cast only the tiny scalar reductions to fp16 before square/sub/sqrt/add/sub; avoid casting image tensors
  • task084 WIN (17.3803->17.7914, +0.4111): for sparse edits over mostly-preserved input, direct ScatterElements writer can beat label-canvas rendering: spend small constant updates/index tensors to remove 21x21/full-grid masks
  • task002 WIN (15.8051->15.8368, +0.0317): merge adjacent 18x18 flood support predicates into one wider uint8 QLinearConv: +small params can remove an entire tiny-domain intermediate without alignment tensors
  • task011 WIN (19.5028->19.9438, +0.4410): once a renderer is zero-memory direct Einsum, optimize static relation tensors by factorizing coordinate/render tables into small reusable basis matrices; here params drop 244->157 with no intermediates
  • task009 WIN (16.5028->16.6576, +0.1548): for separator rendering, encode validity as high marker values and combine with line color using variadic Min; valid markers collapse to the separator color while invalid zeros stay outside the output color set
  • task013 WIN (18.1488->18.2442, +0.0954): after moment-based period extraction is correct, inspect possible quadratic differences; task-specific integer decode with Add/Div/BitShift can replace Sqrt and save params/memory while reducing Kaggle hidden-risk
  • task002 WIN (15.7288->15.8051, +0.0763): spend small rectangular QLinearConv kernel params to emit exact 18x18 support masks and seed directly in the flood domain; memory drop can beat param increase when propagation stays in that interior domain
  • task011 WIN (19.4090->19.5028, +0.0938): inline tiny selector vectors into the final Einsum relation; when a graph is already near cost 250, eliminating 24B of selector memory gives about +0.09 without changing params
  • task008 WIN (17.1636->17.3642, +0.2006): pack multiple row/column facts into one mixed descriptor, cast to int8, decode channels with Mod/Div, and keep the final renderer as [moved_patch, rank-2 base] ConvInteger when background/obstacle structure is row-column factorizable
  • task085 WIN (16.4094->18.1279, +1.7185): for input-plus-periodic-edit tasks, avoid full edit masks. Encode row/column phase in a signed 1D fingerprint, detect active rows with a tiny 1D Conv, and let final Einsum combine the free input, row feature, column parity, and a small coefficient tensor to write output directly.
  • task011 WIN (18.5833->19.4090, +0.8257): for fixed grid-partition expansion, fuse selector and renderer. Two tiny selector vectors (row_sel, col_sel) plus one direct Einsum can replace selected-tile slicing, label encoding, Pad tails, and 30x30 label planes. Spending modest spatial relation params is worthwhile when it leaves only scalar/vector intermediates.
  • task013 WIN (17.4347->18.1488, +0.7141): for full-grid periodic stripe tasks, render from two 1D vectors instead of a 30x30 label plane. Here a 30-long uint8 stripe pattern plus channel-offset vector uses BitwiseXor/Equal to write one-hot output. Caveat: this task013 graph contains Sqrt; treat it as task-specific LB-confirmed, not a general safe op.
  • task083 WIN (18.8974->19.1799, +0.2825): for two-color mirror/tiling tasks, do not mirror all 10 channels. Mirror only the background/shape mask, infer the single foreground color as a scalar, build tiny polynomial color features (c, c^2), and classify with final QLinearConv.
  • task008 WIN (16.8664->17.1636, +0.2972): after a dynamic patch writer is correct, compress the non-moving canvas separately. Here active/background and fixed 2x2 cyan are a rank-2 int8 base grid from row/column descriptors via QLinearMatMul; the final ConvInteger needs only [moved_red, base]. Also shrink the live patch by orientation (5x3 vs 3x5) instead of paying for a generic 5x5.
  • task002 WIN (15.6715->15.7288, +0.0572): for enclosed-region/flood tasks, a directional candidate front-end does not have to be four separate full masks. Two asymmetric rectangular QLinearConv support kernels can encode paired directional evidence and remove full 20x20 predicates, while the exact 18x18 masked flood stays path-faithful.
  • task008 WIN (16.3664->16.8664, +0.5000): bounded dynamic patch writers can beat full-plane translations when implemented as Slice a small live patch, dynamic Pad into the active canvas, and final ConvInteger direct output. The key is avoiding ScatterND coordinate lists; spend small descriptor Conv params to remove the 16x16 Gather/Where shift chain.
  • task011 WIN (17.3705->18.5833, +1.2128): for fixed grid-partition expansion, infer the selected tile coordinates as scalar/vector descriptors first, slice only the selected tile, then render directly with a compact output Einsum. This removed the 30x30 scalar label tail and most grid-wide detector tensors, cutting cost from 2,058 to 612.
  • task005 WIN (16.1900->17.0251, +0.8351): for template ray-replication tasks, use the live template mask itself as a dynamic QLinearConv kernel and assemble ray directions from tiny scalar fragments. This replaced broad label banks with compact uint8/QLinearConv tensors and a single-channel label tail, cutting cost from 6,701 to 2,907.
  • task004 WIN (16.3166->16.8655, +0.5489): a single direct-output Conv with W[10,10,2,17] spends 3,410 params but removes all counted intermediates from the structural label/bool pipeline. This is now LB-confirmed for task004; for other tasks, treat analogous direct kernels as probe candidates because prior compressed task004 direct-kernel variants hidden-failed.
  • task001 WIN (19.6917->20.1022, +0.4104): in one-Einsum direct renderers, merge duplicated coordinate selector tables and separate sign/coefficient vectors into a shared coordinate-feature table plus tiny selector matrices. Here U[30,3] stores [gate,floor,mod], F/M select views, and one Q[2,2,3] serves both coordinate quadratic selectors and color/background signs, cutting params from 202 to 134 with zero intermediate memory.
  • task088 WIN (17.4652->18.0079, +0.5427): for dynamic small-crop recolor tasks, encode bg/fg/outside as a tiny uint8 scalar grid under a useful zero_point, then use final ConvInteger as both channel expander and 30x30 padder. This can remove a counted label-grid Pad + final Equal tail. Caveat: this task's bbox path still uses Sqrt; treat that part as task088 LB-confirmed only, not a general safe pattern.
  • task081 WIN (18.8601->19.0211, +0.1610): for local detector tasks, fold the small-canvas render and final padding into the last Conv/QLinearConv by using output padding on that layer. This removes counted one-hot/Pad tail tensors; here a 2-hidden uint8 QLinearConv detector plus padded final QLinearConv cost only 395.
  • task008 STALL (16.3664->16.3664, +0.0000): correct 5x5 patch writer and ScatterND(max) writer both lost; generated int64 ScatterND coordinate chains can cost more than full 16x16 shift planes
  • task009 STALL (16.0294->16.0294, +0.0000): OneHot only supports int64 indices here and is not a cheap scalar-label front end; QLinearMatMul does not directly replace bilinear interval Einsum without materializing endpoint pairs
  • task017 LB_FAIL (16.1412->16.1412, +0.0000): Grouped witness hash candidate task017 scored local/metamorphic +0.1352 but failed LB probe; treat grouped/hash witness compression as hidden-risk even when public stress passes.
  • task017 PROBE (16.1412->16.2764, +0.1352): Witness-table grouped hash passes local/metamorphic but remains hidden-risk; isolate as single-task LB probe before best-unvarified/canonical promotion.
  • task014 WIN (16.4405->16.4413, +0.0008): Safe ONNX cleanup: optional all-one Slice steps can be omitted when opset accepts default steps; validate with batch_surgery/round_runner before registering.
  • task008 STALL (16.3664->16.3664, +0.0000): task008 patch writer blocked by Gather uint8 indices, Max uint8, and Pad bool runtime limits
  • task002 STALL (15.6715->15.6715, +0.0000): task002 seed folding exact but memory-worse; next chance is 20x20 wall-presence front-end compression, not more flood-tail surgery
  • task014 WIN (16.2226->16.4405, +0.2179): after safe 25x25 channel crop, exact bbox Slice beats Gather row/col crop sampler; derive pad extents from reshaped bbox endpoints
  • task017 WIN (16.1046->16.1412, +0.0366): decode selected witness metadata from scalar range counts and weighted boolean sums instead of gathering candidate_params
  • task005 STALL (16.1900->16.1900, +0.0000): single-channel sentinel label tail can beat prepad one-hot rendering; width dominates before node count
  • task018 WIN (14.7820->14.7910, +0.0090): replace anchor OneHot/Einsum ranking with CumSum+Equal rank remap; bbox first/last via ArgMax while preserving seed logic
  • task009 WIN (16.0116->16.0294, +0.0178): derive separator masks from 1D row/column validity vectors instead of slicing full 10x10 valid-cell plane

Runtime: high-arity direct-output Einsum

  • Operand order is an execution parameter even when the symbolic contraction and official cost are unchanged. For repeated (matrix, vector, matrix) factor triples, trying (matrix, matrix, vector) cut task306 latency 1.72x and task356 latency 2.11x with zero new tensors or parameters.
  • Treat every reorder as a numerical candidate, not a graph-cleanup proof: float32 reassociation made task333 7.73x faster but broke 9/261 ARC-GEN cases. Require complete decoded-output validation before staging.
  • Use a short first-example gate before full validation; many naive global orders became slower than 20 seconds. Benchmark slow tasks one at a time because concurrent high-arity contractions saturate memory bandwidth and can hide the real deployment latency.
  • Preserve numerically sensitive low-rank blocks while scheduling the larger contraction. On task333, moving intact CPW,CPL,CPR blocks gave 5.78x speedup and passed all 265/265; globally reordering individual factors gave 7.73x but failed nine generated cases.
  • Keep an explicit timeout-safe fallback when the zero-memory golf graph is pathologically slow. A direct Conv can be orders of magnitude faster but cost score (task331: 19.7743 -> 18.1866), so package it separately rather than silently replacing the high-score canonical model.