Skip to content

feat: Phase 2 — mirror simulator profiling scripts#9

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/simulators-mirror
May 16, 2026
Merged

feat: Phase 2 — mirror simulator profiling scripts#9
Jammy2211 merged 1 commit into
mainfrom
feature/simulators-mirror

Conversation

@Jammy2211
Copy link
Copy Markdown
Contributor

Summary

Phase 2 of the autolens_profiling z_feature roadmap — mirrors the 6 simulator-profiling scripts from autolens_workspace_developer/jax_profiling/simulators/ (~2,040 LOC across imaging, interferometer, point_source, cluster, group, multi) into the new repo at simulators/. _developer stays the source of truth — the originals do not move.

Closes #4.

What changed

  • 6 simulator scripts mirrored from clean origin/main of _developer/jax_profiling/simulators/autolens_profiling/simulators/.
  • 4 path-rewrite patterns applied uniformly across all 6:
    • _workspace_root / \"jax_profiling\" / \"dataset\"_workspace_root / \"dataset\"
    • _workspace_root / \"jax_profiling\" / \"results\" / \"simulators\"_workspace_root / \"results\" / \"simulators\"
    • _script_dir.parents[1]_script_dir.parents[0] (scripts are one level shallower in the new layout — simulators/<name>.py vs jax_profiling/simulators/<name>.py)
    • Docstring example commands: python jax_profiling/simulators/<name>.pypython simulators/<name>.py
  • simulators/README.md replaces the Phase 0 placeholder. Covers: what each simulator profiles, the dataset_name collision warning for point_source.py, versioned artifact convention, headline run-times table placeholder for Phase 4's dashboard, and a per-script JIT-readiness audit.

Artifact filename convention is unchanged: results/simulators/<script>_summary_v<al.__version__>.{json,png}.

Test plan

  • py_compile PASSES for all 6 mirrored scripts.
  • grep -r jax_profiling returns no residual references in the mirrored scripts.
  • dataset/<type>/<name>/ write target verified to resolve correctly with _script_dir.parents[0] (one level shallower than Phase 1's parents[1]).
  • .gitignore from Phase 1 already covers the regenerable dataset variants (dataset/{cluster,group,multi}/, */simple/), so smoke runs that use default dataset_name = \"simple\" won't leak binary outputs.
  • Full runtime smoke skipped: running simulators/point_source.py at default dataset_name=\"simple\" would overwrite Phase 1's tracked dataset/point_source/simple/{point_dataset_positions_only.json,tracer.json} (corrupting the likelihood inputs that Phase 1 specifically locked in). Phase 5 (issue #7) will land the AUTOLENS_PROFILING_SMOKE=1 env-var short-circuit that makes future smokes cheap and side-effect-free. Until then, smoke manually by passing a non-conflicting dataset_name (e.g. \"smoke\").

F1 lesson applied

Copies came from the worktree's clean origin/main of _developernot the canonical (which is dirty with ~36 modified files, the same condition that motivated F1's re-mirror PR #3 for Phase 1).

Notes for Phase 4

  • The simulator-side point_source.py exercises a JIT'd solver.solve and asserts eager ≡ JIT. This is the same assertion that drifted upstream and is tracked under PyAutoLens#514. Phase 4's dashboard cell for point_source/simulator may show ERR or pending upstream until that resolves — same handling as the likelihood-side point_source drift.

Refs

🤖 Generated with Claude Code

Phase 2 of the autolens_profiling z_feature roadmap. Mirrors the 6
simulator-profiling scripts from autolens_workspace_developer/jax_profiling/
simulators/ into autolens_profiling/simulators/. _developer stays the
source of truth — the originals do not move.

Files mirrored (6 scripts, ~2040 LOC, all from clean origin/main of _developer):
  jax_profiling/simulators/imaging.py        -> simulators/imaging.py
  jax_profiling/simulators/interferometer.py -> simulators/interferometer.py
  jax_profiling/simulators/point_source.py   -> simulators/point_source.py
  jax_profiling/simulators/cluster.py        -> simulators/cluster.py
  jax_profiling/simulators/group.py          -> simulators/group.py
  jax_profiling/simulators/multi.py          -> simulators/multi.py

Path rewrites applied uniformly across all 6 scripts:
- _workspace_root / "jax_profiling" / "dataset" -> _workspace_root / "dataset"
- _workspace_root / "jax_profiling" / "results" / "simulators"
    -> _workspace_root / "results" / "simulators"
- _script_dir.parents[1] -> _script_dir.parents[0]
    (scripts are one level shallower in the new layout —
     simulators/<name>.py vs jax_profiling/simulators/<name>.py)
- Docstring example commands: `python jax_profiling/simulators/<name>.py`
    -> `python simulators/<name>.py`

The artifact filename convention is unchanged:
  results/simulators/<script>_summary_v<al.__version__>.{json,png}

simulators/README.md replaces the Phase 0 placeholder with a section
narrative covering what each simulator profiles, run instructions
(including the dataset_name collision warning for point_source — its
default writes to dataset/point_source/simple/ which holds Phase 1's
tracked likelihood input JSONs), versioned artifact convention, the
headline run-times table placeholder for Phase 4's dashboard, and a
JIT-readiness audit per script.

Smoke status: py_compile + rewrite verification PASSED for all 6 scripts.
Full runtime smoke (each simulator run-to-completion) was intentionally
skipped — running simulators/point_source.py at default dataset_name="simple"
would overwrite Phase 1's tracked point_dataset_positions_only.json and
tracer.json (corrupting the likelihood inputs). Phase 5's
AUTOLENS_PROFILING_SMOKE=1 short-circuit will provide a clean smoke path;
until then the static checks + matching the Phase 1/3 pattern give
sufficient confidence to ship.

F1 lesson applied: copies came from worktree's clean origin/main of
_developer (NOT the canonical, which is dirty with ~36 modified files).

Closes #4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 75a562f into main May 16, 2026
@Jammy2211 Jammy2211 deleted the feature/simulators-mirror branch May 16, 2026 13:13
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.

feat: Phase 2 — mirror simulator profiling scripts

1 participant