Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(windows): drop global /arch:AVX2 and link MS onnxruntime.dll so the app launches on non-AVX2 CPUs

Ezra Ellette4f659ace9757
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 6214574e1..dcb2928b4 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -316,8 +316,12 @@ jobs:
~/.cargo/git/db/
target/${{ matrix.target }}
apps/screenpipe-app-tauri/src-tauri/target
- # Shared cache across branches
- shared-key: "rust-cache-${{ matrix.target }}"
+ # Shared cache across branches. v2 epoch: flushes objects compiled
+ # under the old global CFLAGS/CXXFLAGS=/arch:AVX2 (and any stale
+ # pre-April AVX-512 LTCG objects) — cc/cmake outputs are NOT keyed
+ # on those env vars, so without the bump the first post-fix build
+ # could silently reuse AVX2-poisoned objects.
+ shared-key: "rust-cache-v2-${{ matrix.target }}"
# Save cache even on failed builds
save-if: true
@@ -327,9 +331,10 @@ jobs:
path: |
target/${{ matrix.target }}/release
apps/screenpipe-app-tauri/src-tauri/target/release
- key: ${{ runner.os }}-artifacts-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
+ # v2 epoch: see rust-cache shared-key above (AVX2 flag change).
+ key: ${{ runner.os }}-artifacts-v2-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
- ${{ runner.os }}-artifacts-${{ matrix.target }}-
+ ${{ runner.os }}-artifacts-v2-${{ matrix.target }}-
- name: Verify Cargo toolchain
shell: bash
@@ -376,9 +381,11 @@ jobs:
apps/screenpipe-app-tauri/node_modules
apps/screenpipe-app-tauri/.tauri
apps/screenpipe-app-tauri/src-tauri/target
- key: ${{ matrix.platform }}-${{ matrix.target }}-node-${{ hashFiles('**/bun.lockb') }}
+ # node-v2 epoch: this cache also holds src-tauri/target (compiled
+ # objects) — flush alongside the rust caches for the AVX2 flag change.
+ key: ${{ matrix.platform }}-${{ matrix.target }}-node-v2-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
- ${{ matrix.platform }}-${{ matrix.target }}-node-
+ ${{ matrix.platform }}-${{ matrix.target }}-node-v2-
- name: Install dependencies
if: matrix.os_type == 'macos'
@@ -452,8 +459,8 @@ jobs:
if: matrix.os_type == 'windows'
uses: ilammy/msvc-dev-cmd@v1
- # `tauri.windows.conf.json` bundles `onnxruntime*\lib\onnxruntime.dll`
- # as a Tauri resource. Without this file in place at build time,
+ # `tauri.windows.conf.json` bundles `onnxruntime*\lib\*.dll`
+ # as a Tauri resource. Without a matching file in place at build time,
# tauri_build::build() inside the screenpipe-app build script panics
# with `glob pattern ... didn't match any files`, killing the cargo
# build before it can even compile our crate. The ORT setup that used
@@ -476,26 +483,56 @@ jobs:
# runtime (ONNX init fails: VAD/diarization/PII broken). Match ci.yml's
# 1.24.2. See #4173/#4176.
$version = '1.24.2'
- $url = "https://github.com/microsoft/onnxruntime/releases/download/v$version/onnxruntime-win-$arch-$version.zip"
- $zipFile = "onnxruntime-win-$arch-$version.zip"
$extractDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-$arch-$version"
- Invoke-WebRequest -Uri $url -OutFile $zipFile
if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }
- 7z x $zipFile -o"apps/screenpipe-app-tauri/src-tauri/" -y
- Write-Host "ONNX Runtime extracted to $extractDir"
- Get-ChildItem "$extractDir/lib" | ForEach-Object { Write-Host $_.Name }
- # ARM64 has no pyke prebuilt and load-dynamic hangs with ort rc.12
- # (#4173/#4176), so link the MS DLL at build time. ort-sys's `system`
- # strategy wants the dir that DIRECTLY contains onnxruntime.lib — the
- # `lib` subdir, not the extract root. Set these ONLY for ARM64; x64
- # must stay on download-binaries (no ORT_STRATEGY/ORT_LIB_LOCATION).
- if ($arch -eq 'arm64') {
- $libDir = (Resolve-Path "$extractDir/lib").Path
- "ORT_STRATEGY=system" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- "ORT_LIB_LOCATION=$libDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- "$libDir" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
- Write-Host "ARM64: ORT_STRATEGY=system, ORT_LIB_LOCATION=$libDir"
+ if ($arch -eq 'x64') {
+ # DirectML flavor of the OFFICIAL MS build: baseline SSE2 + MLAS runtime
+ # CPUID dispatch (full AVX2 speed on modern CPUs, no crash on old ones),
+ # DML EP for parakeet/PII. pyke's download-binaries static libs are
+ # compiled /arch:AVX2 since Oct 2025 and caused 0xc000001d at launch on
+ # pre-Haswell CPUs (ort sessions are created on the audio boot path at
+ # every app launch).
+ $dmlOrtVersion = $version
+ $dmlVersion = '1.15.4'
+ Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.ML.OnnxRuntime.DirectML/$dmlOrtVersion" -OutFile ort-dml.zip
+ Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/$dmlVersion" -OutFile directml.zip
+ 7z x ort-dml.zip -oort-dml -y
+ 7z x directml.zip -odirectml -y
+ New-Item -ItemType Directory -Force -Path "$extractDir/lib" | Out-Null
+ Copy-Item "ort-dml/runtimes/win-x64/native/onnxruntime.dll" "$extractDir/lib/"
+ Copy-Item "ort-dml/runtimes/win-x64/native/onnxruntime.lib" "$extractDir/lib/"
+ Copy-Item "directml/bin/x64-win/DirectML.dll" "$extractDir/lib/"
+ } else {
+ # ARM64: MS official CPU build (pyke ships no arm64 prebuilt). Extract
+ # the zip to a scratch dir, then stage a CONTROLLED lib/ containing
+ # exactly onnxruntime.dll + onnxruntime.lib. The tauri resource glob
+ # (onnxruntime*\lib\*.dll) must bundle exactly the same DLL set the
+ # old per-file glob shipped — the MS zip's lib/ has extra DLLs
+ # (providers_shared etc.) that were never bundled and must stay out.
+ $url = "https://github.com/microsoft/onnxruntime/releases/download/v$version/onnxruntime-win-$arch-$version.zip"
+ $zipFile = "onnxruntime-win-$arch-$version.zip"
+ Invoke-WebRequest -Uri $url -OutFile $zipFile
+ 7z x $zipFile -oort-mszip -y
+ New-Item -ItemType Directory -Force -Path "$extractDir/lib" | Out-Null
+ Copy-Item "ort-mszip/onnxruntime-win-$arch-$version/lib/onnxruntime.dll" "$extractDir/lib/"
+ Copy-Item "ort-mszip/onnxruntime-win-$arch-$version/lib/onnxruntime.lib" "$extractDir/lib/"
}
+ # Import-table (load-time) link against the MS DLL for BOTH arches:
+ # pyke's static prebuilt is AVX2-only on x64, and pyke has no arm64
+ # build. Load-time linking ≠ ort's `load-dynamic` feature (runtime
+ # LoadLibrary, which deadlocks with ort rc.12 — #4171/#4173); this is
+ # the exact mechanism ARM64 already shipped with. ort-sys's build
+ # script wants the dir that DIRECTLY contains onnxruntime.lib.
+ # ORT_PREFER_DYNAMIC_LINK=1 makes ort-sys emit `rustc-link-lib=
+ # onnxruntime` (dynamic import) instead of attempting a static link
+ # (see ort-sys build/main.rs:45-51 + build/dynamic_link.rs:6-11).
+ $libDir = (Resolve-Path "$extractDir/lib").Path
+ "ORT_STRATEGY=system" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
+ "ORT_LIB_LOCATION=$libDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
+ "ORT_PREFER_DYNAMIC_LINK=1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
+ "$libDir" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
+ Write-Host "${arch}: ORT_LIB_LOCATION=$libDir (dynamic import link)"
+ Get-ChildItem "$extractDir/lib"
- name: Install Ninja (ARM64)
if: matrix.os_type == 'windows' && matrix.target == 'aarch64-pc-windows-msvc'
@@ -868,31 +905,47 @@ jobs:
CARGO_PROFILE_RELEASE_STRIP: none
CARGO_PROFILE_RELEASE_PANIC: abort
CARGO_PROFILE_RELEASE_INCREMENTAL: "false"
- # LTCG removed: MSVC has known bugs where LTCG ignores /arch:AVX2 and
+ # LTCG removed: MSVC has known bugs where LTCG ignores /arch flags and
# emits AVX-512 instructions on Xeon CI runners, causing STATUS_ILLEGAL_INSTRUCTION
# (0xc000001d) on consumer CPUs without AVX-512 (Arrow Lake, Panther Lake, Lunar Lake).
# See: https://developercommunity.visualstudio.com/content/problem/848627
RUSTFLAGS: ""
- CFLAGS: ${{ matrix.target == 'x86_64-pc-windows-msvc' && '/arch:AVX2' || '' }}
- CXXFLAGS: ${{ matrix.target == 'x86_64-pc-windows-msvc' && '/arch:AVX2' || '' }}
- # Fix whisper.cpp/GGML AVX-512 crash on Lunar Lake, Arrow Lake, etc.
+ # Do NOT set global CFLAGS/CXXFLAGS=/arch:AVX2. That flag made EVERY
+ # cc/cmake-compiled C dep (bundled SQLite, sqlite-vec, lame, webrtc-vad,
+ # knf, samplerate, antirez qwen3 kernels...) require AVX2, so the app
+ # died with 0xc000001d AT LAUNCH on pre-Haswell/Atom CPUs (no AVX2).
+ # MSVC's default for x64 is baseline SSE2 — safe everywhere. AVX2 is
+ # opted into ONLY where there's a runtime guard: ggml below (whisper is
+ # gated on is_x86_feature_detected in screenpipe-audio), and ONNX
+ # Runtime does its own runtime CPUID dispatch (MS official DLL).
+ CFLAGS: ""
+ CXXFLAGS: ""
# whisper-rs build.rs passes env vars starting with GGML_ as cmake defines.
# CMAKE_ARGS as a single string gets passed as -DCMAKE_ARGS="..." which cmake ignores.
# Individual GGML_* env vars are the ONLY way to control the whisper-rs cmake build.
- # Without GGML_NATIVE=OFF, FindSIMD.cmake detects AVX-512 on CI Xeon runners
- # and overrides GGML_AVX512 to ON, producing 512-bit ZMM instructions that crash
- # on CPUs without full AVX-512 support (STATUS_ILLEGAL_INSTRUCTION 0xc000001d).
+ # GGML_NATIVE=OFF prevents FindSIMD.cmake from detecting AVX-512 on CI Xeons.
+ # AVX2/BMI2 are pinned ON explicitly (don't rely on ggml defaults): whisper
+ # keeps full speed, and screenpipe-audio refuses to init whisper on CPUs
+ # without AVX2 (runtime gate) instead of crashing. The x86 ISA pins are
+ # no-ops on the aarch64 target (ggml only applies them on x86 builds).
GGML_NATIVE: "OFF"
+ GGML_SSE42: "ON"
+ GGML_AVX: "ON"
+ GGML_AVX2: "ON"
+ GGML_BMI2: "ON"
GGML_AVX512: "OFF"
GGML_AVX512_VBMI: "OFF"
GGML_AVX512_VNNI: "OFF"
GGML_AVX512_BF16: "OFF"
- CMAKE_ARGS: ${{ matrix.target == 'x86_64-pc-windows-msvc' && '-DGGML_NATIVE=OFF -DGGML_AVX512=OFF -DGGML_AVX512_VBMI=OFF -DGGML_AVX512_VNNI=OFF -DGGML_AVX512_BF16=OFF -DCMAKE_C_FLAGS=/arch:AVX2 -DCMAKE_CXX_FLAGS=/arch:AVX2' || '-DGGML_NATIVE=OFF' }}
+ CMAKE_ARGS: ${{ matrix.target == 'x86_64-pc-windows-msvc' && '-DGGML_NATIVE=OFF -DGGML_AVX512=OFF -DGGML_AVX512_VBMI=OFF -DGGML_AVX512_VNNI=OFF -DGGML_AVX512_BF16=OFF' || '-DGGML_NATIVE=OFF' }}
OPENBLAS_PATH: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/openblas
- # ORT link strategy is set per-arch in the "Download ONNX Runtime" step
- # via $GITHUB_ENV (ARM64 → system + ORT_LIB_LOCATION; x64 → unset, uses
- # download-binaries). Setting them inline here broke x64 because empty
- # env values are still "set" and ort-sys chokes on them.
+ # ORT link strategy is set in the "Download ONNX Runtime" step via
+ # $GITHUB_ENV for BOTH Windows arches: ORT_STRATEGY=system +
+ # ORT_LIB_LOCATION + ORT_PREFER_DYNAMIC_LINK=1 → import-table link
+ # against the MS onnxruntime.dll (runtime CPUID dispatch; x64 was
+ # previously pyke's AVX2-only static lib → 0xc000001d on old CPUs).
+ # Don't set them inline here: empty env values are still "set" and
+ # ort-sys chokes on them.
run: bunx tauri build --verbose ${{ matrix.tauri-args }}
- name: Sign NSIS installer with SSL.com EV (Windows)
diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml
index e003f228d..eab57965d 100644
--- a/.github/workflows/release-cli.yml
+++ b/.github/workflows/release-cli.yml
@@ -294,18 +294,39 @@ jobs:
~/.cargo/git/db/
key: windows-cargo-${{ hashFiles('**/Cargo.lock') }}
- - name: Download ONNX Runtime (CPU)
+ - name: Download ONNX Runtime
shell: pwsh
run: |
- # Pre-download CPU onnxruntime so ort crate finds it via ORT_LIB_LOCATION
- $url = "https://github.com/microsoft/onnxruntime/releases/download/v1.24.2/onnxruntime-win-x64-1.24.2.zip"
- $zipFile = "onnxruntime-win-x64-1.24.2.zip"
- $extractDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.24.2"
- Invoke-WebRequest -Uri $url -OutFile $zipFile
+ # DirectML flavor of the OFFICIAL MS build: baseline SSE2 + MLAS runtime
+ # CPUID dispatch (full AVX2 speed on modern CPUs, no crash on old ones),
+ # DML EP for parakeet/PII. pyke's download-binaries static libs are
+ # compiled /arch:AVX2 since Oct 2025 and caused 0xc000001d at launch on
+ # pre-Haswell CPUs. Keep in sync with release-app.yml's x64 branch.
+ $version = '1.24.2'
+ $dmlVersion = '1.15.4'
+ $extractDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-$version"
if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }
- 7z x $zipFile -o"apps/screenpipe-app-tauri/src-tauri/" -y
- Write-Host "ONNX Runtime extracted to $extractDir"
- Get-ChildItem "$extractDir/lib" | ForEach-Object { Write-Host $_.Name }
+ Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.ML.OnnxRuntime.DirectML/$version" -OutFile ort-dml.zip
+ Invoke-WebRequest -Uri "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/$dmlVersion" -OutFile directml.zip
+ 7z x ort-dml.zip -oort-dml -y
+ 7z x directml.zip -odirectml -y
+ New-Item -ItemType Directory -Force -Path "$extractDir/lib" | Out-Null
+ Copy-Item "ort-dml/runtimes/win-x64/native/onnxruntime.dll" "$extractDir/lib/"
+ Copy-Item "ort-dml/runtimes/win-x64/native/onnxruntime.lib" "$extractDir/lib/"
+ Copy-Item "directml/bin/x64-win/DirectML.dll" "$extractDir/lib/"
+ # Import-table (load-time) link against the MS DLL — NOT ort's
+ # `load-dynamic` feature (runtime LoadLibrary deadlocks with ort
+ # rc.12, #4171/#4173). ORT_PREFER_DYNAMIC_LINK=1 makes ort-sys emit
+ # a dynamic import instead of attempting a static link (which needs
+ # onnxruntime_common.lib + the static _deps tree the MS prebuilt
+ # doesn't ship).
+ $libDir = (Resolve-Path "$extractDir/lib").Path
+ "ORT_STRATEGY=system" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
+ "ORT_LIB_LOCATION=$libDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
+ "ORT_PREFER_DYNAMIC_LINK=1" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
+ "$libDir" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
+ Write-Host "x64: ORT_LIB_LOCATION=$libDir (dynamic import link)"
+ Get-ChildItem "$extractDir/lib"
- name: Install wget (Windows)
shell: pwsh
@@ -344,25 +365,37 @@ jobs:
CARGO_PROFILE_RELEASE_STRIP: "none"
CARGO_PROFILE_RELEASE_PANIC: "abort"
CARGO_PROFILE_RELEASE_INCREMENTAL: "false"
- # LTCG removed: MSVC LTCG ignores /arch:AVX2 and can emit AVX-512 on Xeon CI runners
+ # LTCG removed: MSVC LTCG ignores /arch flags and can emit AVX-512 on Xeon CI runners
# causing STATUS_ILLEGAL_INSTRUCTION on consumer CPUs (Arrow Lake, Panther Lake, Lunar Lake)
RUSTFLAGS: ""
- CFLAGS: "/arch:AVX2"
- CXXFLAGS: "/arch:AVX2"
+ # Do NOT set global CFLAGS/CXXFLAGS=/arch:AVX2. That made EVERY cc/cmake
+ # C dep (bundled SQLite, sqlite-vec, lame, webrtc-vad, knf, samplerate,
+ # antirez qwen3 kernels...) require AVX2 → 0xc000001d AT LAUNCH on
+ # pre-Haswell/Atom CPUs. MSVC's x64 default is baseline SSE2. AVX2 is
+ # opted into ONLY where there's a runtime guard: ggml below (whisper is
+ # gated on is_x86_feature_detected in screenpipe-audio), and ONNX
+ # Runtime does its own runtime CPUID dispatch (MS official DLL).
+ CFLAGS: ""
+ CXXFLAGS: ""
# whisper-rs build.rs passes GGML_* env vars as cmake defines.
# CMAKE_ARGS string was ignored — these individual vars actually work.
+ # GGML_NATIVE=OFF prevents FindSIMD.cmake AVX-512 detection on CI Xeons.
+ # AVX2/BMI2 pinned ON explicitly: whisper keeps full speed; the runtime
+ # AVX2 gate in screenpipe-audio disables whisper instead of crashing.
GGML_NATIVE: "OFF"
+ GGML_SSE42: "ON"
+ GGML_AVX: "ON"
+ GGML_AVX2: "ON"
+ GGML_BMI2: "ON"
GGML_AVX512: "OFF"
GGML_AVX512_VBMI: "OFF"
GGML_AVX512_VNNI: "OFF"
GGML_AVX512_BF16: "OFF"
- CMAKE_ARGS: "-DGGML_NATIVE=OFF -DGGML_AVX512=OFF -DGGML_AVX512_VBMI=OFF -DGGML_AVX512_VNNI=OFF -DGGML_AVX512_BF16=OFF -DCMAKE_C_FLAGS=/arch:AVX2 -DCMAKE_CXX_FLAGS=/arch:AVX2"
- # Link ONNX Runtime via ort's download-binaries (pyke prebuilt), same as the
- # green release-app.yml. Setting ORT_LIB_LOCATION forces ort-sys into system
- # static-linking, which needs onnxruntime_common.lib + the static _deps tree
- # the dynamic MS prebuilt doesn't ship -> "ort-sys could not link" (#4173
- # fallout, after Windows x86_64 moved off load-dynamic). The MS zip staged
- # above still provides the runtime DLL.
+ CMAKE_ARGS: "-DGGML_NATIVE=OFF -DGGML_AVX512=OFF -DGGML_AVX512_VBMI=OFF -DGGML_AVX512_VNNI=OFF -DGGML_AVX512_BF16=OFF"
+ # ONNX Runtime links dynamically (import table) against the MS
+ # DirectML-flavored onnxruntime.dll: the "Download ONNX Runtime" step
+ # sets ORT_STRATEGY/ORT_LIB_LOCATION/ORT_PREFER_DYNAMIC_LINK via
+ # $GITHUB_ENV. Same mechanism as release-app.yml — keep in sync.
OPENBLAS_PATH: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/openblas
# Use prebuilt NASM objects on Windows: https://aws.github.io/aws-lc-rs/requirements/windows.html#prebuilt-nasm-objects
AWS_LC_SYS_PREBUILT_NASM: "1"
@@ -447,6 +480,9 @@ jobs:
$ortDll = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.24.2/lib/onnxruntime.dll"
}
Copy-Item $ortDll "$packageDir/bin/"
+ # DirectML.dll: the DirectML-flavored onnxruntime.dll needs it for the
+ # DML EP (staged by the "Download ONNX Runtime" step).
+ Copy-Item "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.24.2/lib/DirectML.dll" "$packageDir/bin/"
# Copy OpenBLAS DLL(s) for qwen3-asr (libopenblas.dll or openblas.dll)
$openblasBin = "apps/screenpipe-app-tauri/src-tauri/openblas/bin"
if (Test-Path $openblasBin) {
diff --git a/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json b/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
index 8377b49ec..b9d7d7545 100644
--- a/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
+++ b/apps/screenpipe-app-tauri/src-tauri/tauri.windows.conf.json
@@ -20,7 +20,7 @@
"ffmpeg\\bin\\ffprobe.exe": "./",
"ffmpeg\\bin\\*.dll": "./",
"ffmpeg\\lib\\*": "./",
- "onnxruntime*\\lib\\onnxruntime.dll": "./",
+ "onnxruntime*\\lib\\*.dll": "./",
"openblas\\bin\\*.dll": "./",
"vcredist\\*.dll": "./",
"assets/*": "./assets/"
diff --git a/crates/screenpipe-audio/Cargo.toml b/crates/screenpipe-audio/Cargo.toml
index 3167dc488..acfb70784 100644
--- a/crates/screenpipe-audio/Cargo.toml
+++ b/crates/screenpipe-audio/Cargo.toml
@@ -118,13 +118,20 @@ windows = { workspace = true, features = [
"Win32_UI_WindowsAndMessaging",
] }
-# Bundle ONNX Runtime at build time on Windows x86_64 (same as Linux/macOS-arm64).
-# `load-dynamic` (runtime LoadLibrary of onnxruntime.dll) was tried but HANGS on
-# some hosts: ort rc.12's first call deadlocks inside `libloading::Library::new`
-# at 0% CPU, before `CreateEnv`, so the audio engine never finishes the
-# `building_audio` boot phase and the app looks dead (recording, VAD, diarization
-# all broken). Load-time linking of the *same* onnxruntime.dll initializes in
-# ~30ms. See PR #4171.
+# Windows x86_64 RELEASE builds link ONNX Runtime dynamically (import table)
+# against Microsoft's official DirectML-flavored onnxruntime.dll: CI sets
+# ORT_STRATEGY=system + ORT_LIB_LOCATION + ORT_PREFER_DYNAMIC_LINK=1, which
+# overrides `download-binaries` in ort-sys's build script (the env vars take
+# precedence over the feature). The MS DLL is baseline SSE2 with MLAS runtime
+# CPUID dispatch → works on non-AVX2 CPUs (pyke's static prebuilts are
+# compiled /arch:AVX2 since Oct 2025 and caused 0xc000001d at launch —
+# ort sessions are created on the audio boot path at every launch).
+# Local dev builds without the env vars still use pyke's static lib.
+# Do NOT switch to the `load-dynamic` feature: runtime LoadLibrary HANGS with
+# ort rc.12 (deadlocks inside `libloading::Library::new` at 0% CPU, before
+# `CreateEnv`, so the audio engine never finishes the `building_audio` boot
+# phase — recording, VAD, diarization all broken). Load-time linking of the
+# *same* onnxruntime.dll initializes in ~30ms. See #4171/#4173.
[target.'cfg(all(target_os = "windows", target_arch = "x86_64"))'.dependencies]
ort = { workspace = true, features = ["download-binaries", "tls-native"] }
samplerate = { workspace = true }