Skip to content
CAI
Software that uses CAICheck a score

kean/Nuke

69.7

Adequate · 27 September 2026

27.6k

lines of production code

Swift

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a high-performance image loading and processing library for Apple platforms, featuring a modernized pipeline built with Swift concurrency. It handles the complete lifecycle of image assets, including downloading, caching, decoding (with support for animated formats and video), and processing. The library provides both programmatic APIs and SwiftUI/UIKit components for efficient asynchronous image display, along with comprehensive diagnostics and testing tools for performance monitoring.

How it got here

2016–2022 — Swift concurrency and Nuke 14 overhaul

24 changes.

This period focused on rewriting the Nuke library to adopt modern Swift concurrency, replacing legacy delegate-based APIs with async/await and introducing a new ImagePipelineActor. The work included restructuring the caching subsystem with a custom LRU memory cache, redesigning animated image decoding for browser-consistent playback, and expanding the NukeUI module with SwiftUI components. Comprehensive test coverage was added to validate thread safety, performance benchmarks, and the new encoding and decoding pipelines.

2023–2026 — NukeVideo, AnimatedImage, and Demo App

16 changes.

This period introduced native video playback via NukeVideo and animated image support through a new AnimatedImage view, alongside comprehensive diagnostics and performance monitoring tools. The project also launched a new SwiftUI-based demo application featuring interactive labs, stress tests, and a real-time pipeline HUD to visualize and debug image loading behaviors.

Features

Add performance demo screens for decompression and prefetching

The Demo/Performance area now includes two new interactive screens: DecompressionDemo, which visualizes the main-thread frame savings and memory impact of background JPEG decompression and \UIImage.preparingForDisplay()\, and PrefetchingDemo, which demonstrates \ImagePrefetcher\ behavior in both UIKit and SwiftUI, tracking how many images are ready in the cache before they appear on screen.

Demo/Performance · high confidence

Add pipeline diagnostics probe to the demo app

The demo app now includes a \DemoPipelineProbe\ that acts as a delegate for every image pipeline, collecting detailed metrics on task counts, cache hits (memory, disk, HTTP), download progress, decoding times, and queue states. This probe enables a new HUD overlay on demo screens to visualize pipeline performance and allows screens to list delegate calls and data loader events for debugging purposes.

Demo/Helpers/Probe · high confidence

New AnimatedImage view and player for SwiftUI and UIKit

This change introduces a new \AnimatedImage\ SwiftUI view and \AnimatedImageView\ UIKit/AppKit view, along with the \AnimatedImagePlayer\ class, to natively play animated images (such as GIFs) within the NukeUI framework. The \AnimatedImage\ view integrates with SwiftUI's layout system, respecting \resizable()\ and content modes, and automatically pauses playback when the view is off-screen or when Accessibility settings disable auto-play. The underlying \AnimatedImagePlayer\ manages frame decoding off the main thread, synchronizes playback across multiple views showing the same animation, and shares decoded frames via a global \AnimatedImageFramePool\ to optimize memory usage. The pool intelligently manages memory by holding full animations in memory when possible, falling back to a small window of frames for larger animations, and responding to system memory warnings and Low Power Mode by throttling playback or releasing idle frames.

Sources/NukeUI/AnimatedImages · high confidence

New Animation Lab, Priority Coalescing, and Scroll Stress demos in the Lab

The Lab now includes three new interactive demos. Animation Lab visualizes up to 36 simultaneous animations to demonstrate the shared AnimatedImageFramePool, allowing users to adjust the pool budget (4–256 MB), trigger memory warnings, and toggle lockstep synchronization. Priority Coalescing demonstrates how the pipeline handles concurrent requests by showing task counts, download slots, and priority-based queue ordering across twenty requests for six photos. Scroll Stress tests pipeline performance under heavy load by auto-scrolling a grid of images with caching and coalescing disabled, providing real-time frame rate and dropped frame metrics.

