Repository navigation
test: cap the chapter-3 source meshes with the data under PYAUTO_SMALL_DATASETS (epic phase 8) - #77
Merged
Merged
Conversation
…epic phase 8) Three chapter 3 tutorials build a 40 x 40 `RectangularBilinearAdaptDensity` mesh. `Grid2D.uniform` and `Mask2D.circular` both honour `PYAUTO_SMALL_DATASETS=1` and cap to `SMALL_DATASETS_SHAPE_NATIVE`, but a pixelization's `shape=` does not, so a capped smoke run reconstructs 1600 source pixels from the 80 unmasked image pixels a 16 x 16 image leaves — an inversion 20x over-parameterised against its own data, solved by the NNLS Cholesky path on every fit. `mesh_shape` reads the cap back off the loaded dataset, the way the workspace scripts already read the pixel scale back off it, and uses the existing `al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE` constant. A full-resolution run — every run a reader will do — is unchanged at 40 x 40, so the prose, the figures and what each tutorial demonstrates are untouched. Measured in a warm container under the smoke profile: tutorial_6_borders.py 14.0 s -> 4.5 s tutorial_4_bayesian_regularization.py 10.0 s -> 4.2 s tutorial_3_inversions.py 7.7 s -> 4.1 s Full smoke suite 50/50 PASS, 182.2 s (was ~201 s); no assertion, tolerance or allowlist entry touched. Notebooks regenerated. The systemic form of this — capping mesh `shape` in PyAutoArray beside the grid and mask, which would reach ~28 further call sites — is proposed separately and routes through the library-first gate; this guard resolves to the same shape and is harmless if that lands. Refs PyAutoLabs/autolens_workspace#536 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of autolens_workspace#536 — phase 8 of the
ci-timing-fast-testsepic (PyAutoMinddraft/feature/pyautoheart/ci_timing_fast_tests_epic.md): the user-workspace + HowTo slow-script pass driven by the ingested per-script timings.Summary
Three chapter-3 tutorials reconstructed a 1600-pixel rectangular source from 80 unmasked image pixels under the smoke cap:
PYAUTO_SMALL_DATASETS=1shrinks the data to 16×16 but nothing capped the model, so the capped run solved a harder, more degenerate inversion than the real one (fnnls_cholesky4.5 s +cholinsertlast_inplace1.7 s per fit). The mesh shape now follows the data:It reads the cap back off the loaded dataset (the idiom these tutorials already use for the pixel scale) with the library's existing constant — no new environment variable, no env read in a tutorial, no prose changed, and nothing a reader sees changes: with the cap unset the dataset is
(100, 100)and the mesh stays(40, 40)(verified).chapter_3_pixelizations/tutorial_6_borders.py— 1 sitechapter_3_pixelizations/tutorial_4_bayesian_regularization.py— 4 siteschapter_3_pixelizations/tutorial_3_inversions.py— 1 site (not on the issue list; the identical finding in the same folder)Notebooks regenerated and committed alongside.
Measured (this container, warm numba cache, smoke profile, the repo's own smoke runner)
tutorial_6_borders.pytutorial_4_bayesian_regularization.pytutorial_3_inversions.pyCI record before (run 33908175450): 219.3 s; the PR's own run is the after. The remaining time on this repo is the per-process import floor (47 of 50 scripts under 10 s; 4.3–4.8 s warm), which no workspace change can move.
Context from the diagnosis (on the issue)
The "4–6× slower locally" gap the issue opened with was a cold numba cache plus the
should_simulatere-simulation subprocess, not any script; warm, the local suite agrees with CI per script. The category (a) findings — work aPYAUTO_*variable should have suppressed — were traced to unguarded library calls and are filed as library prompts, not applied here.Test Plan
(100, 100), mesh(40, 40)— reader-facing behaviour unchanged🤖 Generated with Claude Code
https://claude.ai/code/session_0151gQm9fk3XGLi5f18Urdba
Generated by Claude Code