Skip to content

maintenance: rebuild to the autolens_workspace_test shape; retire legacy/ + imaging_ci/ via Gut (cti-upkeep 3b) - #27

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/cti-workspace-test-rebuild
Nov 6, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/cti-workspace-test-rebuild

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Rebuilds autocti_workspace_test to the autolens_workspace_test shape and retires its two pre-resurrection trees through PyAutoGut. Closes #26 (cti-upkeep phase 3b).

  • Retired via Gut (ruling R3, plus a human ruling on 2026-11-06 for imaging_ci/): legacy/ (139 files) and the top-level imaging_ci/ (43 files), both Euclid VIS heritage on the pre-2025 API that nothing ran. Recoverable from PyAutoGut refs/heads/archive/condemned/autocti-workspace-test-legacy @ 72970e78 (this repo's pre-purge main); listed in PyAutoMind condemned.md (sweep-after 2026-12-06).
  • Self-consistency checks that assert. Data are simulated with arctic and fitted, corrected or flagged with the same arctic, so the checks hold whatever arcticpy version is installed. At the arcticpy 2.7 bump only the 0b likelihood pins move.
script asserts
dataset_1d/recover_input.py the truth fits noise-free data (chi² = 0); density ×1.2 / ×0.8, timescale ×1.2 and well-fill ×1.2 are all worse; a 21-point density scan peaks at the truth
imaging_ci/recover_input.py the same for parallel, serial and parallel+serial CTI
dataset_1d/remove_cti.py remove_cti(add_cti(x)) is within 0.1% of the 78.8 e⁻ trail (measured 1.3e-5 e⁻); more iterations reduce the residual
imaging_ci/remove_cti.py the same per direction (parallel and serial each about 1e-6 e⁻); parallel+serial is bounded on its mean, with max under 1% of the trail (see findings)
imaging_ci/cosmic_ray_flagging.py all bright seeded cosmic-ray pixels (> 40σ) are flagged; under 1% false flags (measured 1/5869); the buffered mask covers every pixel the cosmic rays and their CTI trails contaminate, measured by clocking the image with and without them
{dataset_1d,imaging_ci}/model_fit.py the aggregator round trip returns the dataset, the fit and a CTI identical to the search result. imaging_ci had no round trip before; 1D also checks one CTI per dataset.
  • Harness: run_all_scripts.sh (from autolens_workspace_test), config/build/no_run.yaml (empty, with the SLOW/NEEDS_FIX conventions), config/build/profile_release.yaml (from autocti_workspace, plus a real-plotting override for plot/subplots.py, which asserts its PNGs exist), smoke_tests.txt 5 → 10 (every script), .gitignore failed/, AGENTS.md and README rewritten for the design.

Design change from the plan: the plan had a short real search under profile_release recover the density within 10%. That profile caps the sampler (PYAUTO_TEST_MODE=1), so that check would be flaky. The recover-input scripts instead do a deterministic likelihood scan over density, which recovers the input exactly under every profile. The sampler path stays covered by model_fit.py.

Findings (recorded in the scripts, not changed here)

  1. Parallel+serial CTI correction plateaus at about 0.2 e⁻ (0.34 e⁻ at 5 iterations, 0.23 at 10, 0.20 at 20), always at one pixel: row 0, column 29, the first row's serial-overscan corner. Each direction alone converges to about 1e-6 e⁻. The combined bound (max < 1% of the trail = 0.49 e⁻) has a modest margin against 0.34 e⁻. Worth a look in arctic; the 2.7 bump could move it.
  2. The default cosmic-ray mask buffer under-masks at high trap density. With density 10 and release timescale 5, cosmic-ray trails stay above the read noise for 11–17 rows, past the default 10-row parallel buffer, so 61 contaminated pixels go unmasked. With the Euclid-like traps from the workspace example (used in the check), the defaults mask everything. Buffer size should probably scale with the trap model.

Scripts Changed

  • Added: scripts/dataset_1d/{recover_input,remove_cti}.py, scripts/imaging_ci/{recover_input,remove_cti,cosmic_ray_flagging}.py, run_all_scripts.sh, config/build/{no_run,profile_release}.yaml
  • Changed: scripts/{dataset_1d,imaging_ci}/model_fit.py (aggregator assertions), smoke_tests.txt, AGENTS.md, README.md, .gitignore
  • Removed: legacy/ (139 files), imaging_ci/ (43 files)

Upstream PR

None (workspace only; no library change).

Test Plan

  • Fresh clone, profile_smoke: 10/10 passed in 142 s
  • Fresh clone, profile_release: 9/10, then plot/subplots.py given its real-plotting override (7ee8733), re-run passed
  • Fresh clone, bash run_all_scripts.sh: no failures
  • Every new assertion was shown to fail when its premise is broken: wrong simulation model (1D/2D recover), wrong correction model (1D/2D remove_cti), raised flagging threshold, missing serial buffer, missing parallel+diagonal buffers
  • CI smoke 3.12 / 3.13

Heart: STALE at ship time for one reason, "release validation incomplete: no rehearsal for current source", acknowledged by the human.

Tier: judge. Merge mode: human /prm.

🤖 Generated with Claude Code

Jammy2211 and others added 3 commits November 6, 2026 11:35
…uling R3)

Both trees are pre-resurrection Euclid VIS heritage written against the pre-2025
API and not runnable (139 + 43 files). Recoverable through the transit window from
PyAutoGut refs/heads/archive/condemned/autocti-workspace-test-legacy
@ 72970e7 (also this repo's history at that SHA);
ledger entry in PyAutoMind condemned.md.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arness (cti-upkeep 3b)

- scripts/{dataset_1d,imaging_ci}/recover_input.py: truth fits noise-free data (chi2 = 0),
  offsets are worse, a density likelihood scan peaks at the truth (2D: parallel, serial, both)
- scripts/{dataset_1d,imaging_ci}/remove_cti.py: remove_cti(add_cti(x)) = x, residual shrinks
  with iterations; parallel+serial corner plateau (~0.2 e-, row 0 col 29) measured and bounded
- scripts/imaging_ci/cosmic_ray_flagging.py: seeded cosmic rays flagged; the buffered mask covers
  every pixel the cosmic rays + CTI trails contaminate (measured by clocking with/without them)
- model_fit.py (1D + 2D): aggregator round trip asserts the database CTI equals the search result
  (imaging_ci had no round trip before)
- run_all_scripts.sh, config/build/no_run.yaml, config/build/profile_release.yaml
- smoke_tests.txt 5 -> 10 (every script); AGENTS.md + README describe the design

Every new assertion was checked to fail when its premise is broken.

Refs #26

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NGs are written)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 4160e32 into main Nov 6, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/cti-workspace-test-rebuild branch November 6, 2026 12:10
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.

maintenance: rebuild to the autolens_workspace_test shape; retire legacy/ + imaging_ci/ via Gut (cti-upkeep 3b)

1 participant