Demo/Lab · high confidence

New Nuke Demo app with catalog, Lab, and pipeline HUD

The repository now includes a new SwiftUI-based demo application that provides a structured catalog of Nuke features (Essentials, Formats, Performance, Integration) and a dedicated Lab section for stress testing and diagnostics. The app introduces a global Pipeline HUD overlay that displays real-time pipeline metrics and opens detailed task information, and supports automated testing via launch arguments that can open specific screens, enable autorun, and configure the HUD state.

Demo/App · high confidence

New Pipeline Performance HUD for Demos

A new HUD overlay is now available in the demo apps, providing real-time performance metrics for image pipelines. It displays a compact card with key figures (active tasks, hit rate, task duration) and, when expanded, detailed charts tracking the last 30 seconds of pipeline activity, including request sources (memory, disk, network) and queue utilization. The HUD also monitors display frame rates and app memory footprint. Users can drag the HUD to any screen corner, pin it to a specific pipeline, and open a detailed sheet to inspect cache usage and control queue suspension.

Demo/Helpers/HUD · high confidence

New demo helper utilities and resources

The demo application now includes a comprehensive set of helper utilities in the Demo/Helpers directory to support its screens and diagnostics. This includes \DemoAnimations\ for managing and loading animated image formats (GIF, APNG, WebP, HEIC) with player integration, and \DemoAutoScroll\ for driving consistent, timed scrolling in grid views to measure throughput. New data loaders like \PacedDataLoader\ and \ThrottledDataLoader\ allow simulating slow or chunked network conditions to visualize progressive decoding and download behavior. The update also introduces \GridPrefetcher\ for SwiftUI grids, \DemoImageHeader\ for inspecting file metadata, and \DemoErrorText\ for user-friendly error reporting. Supporting resources include a shared \DemoImages\ enum for network URLs, a \photos.json\ fixture list, and UI components like \DemoInfo\ sheets and \DemoUI\ styling helpers.

Demo/Helpers · high confidence

New demo screens for image processing, LazyImage, and UIKit views

The Essentials demo now includes dedicated screens for Image Processing, LazyImage, and UIKit Views. The Image Processing screen demonstrates built-in and custom processors, cache keys, and memory diagnostics. The LazyImage screen covers loading states, transitions, processors, and the FetchImage observable object. The UIKit Views screen compares the UIImageView extension (where the app owns loading states) with LazyImageView (where the view owns them).

Demo/Essentials · high confidence

New image loading diagnostics with detailed task metrics and timeline reporting

Developers can now enable runtime diagnostics on the image pipeline to capture detailed performance data for every image task. When enabled via \isDiagnosticsEnabled\ or the \NUKE\_DIAGNOSTICS\_ENABLED\ environment variable, each task finishes with a \Metrics\ record available on \ImageTask\. This record includes a text-based timeline showing exactly where time was spent (cache lookups, downloads, decoding, processing), job coalescing information, priority changes, and granular \URLSession\ metrics. The metrics are versioned, \Codable\, and can be formatted into a structured report suitable for bug reports or logging, providing visibility into load times and resource usage without external profiling tools.

Sources/Nuke/Diagnostics · high confidence

New video playback and decoding capabilities in NukeVideo

The NukeVideo module now includes a video decoder that extracts thumbnails and AVAsset data from MP4, M4V, and MOV files, along with a cross-platform VideoPlayerView for rendering that content. This view supports looping, muting, and frame resizing, and specifically fixes a bug where looping videos on macOS would not resume when the window regained focus, while also ensuring proper cleanup of notification observers.

Sources/NukeVideo · high confidence

Behavioural changes

DataLoader now supports session-level delegates and incremental delivery control

The DataLoader class now exposes a \delegate\ property conforming to \URLSessionDelegate\, allowing users to handle session-wide events such as authentication challenges and to integrate with network debugging tools like Pulse. Additionally, a new \prefersIncrementalDelivery\ boolean property has been added to control whether partial response bodies are delivered in increments, which is disabled by default. These changes enhance the flexibility of the data loading layer for advanced networking scenarios and diagnostics.

