Skip to content

fix: stale auto-simulated dataset/cluster/simple is never regenerated #445

Done

Description

@Jammy2211

Why

Found during PyAutoLens#799. The local gitignored dataset/cluster/simple (written 2026-05-16) has no scaling_galaxies.csv. Its tracer.json uses the old dPIEMassSph(rs=, b0=, ra=) signature, so it no longer deserialises.

The current simulator (scripts/misc/simulators/cluster.py) writes dPIEMassB0Sph and scaling_galaxies.csv. But _profile_cli.auto_simulate_if_missing gates only on al.util.dataset.should_simulate, which checks existence, so a stale dataset is never refreshed. The #799 worker had to rebuild the CSV in a scratch copy and bypass simple_truth_gate.

Deliverables

  1. Detect a stale auto-simulated dataset. Options:
    • record the simulator sha256 (already computed in scripts/cluster/image_plane/_datasets.py) in a marker file beside the dataset, and re-simulate on mismatch;
    • or check for the required files.
  2. Either regenerate or fail loudly; never silently use a stale truth.
  3. Keep the shared helper general (it serves every dataset_type), and coordinate with the point-source regime draft named in Related:.

Mind prompt: draft/bug/autolens_profiling/stale_auto_simulated_cluster_dataset.md. Found during PyAutoLabs/PyAutoLens#799.

Activity

  1. Jammy2211 commented on Nov 24, 2026

    @Jammy2211
    ContributorAuthor

    Reproduced on main at 9b4a645 with the local legacy dataset. The cache gate returned with scaling_galaxies.csv absent, and loading tracer.json raised TypeError for the old rs argument.

    1. Validate the cluster/simple simulation outputs on reuse and after simulation. Fail with the exact path and recovery command so the operator retains the old data.
    2. Keep the validation specific to the simple cluster, using the same gate for the image-plane, source-plane and robust-settings consumers. The separate point-source regime draft continues to own the shared resolution policy.
    3. Exercise the actual legacy fixture and a fresh simulator output, add a regression for a stale tracer even with the CSV present, and run targeted smoke and independent review.

    Implementation in autolens_profiling, branch feature/stale-auto-simulated-cluster-dataset. The shared _profile_cli.py helper will apply cluster-specific validation only for cluster/simple. Use current PyAutoLens to load the saved tracer. Fresh simulation and validation use an isolated output directory.

    effective level: supervised; merge mode: auto-merge on green if the Witness passes after a merge slot

  2. Jammy2211 commented on Nov 24, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    • PR: Reject stale truth files in the simple cluster cache #532 (merged 2026-11-24, d11ff94)
    • Summary: the simple-cluster cache gate now requires scaling_galaxies.csv and loads the saved tracer with the installed PyAutoLens before reusing dataset/cluster/simple; a missing table or incompatible tracer.json raises an error naming the file and how to regenerate it. Applies to both cluster profiling cells and the robust-settings sweep.
    • Validation: regression test + stale/fresh witness, cluster import smokes, independent review CLEAN, scoped Heart GREEN.
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