Skip to content

fix(ep-tests): use platform-correct ORT lib name from ort_discovery - #823

Merged
justinchuby merged 1 commit into
mainfrom
squad/fix-ort-discovery-platform-lib-name
Aug 12, 2026
Merged

justinchuby merged 1 commit into
mainfrom
squad/fix-ort-discovery-platform-lib-name

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

Summary

Cherry-pick of commit dd6ab807f which missed the #762 merge window by 30 minutes and is stranded on the already-merged branch.

This fixes CURRENTLY-RED lanes on main:

  • Rust Windows ARM64
  • Rust coverage Windows x86_64
  • Rust coverage macOS arm64

The root cause: 7 hardcoded libonnxruntime.so joins in plugin_ort_e2e.rs that fail on Windows (onnxruntime.dll) and macOS (libonnxruntime.dylib).

Fix: Route all ORT library path construction through ort_discovery::ort_lib_name() which returns the correct platform-specific filename. Also switches diag_ort_ep_api_nullcheck to use the skip_if_missing! macro.

Verification (Linux x86_64):

  • cargo test -p onnx-runtime-ep-cpu-plugin --no-fail-fast: 24 passed, 0 failed, 0 ignored
  • cargo clippy -p onnx-runtime-ep-cpu-plugin --all-targets -- -D warnings: clean
  • No hardcoded lib names outside ort_discovery.rs

Windows/macOS correctness is BY CONSTRUCTION (via ort_lib_name() returning the right filename per cfg!(target_os)) and must be confirmed by CI — we have no such hardware in this environment.

