Skip to content

Consolidated Raul comparison notebook: main vs #12, and the pole regression it found - #13

Merged
christianhbye merged 12 commits into
mainfrom
notebooks/raul-comparison
Sep 15, 2026
Merged

christianhbye merged 12 commits into
mainfrom
notebooks/raul-comparison

Conversation

@christianhbye

@christianhbye christianhbye commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

One notebook, notebooks/sim_comparisons/raul_comparison.ipynb, replaces the three sim_comparison* notebooks. It compares Raul's reference simulator against mistsim under two environments: main before #12 (croissant 5.1.4) and #12 (croissant v5.3.0.dev2). The same cells run under two Jupyter kernels, each run caches its waterfalls under a tag derived from its croissant revision, and the comparison section plots every cached run it finds.

Impact: #12 introduced a large regression at latitude ±90, and it is now on main. Result (mean |mistsim − Raul|, and the arch ratio of mid-day to edge residual):

test main (5.1.4) #12 (v5.3.0.dev2)
MARS, with mountains 2.356 K, arch 4.01 1.303 K, arch 1.42
MARS, no mountains 2.260 K, arch 7.23 0.921 K, arch 1.15
North Pole, no mountains 4.389 K, arch 2.49 117.527 K, arch 1.00

The mapmaking results for the other sites are unaffected. Data and forward model share one Simulator, so frame changes cancel: a re-run of mars-lmax40 moved relative reconstruction error by 0.006%.

Changes

  • notebooks/sim_comparisons/raul_comparison.ipynb (new): setup and environment tagging, Raul's reference, sky and beams, the three cached simulations, the comparison figures and summary table, a results cell stating the conclusion, and a disabled beam_az_rot=90 convention check.
  • notebooks/sim_comparisons/results/.gitignore: cached waterfalls are regenerable and stay out of git.
  • Deleted sim_comparison.ipynb, sim_comparison_azrot0.ipynb and sim_comparison_azrot90.ipynb. The new notebook covers them, since BEAM_AZ_ROT is a parameter. They remain in history.
  • docs/superpowers/specs/…-design.md, docs/superpowers/plans/….md: the design and implementation plan.

Reproducing

Cell 0 contains the setup for the second kernel:

git worktree add ../mistsim-main daa5e7b   # last commit before #12
cd ../mistsim-main && uv sync --all-extras --dev
uv run python -m ipykernel install --user --name mistsim-cro514 \
    --display-name "mistsim (croissant 5.1.4)"

Run the notebook under that kernel first, then under the project kernel. Now that #12 is merged, main needs to be the pre-#12 commit (daa5e7b) for the old environment. The inputs under data/ are gitignored, as they already were in this repo.

Verification

  • uv run pytest: 111 passed on this exact tree.
  • The notebook runs end to end under both kernels, with distinct cache tags (5.1.4, 5.2.1+gitd972c5f). data/beam.npz and data/feko_beam.npz have the same md5 before and after.
  • Each implementation task had a spec and quality review, plus a final whole-branch review.

🤖 Generated with Claude Code

https://claude.ai/code/session_012qDDdFg7x9CVkj4EGVT8AE

christianhbye and others added 12 commits September 14, 2026 17:11
The croissant v5.3.0.dev2 bump leaves the mapmaking results alone --
data and forward model are built from the same Simulator, so the
pole-of-date change cancels in the linear inverse and a re-run of
mars-lmax40 moved the relative reconstruction error by 0.006%. The
comparison against Raul's reference simulator has no such cancellation
and has to be redone.

The three sim_comparison notebooks could not do that: none referenced
the others, and none had any notion of comparing two versions of
mistsim. The stored comparison_022526.npz was written thirty-six
minutes before that day's croissant-v5 upgrade commits, so it predates
five subsequent changes and cannot serve as a controlled baseline.

The design replaces all three with one notebook run under two kernels
-- a git worktree of main against this branch -- so both versions
execute byte-identical cells. main and this branch differ in croissant,
s2fft and jax together, and those cannot be separated cheaply, so the
notebook measures main versus PR 12 rather than the pole fix alone;
the spec says so and labels its curves by environment.

