Skip to content

Feature/solve nan - #626

Merged
marcschefer merged 5 commits into
developfrom
feature/solve_nan
Dec 3, 2025
Merged

marcschefer merged 5 commits into
developfrom
feature/solve_nan

Conversation

@mkuemmel

Copy link
Copy Markdown
Collaborator

Checked it also on Raphael's dataset. And it does identify the bad apples.

@mkuemmel

Copy link
Copy Markdown
Collaborator Author

Perfect, also the check now happens earlier:

2025-09-26T19:42:03CEST BackgroundModel  INFO : Background for image: Masked(Masked(ProcessedImage(BufferedImage(/project/ls-mohr/users/martin.kuemmel/cluster_sepp_example/CORR-0268528-102.fits),ConstantImage<2048,4176>(0.070091))) with 0.0% weight image masked pixels;) with 38.0% weight image masked pixels; median: 0.0968899 rms: 4.06483!
2025-09-26T19:42:05CEST PsfPlugin ERROR : Failed loading a psf file: /project/ls-mohr/users/martin.kuemmel/cluster_sepp_example/CORR-0091740-102.psf
2025-09-26T19:42:05CEST SourceXtractor FATAL : Malformed variable PSF, coefficient matrices contains NANs
2025-09-26T19:42:05CEST Python::Interpreter  INFO : Python GIL acquired 63 times
INFO:    Cleaning up image.

@mkuemmel

Copy link
Copy Markdown
Collaborator Author

With only the good PSFEx files everything is golden:

bash-5.1$ tail euclid_slurm.usm-cl-bt01n2.11443608.err
2025-09-27T07:37:09CEST Progress  INFO : Elapsed: 10:29:39
2025-09-27T07:37:09CEST SourceXtractor  INFO : total 189544 sources detected
2025-09-27T07:37:09CEST ElementsProgram  INFO : ##########################################################
2025-09-27T07:37:09CEST ElementsProgram  INFO : #
2025-09-27T07:37:09CEST ElementsProgram  INFO : #  C++ program:  sourcextractor++ stops 
2025-09-27T07:37:09CEST ElementsProgram  INFO : #
2025-09-27T07:37:09CEST ElementsProgram  INFO : ##########################################################
2025-09-27T07:37:09CEST ElementsProgram  INFO : ##########################################################
2025-09-27T07:37:09CEST Python::Interpreter  INFO : Python GIL acquired 63 times
INFO:    Cleaning up image...

That was: 10 true cores, 20GB RAM and 10h run time.

@marcschefer
marcschefer merged commit 16f3e29 into develop Dec 3, 2025
6 checks passed
@marcschefer
marcschefer deleted the feature/solve_nan branch December 3, 2025 13:42
@embray

embray commented Oct 27, 2026

Copy link
Copy Markdown

Unfortunately, as I've discovered while continuing to try to fix #649, this is not a complete fix. Even with the type punning modern versions of clang are clever enough to recognize this pattern. It "reasons", "x was a float, so even if we're punning it as an integer, because -ffast-math NaNs do not exist so this bit pattern should never be found in a float either". At least that appears to be what's happening because on my experiments with compiling with newer clang (21.1.0, from conda in my case) this check is completely compiled out on release builds.

One workaround is to compile with -fno-finite-math-only and do accept that Nan/Inf can exist and must be dealt with appropriately. I am also experimenting with some possible more targeted approaches.

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.

3 participants