[PR #4974] [Engine] tests: the three files that set env variables do not compile on Windows (setenv is POSIX) #5274

Open
opened 2026-11-07 16:33:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4974
Author: @thatbuzzguy
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/windows-test-env-guard


📝 Commits (1)

  • 25764b0 Tests: the parity and bench files that set env variables do not compile on Windows (setenv is POSIX)

📊 Changes

3 files changed (+36 additions, -6 deletions)

View changed files

📝 bench/gdn_chunk_bench.cpp (+10 -2)
📝 src/kernels/gdn_chunk_parity.cpp (+10 -2)
📝 src/kernels/hc_persist_parity.cpp (+16 -2)

📄 Description

Draft — the CUDA-gated targets cannot be compiled here; see Not run.

Problem and result: three files call POSIX setenv/unsetenv, which no Windows C runtime declares:
src/kernels/hc_persist_parity.cpp (lines 55-56), src/kernels/gdn_chunk_parity.cpp,
bench/gdn_chunk_bench.cpp. On Windows the affected targets fail to compile, so ctest never runs
hc_persist_parity or hc_persist_default_off. With the guard all three compile and both entries run.

Related discussion: #3093 (closed; the guard it proposed is still not in the file at HEAD). #3093 covers
only hc_persist_parity.cpp — the other two files make the same calls.

Approach: the same #if defined(_WIN32) helper the repository already uses in one of the two shapes it
already has — set_env as in src/kernels/decode_cluster_parity.cpp, put/unset as in
src/prefill/kva_test.cpp. _putenv_s(name, "") removes the variable on Windows, which is what --off
needs: the reader is v != nullptr && std::atoi(v) != 0 (src/kernels/cuda/fused_gr.cu:3156), so an empty
value reads as off. No engine path changes.

Validation:
Passed: HIP build with tests on an RX 7600 XT (gfx1102), ROCm 10.2.0a20260930, clang 24.0.0 with the
MSVC CRT (not MSVC itself). tools\hip\build_windows.bat tests → 250 targets, no error.
ctest --test-dir build-hip-gfx1102 --output-on-failure --timeout 120 -E '^(ple_parity|platform_memory_test)$'
→ 167 passed, 5 failed, 10 not run; hc_persist_parity and hc_persist_default_off passed.
The same build before the change stopped at hc_persist_parity.cpp:55: use of undeclared identifier 'unsetenv'
(log: build-gfx1102-run1.log).
Failed: none observed for this change.
Not run: MSVC compilation of the three files; the CUDA build — gdn_chunk_parity and gdn_chunk_bench
are gated on STRATA_ENABLE_CUDA, so they were never compiled or registered on this machine, and their
behavior after the change is unverified.

Limits: test compilation only. The CUDA check needs a machine with a CUDA toolchain.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4974 **Author:** [@thatbuzzguy](https://github.com/thatbuzzguy) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/windows-test-env-guard` --- ### 📝 Commits (1) - [`25764b0`](https://github.com/Niko1221/Strata/commit/25764b024c55c2fdb7f39a6fb03664f95bfc92db) Tests: the parity and bench files that set env variables do not compile on Windows (setenv is POSIX) ### 📊 Changes **3 files changed** (+36 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `bench/gdn_chunk_bench.cpp` (+10 -2) 📝 `src/kernels/gdn_chunk_parity.cpp` (+10 -2) 📝 `src/kernels/hc_persist_parity.cpp` (+16 -2) </details> ### 📄 Description Draft — the CUDA-gated targets cannot be compiled here; see Not run. Problem and result: three files call POSIX setenv/unsetenv, which no Windows C runtime declares: src/kernels/hc_persist_parity.cpp (lines 55-56), src/kernels/gdn_chunk_parity.cpp, bench/gdn_chunk_bench.cpp. On Windows the affected targets fail to compile, so ctest never runs `hc_persist_parity` or `hc_persist_default_off`. With the guard all three compile and both entries run. Related discussion: #3093 (closed; the guard it proposed is still not in the file at HEAD). #3093 covers only hc_persist_parity.cpp — the other two files make the same calls. Approach: the same `#if defined(_WIN32)` helper the repository already uses in one of the two shapes it already has — `set_env` as in src/kernels/decode_cluster_parity.cpp, `put`/`unset` as in src/prefill/kva_test.cpp. `_putenv_s(name, "")` removes the variable on Windows, which is what `--off` needs: the reader is `v != nullptr && std::atoi(v) != 0` (src/kernels/cuda/fused_gr.cu:3156), so an empty value reads as off. No engine path changes. Validation: Passed: HIP build with tests on an RX 7600 XT (gfx1102), ROCm 10.2.0a20260930, clang 24.0.0 with the MSVC CRT (not MSVC itself). `tools\hip\build_windows.bat tests` → 250 targets, no error. `ctest --test-dir build-hip-gfx1102 --output-on-failure --timeout 120 -E '^(ple_parity|platform_memory_test)$'` → 167 passed, 5 failed, 10 not run; `hc_persist_parity` and `hc_persist_default_off` passed. The same build before the change stopped at `hc_persist_parity.cpp:55: use of undeclared identifier 'unsetenv'` (log: build-gfx1102-run1.log). Failed: none observed for this change. Not run: MSVC compilation of the three files; the CUDA build — `gdn_chunk_parity` and `gdn_chunk_bench` are gated on STRATA_ENABLE_CUDA, so they were never compiled or registered on this machine, and their behavior after the change is unverified. Limits: test compilation only. The CUDA check needs a machine with a CUDA toolchain. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5274
No description provided.