Skip to content

Conversation

@WarrenWeckesser
Copy link
Member

@WarrenWeckesser WarrenWeckesser commented Oct 30, 2025

Over in #69, there were about 30 failures of the cyl_bessel_y() tests in the Windows CI job. This line

D:\a\xsf\xsf\tests\scipy_special_tests\test_cyl_bessel_y.cpp(42): FAILED:

appears 30 times in the log, and in each case the z input is 0. Apparently the culprit is somewhere in here:

xsf/include/xsf/bessel.h

Lines 963 to 970 in 33768a0

if (sign == -1) {
if (!detail::reflect_jy(&cy_y, v)) {
nz = amos::besj(z, v, kode, n, &cy_j, &ierr);
// F_FUNC(zbesj,ZBESJ)(CADDR(z), &v, &kode, &n, CADDR(cy_j), &nz, &ierr);
set_error_and_nan("yv(jv):", ierr_to_sferr(nz, ierr), cy_j);
cy_y = detail::rotate_jy(cy_y, cy_j, -v);
}
}

In this PR, I avoid that code by handling z=0+0j entirely in the first if-statemet where it checks for z = 0+0j. With this change, I don't see any of those cyl_bessel_y() test failures (but there are many others, so the Windows job still fails overall).

This change is not thoroughly checked, and is probably not the most elegant way to implement the calculation. I'm sure I'm duplicating functionality that should be in that code shown above, so I'm leaving this in draft status. I think this gets close to the correct behavior, so it might be useful for further investigation and debugging. Ideally the specific problem in the above code that occurs on Windows would be identified and fixed, and this PR closed without merging.

@WarrenWeckesser WarrenWeckesser marked this pull request as draft October 30, 2025 00:12
@WarrenWeckesser
Copy link
Member Author

WarrenWeckesser commented Oct 30, 2025

Edit: Moved comment to the top.

@WarrenWeckesser
Copy link
Member Author

@fbourgey, if you are interested in working on a "high value" issue, you could take a look at the failures of the CI Windows job. This PR is the beginning of an investigation of some of those failures.

My opening comment briefly explains what this PR is. What I found is that it appears that the code has different behaviors for a floating point input when that input is an even or odd integer. This hack attempts to handle that in a new block of code for the special case. Instead of this hack, it would be better to (a) verify that my (incomplete) understanding of the problem is close to correct, and (b) figure out why the existing implementation fails on Windows, and fix that. I hope it turns out to be a trivial fix, but I didn't dig deep enough to find it.

@fbourgey
Copy link
Member

@WarrenWeckesser, happy to investigate this. However, I do not have access to a Windows... so this is going to be difficult.

@WarrenWeckesser
Copy link
Member Author

@fbourgey, no problem. As you've found, there are plenty of other issues to work on in scipy & xsf.

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