Sources/Nuke/Loading · high confidence

Demo images now serve from local fixtures for offline testing

The demo app no longer requires network access to load images; it now uses a local fixture system that serves generated or bundled images (JPEG, GIF, APNG, WebP, and a custom NukePix format) via a custom \DataLoading\ implementation. This allows users to test image loading, decoding, and pacing behaviors completely offline, with support for simulating network conditions like latency and chunked delivery, as well as range requests for resumable downloads.

Demo/Helpers/Fixtures · high confidence

ImagePrefetcher completion callback now runs on the main thread

The \didComplete\ closure in \ImagePrefetcher\ is now guaranteed to execute on the main queue, ensuring that any UI updates or state changes performed in response to prefetching completion are thread-safe without requiring manual dispatching. This change simplifies integration by removing the need for callers to wrap the callback in \DispatchQueue.main.async\.

Sources/Nuke/Prefetching · high confidence

Internal performance optimizations and concurrency safety improvements

This update refactors internal components to improve performance and concurrency safety. SHA1 hashing is optimized by using CryptoKit and avoiding intermediate allocations. Cache and task keys now use reference types and pre-computed hash values to speed up lookups. The rate limiter's default request rate is increased to 100 per second. URL scheme comparisons for local resources are now case-insensitive. Resumable data storage is synchronized using the ImagePipelineActor, and various Sendable and concurrency warnings are fixed to ensure thread safety.

Sources/Nuke/Internal · high confidence

Major concurrency overhaul and API simplification in Nuke

The Nuke library has been rewritten to adopt modern Swift concurrency, replacing the legacy delegate-based architecture with async/await and AsyncStream. ImageTask now exposes typed throws for errors, provides a unified Status snapshot for state, and streams progress and events, while ImageRequest is simplified by removing the userInfo parameter and deprecated ImageRequestConvertible conformance. Internally, the pipeline uses OSAllocatedUnfairLock for thread safety, implements Copy-on-Write for ImageContainer to reduce allocations, and attaches raw data to animated images to support playback in NukeUI.

Sources/Nuke · high confidence

New image encoding system with format-specific and adaptive encoders

The image encoding subsystem has been restructured to provide more control over output formats and reliability. A new \ImageEncoders.ImageIO\ encoder allows users to explicitly specify output formats (such as JPEG, PNG, or HEIC) and compression ratios, while a new \ImageEncoders.Default\ encoder automatically selects the best available format based on image properties (e.g., using HEIC if preferred and supported, otherwise JPEG for opaque images or PNG for transparent ones). Additionally, the encoding protocol now returns \nil\ instead of empty data when encoding fails, and GIF images are preserved in their original data format rather than being re-encoded, fixing issues where GIFs were incorrectly stored as JPEGs in the disk cache.

Sources/Nuke/Encoding · high confidence

New local CI and build scripts for consistent development workflows

The project introduces a new \.scripts\ directory containing \ci.sh\, \create-xcframeworks.sh\, and \lint.sh\ to standardize local and continuous integration workflows. \ci.sh\ serves as the single source of truth for the CI matrix, allowing developers to run the exact same test and build jobs locally via \make ci\ with live progress reporting and flaky-test detection. \create-xcframeworks.sh\ automates the archiving and packaging of Nuke and NukeUI frameworks for iOS, macOS, tvOS, and watchOS. \lint.sh\ provides a local SwiftLint execution path. These changes ensure local development parity with CI and streamline framework distribution.

.scripts · high confidence

Nuke 14 API overhaul: async/await, new delegate, and removed legacy APIs

