Repository navigation
fix(ep-cpu): make the dispatcher-placement probes inert under Miri (main is red, mine) - #1921
Merged
Merged
Conversation
CI caught this, which is the whole argument for waiting on it: the Miri job runs `decode_spmd::tests::a_panic_in_the_dispatcher_shard_still_waits_for_the_workers`, that test dispatches on a real pool, and dispatch now calls `sample_dispatcher_cpu()` -> `libc::sched_getcpu()`, which Miri has no shim for. The test aborted with "can't call foreign function `sched_getcpu`" -- a failure in a panic-safety test that has nothing to do with placement. `sample_dispatcher_cpu`, `current_thread_os_id` and the `sched_setaffinity` call are now gated on `not(miri)`. Nothing is lost by it: a CPU-placement sample is meaningless under an interpreter that does not model CPUs, there is no `/proc` for a tid to index, and the property Miri is actually there to check -- that the unsafe blocks are sound -- does not depend on the calls being made. Setting the knob under Miri now degrades to "not pinned" rather than failing an unrelated test. Verified locally with the workflow's exact invocation: `MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-num-cpus=4 -Zmiri-ignore-leaks" cargo +nightly miri test --locked -p onnx-runtime-ep-cpu --lib decode_spmd::tests::a_panic_in_the_dispatcher` -> 1 passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
justinchuby
enabled auto-merge (squash)
August 24, 2026 02:10
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1921 +/- ##
==========================================
+ Coverage 80.14% 80.32% +0.17%
==========================================
Files 413 415 +2
Lines 200822 204575 +3753
Branches 200822 204575 +3753
==========================================
+ Hits 160957 164333 +3376
- Misses 34343 34669 +326
- Partials 5522 5573 +51
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main is red on Miri and it is mine
Reporting this against myself. #1915 merged at 01:59:54Z on required checks
(
Fast (Linux x86_64),Rust quality) whileMiri unsafe-crate soundnesswas still running, and it subsequently failed. Miri is not a required
check on this repo, so auto-merge fired legitimately — no
--admin, noruleset bypass — but the outcome is the same as if it had been bypassed: a
defect landed on main that CI caught. I had the fix pushed to the PR branch at
02:03, four minutes too late.
The defect. The Miri job runs
decode_spmd::tests::a_panic_in_the_dispatcher_shard_still_waits_for_the_workers.That test dispatches on a real pool, and #1915 made dispatch call
sample_dispatcher_cpu()→libc::sched_getcpu(), which Miri has no shim for:A panic-safety test failing for reasons that have nothing to do with panic
safety.
The fix.
sample_dispatcher_cpu,current_thread_os_idand thesched_setaffinitycall are gated onnot(miri). Nothing is lost: aCPU-placement sample is meaningless under an interpreter that does not model
CPUs, there is no
/procfor a tid to index, and the property Miri exists tocheck — that the unsafe blocks are sound — does not depend on the calls being
made. Setting
ONNX_GENAI_CPU_DECODE_DISPATCHER_PINunder Miri now degrades to"not pinned" instead of failing an unrelated test.
Verified with the workflow's exact invocation, on this branch, off current
main:
What I'm taking from it. "Wait for required CI" is not sufficient when a
job that can fail is not in the required set. For anything that adds an FFI
call inside a code path a Miri test executes, the check to run before merging
is Miri itself, locally, not the required set. I should have run it before
opening #1915 — the test is named in
.github/workflows/miri.yml:227and Itouched the exact function it exercises.