Skip to content

Image QC follow-ups from the #365 audit: strided-block memory test, small-block reason, QC_VERSION on planner changes #393

Open

Description

@guijacquemet

Follow-ups from the external re-check of #365 (image QC metrics, merged), answer chatgpt-ag (MorphoFeature claude/restart-doc, docs/restart/chatgpt-answers/chatgpt-ag-answer-2026-11-22.md). None blocks; all hardening.

  1. Memory bound on non-contiguous blocks. tests/test_image_qc_memory.py profiles contiguous arrays. planes.py (~1092-1105) can yield transposed blocks and image_qc_sums.py (~133-135) reshapes its input, which may copy. Extend the tracemalloc test to transposed / non-contiguous blocks and to a tight-limit tiled read, and adjust qc_memory if the bound does not hold.
  2. Reason wording for small blocks. A large plane read in blocks of fewer than three rows can report plane_too_small for gradient/Laplacian metrics (image_qc.py ~279-295); the block layout, not the plane, is too small. Use a reason that says so (e.g. block_too_small), with a test.
  3. Reuse after a block-planner change. Reuse at an unchanged memory limit assumes an unchanged block layout. Rule: any change to the block planner (qc_memory, or normalization's estimate_histogram_memory after a pin bump) that can change QC neighbour pairs must bump QC_VERSION; or record the effective block shape per file in the reuse identity. Add the rule to contract §19 and a test that fails if the planner output changes without a version bump (or implement the block-shape record).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions