Skip to content

refactor: group scripts/misc tests by folder, READMEs per group (#442 PR 5) - #450

Merged
Jammy2211 merged 10 commits into
mainfrom
feature/likelihood-lifecycle-p0-profiling-misc
Oct 24, 2026
Merged

Jammy2211 merged 10 commits into
mainfrom
feature/likelihood-lifecycle-p0-profiling-misc

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

PR 5 of #442 (likelihood-lifecycle phase 0B): tidying scripts/misc/. Stacked on #449 (PR 3b), so merge that first. This PR's own commits are the last four: 0400150a, 66b517c1, dd279bba and the merge e5633fe8.

  • Tests split by group: each test moves from scripts/misc/test/ to scripts/misc/<group>/test/, where <group> is the misc folder whose code it imports. Repo-wide tests (catalogue, dashboard, layout, mirror, write-destination guard, script_routes, _profile_cli helpers) and the browser check go to tooling/test/. Cell tests with no helper folder (cluster ×3, lens solver) go to a new cells/test/. The move commit 0400150a is renames only (78 at 100% similarity, plus deleting the empty scripts/misc/test/__init__.py).
  • Same tests: 1554 test ids are collected before and after, identical apart from their folder. The test folders have no __init__.py; scripts/misc/conftest.py and a root pytest.ini put scripts/misc on the import path, as the old package did.
  • CI: lint.yml runs pytest scripts/misc/*/test -q and the browser check at its new path.
  • misc/searches/: it no longer exists; it was already removed in chore: scrap the retired inference programme (Gut-archived) — autolens-inference phase 2 #245. Archived: none. Under the conservative rule, every misc script is referenced by another script, a test, an HPC submit or its group README.
  • READMEs: a group index scripts/misc/README.md, plus new READMEs for cell_builders/ and cells/.
  • One wiki edit: in wiki/campaigns/misc/timing_noise_audit_2026_10.md, only the test path keys changed, because list_timing_assertions --check enforces them. Dated campaign journals still mention scripts/misc/test/ as history; they were left alone on purpose.

Scripts Changed

  • scripts/misc/test/* → scripts/misc/{likelihood_breakdown,tooling,hazards,jax_compile,cells,vram,wall,likelihood_runtime,pipeline_resume}/test/ (renames only)
  • New: scripts/misc/conftest.py, pytest.ini, scripts/misc/README.md, scripts/misc/cell_builders/README.md, scripts/misc/cells/README.md
  • Edited: .github/workflows/lint.yml, scripts/misc/tooling/{build_catalogue,apply_migration_map}.py (skip every group's test/), scripts/misc/tooling/README.md, AGENTS.md, dashboard/README.md, .gitignore, wiki/campaigns/misc/timing_noise_audit_2026_10.md (path keys only), and Path(__file__).parents[N] depth fixes in 19 tests. Comment-only path updates elsewhere.
  • Merge of the feat: drop the old results layout — v3-keyed trends, writers into the mirrored tree (#442 PR 3b) #449 review fixes: test_sweep_layout.py placed in scripts/misc/likelihood_runtime/test/.

Test Plan

Validation checklist (--auto run — plan was not pre-approved)

Refs #442

🤖 Generated with Claude Code

https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L

Jammy2211 and others added 10 commits October 24, 2026 12:48
…y; drop results_layout (#442 PR 3b)

build_dashboard.py reads the mirrored tree natively: a series is
<measurement>:<dataset_type>/<variant>:<instrument>:<setup_id>:<host_class>:<model_variant>,
a cell's comparison.json entries join the setup row they summarise, and
results/lens keeps its versioned grammar. catalogue/series_id_map.json,
generated from catalogue/migration_day_zero.json by build_series_id_map.py,
maps every pre-move series id to its new id (151 ids: 107 to v3 ids, 44 with
no mirrored member kept behind legacy:) and attaches the pre-move points
outside the mirrored tree, so all 144 published series keep their 158
releases; a test checks the continuity and that the map is current.

build_readme.py reads breakdown rows and sweep comparisons from the mirrored
tree (unresolved legacy rows listed as setup not recorded), the misc groups
and their archived history (labelled archived), and matches archived
baselines to the current cell through the map's cell table.

scripts/misc/tooling/results_layout.py and its imports are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…irrored tree; guard test (#442 PR 3b)

Writers that composed old-layout results paths outside resolve_output_paths
now place through place_output_path / resolve_output_paths, or write to the
results/misc/<group>/ landing folder where a file must keep its name:
likelihood_runtime vmap probes (+ resolve_vmap_batch), point-source
*_summary_v* writers, fixed_light witnesses and numba scaling/draws/memo
defaults, nautilus_batch_capture, separation_rule, oracle_figure, bakeoff,
memo_after_summary, misc/latent, likelihood_runtime sweep.py/aggregate.py
(comparisons to the mirrored cell) and 15 HPC submits. Their readers
(aggregate, size_sweep_table, fixed_light_scaling_table,
gradient_mode_library_ab, lens/solver/_corpus) resolve through the new
_profile_cli helpers (legacy_landing_dir, legacy_read_dirs,
locate_legacy_result, ...). Committed tables and 13/14 comparisons
re-render byte-identical.

test_results_write_destinations.py fails any script under scripts/,
_profile_cli.py or hpc/ that names a results path outside the mirrored
tree (heuristic and exclusions in its docstring).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…enames only (#442 PR 5)

Pure git mv: each test moves to the test/ dir of the scripts/misc group whose
code it exercises (repo-wide contract tests to tooling/test/, tests of cells
outside scripts/misc to cells/test/). The empty scripts/misc/test/__init__.py
is removed. Path and import fixups follow in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…isons, writer and reader (#442 PR 3b review)

sweep.py now places every row itself with sweep_layout.placed_row (the day-zero
classification of <class>/<model>/<instrument>/<model>_<config>[_sparse].json
fed the instrument, precision and dense-route transformer the matrix fixes)
and passes the exact path as the new --output-path; aggregate.py reads the
same paths (rows a run wrote win over committed rows) instead of rebuilding
locations from instrument/precision hints. All 308 matrix rows get distinct
mirrored paths under their instrument; the 13 committed comparisons rebuild
byte-equal, including interferometer/{delaunay,pixelization}/sma and
datacube/delaunay/sma.

Comparisons are placed from the instrument their rows record, so the
two-level imaging/delaunay_nn cell goes to results/imaging/delaunay_nn/hst/.
Standalone leaf runs name a two-level runtime folder under --instrument and
the interferometric leaves record the transformer they hard-code, so a
config-named row cannot collide across instruments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…ed (#442 PR 3b review)

The breakdown table lists, after the current v3 cells, every published row
with no v3 cell, latest per pre-move group, read where the day-zero move put
it under the name it kept: unresolved rows in results/breakdown/, the current
results/misc/likelihood_breakdown/ (2 datacube/inversion rows) and
archive/*/*/<slug>/breakdown/ (labelled archived). A group whose newest
release the map moved into a mirrored cell is shown by that cell's v3 row.
106 rows before the move-era re-key, 110 now; every old row is present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…path, CI (#442 PR 5)

- moved tests: fixed Path(__file__).parents[N] indices +1, the browser
  check's dashboard root, and the sibling test_fixed_light_cell.py reads;
- scripts/misc/conftest.py puts scripts/misc on sys.path (pytest used to do
  it via the old test/__init__.py); a bare root pytest.ini makes the repo root
  pytest's rootdir so the conftest loads even for a single test file;
- lint.yml runs pytest scripts/misc/*/test and the moved browser check;
- build_catalogue, apply_migration_map, the write-destination guard and
  test_headline_completion skip every group's test/ dir (and the conftest);
- scripts/misc/test/<file> references in code comments, hpc submit comments,
  dashboard/README and the CI-enforced timing-noise inventory key list
  rewritten mechanically to the new paths (historical wiki ledgers untouched).

Same 1544 tests collected before and after (identical node ids modulo dir).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
#442 PR 5)

A short index of every scripts/misc group (what it holds, where it writes,
how to run its tests), READMEs for the two groups that had none, the tooling
README's title and test pointer, and AGENTS.md's layout line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…iases and variant names (#442 PR 3b review)

test_results_write_destinations.py flattens each path expression into
segments (/ joins, .joinpath, os.path.join, Path/PurePosixPath args, split
constants, and names bound by a simple same-module NAME = <path>
assignment), so R = ROOT / "results"; R / "runtime" is caught. A
results/<dataset_type>/ path must name a variant scripts/<dataset_type>/ has
(results/imaging/pixelization fails). Self-checks cover each new form; what
it cannot follow (other modules, parameters, non-trivial bindings) is
documented. build_readme's pre-move map prefix becomes a LEGACY_ constant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…ep_layout.py (#442 PR 3b review)

resolve_output_paths reads the instrument with getattr (callers pass a
minimal namespace) and only re-folders legacy results paths; the catalogue's
script navigation lists the new scripts/misc/likelihood_runtime/sweep_layout.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
…untime/test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SeDHwsR2dnwCk8Btfhej2L
@Jammy2211
Jammy2211 merged commit 73b9385 into main Oct 24, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/likelihood-lifecycle-p0-profiling-misc branch October 24, 2026 13:50
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.

1 participant