Milestone 7 of 8
Inspect, save, and replay the dataset
Save aligned arrays, tables, figures, coverage and reconstruction evidence, manifests, and batches; read them back; and reproduce them in a separate replay tree.
The saved dataset should remain understandable after the editor closes. Save spatial evidence, not just anonymous arrays.
Goal
Inspect selected patches with coordinates and masks, save arrays and evidence, read them back, and replay the complete patch dataset in a separate output tree.
Inputs
Use the validated images and configuration, grids, patch records, aligned
arrays, groups, batches, coverage maps, and reconstruction results. Select
patches by composite identity (image_id, top, left), not by whichever rows
happen to be nearby.
For each selected patch, show image ID, origin, source and valid bounds, padding counts, patch values or a saved preview, and its validity mask. Keep coordinates visible beside any visual mosaic.
Deliverables
Extend src/report.py and src/main.py to save:
- aligned patch/mask archives and metadata;
- per-image summaries, group archives, and
batch_manifest.json; - coverage arrays, reconstruction/equality records, and uncovered coordinates;
- selected-patch, mask, coverage, and reconstruction/difference figures with exact plot data;
output/image_patch_dataset_manifest.json; and- a replay agreement or mismatch record under
output/replay/.
The manifest records source, transformation, configuration, group, artifact, and implementation identities. Replay must not overwrite the original output.
Checks
Read every artifact back and check shapes, dtypes, masks, identities, order, counts, group conservation, batches, coverage, reconstruction status, and figure data. Replay into a distinct directory and compare complete arrays, metadata, group indexes, batches, coverage, and reports.
Deliberately change one source digest, patch setting, group assignment, array row, or batch policy. Report the first mismatch and leave the original output unchanged. Check both complete and incomplete reconstruction cases.
Workspace
Keep original artifacts under output/ and replay artifacts under
output/replay/. Keep the manifest and patch-dataset card at stable project
paths.
Hints
HintCompare spatial evidence first
HintPlot data is evidence
Review
Open one original and replayed padded patch with its mask and metadata. What does exact agreement establish for this configuration? What does it not say about embeddings, attention, or model quality?
How to check your work
Checks compare manifest fields, read-back schemas, selected records, complete arrays, and replay output with the fixtures. A mismatch remains visible rather than being repaired by a silent rebuild.