Skip to content

[AI] Fix corrupted AI output when provider is set to auto#21063

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_auto
May 19, 2026
Merged

[AI] Fix corrupted AI output when provider is set to auto#21063
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_auto

Conversation

@andriiryzhkov
Copy link
Copy Markdown
Collaborator

A user on pixls.us reported posterized blue/magenta raw denoise output on macOS – but only with "auto" selected. Explicit "CoreML" or "CPU" worked fine.

The rawdenoise-nind manifest declares cpu_only: { model_bayer: [coreml] }, telling the backend that the Bayer head needs CoreML's CPU compute units (the ANE/GPU path produces garbage). That check ran for explicit "CoreML" but was exempted for "auto" – so on macOS "auto" enabled CoreML without USE_CPU_ONLY and ran on the ANE.

Rather than special-casing macOS, AUTO and cpu_only now flow through one resolver in backend_common.c:

  • AUTO walks a per-platform candidate list (macOS: [CoreML], Windows: [DirectML], Linux: [CUDA, MIGraphX, OpenVINO]) and applies cpu_only to each. First candidate that's available and either not banned, or (CoreML) tolerable via USE_CPU_ONLY, wins.
  • _enable_acceleration no longer carries an AUTO case – the resolver guarantees a concrete EP.
  • Single-candidate platforms skip dt_ai_probe_provider; probe results are memoized per process.

Linux AUTO on a model that bans one GPU EP now falls through to the next instead of dropping straight to CPU. Explicit-EP and CPU paths are unchanged.

@andriiryzhkov andriiryzhkov added the bugfix pull request fixing a bug label May 18, 2026
Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

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

Thanks!

@TurboGit TurboGit added this to the 5.6 milestone May 19, 2026
@TurboGit TurboGit added the scope: AI features AI features related issues and PR label May 19, 2026
@TurboGit TurboGit merged commit 050d5fe into darktable-org:master May 19, 2026
5 checks passed
@andriiryzhkov andriiryzhkov deleted the fix_auto branch May 19, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug scope: AI features AI features related issues and PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants