Skip to content

fix(windows): pass _wsopen_s only the permission bits it accepts and keep the isa flags for icx-cl - #2408

Merged
lusoris merged 1 commit into
masterfrom
fix/msvc-wsopen-pmode
Oct 7, 2026
Merged

lusoris merged 1 commit into
masterfrom
fix/msvc-wsopen-pmode

Conversation

@lusoris

@lusoris lusoris commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

BLUF: master's Windows builds crash in test_path_utf8 and test_output (0xc0000409) and the vmaf CLI tests exit 127 since #2393: _wsopen_s / _sopen_s treat a permission mode with bits other than _S_IREAD / _S_IWRITE as an invalid parameter and abort, and callers pass 0644. The mode is masked to those two bits (what _wopen effectively did). Found in the Windows ARM64 log of the next PR's run (job 112729402258).

Also in this PR: the -mavx2 family goes to every compiler but cl.exe (icx-cl needs it: its target-feature check of the intrinsics headers fails without, which broke the MSVC+SYCL leg), sycl/common.cpp calls VMAF_STRDUP, the last test narrowing (test_cambi.c, uint16 to uint8 store) is cast, and test_cambi.c replaces CAMBI_TEST_NULL_POINTER with NULL under ADR-1138.

Type

  • fix — bug fix

Checklist

  • Commits follow Conventional Commits.
  • mingw-w64 syntax check of the Windows branches; Linux suite unaffected (Windows-only code).
  • No SIMD/GPU arithmetic touched.

Bug-status hygiene

Netflix golden-data gate

  • I did not modify any assertAlmostEqual(...) score in the Netflix golden Python tests.

Deep-dive deliverables

  • Research digest — no digest needed: one-line fix.
  • Decision matrix — no alternatives: only-one-way fix (_wsopen_s is the non-deprecated spelling; masking keeps the old effective behaviour).
  • AGENTS.md invariant note — no rebase-sensitive invariants.
  • Reproducer / smoke-test command — below.
  • CHANGELOG fragment — changelog.d/fixed/windows-wsopen-pmode.md.
  • Rebase note — docs/rebase-notes.md.

Reproducer

Windows: python scripts\ci\run_meson_test.py -- -C build --suite fast; test_path_utf8 and test_output pass.

Known follow-ups

Windows MSVC+SYCL (icx-cl) leg warnings (-Woverriding-option, unused -experimental:c11atomics, __stdcall in the pthread shim) follow after #2401.

@lusoris
lusoris force-pushed the fix/msvc-wsopen-pmode branch from a966a1b to 4298a7c Compare October 7, 2026 12:35
…keep the isa flags for icx-cl (#2408)

* fix(windows): pass _wsopen_s only the permission bits it accepts and keep the isa flags for icx-cl

The first Windows run after #2393 crashed test_path_utf8 and test_output and
made the vmaf CLI tests exit 127: _wsopen_s and _sopen_s abort on a permission
mode with bits other than _S_IREAD and _S_IWRITE, and the callers pass POSIX
modes such as 0644 (_wopen ignored the rest). The mode is masked. The -mavx2
family is withheld from cl.exe only: icx-cl needs it for the intrinsics
headers' target-feature check. sycl/common.cpp calls _strdup through
VMAF_STRDUP, test_cambi.c casts the last uint16 to uint8 store and replaces
CAMBI_TEST_NULL_POINTER with NULL under ADR-1138.
@github-actions github-actions Bot added the type:bug Something isn't working label Oct 7, 2026
@lusoris
lusoris force-pushed the fix/msvc-wsopen-pmode branch from 4298a7c to 782acca Compare October 7, 2026 13:10
@lusoris
lusoris merged commit 782acca into master Oct 7, 2026
3 of 52 checks passed
@lusoris
lusoris deleted the fix/msvc-wsopen-pmode branch October 7, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant