Skip to content

ci: run the sanitizers on pull requests that change the meta backend or its tests - #10

Merged
lukekim merged 4 commits into
spiceai-b11803from
lukim/b11803-sanitize-meta-prs
Oct 26, 2026
Merged

lukekim merged 4 commits into
spiceai-b11803from
lukim/b11803-sanitize-meta-prs

Conversation

@lukekim

@lukekim lukekim commented Oct 26, 2026 •

Copy link
Copy Markdown

What this changes

build-sanitize.yml ran only on pushes to master and on changes to itself, so a pull request to spiceai-b11803 never ran under ThreadSanitizer, AddressSanitizer or UBSan. A pull request that changes ggml/src/ggml-backend-meta.cpp, ggml/src/ggml-backend-impl.h, or a tests/test-meta-*.cpp test now triggers the three sanitizer jobs. The matrix is built from the event (strategy.matrix: fromJSON(...)): a pull request runs ADDRESS, THREAD and UNDEFINED on ubuntu-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 to master keep 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_buffer reading active_buf while another thread's graph_compute wrote it; parked erased 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 the main label, so ctest -L main runs it under each sanitizer once this workflow runs.

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 under tests/ exercises the RPC server, so a sanitizer run there would test nothing yet.

…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.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 06:49
Copilot AI previously approved these changes Oct 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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-*.cpp tests.
  • Documents why these paths need sanitizer coverage.
  • Preserves existing sanitizer jobs and push-to-master behavior.
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.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 07:21
Copilot AI dismissed their stale review, a newer Copilot review was requested October 26, 2026 07:22
@lukekim

lukekim commented Oct 26, 2026

Copy link
Copy Markdown
Author

The first run of this workflow on a pull request (head ffef3ff17, triggered by the workflow file itself) is the evidence for the change: ctest (ADDRESS, ubuntu-24.04) passed in 20m16s and ctest (THREAD, ubuntu-24.04) in 16m18s, so the base's main tests are clean under both sanitizers, while ctest (UNDEFINED, self-hosted, X64, Linux) never started, because this repository has no such runner. 4d6acf188 skips that leg on pull requests (if: github.event_name != 'pull_request' || matrix.sanitizer != 'UNDEFINED'), so a meta-backend pull request shows two sanitizer results instead of two results and one check pending for good; pushes to master are unchanged. This head's run is the read-back for the skip.

…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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The job-level condition uses the unavailable matrix context, invalidating the workflow for both new and existing triggers.

1 open issue

Review effort: Balanced

Comment thread .github/workflows/build-sanitize.yml Resolved
Copilot AI balanced review requested due to automatic review settings October 26, 2026 07:28
@lukekim

lukekim commented Oct 26, 2026

Copy link
Copy Markdown
Author

4d6acf188 did not do what its message says: the run of this workflow for that head (40285342945) completed as a failure with no jobs, because the matrix context is not available in a job-level if, so the workflow failed to parse. d7b7673be builds the matrix from the event instead (strategy.matrix: ${{ fromJSON(github.event_name == 'pull_request' && … || …) }}), which is where the github context is allowed. Read back on this head: run 40285953285 scheduled exactly ctest (ADDRESS, ubuntu-24.04) and ctest (THREAD, ubuntu-24.04), no UNDEFINED leg; their results are the after-evidence.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Pull requests omit UBSan despite the stated requirement to run all three sanitizers.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread .github/workflows/build-sanitize.yml Resolved
…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.
Copilot AI balanced review requested due to automatic review settings October 26, 2026 07:52
@lukekim

lukekim commented Oct 26, 2026

Copy link
Copy Markdown
Author

Round 3, head 15fabb8d0: Copilot's point on d7b7673be stands (two legs ran on pull requests, the description promised three). Pull requests now run ADDRESS, THREAD and UNDEFINED on ubuntu-24.04; pushes to master keep UNDEFINED on the self-hosted runner. Run 40288464464 scheduled all three on this head; pending its results and Copilot's review of it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

All three sanitizer jobs are still running, so validation remains incomplete, particularly for the newly hosted UNDEFINED job.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@lukekim

lukekim commented Oct 26, 2026

Copy link
Copy Markdown
Author

Read back on 15fabb8d0: run 40288464464's three legs all passed on ubuntu-24.04 — ctest (ADDRESS) in 20m15s, ctest (UNDEFINED) in 18m49s, ctest (THREAD) in 26m41s — so the base's main tests are clean under all three sanitizers on hosted runners, and the hosted UNDEFINED leg costs about the same as the other two. Copilot's review of this head reports no open issues. Nothing left on my side; ready for review and merge.

@lukekim

lukekim commented Oct 26, 2026

Copy link
Copy Markdown
Author

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:

  • ctest (ADDRESS, ubuntu-24.04) — pass
  • ctest (THREAD, ubuntu-24.04) — pass
  • ctest (UNDEFINED, ubuntu-24.04) — pass (the newly hosted UBSan matrix entry the headline called out)

So the validation the review was waiting on is complete and green. No code change.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The scoped changes preserve non-PR behavior, and all three hosted sanitizer jobs passed in run 40288464464.

No open issues 🎉

Review effort: Balanced

@lukekim
lukekim merged commit 571696b into spiceai-b11803 Oct 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants