Mark/easystitch: 1024x1024 raster tests take ~14min — investigate #83

Closed
opened 2026-06-24 15:58:36 +00:00 by Mark · 0 comments
Owner

Problem

tests/test_main.py and tests/test_pipeline_e2e.py use _png_bytes_1024() fixtures (1024x1024 PNG) that go through the full type-aware stitch dispatch (post-#77). They take ~14 minutes each to run.

Impact

  • test_digitize_to_stitches_returns_structured_result
  • test_digitize_to_stitches_shape_contract
  • test_process_bytes_api_unchanged (depends on others)
  • TestRasterToDstRoundTrip
  • TestMultiStitchClassification
  • Any future test using _png_bytes_1024()

These slow tests cascade through kilo-gsd's Verify gate and have caused MAX_PHASE_TIME to trip at 1800s during real runs (Mark/easystitch#76, 2026-06-24). Workaround: bumped runner's MAX_PHASE_TIME from 1800s to 3600s and GATE_TIMEOUT_LINT from 180s to 300s.

Possible causes

  • Fill generator density scaling: stitch count grows linearly with pixel area, but generator may not have density caps for high-coverage inputs.
  • Pull compensation runs after generation and re-walks every stitch — for 10k+ stitch inputs, dominates wall time.
  • Each PathData coordinate pair triggers a single running stitch fallback when classification is ambiguous — for solid-fill rasters this is the worst case.

Investigation paths

  1. Profile digitize_to_stitches(_png_bytes_1024()) and identify the dominant cost (likely fill generator or pull compensation).
  2. Consider reducing fixture size for tests that don't need 1024x1024 specifically (e.g. shape-contract tests could use 64x64 like test_digitize_to_stitches_raster_has_type_distribution).
  3. Add a stitch-count cap to the dispatcher for high-coverage inputs (above some threshold, downsample coordinates).
  4. Investigate whether pull compensation can be made linear instead of quadratic in stitch count.

Acceptance

  • _png_bytes_1024()-based tests run in under 60s each.
  • kilo-gsd runner timeouts can be reverted toward original values.
  • Mark/easystitch#77 — raster placeholder fix (introduced real dispatch)
  • kilo-gsd runner: ~/.hermes/scripts/kilo-gsd.py:73-75 — timeout constants bumped as workaround

Out of scope

Correctness is fine; this is purely a runtime concern. The raster type-distribution test (#77) already uses a smaller fixture and runs in <1s.

## Problem `tests/test_main.py` and `tests/test_pipeline_e2e.py` use `_png_bytes_1024()` fixtures (1024x1024 PNG) that go through the full type-aware stitch dispatch (post-#77). They take ~14 minutes each to run. ## Impact - `test_digitize_to_stitches_returns_structured_result` - `test_digitize_to_stitches_shape_contract` - `test_process_bytes_api_unchanged` (depends on others) - `TestRasterToDstRoundTrip` - `TestMultiStitchClassification` - Any future test using `_png_bytes_1024()` These slow tests cascade through kilo-gsd's Verify gate and have caused `MAX_PHASE_TIME` to trip at 1800s during real runs (Mark/easystitch#76, 2026-06-24). Workaround: bumped runner's `MAX_PHASE_TIME` from 1800s to 3600s and `GATE_TIMEOUT_LINT` from 180s to 300s. ## Possible causes - Fill generator density scaling: stitch count grows linearly with pixel area, but generator may not have density caps for high-coverage inputs. - Pull compensation runs after generation and re-walks every stitch — for 10k+ stitch inputs, dominates wall time. - Each PathData coordinate pair triggers a single running stitch fallback when classification is ambiguous — for solid-fill rasters this is the worst case. ## Investigation paths 1. Profile `digitize_to_stitches(_png_bytes_1024())` and identify the dominant cost (likely fill generator or pull compensation). 2. Consider reducing fixture size for tests that don't need 1024x1024 specifically (e.g. shape-contract tests could use 64x64 like `test_digitize_to_stitches_raster_has_type_distribution`). 3. Add a stitch-count cap to the dispatcher for high-coverage inputs (above some threshold, downsample coordinates). 4. Investigate whether pull compensation can be made linear instead of quadratic in stitch count. ## Acceptance - `_png_bytes_1024()`-based tests run in under 60s each. - `kilo-gsd` runner timeouts can be reverted toward original values. ## Related - Mark/easystitch#77 — raster placeholder fix (introduced real dispatch) - kilo-gsd runner: `~/.hermes/scripts/kilo-gsd.py:73-75` — timeout constants bumped as workaround ## Out of scope Correctness is fine; this is purely a runtime concern. The raster type-distribution test (#77) already uses a smaller fixture and runs in <1s.
Mark 2026-06-25 16:59:30 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#83
No description provided.