Skip to content

Read spacing-readable dense images through resolved hs2p plans - #263

Merged
clemsgrs merged 1 commit into
mainfrom
agent/issue-259
Jul 29, 2026
Merged

Read spacing-readable dense images through resolved hs2p plans#263
clemsgrs merged 1 commit into
mainfrom
agent/issue-259

Conversation

@clemsgrs

Copy link
Copy Markdown
Owner

Summary

  • classify each dense-image run into exactly one raster or hs2p spacing-readable reader regime, including content-based capability probing for readers such as OpenSlide
  • resolve immutable per-image backend, source spacing, native level, tolerance, read geometry, and effective spacing plans in the parent before resume filtering, then round-trip them to distributed ranks
  • read complete selected levels through hs2p, area-downsample without upsampling, enforce strict post-read target geometry, and persist the complete plan in sidecars and compatibility identity
  • document the public reader/spacing contract and cover native, downsampled, default/override, backend, serialization, metadata, resume, mixed, unsupported, and OpenSlide-backed examples

Why

Dense extraction previously handled only Pillow raster inputs, so pre-cropped WSI-format images could not be read at a run-level physical scale or resumed against a fully resolved read identity. The parent now owns resolution and ranks consume the exact immutable plan, preventing backend/level policy drift across processes.

User impact

Callers can pass hs2p-readable pre-cropped images to Model.embed_images_dense, request an explicit physical spacing or use one unambiguous model default, override source level-0 spacing when needed, and receive sidecars that distinguish declared, source, native-read, and effective spacing. Mixed regimes, unsupported inputs, missing metadata, invalid overrides, and target-geometry mismatches fail before model inference with actionable errors.

Validation

  • focused dense-image suite: 89 passed, 1 deselected before the final classifier review; final classifier regressions: 4 passed
  • full suite: 757 passed, 14 skipped; the sole failure is the pre-existing tests/test_dense_image_shard.py::test_multi_rank_matches_single_rank exact CPU tensor comparison, reproduced on clean main
  • docs: python -m sphinx -W -b html docs ... succeeded
  • final /code-review: no actionable Standards or Spec findings

Closes #259

@clemsgrs
clemsgrs marked this pull request as ready for review July 29, 2026 22:01
@clemsgrs
clemsgrs merged commit 4a4404b into main Jul 29, 2026
3 checks passed
@clemsgrs
clemsgrs deleted the agent/issue-259 branch July 29, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read spacing-readable dense images through resolved hs2p plans

1 participant