Repository navigation
ci: run the sanitizers on pull requests that change the meta backend or its tests - #10
Conversation
…or its tests build-sanitize.yml ran only on pushes to master and on changes to itself, so a pull request to spiceai-b11803 never saw ThreadSanitizer. The meta backend is the one place in the fork where several contexts share process-wide state from different threads (the graph-slot cache a buffer free touches, the device and buffer-type registries), and #9 reproduced a race there under ThreadSanitizer that every other job passed. A pull request that changes the meta backend, the backend interface header, or a meta test now runs the ADDRESS, THREAD and UNDEFINED jobs; the test that drives those paths, test-meta-graph-slots, carries the main label, so ctest runs it under each.
There was a problem hiding this comment.
🟢 Approved
The narrow path-filter additions match the intended coverage, with no unresolved findings or changes to job execution.
No open issues 🎉
What changed in this PR
This PR extends sanitizer coverage to pull requests that modify the meta backend or its tests, addressing the coverage gap highlighted by #9.
Changes:
- Adds pull request path filters for the meta backend implementation, backend interface header, and
test-meta-*.cpptests. - Documents why these paths need sanitizer coverage.
- Preserves existing sanitizer jobs and push-to-
masterbehavior.
| File | Description |
|---|---|
.github/workflows/build-sanitize.yml |
Expands pull request triggers to cover meta-backend code and tests. |
Review effort: Balanced
The UNDEFINED leg runs on a self-hosted X64 Linux runner this repository does not have, so on a pull request it stayed pending for good (#10's own run: ADDRESS and THREAD passed on ubuntu-24.04 in 20 and 16 minutes, UNDEFINED never started). A pull request now runs the two GitHub-hosted legs and skips the third; pushes to master are unchanged.
|
The first run of this workflow on a pull request (head |
…el if cannot see the matrix The previous commit put the pull-request skip in a job-level if that referenced matrix.sanitizer; the matrix context is not available there, so the workflow failed to parse and its run had no jobs. The matrix is now built from the event with fromJSON: a pull request gets the ADDRESS and THREAD legs on ubuntu-24.04, a push to master keeps all three.
|
|
…l requests A pull request that changes the meta backend ran ADDRESS and THREAD only, which is not the three sanitizers the change set out to run. The UNDEFINED leg now runs on ubuntu-24.04 for pull requests (its Debug configure step is unchanged) and keeps its self-hosted runner for pushes to master.
|
Round 3, head |
|
Read back on |
|
Addressed #10 (review). The headline was that the three sanitizer jobs were still running at review time, so validation was incomplete. They have since completed and all pass on this HEAD:
So the validation the review was waiting on is complete and green. No code change. |


What this changes
build-sanitize.ymlran only on pushes tomasterand on changes to itself, so a pull request tospiceai-b11803never ran under ThreadSanitizer, AddressSanitizer or UBSan. A pull request that changesggml/src/ggml-backend-meta.cpp,ggml/src/ggml-backend-impl.h, or atests/test-meta-*.cpptest now triggers the three sanitizer jobs. The matrix is built from the event (strategy.matrix: fromJSON(...)): a pull request runs ADDRESS, THREAD and UNDEFINED onubuntu-24.04, since the UNDEFINED leg's self-hosted runner does not exist for this repository's pull requests and a job targeting it would sit pending for good; pushes tomasterkeep the original three legs, UNDEFINED on the self-hosted runner.Why
The meta backend is the one place in this fork where several contexts share process-wide state from different threads: the graph-slot cache that a buffer free touches on every live backend, and the static device and buffer-type registries. #9 reproduced a data race there under ThreadSanitizer (
forget_bufferreadingactive_bufwhile another thread'sgraph_computewrote it;parkederased during a rehash) that every job this repository runs on a pull request passed, because none of them runs a race detector.tests/test-meta-graph-slots.cpp(#9) drives that path from two threads and carries themainlabel, soctest -L mainruns it under each sanitizer once this workflow runs.Evidence
gh run list --workflow "CI (sanitize)"on this repository shows no run for anyspiceai-b11803pull request; Decide backend sampling after the sampler chain is built, and drop a freed compute buffer's parked graph split (follow-ups to #7) #9's checks (https://github.com/spiceai/llama.cpp/pull/9/checks) list no sanitizer job.-DGGML_SANITIZE_THREAD=ON -DLLAMA_SANITIZE_THREAD=ON -DGGML_OPENMP=OFFbuild, the same flags the THREAD job uses.ffef3ff17ran ADDRESS in 20m16s and THREAD in 16m18s onubuntu-24.04, both passing on the base, while UNDEFINED never started on the self-hosted runner;4d6acf188(a job-levelifonmatrix.sanitizer) failed to parse and ran no jobs;d7b7673bescheduled exactly the two hosted legs;15fabb8d0scheduled all three on hosted runners (run 40288464464), whose results are this change's evidence.What is not covered
The sanitizer jobs build on GitHub-hosted runners and take their usual time; they run only for pull requests that touch the listed paths, so the cost lands on meta-backend changes, not on every pull request.
ggml/src/ggml-rpc/is not listed: nothing undertests/exercises the RPC server, so a sanitizer run there would test nothing yet.