Skip to content

fix: los_halos simulator_jax sizes halo arrays with max_n=None - #682

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/substructure-halo-arrays-overflow
Nov 19, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/substructure-halo-arrays-overflow

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

los_halos/simulator_jax.py packed its halos with a fixed max_n=200. With the script's own settings, the fullest plane holds 304 halos when the fallback coefficients on main are used, and 323–377 with the colossus coefficients (seeds 42 and 100–107). So the example was silently dropping halos while the negative sheets still removed their mass. After PyAutoLabs/PyAutoLens#870 the same call raises instead.

This switches the example to max_n=None, which sizes the arrays to the fullest plane. The batched call inherits it and sizes to the fullest plane across the batch. The docstring explains the trade-off: a fixed integer max_n avoids recompiling but must be big enough.

Merges after PyAutoLabs/PyAutoLens#870 (library first); max_n=None does not exist before it.

Sibling

autolens_workspace#681 (LOSSampler colossus) edits the same file, in other hunks: the sampler setup (lines ~101–150) and the batch coefficients (~406). This PR touches the __Convert to Padded Arrays__ docstring and lines 254/264 only.

Checks

  • Ran the full script on the PyAutoLens branch: Sampled 1100 LOS halos across 9 planes. / Padded to 304 slots per plane (1100 active slots across all planes). / batch of 8 images (8, 101, 101). Exit 0.

🤖 Generated with Claude Code

The fixed max_n=200 was below the fullest plane (300-380 halos with the
script's own settings), so halos were silently dropped; with the
PyAutoLens fix it would raise. max_n=None keeps every halo.

Refs PyAutoLabs/PyAutoLens#869

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the decision-taken Autonomous run took a flagged decision label Nov 19, 2026
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Decision taken (shift worker): the plan said to update max_n=200 if it overflows, but not how. I chose max_n=None (keeps every halo; arrays re-size per population, so a new draw may recompile) over a larger fixed integer such as 512 (fixed shape, but it can still overflow at lower m_min). If you would rather keep a fixed shape for the jit-reuse story, swap it for an integer and the docstring already explains the trade-off.

@Jammy2211
Jammy2211 merged commit fb91675 into main Nov 19, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/substructure-halo-arrays-overflow branch November 19, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

decision-taken Autonomous run took a flagged decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant