Run tile graph solver on Torch devices

This commit is contained in:
Meta Vens 2026-04-22 19:55:52 +01:00
commit 1b33050883
4 changed files with 322 additions and 36 deletions

View file

@ -72,7 +72,8 @@ Experimental tile-graph note:
- the raw-pixel rewrite fixed an implementation mismatch where candidates had drifted into cell-averaged patch colors instead of actual source pixels
- accepted component candidates now consume their cell-sized source footprint, and placement now uses per-cell local candidate sets instead of one reusable global candidate matrix
- that fixes the core design mismatch behind the patchy repeated-color blocks and opaque-black background takeover: a candidate is now tied to its inferred output coord instead of being reusable across the whole raster
- the new downside is performance: large real-fixture runs are now noticeably slower because the tile-graph candidate pool scales with output area, so optimization and pruning are now required before this path is practical on stress cases like the badge
- the local tile-graph solver now honors `device` and runs through Torch, so CUDA can accelerate the scoring/update loop
- the remaining downside is performance in candidate extraction/building: large real-fixture runs are still noticeably slow because the tile-graph candidate pool scales with output area and is still assembled on the CPU
Next after that:
- rerank low-confidence top lattice candidates with short real solver probes instead of relying only on the cheapest preview
@ -117,7 +118,7 @@ What future work should improve here:
- some form of coordinated local relaxation so nearby cells can move together toward a globally better contour
- optional background suppression or de-weighting when a baked checkerboard is clearly not semantic content
- for the experimental tile-graph path specifically, better local candidate coverage and stronger adjacency evidence are still needed even after switching candidates back to literal source pixels
- for the experimental tile-graph path specifically, the next useful step is performance-aware local propagation: keep the new per-cell candidate sets, but add pruning, caching, or banded neighborhoods so the badge-scale solve is fast enough to iterate on
- for the experimental tile-graph path specifically, the next useful step is performance-aware extraction and propagation: keep the new per-cell candidate sets and CUDA-backed solver, but add pruning, caching, and cheaper component stepping so the badge-scale run is fast enough to iterate on
Current optimizer diagnosis:
- the shared source-lattice reference, source-first snap/refine scoring, and relaxed-mode handoff are now in place, so the biggest remaining losses are no longer caused by the old representative-lattice collapse