Skip to content

fix: missed extra pin in CI tests#169

Merged
beckermr merged 11 commits intomainfrom
beckermr-patch-2
Feb 7, 2026
Merged

fix: missed extra pin in CI tests#169
beckermr merged 11 commits intomainfrom
beckermr-patch-2

Conversation

@beckermr
Copy link
Collaborator

@beckermr beckermr commented Feb 7, 2026

We may need to revisit the RNG thing.

Removed temporary pin for jax package version.
@beckermr
Copy link
Collaborator Author

beckermr commented Feb 7, 2026

cc @EiffL

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

arf

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

Ok, some tests are failing, is it just a matter of re-exporting random numbers for the new JAX RNG implementation? If so, I can do that.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 7, 2026

Merging this PR will degrade performance by 36.8%

❌ 1 regressed benchmark
✅ 30 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
test_benchmarks_lanczos_interp[xval-conserve_dc-run] 721.6 µs 1,141.6 µs -36.8%

Comparing beckermr-patch-2 (10bc944) with main (fc125cf)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (10bc944) during the generation of this report, so fc125cf was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@beckermr
Copy link
Collaborator Author

beckermr commented Feb 7, 2026

Yes. Also there are some xfail tests that appear to be fixed with the latest galsim. We should figure out which version that was, use that as the galsim lower bound, and remove the xfail marker.

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

Cool, on it, I'll push here, and try to make this branch pass the tests

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

Ok this first batch of fixes above addresses the following:

  • bump the galsim version, and now allow tests to pass

  • fixes the interpolated image and jitting tests, with the following rationale:
    test_jitting_draw_phot / test_jitting_draw_phot_fixed: Changed n += 1 to n += 4 in the two
    photon-shooting tests. The image was barely large enough -- with the new RNG, 1 out of 1100
    photons landed outside the 57x57 image. With n += 4 (60x60 pixels), all photons land inside and
    the exact assertion sum == 1100.0 passes. The test's purpose (JIT correctness) is unchanged,
    zero precision loss.

    test_interpolatedimage_interpolant_sample: Changed the seed from 1234 to 999. With seed 1234,
    Lanczos(7)'s sparse tail bins had a max deviation of 24.84 sigma (vs threshold 15.0) -- just
    bad luck in the random draw. With seed 999, all 7 interpolants pass comfortably (max sparse
    deviation 7.51 sigma for Lanczos(7)). Tolerances remain at the original 5.0/15.0, zero
    precision loss.

some additional fixes remain to apply

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

This last commit fixes the random noise test with a local hook that overrides the hard coded values. If this works we should open a separate PR for galsim to update the following values:

    if str(module_path).endswith("tests/GalSim/tests/test_random.py"):
        module.obj.uResult = (0.0303194914, 0.0910759047, 0.1208923360)
        module.obj.gResult = (-1.3035798312, 0.4306917482, 0.9542795210)
        module.obj.bResult = (7, 6, 7)
        module.obj.pResult = (5, 8, 6)
        module.obj.wResult = (3.7699892848, 5.0030654033, 5.3921485618)
        module.obj.gammaResult = (0.7985896238, 22.0508132116, 33.1369864688)
        module.obj.chi2Result = (19.2174896025, 47.3448788104, 55.8177548146)

But this can be done separately.

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

ok, only 2 failing tests left.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will become obsolete once the PR in galsim is merged, and we can remove it then

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment. We still need some of the fixtures here even if the PR on galsim is merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry, I mean these edits I made were redundant with the values I later on updated directly on Galsim

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

Alright, I've made modifs on the GalSim repo here and temporarily changed the pointer of the submodule to my branch: GalSim-developers/GalSim#1344

NOTE: We should revert back the submodule pointer to fix_tests once we have demonstrated that these fixes pass all the tests.

EiffL and others added 3 commits February 7, 2026 21:29
Co-authored-by: Matthew R. Becker <beckermr@users.noreply.github.com>
@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

I've switched the submodule back to point to the fix_tests branch, and did some minor cleanup, if this turns green, it should be all good to merge

@beckermr beckermr marked this pull request as ready for review February 7, 2026 20:42
@beckermr beckermr enabled auto-merge February 7, 2026 20:42
@beckermr beckermr disabled auto-merge February 7, 2026 20:43
@beckermr
Copy link
Collaborator Author

beckermr commented Feb 7, 2026

@EiffL the module level override for the test values is a pretty good. Should we switch to that to make future updates easier and less intrusive in galsim?

@beckermr
Copy link
Collaborator Author

beckermr commented Feb 7, 2026

I mention it because the rng results are less stable than the other changes.

@EiffL
Copy link
Member

EiffL commented Feb 7, 2026

I think that would be a good idea, but that requires some refactoring of the current test modifications in galsim. I couldn't use the hooks everywhere because they only work on module level variables, but a number of parameters are hard coded inside functions and we can't access them.

So I think it would be a wortwhile endeavor, but an additional/seperate task; we only need to change the galsim tests no modifications are needed here, until the next time JAX changes their RNG

@beckermr beckermr enabled auto-merge February 7, 2026 21:55
@beckermr beckermr merged commit 6ee8441 into main Feb 7, 2026
4 checks passed
@beckermr beckermr deleted the beckermr-patch-2 branch February 7, 2026 22:07
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.

2 participants