The pipeline now uses Swift concurrency (async/await) as the primary interface, replacing the previous closure-based callbacks with methods like \image(for:)\ and \data(for:)\. The old \ImagePipelineDelegate\ has been replaced by \ImagePipeline.Delegate\, which uses async methods for hooks like \willLoadData\ and \willCache\. Legacy APIs such as \ImagePublisher\, \maximumDecodedImageSize\, and \isSignpostLoggingEnabled\ have been removed (kept as unavailable stubs in \Deprecated.swift\), and the pipeline is now backed by a new \ImagePipelineActor\ for internal coordination.

Sources/Nuke/Pipeline · high confidence

Nuke Xcode project structure updated for modern Swift and documentation

The Nuke Xcode project has been restructured to support modern Swift development and improved documentation workflows. The project now includes dedicated documentation catalogs (Nuke.docc, NukeUI.docc) for DocC integration, and the build configuration has been updated to Swift 5.0. The project structure consolidates targets, embedding Nuke, NukeUI, and NukeVideo frameworks, and removes legacy components like NukeExtensions in favor of the unified NukeUI target. This change simplifies the project layout and aligns it with current Apple development standards.

Nuke.xcodeproj · high confidence

NukeUI restructured with new SwiftUI and UIKit components

The NukeUI module has been reorganized to provide a modern SwiftUI experience alongside updated UIKit/AppKit support. The new \LazyImage\ SwiftUI view and \LazyImageView\ UIKit component replace previous patterns, offering consistent APIs for asynchronous image loading with features like custom placeholders, transitions, and progress tracking. The \FetchImage\ observable object simplifies programmatic image loading in SwiftUI, while the \ImageLoadingOptions\ struct centralizes configuration for placeholders, failure images, and content modes. The \NukeExtensions\ module is now a shim that re-exports \NukeUI\ for backward compatibility, and deprecated APIs have been moved to a dedicated \Deprecated.swift\ file with clear migration messages.

Sources/NukeUI · high confidence

Redesigned animated image decoding with browser-consistent playback and progressive JPEG improvements

The decoding subsystem has been restructured to handle animated images (GIF, APNG, WebP, HEIC, AVIF) with behavior that matches web browsers: GIFs without a loop extension now play once instead of looping forever, and frame delays below 11ms are corrected to 100ms to prevent excessive CPU usage. Animated image metadata (frame count, delays, loop count) is now parsed once during decoding and attached to the image container, allowing views to access animation properties without re-parsing. Progressive JPEG support has been improved with better handling of End-Of-Image markers and a thumbnail fallback for JPEGs with large EXIF headers that prevent incremental decoding. The system now uses a new \AnimatedImageSource\ class to describe animations and an \AnimatedImageFrameDecoder\ actor to decode frames off the main thread, ensuring smooth playback. A new \ImageDecoderRegistry\ allows registering and unregistering decoders, and \AssetType\ provides a unified way to identify image formats including new support for AVIF, ICO, and HEIC sequences.

Sources/Nuke/Decoding · high confidence

Refactored image processing API with new options namespace and optimized identity handling

The image processing pipeline has been restructured to improve performance and API clarity. Processor identities are now boxed into a dedicated \ImageProcessorID\ type to avoid expensive string creation and runtime lookups during cache comparisons. Common configuration options, such as \ContentMode\ and \Unit\, have been moved into a shared \ImageProcessingOptions\ namespace. Additionally, a new \ImageDecompression\ module manages image decompression state, and the \ImageProcessing\ protocol now includes a \hashableIdentifier\ property for faster equality checks.

Sources/Nuke/Processing · high confidence

Replaced NSCache with a custom LRU memory cache and restructured disk caching

The memory cache implementation has been replaced with a custom LRU (Least Recently Used) cache to provide precise cost enforcement, as the previous NSCache-based approach only treated cost limits as hints. This new Cache class uses a CLOCK/second-chance algorithm for efficient eviction and splits the memory budget between the main image cache and animated frame pools. Additionally, the disk caching layer (DataCache) has been restructured to perform reads asynchronously and drain the staging area with a single writer task, improving concurrency and reducing main-thread blocking during cache operations.