Delete the three superseded notebooks; they remain in history on main.
interp_beam.ipynb is untouched, being a study of beam sampling rather
than frame correctness.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Declare NSIDE and SIM_LMAX in Task 2's produces block; Task 3 consumes
them and an undeclared interface invites redefinition. Replace Task 3's
absolute cache-timing bound with a relative one -- re-execution rebuilds
the sky and beam transforms regardless of the cache, so the bound could
fail for reasons unrelated to what it tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Creates notebooks/sim_comparisons/raul_comparison.ipynb with the
title cell, setup cell (paths, BEAM_AZ_ROT, NSIDE/SIM_LMAX, TESTS),
an environment-tagging cell that distinguishes croissant main vs
PR 12 via cro.rotations.eq2cirs, and a cell loading Raul's three
reference HDF5 waterfalls. Verified headless via nbconvert under
the project kernel (croissant v5.3.0.dev2): all in-cell asserts
pass, shapes are (241, 86), freqs span 40-125 MHz.

Also adds notebooks/sim_comparisons/results/.gitignore so the
notebook's regenerable cached npz outputs stay untracked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Address code-review fix round 1 on the comparison section:

- Cell 11 suptitle and the residual_profile docstring no longer
  attribute an observed arch to any specific fix (pole-of-date or
  otherwise) -- they only describe the shape, per the plan's own
  "labelled by environment, never by feature" constraint. The
  docstring now cites croissant's CHANGELOG entry for the pointing
  error numbers instead of stating them as bare fact.
- arch_ratio now returns nan when the edge mean is negligible
  relative to mean_abs_K (not just exactly zero), avoiding an
  arbitrarily large, meaningless ratio in precisely the regime this
  metric exists to flag.
- The right-edge slice in residual_profile no longer aliases to the
  whole array when third // 2 == 0 (the "-0" slicing trap); not
  triggered at 241 samples but was a latent corruption on a coarser
  grid.
- Cell 12's residual heatmaps now share one colour scale across all
  runs per test (like cell 13 already did), so panels are directly
  comparable by eye instead of each floating on its own vmin/vmax.
- The summary table's "rel %" header is renamed "ratio %" since the
  value is a ratio of means, not a mean of per-point relative
  errors; a comment in residual_profile now says so explicitly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Add a results markdown cell after the summary table stating the
  outcome: MARS improves under PR 12, North Pole regresses 27x with
  a constant (arch=1.00) offset, and the diagnosed mechanism (a
  non-orthogonal get_rot_mat from astropy annual aberration,
  amplified through rotmat_to_eulerZYZ's beta-conditioned split,
  confirmed independently by a +66.0 degree LST-lag scan). Notes
  that the table mixes croissant/s2fft/jax and cannot attribute its
  own numbers, unlike the separately-measured diagnosis, and flags
  the southpole synthetic data as carrying the smaller pre-CIRS
  error.
- Fold BEAM_AZ_ROT into the cache filename so changing it can't
  silently load and mislabel results simulated under a different
  rotation; rename the two existing gitignored cache files to match.
- Derive REPO from the notebook's own location instead of a
  hardcoded path, and document the worktree/kernel setup commands
  in the intro cell so the notebook is self-contained.
- Add a failure message to the MARS LST-grid assert, since it
  guards LSTs plotted later for both tests 0 and 1.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PR 12 has merged, so cell 0's `git worktree add ../mistsim-main main`
now builds croissant v5.3.0.dev2 in both kernels. Both runs would then
write the same cache file, and the comparison would quietly show one
environment. Pin daa5e7b, the last commit before the merge.

The results cell said the April southpole synthetic data carry a -1.4
degree error, a figure measured only at +90. Measured now at the
runs.yaml start time and latitude -90, as the angle between the Euler
reconstruction and the nearest true rotation (meaningful at either
pole): 1.4 degrees under croissant 5.1.4, 38.5 degrees under PR 12.
Also say that the error depends on epoch, so the notebook's 66.5 degrees
and the 133.4 degrees in croissant#152 are each correct for their own
epoch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012qDDdFg7x9CVkj4EGVT8AE
@christianhbye
christianhbye merged commit 41911ff into main Sep 15, 2026
6 checks passed
@christianhbye
christianhbye deleted the notebooks/raul-comparison branch September 15, 2026 00:39
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