Technology
Google Open-Sources ABFS, CASFS, and Ninja-go to Cut Massive Git Checkouts to Seconds
Google open-sourced ABFS, CASFS, and Ninja-go on November 17, 2026, replacing full Git checkouts and timestamp builds with lazy content-addressable streaming and two-phase caching—cutting AOSP checkouts from 36m 19s to under 8 seconds and full builds from 80m to ~2 minutes.
10 min read
Google Open-Sources ABFS, CASFS, and Ninja-go to Cut Massive Git Checkouts to Seconds
Executive Summary
On November 17, 2026, Google officially open-sourced Another Build File Service (ABFS), its Content-Addressable Storage Filesystem (CASFS) Linux kernel module, and its Go-based Ninja reimplementation, Ninja-go. Built by the Android ABFS Team to eliminate multi-hour workspace setup and cold-build bottlenecks in massive Git monorepos and multi-repository trees, the stack replaces full local source checkouts and timestamp-driven rebuilds with on-demand content streaming and two-phase remote build caching.
In published benchmarks on a 64-vCPU Google Compute Engine VM (n2d-standard-64, 256 GB RAM), ABFS reduced Android Open Source Project (AOSP) source checkouts from a traditional mean of 36 minutes 19 seconds to 7.4 seconds with an empty local cache (294.5x speedup) and 3.6 seconds with a warm local cache (605.3x speedup). Full Cuttlefish emulator builds dropped from 1 hour 20 minutes 35 seconds to 2 minutes 11 seconds with a full remote cache (36.9x speedup) and 1 minute 19 seconds with a full local cache (61.2x speedup).
Confidence Level: High. Core architectural details, benchmark tables, and operational caveats are directly corroborated across three primary sources published by Google: the Google Developers Blog announcement and the official google/abfs and google/ninja-go GitHub repositories. Kernel module implementation details for casfs carry medium-to-high confidence based on published repository documentation, though external kernel version compatibility remains explicitly limited at launch.
Why Massive Git Trees Break Traditional Workflows
Modern Android operating system development exemplifies the scaling limits of traditional Git and repo workflows. According to Google's measurements of the Android 17 open-source release, a single AOSP tree comprises 1,084 Git projects, 1,620,371 regular files, and 324,457 directories, occupying 161 GB for source code and 155 GB for build outputs (~300 GB total per built workspace). In commercial device trees containing hardware vendor repositories, board support packages (BSPs), and first-party applications, total scale expands 2–3x beyond AOSP to over 3,000 Git repositories across multiple active SKU and legacy maintenance branches.
Two structural bottlenecks compound this footprint:
- Cold-start sync penalty: Even with
repo init --partial-cloneandrepo sync -j8(higher-jconcurrency triggers Gerrit rate-limiting onandroid.googlesource.com), fetching a fresh workspace averages over 36 minutes. Ephemeral CI runners, branch switches, and parallel AI coding agents hit this wall repeatedly. - Timestamp-based rebuild fragility: Android's build pipeline uses Blueprint (
Android.bp) and Soong to emit Ninja files, which upstream Ninja evaluates using file modification timestamps (mtime). Building the Cuttlefish emulator target executes 192,249 Ninja actions. Even when a developer edits a core library likesystem/libbase, 97% of the build graph remains identical to continuous integration (CI) outputs—yet a cold workspace wastes roughly 80 minutes on a 64-core workstation repeating work CI already completed. Worse, undeclared hidden dependencies (such as schema files passed inside raw compiler flags) silently corrupt timestamp-based incremental builds, forcing periodic clean wipes.
Technical Mechanics & Architecture
ABFS resolves both bottlenecks by unifying source distribution, local filesystem virtualization, and build execution around immutable Git SHA content hashes.
+-------------------------------------------------------------------------+
| DEVELOPER / AGENT HOST |
| |
| [ Ninja-go (ABFS Backend) ] <---> [ Tap Utility ] |
| | | |
| v v |
| [ Mount Daemon ] <--------------> [ Cacheman (LRU Local Cache) ] |
| | ^ |
| | AF_UNIX SOCK_STREAM | Lazy Blob / Metadata Fetch |
| v (20-byte hash framing) | |
| [ CASFS Linux Kernel Module (casfs.ko) ] | |
+-------------------------------------------|-----------------------------+
| gRPC
v
+-------------------------------------------------------------------------+
| ABFS SERVER INFRASTRUCTURE |
| |
| [ ABFS CAS Server ] <---- [ Git-pushers ] <---- [ Gerrit / Git Hosts ] |
| (Horizontally scalable gRPC store for Git objects, snapshots & cache) |
+-------------------------------------------------------------------------+
Server-Side Ingestion and gRPC CAS
On the infrastructure side, gitpusher services continuously ingest new Git objects from Gerrit or upstream Git hosts into a horizontally scalable gRPC ABFS Content-Addressable Storage (CAS) Server. Rather than serving monolithic tarballs or cloning full object packs to every client, the CAS server indexes Git blobs, directory trees, persistent workspace snapshots, and remote build-step action results by content hash.
Client-Side Virtualization with CASFS and Cacheman
On the Linux client host, ABFS splits responsibilities between user-space Go daemons and an in-kernel filesystem module:
- CASFS Kernel Module (
github.com/google/abfs-casfs): Implemented as a Linux Virtual File System (VFS) module (casfs.ko), CASFS exposes Git SHA content hashes via extended attributes. During checkout, CASFS populates directory structures, filenames, permissions, and file sizes immediately without downloading file bytes. - Cacheman & Mount Daemon: A background
systemdservice (cacheman) maintains a local Least Recently Used (LRU) cache on disk. When a compiler, editor, or shell reads a file for the first time, CASFS communicates with the user-space daemon over a local Unix domain stream socket (AF_UNIX,SOCK_STREAM) using little-endian frames with 20-byte binary hashes (CASFS_HASH_LEN), streaming the missing blob on demand. - Persistent Synchronized Workspaces: Each mounted checkout binds to a persistent workspace that eagerly syncs modified files, Git state, and
repostate back throughcachemanto the ABFS CAS Server, enabling seamless handoff across sessions or hosts.
The official google/abfs documentation demonstrates this content-addressable decoupling with a minimal local-only test:
# Prepopulate metadata using a Git SHA-1 hash without downloading file bytes
touch hello
abfs hash --set cc628ccd10742baea8241c5924df992b5c019f71 hello
# Metadata (name, size, permissions) is immediately visible
ls -l hello
# -rw-r----- 1 user primarygroup 6 Nov 3 00:11 hello
# File bytes are lazy-loaded only upon first read
cat hello
# world
Two-Phase Content-Addressable Caching in Ninja-go
To eliminate stale incremental artifacts without sacrificing remote cache reuse, google/ninja-go reimplements Ninja in Go with pluggable execution backends (backends/classic for standard .ninja_log/.ninja_deps workflows, and the ABFS backend for content-addressable builds).
CASFS includes a tapping mechanism (Tap) that intercepts build processes and records every file actually read, written, or deleted during an action into compact lists called read patches and write patches. Ninja-go uses these patches in a strict two-phase lookup:
- Phase 1 — Declared Key Lookup: Ninja-go hashes the build step's command line, relevant environment variables, and declared input file hashes to query the remote CAS for candidate cached outputs from prior CI or developer runs.
- Phase 2 — Read-Patch Verification: Before materializing a cached result, ABFS verifies every file hash in the candidate's recorded read patch against the current CASFS filesystem state. If all hashes match—including any undeclared headers or compiler flags—ABFS applies the write patch instantly. If even a single hidden dependency differs on disk, ABFS rejects the stale candidate and reruns the action locally with tapping enabled.
This design guarantees clean-build correctness even on legacy build graphs with incomplete dependency declarations, while letting multiple parallel AI agents mount five distinct Android release branches simultaneously on one VM in under 8 seconds each.
Evidence & Published Benchmarks
Google published controlled benchmark results in both the Google Developers Blog and the google/abfs README, measuring the mean of 3 runs on a GCE n2d-standard-64 VM (64 vCPUs, 256 GB RAM) with the ABFS remote server hosted in the same cloud VPC.
Source Checkout Performance (AOSP)
| Workflow | Mean Time | Speedup vs. Traditional |
|---|---|---|
Traditional (repo init --partial-clone & repo sync -j8) |
36m 19s | 1.0x |
| ABFS mount (empty local cache) | 7.4s | 294.5x |
| ABFS mount (warm local cache) | 3.6s | 605.3x |
Full Build Performance (lunch aosp_cf_x86_64_only_phone-aosp_current-userdebug && m droid)
| Build Configuration | Mean Time | Speedup vs. Traditional |
|---|---|---|
| Traditional local build | 1h 20m 35s | 1.0x |
| ABFS build (cache use disabled) | 1h 39m 11s | 0.81x |
| ABFS build (empty local cache, full remote cache) | 2m 11s | 36.9x |
| ABFS build (full local cache) | 1m 19s | 61.2x |
Two numbers in the build table merit close engineering scrutiny. First, running ABFS with caching disabled is 19% slower (0.81x, 1h 39m 11s) than a traditional build because CASFS virtualization and kernel-level file tapping introduce measurable I/O and syscall overhead. ABFS's massive speedups rely entirely on sharing a warm remote cache populated by CI. Second, if a fork contains non-deterministic build steps—such as embedding timestamps, build numbers, or un-sandboxed host environment variables—cache hit rates drop sharply, though ABFS includes diagnostic tooling to pinpoint non-hermetic steps.
Hardening & Deployment Playbook
Adopting an out-of-tree Linux kernel module (casfs.ko), privileged capability binaries, and a shared remote build cache introduces distinct operational and security considerations. Teams evaluating ABFS should apply the following defensive controls before rolling out to developer workstations or CI runners.
1. Restrict Capabilities and Isolate Kernel Module Builds
Running make in google/abfs requests sudo to apply Linux capabilities (setcap) to casfs-mounter, casfuse-mounter, and abfs-resources. Avoid blind privileged installs on shared build hosts:
# Build binaries without automatic setcap so security teams can audit capabilities first
SKIP_SETCAP=1 make
# Inspect assigned capabilities on installed binaries before deployment
getcap $(go env GOPATH)/bin/casfs-mounter $(go env GOPATH)/bin/abfs-resources
Because google/abfs-casfs explicitly warns that casfs.ko has been compiled and tested against a limited set of Linux kernel versions, build and test the module inside an isolated, ephemeral VM matching your fleet's exact kernel headers before deploying to production developer images.
2. Size VFS Slab Caches for High File Counts
Per the abfs-casfs VFS architecture documentation, CASFS allocates a duplicate tracking structure in the Linux VFS layer for every active file: one frontend struct inode / struct dentry on the casfs mount, plus one backend struct inode / struct dentry on the underlying host filesystem (ext4 or xfs). On monorepos exceeding 1.6 million files, memory consumption scales with concurrently tracked files rather than byte volume. Double standard memory headroom for dentry and inode_cache slab caches, and monitor slab pressure continuously:
# Audit kernel dentry and inode slab cache memory usage during parallel builds
sudo slabtop -o -s c | grep -E "dentry|inode_cache"
3. Enforce Build Determinism and Soong Sandboxing
Never disable Soong sandboxing or leak host-specific environment variables (USER, PWD, wall-clock timestamps) into compiler flags. In ABFS, any environment mismatch invalidates Phase 1 declared keys, while non-deterministic outputs poison shared CI cache hit rates. Use ninjago pressure stall information (PSI) flags (--psi-cpu, --psi-io, --psi-mem) on Linux runners to throttle job scheduling when host memory or I/O saturates.
4. Authenticate and Network-Isolate the ABFS CAS Server
Because cacheman streams source code and prebuilt binaries over gRPC, treat the ABFS CAS Server as a Tier-0 supply-chain asset. Place the CAS Server inside a private VPC (matching Google's benchmark topology), enforce mutual TLS or IAM-authenticated gRPC channels, and restrict write-back permissions so compromised developer endpoints cannot push poisoned build-step patches into shared CI caches.
5. Clean Unmount and Rollback Procedure
If a kernel update or workstation issue requires reverting to standard repo checkouts, cleanly unmount all active CASFS trees and purge the daemon rather than force-deleting directories:
# Unmount all active CASFS workspaces cleanly
abfs unmount --all
# Remove cacheman instance and purge ABFS binaries/module
abfs purge
Note that insmod casfs.ko does not persist across reboots by default, providing a straightforward fallback path if a kernel module issue occurs.
Frequently Asked Questions
Does ABFS replace Git or repo commands for Android developers?
No. CASFS uses Git's native object model under the hood, allowing standard git and repo workflows to operate transparently on mounted workspaces while lazy-loading file contents on demand.
Is there a FUSE alternative if we cannot load an out-of-tree kernel module?
A FUSE implementation (casfuse) exists in the google/abfs repository, but Google explicitly notes in the project FAQ that it is still under development and is not feature-complete or ready for production use.
Does ABFS support build systems other than Android's Soong and Ninja? Yes, by design. While Android's Soong/Ninja pipeline was the initial target, Google states that a proof-of-concept integration with Bazel already exists, and Chromium and the Android Common Kernel are actively exploring compatibility.
Why are external GitHub pull requests currently closed on abfs-casfs?
Per CONTRIBUTING.md, Google is not accepting external pull requests or public issue reports on GitHub while stabilizing the external release process. Android partners adopting ABFS are directed to coordinate through their Android Partner Engineering representative or abfs@google.com.
Can ABFS run offline on a laptop without strong network connectivity? Not effectively for cold builds. Google's documentation explicitly warns that ABFS behaves like a demanding networked filesystem and requires strong, low-latency connectivity to the remote CAS server to stream uncached blobs and fetch remote build steps.
Sources
- Google Developers Blog — Accelerating development for massive Git repositories (Published November 17, 2026)
- GitHub (
google/abfs) — ABFS: Another Build File Service Repository & Benchmarks (Accessed November 18, 2026; Apache-2.0) - GitHub (
google/ninja-go) — Ninja-go: Pluggable Content-Addressable Ninja Reimplementation (Accessed November 18, 2026; Apache-2.0) - GitHub (
google/abfs-casfs) — CASFS Inode & VFS Slab Architecture (docs/file.md) and Provider Socket Framing (docs/provider.md) (Accessed November 18, 2026)