Sources/Nuke/Caching · high confidence

Rewritten image loading tasks with async/await and improved caching

The image loading tasks in the pipeline have been rewritten to use Swift's async/await concurrency model, replacing the previous operation-based and stream-based implementations. This change introduces new task classes (AsyncPipelineTask, AsyncTask) that manage subscriptions and diagnostics more efficiently, and updates the data loading and decoding stages to run asynchronously on dedicated queues. Additionally, the caching logic has been refined to better handle original data lookups for thumbnail and processed requests, ensuring that cached data is correctly retrieved and stored, and improving the handling of progressive decoding and resumable downloads.

Sources/Nuke/Tasks · high confidence

Simplified Xcode workspace configuration

The Xcode workspace has been streamlined to reference a single project target, removing previous multi-target complexity. This change updates the workspace data file to point directly to the main project and adds the standard IDE workspace check file to ensure consistent build settings across development environments.

Nuke.xcodeproj/project.xcworkspace · medium confidence

Updated Xcode project schemes and build configurations

The Xcode project schemes have been updated to reflect the addition of new targets (NukeUI, NukeVideo, NukeDemo) and test suites (Thread Safety, Performance). Key behavioral changes include enabling parallel builds across targets, activating code coverage for the Nuke, NukeUI, and NukeVideo frameworks, and enabling the Thread Sanitizer for NukeTests and NukeThreadSafetyTests. Additionally, the Nuke launch scheme now configures environment variables for allocation tracking (NUKE\_ALLOCATIONS\_PERIODIC\_LOG), while the NukeDemo scheme has diagnostics logging disabled by default.

Nuke.xcodeproj/xcshareddata · high confidence

Test coverage

Added Info.plist for the test bundle; Added Swift Testing performance benchmarks for Nuke components; Added compilation tests for documentation snippets; Added comprehensive test coverage for NukeVideo; Added diagnostics metrics test fixtures; Added stress tests for thread safety in caches, pipeline, and prefetcher; Added test coverage for NukeUI animated image playback and memory management; Adopt scene lifecycle in the test host; Expanded test coverage for Nuke 13 image pipeline features; Expanded test coverage for animated image handling and asset type detection; Expanded test coverage for image processors and decoding; New test helpers for animated image fixtures and pixel-accurate assertions; New test mocks for Nuke pipeline components.

Dependencies

Swift Package Manager configuration updated for Nuke 14 with visionOS support

The Package.swift manifest has been updated to define the Nuke package structure, introducing new targets for NukeUI, NukeVideo, and NukeExtensions, and raising the minimum deployment targets to iOS 16, tvOS 16, macOS 13, watchOS 9, and adding support for visionOS 1. A separate Package.swift for DocumentationSnippets has also been added to support building UIKit and Objective-C samples for iOS in CI.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 47 → 70 (+22.2)
  • Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 97 (-3.3)
  • Architecture 98 (new)
  • Maturity 55 → 59 (+3.7)
  • Readiness 27 → 73 (+45.7)
  • Security 71 → 75 (+4.3)

Resolved (11)

  • Dimension evaluation failed
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No automated tests
  • No exposed public API
  • No tests found
  • Test reliability not included
  • The README mentions Nuke's performance guide at https://kean-docs.github.io/nuke/documentation/nuke/performance-guide but does not link to it. (README.md)

