Skip to content

TST: add 3.15t win32 CI and fix issues seen in that build - #31607

Merged
charris merged 13 commits into
numpy:mainfrom
ngoldbaum:3.15t-win32-ci
Jun 15, 2026
Merged

charris merged 13 commits into
numpy:mainfrom
ngoldbaum:3.15t-win32-ci

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

Adds win32 3.15t CI and fixes issues seen in the numpy-release automation. I also enabled "full" tests using the same test command as the windows wheel builder.

The Cython issues were reported upstream in cython/cython#7742 and will be fixed in the next Cython release.

I adjusted tests that run meson to use a new helper that embeds debug info into the pytest failure message. That way debug output is no longer swallowed by pytest-xdist and we'll see errors in CI.

Fixed an issue in the cython tests that led to file paths longer than MAX_PATH so I updated the tests to copy the build tree to generate shorter paths.

Disabled test_dirichlet_moderately_small_alpha on 32 bit builds. 458 MiB is almost 10% of a 32 bit address space and on a test runner with 4 workers it's possible or even likely for memory to get sufficiently fragmented such that this test triggers OOM errors. mimalloc and the free-threaded build might make this situation worse?

ping @seberg @charris since this got reasonably involved.

I used Claude Fable 5 to help with this PR.

@ngoldbaum
ngoldbaum force-pushed the 3.15t-win32-ci branch 4 times, most recently from 895a079 to 21c7b46 Compare June 11, 2026 18:57
@charris

charris commented Jun 11, 2026

Copy link
Copy Markdown
Member

You may want to disable most of the other tests just to speed things up.

@ngoldbaum

Copy link
Copy Markdown
Member Author

It looks like there are a bunch of other issues related to Cython that the wheel builder job doesn't hit. I'll have to dig in to see what's happening there...

@ngoldbaum

Copy link
Copy Markdown
Member Author

cython/cython#7742 is the cause of the cython crashes

@ngoldbaum
ngoldbaum marked this pull request as ready for review June 12, 2026 19:29
@ngoldbaum ngoldbaum changed the title TST: add 3.15t win32 CI to debug issue seen in wheel builds TST: add 3.15t win32 CI and fix issues seen in that build Jun 12, 2026
@charris

charris commented Jun 12, 2026 •

Copy link
Copy Markdown
Member

This looks pretty straight forward. Because we will be supporting 3.15 in 2.5.x, it would probably make things easier if we backported these fixups when they are ready, we don't need to create wheels for them.

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Jun 12, 2026
@charris

charris commented Jun 12, 2026

Copy link
Copy Markdown
Member

Note to self: backport Cython update when it happens.

@charris

charris commented Jun 12, 2026

Copy link
Copy Markdown
Member

I note that the DeprecationWarnings are still being captured. Any plans for that?

@ngoldbaum

ngoldbaum commented Jun 12, 2026 •

Copy link
Copy Markdown
Member Author

That is a different bug in how those warnings are generated that requires tricky C fixes, I'll open a separate PR with what Claude came up with.

@ngoldbaum

Copy link
Copy Markdown
Member Author

I opened #31617 for the datetime/timedelta warnings.

@seberg seberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems good, but maybe Chuck wants to look at something. I think it is worth making that helper not meson specific even if we mostly/only use it for meson subprocess runs right now.

But generally looks all good and basically ready to merge.

Comment thread numpy/testing/_private/utils.py Outdated
return wrapper


def run_meson(args, build_dir):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like the idea of adding a helper, we have a few places that work around it, but even assigning to locals, pytest may not print enough to make out exactly.

How about renaming it, dunno maybe check_subprocess() and not including the "meson" so that we can use it for all such tests.

@pytest.mark.skipif(
not IS_64BIT,
reason="the 458 MiB sample array may not fit in a 32-bit "
"address space fragmented by earlier tests")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds fine, thanks, doesn't seem worth skipping only if allocation fails for this.

# meson refers to sources via paths relative to the build dir, and on
# Windows the unnormalized cwd + `..` chain joining the deeply nested
# pytest tmp dir and site-packages can exceed MAX_PATH, failing the
# compile with "Cannot open source file".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fun when we actually pass the absolute dir, I guess.

Comment thread .github/workflows/windows.yml Outdated
run: |
cd tools
python -m pytest --pyargs numpy -m "not slow" -n2 --timeout=600 --durations=10
python -c "import sys; import numpy; sys.exit(not numpy.test(label='full', extra_argv=['-n=auto', '--durations=10', '--timeout=600']))"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change seems unnecessary? I get it that the cibw_test_command uses it but diverging the way we run them here feels confusing.

# Cython's constant immortalization passes UINT32_MAX through a Py_ssize_t,
# which aborts module init on 32-bit free-threaded builds when asserts are
# enabled. See https://github.com/cython/cython/issues/7742.
extra_c_args += ['-DCYTHON_IMMORTAL_CONSTANTS=0']

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could mention that it should be fixed by Cython 3.2.6, but doesn't matter much.

@charris
charris merged commit 4cbd55f into numpy:main Jun 15, 2026
85 of 87 checks passed
@charris

charris commented Jun 15, 2026

Copy link
Copy Markdown
Member

Let's get this in. There are ways to avoid long, long lines in yml, but we can live with a few.

@charris

charris commented Jun 15, 2026

Copy link
Copy Markdown
Member

Thanks Nathan.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jun 18, 2026
charris added a commit that referenced this pull request Jun 18, 2026
charris added a commit that referenced this pull request Jun 18, 2026
TST: add 3.15t win32 CI and fix issues seen in that build (#31607)
ngoldbaum added a commit to ngoldbaum/numpy that referenced this pull request Aug 4, 2026
Partial backport of the numpy/testing/_private/utils.py hunk of numpy#31607,
needed by the multithreaded tests added in numpy#31682.

(cherry picked from commit 4cbd55f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants