Skip to content

fix: delete 2 unused functions, fixing linking against shared libggml-1.0.0 - #2363

Draft
adamjrichter wants to merge 1 commit into
leejet:masterfrom
adamjrichter:remove-unused-graph-funcs
Draft

adamjrichter wants to merge 1 commit into
leejet:masterfrom
adamjrichter:remove-unused-graph-funcs

Conversation

@adamjrichter

@adamjrichter adamjrichter commented Nov 15, 2026 •

Copy link
Copy Markdown

Summary

Delete two unused connected functions from src/core:

ggml_backend_graph_compute_async_range
sd_backend_graph_compute_with_eval_callback

They were causing an undefined reference to ggml_graph_view when linking stable-diffusion against external shared libggml-1.0.0.

ggml_graph_view is an unexported symbol in libggml-1.0.0. The the function hiding facility used by libggml does
not currently have effect for static libraries, so the problem would only have occurred for users linking external
libggml that is also a shared library.

This diff was vibe coded with app.devin.ai, which suggested the idea of just deleting these two functions.

Related Issue / Discussion

Thanks to @wbruna and @leejet for, respectively, creating and merging ggml-1.0.0
support in pull request #2354.

I had tried asking devin.ai to do the upgrade, as
discussed in #2355, but
am not knowledgeable enough to be confident in the ggml function replacement
the AI suggested (which may have come from it training on or finding some text from
@wbruna somewhere on the internet).

By the way, devin.ai thinks the hidden symbol problem goes back ggml-0.27.0.

Additional Information

An argument this diff might not be OK:

  1. I am a stable-diffusion newbie.
  2. @leejet , @stduhpf, "git blame" shows you as the last editors of the lines
    that this diff would delete, and that you made your changes this year,
    so I encourage you and any other reviewers to stop this diff or change
    it to just comment out the functions if those functions are in the source tree
    because some user of them is about to be merged in.

Arguments this diff should be OK:

  1. This diff consists only of deletions--no new content.

  2. The names of these two deleted functions no longer are found
    anywhere in the source tree, and the C preprocessor '##' operator
    appears only in thirdparty/, reducing chances of an unseen use of
    the deleted functions hiding in any other build configuration.

  3. app.devin.ai reported success building with both internal ggml and
    external shared ggml with this diff.

  4. After I built with this diff, ldd showed sd-cli successfully dynamically
    linked against libggml, and sd-cli was able to generate a picture.

  5. I asked gemini.google.com if stable-diffusion itself could have out of
    tree consumers of symbols, such as plugins or having the effect functions
    made available as a public library it claimed this was not so in this case.

Although this diff consists only of deletions, I hereby release any copyright
interest I may have in it to the public domain.

Checklist

Summary by CodeRabbit

  • Changes
    • Removed support for asynchronous execution of selected graph ranges and callback-driven graph evaluation through the compatibility interfaces.

…-1.0.0

Delete two unused connected functions from src/core:

ggml_backend_graph_compute_async_range
sd_backend_graph_compute_with_eval_callback

They were causing an undefined reference to ggml_graph_view when linking
stable-diffusion against external shared libggml-1.0.0.

ggml_graph_view is a unexported symbol in libggml-1.0.0.  The link error
did not occur with other build configurations because

    (a) these functions are ifdef'ed out when using integrated libggml, and

    (b) the function hiding facility used by libggml does not currently
        have effect for static libraries.

This diff was vibe coded with app.devin.ai, which suggested the idea
of just deleting these two functions.
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change removes ggml_backend_graph_compute_async_range and sd_backend_graph_compute_with_eval_callback, including their declarations and implementations.

Changes: Graph computation API removals

Layer / File(s) Summary
Remove graph computation APIs
src/core/ggml_compat.h, src/core/ggml_compat.cpp, src/core/ggml_extend_backend.h, src/core/ggml_extend_backend.cpp
The async-range API and the evaluation-callback API were removed from their headers and implementations.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: leejet, stduhpf

Merge Risk: Minimal · up to cdd33

This change removes two unused graph-compute helpers to fix a link error against external shared libggml. No remaining callers were found, and the evaluation-callback feature still goes through the scheduler. The merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: deleting two unused functions. It also names the reason, fixing linking against shared libggml-1.0.0. The title is specific and matches the changeset, which removes gg…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description has a clear summary of the change: deleting two unused functions in src/core that caused an undefined reference to ggml_graph_view when linking against an external shared libggml. It a…
Full details: Title check

Explanation

The title names the main change: deleting two unused functions. It also names the reason, fixing linking against shared libggml-1.0.0. The title is specific and matches the changeset, which removes ggml_backend_graph_compute_async_range and sd_backend_graph_compute_with_eval_callback. The title is not vague.

Full details: Description check

Explanation

The description has a clear summary of the change: deleting two unused functions in src/core that caused an undefined reference to ggml_graph_view when linking against an external shared libggml. It also links the related discussion and PR #2354, and includes verification notes (build with internal and external ggml, ldd check, sd-cli generating an image). The checklist is filled in. The description does not follow the template in a few places: the template comment placeholders remain in the body, the Summary section is mixed with a rambling AI-generated note, and the 'Related Issue / Discussion' section contains unrelated commentary. The author also states the diff was AI-generated and contains a copyright waiver, which is off-template but not disqualifying. Some numbered list items are out of sequence (1, 2, then 4, 5, 6, 7), and the description includes a self-described uncertainty about whether the change is acceptable. The required sections are present and the substance is on topic, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3442f640-0455-4da6-b0a3-476940189fb7
Commits

Reviewing files that changed from the base of the PR and between 5dcfa79 and cdd3344.

Files selected for processing: 4

  • src/core/ggml_compat.cpp
  • src/core/ggml_compat.h
  • src/core/ggml_extend_backend.cpp
  • src/core/ggml_extend_backend.h
Files with no reviewable changes: 4

  • src/core/ggml_compat.cpp
  • src/core/ggml_compat.h
  • src/core/ggml_extend_backend.cpp
  • src/core/ggml_extend_backend.h

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@adamjrichter
adamjrichter marked this pull request as draft November 15, 2026 08:20
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