New (176)

  • AnimatedImagePlayer.tick (cognitive 17) (Sources/NukeUI/AnimatedImages/AnimatedImagePlayer.swift)
  • AssetType.make (cognitive 18) (Sources/Nuke/Decoding/AssetType.swift)
  • AssetType.make (cyclomatic 19) (Sources/Nuke/Decoding/AssetType.swift)
  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Duplicate property names with different casing (camelCase vs PascalCase) exposed on the same type. This creates ambiguity and potential confusion for API consumers regarding which property to use.
  • Duplicated block (10 lines × 2) (Demo/Essentials/LazyImageDemo.swift)
  • Duplicated block (10 lines × 2) (Demo/Formats/ImageFormatsDemo.swift)
  • Duplicated block (12 lines × 2) (Demo/Helpers/DemoErrorText.swift)
  • Duplicated block (13 lines × 2) (Demo/Essentials/LazyImageDemo.swift)
  • Duplicated block (17 lines × 2) (Demo/App/DemoScreen.swift)
  • Duplicated block (6 lines × 2) (Demo/Helpers/Fixtures/DemoFixtureLoader.swift)
  • Duplicated block (6 lines × 2) (Demo/Helpers/HUD/DemoDisplayMonitor.swift)
  • Duplicated block (6 lines × 2) (Sources/Nuke/ImageContainer.swift)
  • Duplicated block (8 lines × 2) (Sources/NukeUI/FetchImage.swift)
  • Duplicated block (9 lines × 2) (Demo/Helpers/DemoUI.swift)
  • Duplicated block (9 lines × 2) (Sources/Nuke/Internal/Graphics.swift)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 156 more

Changes since last survey

  • 300 commits — 270 feature/other, 30 fixes

By area

  • Demo/Helpers — 47 commits
  • (repo) — 45 commits
  • Tests/NukeTests — 35 commits
  • Sources/Nuke — 29 commits
  • (root) — 27 commits
  • Demo/Lab — 25 commits
  • Demo/App — 23 commits
  • Demo/Caching — 9 commits
  • Tests/NukeUITests — 9 commits
  • Demo/Integration — 6 commits
  • Demo/README.md — 6 commits
  • Sources/NukeUI — 6 commits
  • Demo/Processing — 5 commits
  • Tests/NukePerformanceTests — 5 commits
  • Demo/Essentials — 4 commits
  • Demo/AnimatedImages — 2 commits
  • Demo/Requests — 2 commits
  • Documentation/Nuke.docc — 2 commits
  • Nuke.xcodeproj/project.pbxproj — 2 commits
  • Tests/DefectRepros — 2 commits

Notable commits

  • fix: Fix Int64 overflow on a resumed download with a huge Content-Length
  • fix: Fix LazyImage restarting its request when the priority changes
  • fix: Fix a data race on DataLoader/delegate
  • fix: Fix or delete the tests that cannot fail
  • fix: Fix queue sometimes being shown as text when not expected
  • fix: Fix the DataCache sweep-timer race in tests
  • fix: Merge branch 'main' into fix/disable-disk-cache-writes-encoded
  • fix: Merge branch 'main' into fix/lazy-image-thumbnail-scale-reload
  • fix: Merge branch 'main' into fix/return-cache-data-dont-load-processed
  • fix: Merge pull request #1004 from kean/fix/data-task-original-data-lookup
  • fix: Merge pull request #1005 from kean/fix/skip-data-loading-queue-key
  • fix: Merge pull request #1006 from kean/fix/resumed-download-keeps-resumable-data
  • fix: Merge pull request #1007 from kean/fix/return-cache-data-dont-load-processed
  • fix: Merge pull request #1008 from kean/fix/disable-disk-cache-writes-encoded
  • fix: Merge pull request #1010 from kean/fix/diagnostics-never-started-stage
  • fix: Merge pull request #1011 from kean/fix/cache-new-entry-evicts-itself
  • fix: Merge pull request #1013 from kean/fix/fetch-image-cancel-is-loading
  • fix: Merge pull request #1014 from kean/fix/cache-oversized-overwrite
  • fix: Merge pull request #1015 from kean/fix/lazy-image-thumbnail-scale-reload
  • fix: Merge pull request #1034 from kean/fix/lazy-image-priority-updates
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

kean/Nuke was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 27 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 61f8aebad96bd27508cb92f9e9fd83520c37a1f3 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d00c643c3f66.