Skip to content

[ci][windows] Fix all failing Windows tests: torch 2.7 pin, MSVC compile error, streaming-generator timeout, uv test - #64865

Merged
elliot-barn merged 3 commits into
masterfrom
windows-test-fixes
Jul 19, 2026
Merged

elliot-barn merged 3 commits into
masterfrom
windows-test-fixes

Conversation

@elliot-barn

@elliot-barn elliot-barn commented Jul 18, 2026 •

Copy link
Copy Markdown
Collaborator

Why are these changes needed?

Fixes all four Windows test failures on master postmerge (builds 18675/18684). Windows tests run only on release-automation-triggered postmerge builds, so these landed silently.

1. test_experimental_collective — torch gloo broken on Windows (pin torch 2.7.0)

Fails since #64257 bumped torch 2.7.0 → 2.9.0:

RuntimeError: makeDeviceForHostname(): unsupported gloo device

torch 2.8/2.9 stock Windows wheels are built without libuv, and gloo's TCP transport is Linux-only, so torch.distributed's gloo backend cannot initialize at all on Windows (pytorch/pytorch#150381). Fixed upstream via pytorch/gloo#472, shipped in torch 2.10 and explicitly not cherry-picked into 2.9.x. Ray's own postmerge bisection (builds 18569–18574) confirmed #64257 as first-bad; Linux/macOS are unaffected.

The windowsbuild image previously pip-installed its test deps constrained by requirements_compiled.txt directly, so there was no depset to override. This brings it under raydepsets (ci_windows.depsets.yaml), mirroring the relax/expand pattern from ci_data.depsets.yaml:

  • windows_tests_ci_depset_310 — compile requirements.txt + test-requirements.txt + dl-cpu-requirements.txt for windows/py3.10 constrained by requirements_compiled (same inputs build_base.sh used).
  • relaxed_windows_tests_ci_depset_310 — relax torch, torchvision, and the ABI-coupled PyG binaries.
  • windows_tests_torch27_ci_depset_310 — expand with python/requirements/windows-requirements.txt: torch==2.7.0, torchvision==0.22.0, and the +pt27cpu PyG local builds (explicit local tags because the relaxed lock still emits the torch-2.9.0 find-links and unsafe-best-match would otherwise re-pick +pt29cpu).

build_base.sh installs the final lock hash-stripped with --no-deps (same pattern as ci/ray_ci/macos/macos_ci.sh). The wanda srcs now key on the lock instead of the four requirements files. The final lock differs from the base resolution by exactly the six torch packages. Windows wheel builds are unaffected (hermetic uv run env in build-wheel-windows.sh). Delete windows-requirements.txt and the torch2.7 depsets once the repo-wide torch pin reaches ≥2.10.

2. generator_waiter_test — MSVC C2131 compile error (cpp tests job)

Broken since #64383: a by-ref-captured constexpr local used as an array bound inside a lambda is not a constant expression to MSVC. Make the test constants static constexpr.

3. test_streaming_generator — timeout, moved to the large shard

Passing Windows runs take ~296s against the moderate (300s) limit (build 18675: PASSED in 296.2s; build 18684: TIMEOUT at 300s in 2/2 attempts, dying mid-suite at test 21–22 of 23) — legitimately slow, not hung. The Windows job selects //python/ray/tests/... by path, so the size-tag move keeps Windows coverage.

4. test_runtime_env_uv::test_uv_with_version_and_check — pkg_resources removed

Use importlib.metadata instead of pkg_resources: virtualenv ≥21 (bumped in #64257) no longer seeds setuptools into the venvs Ray creates, and setuptools ≥83 removed pkg_resources entirely, so the test must not depend on it regardless of the virtualenv pin decision in #64739. Ray's non-test code has zero pkg_resources usage.

Related issue number

Root causes: upstream pytorch/pytorch#150381 (item 1); regressions introduced by #64257 (items 1, 4) and #64383 (item 2).

Checks

  • Not a duplicate: searched open PRs — none address the Windows gloo/torch failure, the MSVC break, or the streaming-generator timeout. [ci][deps] Pin virtualenv==20.29.1 to restore pkg_resources in runtime envs #64739 (virtualenv pin) is complementary: item 4 here makes the test independent of that decision.
  • Tests run locally: bazel run //ci/raydepsets:raydepsets -- build ci/raydepsets/configs/ci_windows.depsets.yaml (all depsets compile; final lock pins torch==2.7.0+cpu, diff vs base is exactly the six torch packages); bazel query confirms test_streaming_generator is a unique target with size = large; pre-commit passed on all changed files. Windows image build + test runs can only be validated in CI — watch windowsbuild (cold rebuild expected) and the Windows cpp/python test jobs on this PR.
  • AI assistance was used for this change (diagnosis and implementation); reviewed and submitted by a human.

🤖 Generated with Claude Code

…o collective tests)

test_experimental_collective fails on Windows since #64257 bumped torch
2.7.0 -> 2.9.0: torch 2.8/2.9 Windows wheels are built without libuv, and
gloo's TCP transport is Linux-only, so torch.distributed's gloo backend
cannot initialize ("makeDeviceForHostname(): unsupported gloo device",
pytorch/pytorch#150381; fixed upstream in torch 2.10, not cherry-picked
into 2.9.x).

The windowsbuild image previously pip-installed its test deps constrained
by requirements_compiled.txt directly, so it had no depset to override.
Bring it under raydepsets (ci_windows.depsets.yaml):

- windows_tests_ci_depset_310: compile requirements.txt +
  test-requirements.txt + dl-cpu-requirements.txt for windows/py3.10,
  constrained by requirements_compiled (same inputs build_base.sh used).
- relaxed_windows_tests_ci_depset_310: relax torch, torchvision and the
  ABI-coupled PyG binaries.
- windows_tests_torch27_ci_depset_310: expand with
  python/requirements/windows-requirements.txt pinning torch==2.7.0,
  torchvision==0.22.0 and the +pt27cpu PyG builds.

build_base.sh now installs the final lock (hash-stripped, --no-deps, same
pattern as macos_ci.sh). The lock differs from the base resolution by
exactly the torch six-pack. Delete windows-requirements.txt and the
torch2.7 depsets once the repo-wide torch pin reaches >=2.10.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn requested review from a team as code owners July 18, 2026 04:06

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Windows CI build environment to use a dependency lockfile instead of installing directly from raw requirements files. It pins PyTorch to version 2.7.0 and torchvision to 0.22.0 (along with compatible PyG extensions) on Windows to avoid a known issue in PyTorch 2.8/2.9 where the Gloo backend fails to initialize due to missing libuv support. Feedback was provided regarding the use of sed on Windows, where CRLF line endings could prevent trailing backslashes from being correctly stripped, and the potential unavailability of /tmp in some Windows container environments. A suggestion was made to strip carriage returns and use a local temporary file instead.

Comment on lines +29 to +32
sed 's/ \\$//; s/ --hash[^ ]*//g' \
python/deplocks/ci/windows-tests-torch27-ci_depset_py3.10.lock \
> /tmp/windows_tests_depset_no_hashes.txt
pip install -U --ignore-installed --no-deps -r /tmp/windows_tests_depset_no_hashes.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

On Windows, files are often checked out with CRLF (\r\n) line endings depending on the user's or CI's git configuration. If the lockfile has CRLF line endings, the $ anchor in sed 's/ \\$//' will not match the trailing backslash because of the carriage return (\r) character preceding the newline. This will prevent the backslashes from being stripped, causing pip install to fail with syntax or parsing errors.

Additionally, /tmp may not be guaranteed to exist or be writable in all Windows container environments. Writing to a local temporary file in the current working directory and cleaning it up afterward is more robust.

We can resolve both issues by stripping \r first and using a local temporary file.

Suggested change
sed 's/ \\$//; s/ --hash[^ ]*//g' \
python/deplocks/ci/windows-tests-torch27-ci_depset_py3.10.lock \
> /tmp/windows_tests_depset_no_hashes.txt
pip install -U --ignore-installed --no-deps -r /tmp/windows_tests_depset_no_hashes.txt
sed 's/\\r//g; s/ \\$//; s/ --hash[^ ]*//g' \
python/deplocks/ci/windows-tests-torch27-ci_depset_py3.10.lock \
> windows_tests_depset_no_hashes.txt
pip install -U --ignore-installed --no-deps -r windows_tests_depset_no_hashes.txt
rm windows_tests_depset_no_hashes.txt

@elliot-barn elliot-barn added the go add ONLY when ready to merge, run all tests label Jul 18, 2026
@ray-gardener ray-gardener Bot added core Issues that should be addressed in Ray Core devprod labels Jul 18, 2026
Three independent Windows-only breaks, all verified against postmerge
builds 18675/18684:

- generator_waiter_test.cc: MSVC C2131 — a by-ref-captured constexpr
  local used as an array bound inside a lambda is not a constant
  expression to MSVC. Make the test constants static constexpr. Broken
  since #64383.

- test_streaming_generator: move from the medium to the large shard.
  Passing Windows runs take ~296s against the moderate 300s limit
  (build 18675: PASSED in 296.2s; build 18684: TIMEOUT at 300s in 2/2
  attempts, mid-suite at test 21-22 of 23) — it is slow, not hung.

- test_runtime_env_uv::test_uv_with_version_and_check: use
  importlib.metadata instead of pkg_resources. virtualenv >= 21 (bumped
  in #64257) no longer seeds setuptools into the venvs Ray creates, and
  setuptools >= 83 removed pkg_resources entirely, so the test must not
  depend on it regardless of the virtualenv pin decision in #64739.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn elliot-barn changed the title [ci][windows] Pin torch 2.7.0 on Windows via raydepsets lock (fix gloo collective tests) [ci][windows] Fix all failing Windows tests: torch 2.7 pin, MSVC compile error, streaming-generator timeout, uv test Jul 18, 2026
The Windows cpp-tests job enumerates //src/... test targets explicitly,
and Bazel errors on explicitly-requested incompatible targets
('command succeeded, but not all targets were analyzed'). The four
RocksDB store-client tests are target_compatible_with linux but were
missing the no_windows tag the job filters on —
chaos_redis_store_client_test in the same file shows the convention.

This was the second, previously-masked failure in the Windows cpp job:
postmerge build 18688 shows generator_waiter_test now compiling and
passing on Windows, with only this analysis error remaining.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
@elliot-barn
elliot-barn merged commit bf5f256 into master Jul 19, 2026
3 checks passed
@elliot-barn
elliot-barn deleted the windows-test-fixes branch July 19, 2026 04:09
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…ile error, streaming-generator timeout, uv test (ray-project#64865)

## Why are these changes needed?

Fixes all four Windows test failures on master postmerge (builds
18675/18684). Windows tests run only on release-automation-triggered
postmerge builds, so these landed silently.

### 1. `test_experimental_collective` — torch gloo broken on Windows
(pin torch 2.7.0)

Fails since ray-project#64257 bumped torch `2.7.0 → 2.9.0`:

```
RuntimeError: makeDeviceForHostname(): unsupported gloo device
```

torch 2.8/2.9 stock Windows wheels are built **without libuv**, and
gloo's TCP transport is Linux-only, so `torch.distributed`'s gloo
backend cannot initialize at all on Windows (pytorch/pytorch#150381).
Fixed upstream via pytorch/gloo#472, shipped in torch **2.10** and
explicitly not cherry-picked into 2.9.x. Ray's own postmerge bisection
(builds 18569–18574) confirmed ray-project#64257 as first-bad; Linux/macOS are
unaffected.

The windowsbuild image previously pip-installed its test deps
constrained by `requirements_compiled.txt` directly, so there was no
depset to override. This brings it under raydepsets
(`ci_windows.depsets.yaml`), mirroring the relax/expand pattern from
`ci_data.depsets.yaml`:

- `windows_tests_ci_depset_310` — compile `requirements.txt` +
`test-requirements.txt` + `dl-cpu-requirements.txt` for windows/py3.10
constrained by `requirements_compiled` (same inputs `build_base.sh`
used).
- `relaxed_windows_tests_ci_depset_310` — relax torch, torchvision, and
the ABI-coupled PyG binaries.
- `windows_tests_torch27_ci_depset_310` — expand with
`python/requirements/windows-requirements.txt`: `torch==2.7.0`,
`torchvision==0.22.0`, and the `+pt27cpu` PyG local builds (explicit
local tags because the relaxed lock still emits the torch-2.9.0
find-links and unsafe-best-match would otherwise re-pick `+pt29cpu`).

`build_base.sh` installs the final lock hash-stripped with `--no-deps`
(same pattern as `ci/ray_ci/macos/macos_ci.sh`). The wanda srcs now key
on the lock instead of the four requirements files. The final lock
differs from the base resolution by exactly the six torch packages.
Windows **wheel** builds are unaffected (hermetic `uv run` env in
`build-wheel-windows.sh`). Delete `windows-requirements.txt` and the
torch2.7 depsets once the repo-wide torch pin reaches ≥2.10.

### 2. `generator_waiter_test` — MSVC C2131 compile error (cpp tests
job)

Broken since ray-project#64383: a by-ref-captured `constexpr` local used as an
array bound inside a lambda is not a constant expression to MSVC. Make
the test constants `static constexpr`.

### 3. `test_streaming_generator` — timeout, moved to the large shard

Passing Windows runs take ~296s against the moderate (300s) limit (build
18675: PASSED in 296.2s; build 18684: TIMEOUT at 300s in 2/2 attempts,
dying mid-suite at test 21–22 of 23) — legitimately slow, not hung. The
Windows job selects `//python/ray/tests/...` by path, so the size-tag
move keeps Windows coverage.

### 4. `test_runtime_env_uv::test_uv_with_version_and_check` —
pkg_resources removed

Use `importlib.metadata` instead of `pkg_resources`: virtualenv ≥21
(bumped in ray-project#64257) no longer seeds setuptools into the venvs Ray
creates, and setuptools ≥83 removed `pkg_resources` entirely, so the
test must not depend on it regardless of the virtualenv pin decision in
ray-project#64739. Ray's non-test code has zero pkg_resources usage.

## Related issue number

Root causes: upstream pytorch/pytorch#150381 (item 1); regressions
introduced by ray-project#64257 (items 1, 4) and ray-project#64383 (item 2).

## Checks

- Not a duplicate: searched open PRs — none address the Windows
gloo/torch failure, the MSVC break, or the streaming-generator timeout.
ray-project#64739 (virtualenv pin) is complementary: item 4 here makes the test
independent of that decision.
- Tests run locally: `bazel run //ci/raydepsets:raydepsets -- build
ci/raydepsets/configs/ci_windows.depsets.yaml` (all depsets compile;
final lock pins `torch==2.7.0+cpu`, diff vs base is exactly the six
torch packages); `bazel query` confirms `test_streaming_generator` is a
unique target with `size = large`; `pre-commit` passed on all changed
files. Windows image build + test runs can only be validated in CI —
watch `windowsbuild` (cold rebuild expected) and the Windows cpp/python
test jobs on this PR.
- AI assistance was used for this change (diagnosis and implementation);
reviewed and submitted by a human.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: elliot-barn <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
Signed-off-by: 400Ping <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core devprod go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant