Skip to content

perf(triangles): raise PointSolver MAX_CONTAINING_SIZE 15 → 20 (#583) - #584

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/pointsolver-mcs-headroom
Sep 27, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/pointsolver-mcs-headroom

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

This raises the JAX PointSolver's per-step containing-triangle cap MAX_CONTAINING_SIZE from 15 to 20 (phase 4c, #583). The cap silently truncates. The phase-4a sweep counted without it and found a maximum of 17 at step 0 on 1 of 200 prior draws, and a smaller grid (±2.5/0.4) already hits exactly 15. At 20 there are 3 triangles of headroom, and no draw exceeds the cap on any refinement step.

The value was chosen by the human from a measured A/B, run interleaved through solver_config_sweep.py --mcs-headroom:

  • RAL 8490H, job 358976 (loaded node; ratios between rows are valid): +6.2 % scalar (CI +5.0 to +8.5 %), +8.6 % at vmap-16, +7 % compile, +0.4 % temp memory.
  • A100, job 359102: 1.00×, compile +3.2 %.
  • Image sets, positions and log L are bit-identical on every prior, stress and stream draw. The fiducial 7.743201200876812 (A100 …806) is unchanged.
  • Gradients differ by at most 6.1e-14 relative. The padded (MCS, 2) shape changes the order of the backward sum.

API Changes

Changed default: autoarray.structures.triangles.array.MAX_CONTAINING_SIZE goes from 15 to 20. It is the default max_containing_size of ArrayTriangles and ArrayTriangles.for_limits_and_scale. JAX PointSolver outputs are padded to (20, 2) instead of (15, 2). No workspace, workspace_test or HowToLens script assumes the old shape.
See full details below.

Test Plan

  • New test_coordinate_jax.py::test__containing_set_above_the_old_cap_is_not_truncated[16|17]: a z → z**k lattice with k preimages strictly inside distinct triangles. It fails at 15 (keeps 15 of 16/17) and passes at 20. It also checks the with_vertices path.
  • The phase-4b fuzz, HLO guard and refinement tests pass; the triangle tests are 144/144.
  • PyAutoArray full suite: 1738 passed.
  • PyAutoLens full suite against this branch: 759 passed, 1 xfailed.
  • autolens_workspace_test point_source/jax_likelihood/* and point_source/jax_grad/gradient.py pass; the pinned −83.38049777774609 is unchanged.
  • Targeted point-source smoke: 31/31.
Full API Changes (for automation & release notes)

Changed Behaviour

  • autoarray.structures.triangles.array.MAX_CONTAINING_SIZE: 15 → 20. It is the default max_containing_size for ArrayTriangles(...) and ArrayTriangles.for_limits_and_scale(...). JAX PointSolver padded positions go from (15, 2) to (20, 2).

Part of #583.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

… phase 4c)

The JAX PointSolver keeps at most MAX_CONTAINING_SIZE containing triangles
per refinement step and truncates the rest silently. On 200 prior draws the
uncapped step-0 maximum was 17 (prior draw 12), so 15 was truncating. 20
clears it with margin; measured on RAL 8490H (job 358976) at +6.2 % scalar
median, compile +7.0 %, no image-set, position or log L change on any draw
and the fiducial log L bit-identical.

New test: a 16- and 17-sheet fold (the static lattice traced through z**k)
keeps every containing triangle under jit at the default, pads to (20,),
and the old cap of 15 passed explicitly drops some. Red at 15.

Refs #583

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PRs: PyAutoLabs/PyAutoLens#753 (companion library), PyAutoLabs/autolens_profiling#335 (profiling data)

@Jammy2211
Jammy2211 merged commit 9428eca into main Sep 27, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/pointsolver-mcs-headroom branch September 27, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant