Overview
Phase 3 of the autolens_profiling z_feature roadmap — stand up autolens_profiling/searches/ with sampler profiling for the Nautilus sampler only, mirrored from autolens_workspace_developer/searches_minimal/. Other samplers in _developer/searches_minimal/ (Dynesty, Emcee, BlackJAX, NumPyro, PocoMC, NSS variants, LBFGS, sweep scripts) are explicitly out of scope — Phase 3 designs the folder layout so they can slot in later under their own prompts.
_developer stays the source of truth — the originals do not move.
Plan
- Mirror 4 files into a new nested folder layout:
nautilus_simple.py → searches/nautilus/simple.py, nautilus_jax.py → searches/nautilus/jax.py, and the shared _setup.py / _metrics.py → searches/{_setup,_metrics}.py. ~20K total source.
- Update the shared
_setup.py path constants from Path("jax_profiling") / "dataset" / "imaging" / "hst" to Path("dataset") / "imaging" / "hst" so the Nautilus scripts find the HST dataset Phase 1 already mirrored at the top level.
- Rewrite the Nautilus scripts' imports:
from searches_minimal._{setup,metrics} → from searches._{setup,metrics} (relative-from-nested-folder structure).
- Make sure run-time + sampler-stat JSON writes land at
results/searches/nautilus/<script>_summary_v<al.__version__>.{json,png} using the same versioned-artifact convention as the rest of the repo.
- Write two READMEs: top-level
searches/README.md (section overview + "supported samplers" table with Nautilus filled in, others marked "planned") and searches/nautilus/README.md (what the Nautilus scripts profile, how to read the result JSON, headline-run-times table placeholder for Phase 4).
- Smoke-check:
python searches/nautilus/simple.py end-to-end with a small problem size; confirm JSON+PNG lands at the expected path.
Detailed implementation plan
Affected Repositories
PyAutoLabs/autolens_profiling (primary, target) — currently at aa131a7 on main after F1 re-mirror.
PyAutoLabs/autolens_workspace_developer (read-only source-of-truth, no changes).
Work Classification
Scripts mirroring (workspace-style). Same routing pattern as Phase 1 / Phase 2 — manual worktree setup.
Branch Survey
| Repository |
Current Branch |
Dirty? |
./autolens_profiling |
main |
clean (no overlap with Phase 2's queued simulators/ touches — Phase 3 touches searches/ only) |
Suggested branch: feature/nautilus-mirror
Worktree root: ~/Code/PyAutoLabs-wt/nautilus-mirror/
Parallel-execution note
Phase 2 (simulators-mirror, autolens_profiling#4) is queued but not yet started (no worktree exists). Phase 3 touches disjoint directories (searches/ vs simulators/), so the two can run in parallel from separate worktrees if needed. The worktree_check_conflict helper currently treats two tasks claiming the same repo as a conflict regardless of whether their file scopes overlap — if both phases want to run simultaneously, decide how to manage that (e.g. start Phase 3 first or merge Phase 2 quickly).
Target folder layout
searches/
README.md # section overview + samplers table
_setup.py # shared dataset/model/analysis builder
_metrics.py # shared MLTracker
nautilus/
README.md # Nautilus-specific narrative + run-times
simple.py # numpy path
jax.py # JAX path
# future: dynesty/, emcee/, blackjax/, numpyro/, pocomc/, nss/, lbfgs/
Path-rewrite patterns
| Pattern |
Before |
After |
File(s) |
| Shared dataset path constant |
Path("jax_profiling") / "dataset" / "imaging" / "hst" |
Path("dataset") / "imaging" / "hst" |
_setup.py |
Workspace-root walk-up in _setup.py |
Path(__file__).resolve().parent.parent (two up from searches_minimal/_setup.py) |
Path(__file__).resolve().parent.parent (still two up, now from searches/_setup.py) |
_setup.py — confirm no change needed since the new location is also one folder deep from repo root |
| Imports in Nautilus scripts |
from searches_minimal._{setup,metrics} import ... |
from searches._{setup,metrics} import ... |
searches/nautilus/{simple,jax}.py |
| Results write path |
(whatever the originals use) |
_workspace_root / "results" / "searches" / "nautilus" |
both Nautilus scripts |
The artifact filename convention is unchanged: <script>_summary_v<al.__version__>.{json,png}.
Implementation Steps
-
Set up worktree manually:
source admin_jammy/software/worktree.sh
worktree_create nautilus-mirror autolens_profiling
cd ~/Code/PyAutoLabs-wt/nautilus-mirror/autolens_profiling
git checkout -b feature/nautilus-mirror
-
Create the section folder skeleton: searches/ already exists from Phase 0 with the placeholder README — create searches/nautilus/ subfolder.
-
Copy 4 files from ~/Code/PyAutoLabs-wt/nautilus-mirror/autolens_workspace_developer/searches_minimal/ (worktree's clean origin/main copy, F1 lesson applied):
_setup.py → searches/_setup.py
_metrics.py → searches/_metrics.py
nautilus_simple.py → searches/nautilus/simple.py
nautilus_jax.py → searches/nautilus/jax.py
-
Apply path rewrites above. The _setup.py walk-up should still resolve correctly (one folder deep, same depth as before).
-
Read _developer/searches_minimal/sweep_findings.md for the user's prior observations from sweep runs — use as context for the Nautilus README narrative (per the prompt's instruction). Do NOT mirror sweep_findings.md itself; it's a workspace note, not a public artifact.
-
Replace searches/README.md placeholder with the real section README — overview, what _setup.py / _metrics.py provide, "supported samplers" table (Nautilus filled, others "planned").
-
Write searches/nautilus/README.md — narrative on what the two scripts profile (chain time, n_live sensitivity, JIT vs NumPy comparison), how to read the result JSON, headline-run-times table placeholder for Phase 4.
-
JIT-placeholder audit: nautilus_jax.py may have caveats (per sweep_findings.md); if so, surface them in the Nautilus README and link the upstream issue.
-
Smoke searches/nautilus/simple.py end-to-end with a small n_live (the docstring already says it's a wiring test). Confirm JSON+PNG lands at results/searches/nautilus/simple_summary_v<al.__version__>.{json,png}.
-
Open PR against main of PyAutoLabs/autolens_profiling. PR body: link this issue + summary of which scripts moved + which JIT paths are stubbed.
Key Files
- Source (read-only):
autolens_workspace_developer/searches_minimal/{_setup,_metrics,nautilus_simple,nautilus_jax}.py (~20K).
- Reference (read-only):
autolens_workspace_developer/searches_minimal/sweep_findings.md — informs the README narrative; NOT mirrored.
- New:
autolens_profiling/searches/{_setup,_metrics}.py (mirrored shared helpers).
- New:
autolens_profiling/searches/nautilus/{simple,jax}.py (Nautilus scripts).
- New:
autolens_profiling/searches/nautilus/README.md.
- Edit:
autolens_profiling/searches/README.md — replace Phase 0 placeholder.
Decisions inherited from Phase 1
- Datasets live at top-level
dataset/<type>/<name>/. Phase 3's _setup.py reads from dataset/imaging/hst/ which Phase 1 already mirrored. No new dataset work.
- Results folder structure mirrors source folder structure (
results/searches/nautilus/ mirrors searches/nautilus/).
F1 lesson applied: copy from clean origin/main, not the canonical
Phase 1 inadvertently copied from the dirty _developer canonical checkout. F1 (autolens_workspace_developer#67) surfaced and fixed it via autolens_profiling#3. Phase 3 must copy from the worktree's _developer (clean origin/main).
Out of scope
- All non-Nautilus samplers in
_developer/searches_minimal/ (Dynesty, Emcee, BlackJAX, NumPyro, PocoMC, NSS, LBFGS) — follow-up prompts will land each under its own folder using the layout this PR establishes.
- All
sweep_*.py scripts and probe_grad.py.
- Mirroring
sweep_findings.md.
- Phase 2 (simulators) and Phases 4–5 of the autolens_profiling z_feature.
Original Prompt
Click to expand starting prompt
The full prompt content is preserved at PyAutoPrompt/issued/searches_nautilus_mirror.md after this issue is created. See also the z_features tracker at PyAutoPrompt/z_features/autolens_profiling.md.
Overview
Phase 3 of the autolens_profiling z_feature roadmap — stand up
autolens_profiling/searches/with sampler profiling for the Nautilus sampler only, mirrored fromautolens_workspace_developer/searches_minimal/. Other samplers in_developer/searches_minimal/(Dynesty, Emcee, BlackJAX, NumPyro, PocoMC, NSS variants, LBFGS, sweep scripts) are explicitly out of scope — Phase 3 designs the folder layout so they can slot in later under their own prompts._developerstays the source of truth — the originals do not move.Plan
nautilus_simple.py→searches/nautilus/simple.py,nautilus_jax.py→searches/nautilus/jax.py, and the shared_setup.py/_metrics.py→searches/{_setup,_metrics}.py. ~20K total source._setup.pypath constants fromPath("jax_profiling") / "dataset" / "imaging" / "hst"toPath("dataset") / "imaging" / "hst"so the Nautilus scripts find the HST dataset Phase 1 already mirrored at the top level.from searches_minimal._{setup,metrics}→from searches._{setup,metrics}(relative-from-nested-folder structure).results/searches/nautilus/<script>_summary_v<al.__version__>.{json,png}using the same versioned-artifact convention as the rest of the repo.searches/README.md(section overview + "supported samplers" table with Nautilus filled in, others marked "planned") andsearches/nautilus/README.md(what the Nautilus scripts profile, how to read the result JSON, headline-run-times table placeholder for Phase 4).python searches/nautilus/simple.pyend-to-end with a small problem size; confirm JSON+PNG lands at the expected path.Detailed implementation plan
Affected Repositories
PyAutoLabs/autolens_profiling(primary, target) — currently ataa131a7on main after F1 re-mirror.PyAutoLabs/autolens_workspace_developer(read-only source-of-truth, no changes).Work Classification
Scripts mirroring (workspace-style). Same routing pattern as Phase 1 / Phase 2 — manual worktree setup.
Branch Survey
./autolens_profilingsimulators/touches — Phase 3 touchessearches/only)Suggested branch:
feature/nautilus-mirrorWorktree root:
~/Code/PyAutoLabs-wt/nautilus-mirror/Parallel-execution note
Phase 2 (
simulators-mirror, autolens_profiling#4) is queued but not yet started (no worktree exists). Phase 3 touches disjoint directories (searches/vssimulators/), so the two can run in parallel from separate worktrees if needed. Theworktree_check_conflicthelper currently treats two tasks claiming the same repo as a conflict regardless of whether their file scopes overlap — if both phases want to run simultaneously, decide how to manage that (e.g. start Phase 3 first or merge Phase 2 quickly).Target folder layout
Path-rewrite patterns
Path("jax_profiling") / "dataset" / "imaging" / "hst"Path("dataset") / "imaging" / "hst"_setup.py_setup.pyPath(__file__).resolve().parent.parent(two up fromsearches_minimal/_setup.py)Path(__file__).resolve().parent.parent(still two up, now fromsearches/_setup.py)_setup.py— confirm no change needed since the new location is also one folder deep from repo rootfrom searches_minimal._{setup,metrics} import ...from searches._{setup,metrics} import ...searches/nautilus/{simple,jax}.py_workspace_root / "results" / "searches" / "nautilus"The artifact filename convention is unchanged:
<script>_summary_v<al.__version__>.{json,png}.Implementation Steps
Set up worktree manually:
Create the section folder skeleton:
searches/already exists from Phase 0 with the placeholder README — createsearches/nautilus/subfolder.Copy 4 files from
~/Code/PyAutoLabs-wt/nautilus-mirror/autolens_workspace_developer/searches_minimal/(worktree's clean origin/main copy, F1 lesson applied):_setup.py→searches/_setup.py_metrics.py→searches/_metrics.pynautilus_simple.py→searches/nautilus/simple.pynautilus_jax.py→searches/nautilus/jax.pyApply path rewrites above. The
_setup.pywalk-up should still resolve correctly (one folder deep, same depth as before).Read
_developer/searches_minimal/sweep_findings.mdfor the user's prior observations from sweep runs — use as context for the Nautilus README narrative (per the prompt's instruction). Do NOT mirrorsweep_findings.mditself; it's a workspace note, not a public artifact.Replace
searches/README.mdplaceholder with the real section README — overview, what_setup.py/_metrics.pyprovide, "supported samplers" table (Nautilus filled, others "planned").Write
searches/nautilus/README.md— narrative on what the two scripts profile (chain time,n_livesensitivity, JIT vs NumPy comparison), how to read the result JSON, headline-run-times table placeholder for Phase 4.JIT-placeholder audit:
nautilus_jax.pymay have caveats (persweep_findings.md); if so, surface them in the Nautilus README and link the upstream issue.Smoke
searches/nautilus/simple.pyend-to-end with a smalln_live(the docstring already says it's a wiring test). Confirm JSON+PNG lands atresults/searches/nautilus/simple_summary_v<al.__version__>.{json,png}.Open PR against
mainofPyAutoLabs/autolens_profiling. PR body: link this issue + summary of which scripts moved + which JIT paths are stubbed.Key Files
autolens_workspace_developer/searches_minimal/{_setup,_metrics,nautilus_simple,nautilus_jax}.py(~20K).autolens_workspace_developer/searches_minimal/sweep_findings.md— informs the README narrative; NOT mirrored.autolens_profiling/searches/{_setup,_metrics}.py(mirrored shared helpers).autolens_profiling/searches/nautilus/{simple,jax}.py(Nautilus scripts).autolens_profiling/searches/nautilus/README.md.autolens_profiling/searches/README.md— replace Phase 0 placeholder.Decisions inherited from Phase 1
dataset/<type>/<name>/. Phase 3's_setup.pyreads fromdataset/imaging/hst/which Phase 1 already mirrored. No new dataset work.results/searches/nautilus/mirrorssearches/nautilus/).F1 lesson applied: copy from clean origin/main, not the canonical
Phase 1 inadvertently copied from the dirty
_developercanonical checkout. F1 (autolens_workspace_developer#67) surfaced and fixed it via autolens_profiling#3. Phase 3 must copy from the worktree's_developer(cleanorigin/main).Out of scope
_developer/searches_minimal/(Dynesty, Emcee, BlackJAX, NumPyro, PocoMC, NSS, LBFGS) — follow-up prompts will land each under its own folder using the layout this PR establishes.sweep_*.pyscripts andprobe_grad.py.sweep_findings.md.Original Prompt
Click to expand starting prompt
The full prompt content is preserved at
PyAutoPrompt/issued/searches_nautilus_mirror.mdafter this issue is created. See also the z_features tracker atPyAutoPrompt/z_features/autolens_profiling.md.