Original commit: dd6ab807f on branch squad/ep-plugin-parity-cuda (PR #762, merged 2026-08-12T15:10:54Z; commit dated 30 min after merge).

Replace 7 hardcoded `libonnxruntime.so` joins in plugin_ort_e2e.rs with
`ort_discovery::ort_lib_name()` which returns the correct filename per
platform (onnxruntime.dll / libonnxruntime.dylib / libonnxruntime.so).

Also fix diag_ort_ep_api_nullcheck to use skip_if_missing! macro so it
respects the NXRT_REQUIRE_ORT_TESTS=1 fail-loud gate.

Fixes CI failures on Windows ARM64, Windows x86_64, and macOS arm64 lanes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.75%. Comparing base (ce5f14a) to head (cb2561b).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #823      +/-   ##
==========================================
+ Coverage   77.49%   77.75%   +0.26%     
==========================================
  Files         351      352       +1     
  Lines      141509   146507    +4998     
  Branches   141509   146507    +4998     
==========================================
+ Hits       109666   113923    +4257     
- Misses      27443    28120     +677     
- Partials     4400     4464      +64     
Flag Coverage Δ
cli-ort-linux 83.50% <ø> (ø)
cli-ort-windows 82.99% <ø> (-0.10%) ⬇️
mlas 80.92% <ø> (-0.05%) ⬇️
offline 77.49% <ø> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown

✅ Benchmarks — No Regression

Comparison of criterion micro-benchmarks: PR head vs merge-base, measured on the same runner in the same job (base first → PR second).

ℹ️ Absolute times are informational only — they vary with runner load. The % change column is the reliable signal because both sides ran under identical conditions.

Status Scenario Base PR Change
✅ qwen3_sampling_processors/top_k_partial_selection 131.60 µs 145.18 µs +10.3%
✅ grammar_masking/llguidance_compute_mask/32 70.14 µs 73.40 µs +4.7%
✅ qwen3_sampling_processors/top_k_top_p_full_sort_baseline 5.30 ms 5.55 ms +4.6%
✅ matmul/medium_generic_bf16_threads=1/32x512x512 500.46 µs 520.63 µs +4.0%
✅ matmul/large_generic_bf16_threads=1/32x1024x1024 1.87 ms 1.94 ms +3.9%
✅ sampling_latency/min_p_per_token 191.33 µs 195.53 µs +2.2%
✅ matmul/medium_generic_bf16_threads=8/32x512x512 377.02 µs 384.98 µs +2.1%
✅ tokenization/encode_tokens_per_second 364.33 µs 370.43 µs +1.7%
✅ qwen3_sampling_processors/top_k_full_sort_baseline 1.95 ms 1.97 ms +1.4%
✅ matmul/large_generic_f32_threads=1/32x1024x1024 8.56 ms 8.66 ms +1.3%
✅ matmul/large_generic_f16_threads=1/32x1024x1024 72.70 µs 73.39 µs +1.0%
✅ sampling_latency/top_p_per_token 350.65 µs 353.15 µs +0.7%
✅ block_quantized_matmul_cached_dense/mxfp4_uncached_dequant_each_call/1x1024x1024 532.60 µs 534.73 µs +0.4%
✅ add/medium_f32_threads=1-internal/262144 2.52 ms 2.52 ms +0.2%
✅ reduce_mean/small_f32_threads=1-internal/4096 14.54 µs 14.57 µs +0.2%
✅ matmul/small_generic_bf16_threads=1/1x256x256 30.10 µs 30.09 µs -0.0%
✅ tokenization/decode_tokens_per_second 5.73 ms 5.73 ms -0.1%
✅ matmul/medium_generic_f32_threads=8/32x512x512 890.65 µs 889.31 µs -0.1%
✅ matmul/small_generic_bf16_threads=8/1x256x256 30.69 µs 30.65 µs -0.2%
✅ sampling_latency/greedy_per_token 3.02 µs 3.01 µs -0.2%
✅ block_quantized_moe_cached_dense/mxfp4_cached_dense_expert_repeated_call/rows=1,H=256,I=256,E=4,top_k=1 72.33 µs 72.09 µs -0.3%
✅ qwen3_sampling_processors/top_p_fast_after_top_k 484.73 µs 482.03 µs -0.6%
✅ logit_processing/seven_processor_chain_per_step 300.79 µs 299.10 µs -0.6%
✅ block_quantized_matmul_cached_dense/mxfp4_cached_dense_repeated_call/1x1024x1024 41.10 µs 40.80 µs -0.7%
✅ qwen3_sampling_processors/top_p_full_sort_after_top_k_baseline 3.30 ms 3.28 ms -0.8%
✅ matmul/medium_generic_f16_threads=8/32x512x512 28.04 µs 27.72 µs -1.1%
✅ reduce_mean/medium_f32_threads=1-internal/65536 231.64 µs 228.91 µs -1.2%
✅ matmul/large_generic_bf16_threads=8/32x1024x1024 1.34 ms 1.32 ms -1.4%
✅ kv_cache/alloc_dealloc_pages 37.17 µs 36.61 µs -1.5%
✅ sampling_latency/top_k_per_token 50.25 µs 48.76 µs -3.0%
✅ block_quantized_moe_cached_dense/mxfp4_uncached_expert_dequant_each_call/rows=1,H=256,I=256,E=4,top_k=1 359.56 µs 348.24 µs -3.1%
✅ matmul/large_generic_f32_threads=8/32x1024x1024 3.78 ms 3.66 ms -3.2%
✅ add/large_f16_threads=1-internal/4194304 40.81 ms 39.08 ms -4.3%
✅ gather/small_f16_threads=1-internal/4096 466.7 ns 443.1 ns -5.1%
✅ reduce_mean/large_f32_threads=1-internal/262144 963.55 µs 911.64 µs -5.4%
✅ add/large_f32_threads=1-internal/4194304 39.46 ms 37.24 ms -5.6%
✅ gather/small_f32_threads=1-internal/4096 662.6 ns 613.2 ns -7.5%
✅ add/medium_bf16_threads=1-internal/262144 2.62 ms 2.42 ms -7.7%
✅ add/small_bf16_threads=1-internal/1024 12.83 µs 11.79 µs -8.1%
✅ qwen3_sampling_processors/top_k_top_p_fast 664.64 µs 610.47 µs -8.1%
✅ matmul/medium_generic_f16_threads=1/32x512x512 30.25 µs 27.76 µs -8.2%
✅ matmul/medium_generic_f32_threads=1/32x512x512 2.38 ms 2.18 ms -8.4%
✅ add/large_bf16_threads=1-internal/4194304 42.89 ms 39.22 ms -8.6%
✅ matmul/small_generic_f16_threads=8/1x256x256 32.83 µs 29.43 µs -10.4%
✅ add/medium_f16_threads=1-internal/262144 2.63 ms 2.35 ms -10.4%
✅ add/small_f32_threads=1-internal/1024 202.6 ns 181.2 ns -10.6%
✅ block_quantized_matmul_cached_dense/mxfp4_preexpanded_dense_oncelock_like_proxy/1x1024x1024 47.83 µs 42.76 µs -10.6%
✅ add/small_f16_threads=1-internal/1024 13.66 µs 11.93 µs -12.6%
🟢 matmul/small_generic_f16_threads=1/1x256x256 37.15 µs 28.52 µs -23.2%
🟢 gather/small_bf16_threads=1-internal/4096 583.7 ns 440.1 ns -24.6%
🟢 gather/large_bf16_threads=1-internal/131072 15.28 µs 10.79 µs -29.3%
🟢 matmul/small_generic_f32_threads=8/1x256x256 49.24 µs 33.18 µs -32.6%
🟢 gather/large_f16_threads=1-internal/131072 18.40 µs 12.14 µs -34.0%
🟢 matmul/small_generic_f32_threads=1/1x256x256 51.48 µs 33.75 µs -34.4%
🟢 gather/medium_bf16_threads=1-internal/32768 3.42 µs 2.19 µs -35.9%
🟢 gather/medium_f32_threads=1-internal/32768 5.64 µs 3.39 µs -39.9%
🟢 gather/large_f32_threads=1-internal/131072 42.71 µs 25.58 µs -40.1%
🟢 gather/medium_f16_threads=1-internal/32768 3.86 µs 2.28 µs -41.0%
🟢 matmul/large_generic_f16_threads=8/32x1024x1024 135.21 µs 77.72 µs -42.5%

Visual flags: ⚠️ ≥ 15% slower, 🔴 ≥ 30% slower — calibrated against measured runner noise (~27% worst-case on multi-threaded matmul)

Host info
CPU: Apple M1 (Virtual)
Cores: 3
OS: Darwin 25.5.0 arm64
Rust: rustc 1.97.1 (8bab26f4f 2026-07-14)
Load avg: { 3.13 3.34 5.42 }
What this cannot catch
  • Regressions in code paths not covered by these benchmarks (e.g., end-to-end decode with a real model)
  • Sub-threshold regressions that compound over multiple PRs
  • Performance changes that only manifest under GPU execution
  • Latency changes in the ORT integration path (these benchmarks exercise the native Rust kernels)

@justinchuby
justinchuby marked this pull request as ready for review August 12, 2026 18:31
@justinchuby
justinchuby merged commit 523ab7b into main Aug 12, 2026
13 of 15 checks passed
@justinchuby
justinchuby deleted the squad/fix-ort-discovery-platform-lib-name branch August 12, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant