DEV Community

Cover image for Gemini 4 Argon API and Android NDK #2260: Google at two speeds

Gemini 4 Argon API and Android NDK #2260: Google at two speeds

Software engineering at Google is currently moving at two distinct speeds for outside developers. Inside Google, teams report using Gemini 4 Argon to refactor millions of lines of Chromium and optimize Python repositories overnight, and on October 13 Google opened the gemini-4-argon endpoint on the paid Gemini API. At the same time, an Android NDK bug report (#2260) showed that developers debugging September's Android 17 update on Pixel phones had to pull libc.so off the device and read ARM64 disassembly because the public Android Open Source Project (AOSP) branch still reflects a March snapshot.

TL;DR

  • Android 17 Pixel wcscspn() and wcspbrk() bug: On September 2026 Android 17 builds (CP3A.260905.009) tested on Pixel 7 and Pixel 8a, Bionic's wide-character complement scan stops at the first character >= U+0100 whenever the reject set has two or more characters < U+0100. That produces false matches across 1,111,808 Unicode code points (U+0100 to U+10FFFF).
  • Disassembly required to diagnose open-source Android: June's public android17-release branch uses a working loop from llvm-libc. Because Google's 2026 AOSP release policy publishes source code twice a year in Q2 and Q4, the September Pixel binary shipped months ahead of its corresponding public source drop.
  • The unit test that asserted the bug: When Google's Bionic maintainer checked the internal tree, he discovered an existing test at bionic/tests/wchar_test.cpp:1475 (wcscspn(L"he\ufffelo", L"lo")) that asserted the buggy return value 2u instead of 3u.
  • Gemini 4 Argon general availability and pricing: On October 13, 2026, Google released gemini-4-argon to general availability on the paid Gemini API and for Google AI Ultra subscribers. Introductory API pricing of $2.00 per 1M input tokens and $10.00 per 1M output tokens runs through November 30, 2026, then doubles to $4.00 input and $20.00 output on December 1, 2026.
  • Human code review remains mandatory: In Google Cloud's 11-hour overnight optimization run on the 205,000-line google/adk-python repository, human maintainers shipped two of Argon's six proposed optimizations and rejected four during code review.

How one emoji broke Android Bionic's wide-character scan in Android NDK #2260

The regression surfaced in a place nobody expects to stress-test system libraries: Visual Pinball on Android. Visual Pinball uses libwinevbs, a standalone C port of Wine's VBScript engine, to run table scripts. After the September 2026 Android 17 update (CP3A.260905.009, security patch 2026-09-05) landed on Pixel 7 and Pixel 8a devices, pinball tables began failing to load whenever a VBScript comment line contained an emoji.

The VBScript lexer called wcspbrk(ptr, L"\n\r") to scan forward to the end of a comment line. Instead of returning a pointer to the newline or carriage return, wcspbrk() returned the position of the emoji inside the comment, causing the parser to stop mid-comment and report an invalid character. In the same library, FileSystem.MoveFolder used wcspbrk(src, L"*?><") to check for wildcard characters and treated every file path containing a character at or above U+0100 as a wildcard pattern.

On October 12, developer francisdb filed Android NDK issue #2260 with a minimal C reproducer built with aarch64-linux-android30-clang:

#include <stdio.h>
#include <wchar.h>

int main(void)
{
    wchar_t s[] = {'a', 0x1F680, 0x100, 'b', 'x', '\n', 0};
    printf("wcscspn(s, L\"x\\n\") = %zu (expected 4)\n", wcscspn(s, L"x\n"));
    printf("wcspbrk(s, L\"x\\n\") = index %ld (expected 4)\n", (long)(wcspbrk(s, L"x\n") - s));
    printf("wcsspn(s, L\"a\\U0001F680\") = %zu (expected 2)\n", wcsspn(s, L"a\U0001F680"));
    return 0;
}
Enter fullscreen mode Exit fullscreen mode

In C, wcscspn(s, reject) counts how many wide characters appear in s before the first character that belongs to reject. In the array above, 'a' is at index 0, 0x1F680 (the rocket emoji) is at index 1, 0x100 (Ā) is at index 2, 'b' is at index 3, and 'x' — the first character actually present in L"x\n" — sits at index 4.

On an Android 16 Nothing Phone 2 (BP2A.250605.031.A3), the program prints 4. On the Pixel 7 and Pixel 8a running September's Android 17 build, both wcscspn() and wcspbrk() return index 1. A full sweep across Unicode code points from U+0001 to U+10FFFF (skipping surrogates and the two delimiter characters) showed wcscspn() returning 0 instead of 1 for all 1,111,808 code points from U+0100 through U+10FFFF. Any Latin Extended, Greek, Cyrillic, CJK, or emoji character triggers a false match whenever the reject set contains two or more characters that are all below U+0100.

Why the developer had to disassemble /apex/com.android.runtime/lib64/bionic/libc.so

When a standard C library function misbehaves on an open-source operating system, the normal debugging workflow is to open the repository and inspect the implementation. When francisdb checked the public android17-release sources (android-17.0.0_r1, published in June 2026), wcscspn() and wcspbrk() were built from external/llvm-libc as a straightforward nested loop over wchar_t. That source code did not exhibit the bug.

Because the source code corresponding to the September Pixel binary was absent from the public repository, francisdb extracted /apex/com.android.runtime/lib64/bionic/libc.so from the device and disassembled wcscspn:

Android NDK issue 2260 disassembly of Bionic libc.so

The disassembled ARM64 instructions revealed three execution paths chosen by the contents of the reject set:

  1. Single-character reject set: runs a direct comparison loop and returns the right index.
  2. Reject set containing any character >= 0x100: falls back to calling wcschr() for each character in the input string and returns the right index.
  3. Reject set with two or more characters all < 0x100: populates a 256-byte bool lookup table on the stack and scans the input string with the following loop:
a2564:  ldrb  w8, [x9, x8]        ; table[c]
a2568:  tbnz  w8, #0, a2578       ; in set -> stop (correct)
a256c:  ldr   w8, [x22, #0x4]!    ; next character
a2570:  cmp   w8, #0x100
a2574:  b.lo  a2564               ; c < 0x100 -> keep scanning
a2578:  ...                       ; c >= 0x100 -> STOP, reported as a match
Enter fullscreen mode Exit fullscreen mode

Look at instructions a2570 and a2574. After loading the next 32-bit wchar_t into w8, the loop compares w8 against 0x100 (256 decimal) and branches back to a2564 only when the character is unsigned-lower (b.lo). When w8 >= 0x100, execution falls through to a2578 and terminates the scan.

For wcsspn(s, accept) — which counts characters that belong to an all-< 0x100 accept set — stopping as soon as a character >= 0x100 appears is the right behavior, because a wide character above 0xFF cannot be inside a lookup table of characters below 0x100. For the complement function wcscspn(s, reject), the exact opposite holds: a character >= 0x100 cannot be in an all-< 0x100 reject set, so the scan must continue past it. Because wcspbrk() is a thin wrapper around wcscspn(), both functions inherited the bug.

The internal Bionic unit test that expected 2u instead of 3u

Three hours after the issue was opened, Google Bionic maintainer Elliott Hughes (enh-google) confirmed the diagnosis:

"yeah, that all sounds correct, and seems to still be an issue at ToT. (i was going to say 'you know you can just look at the source?', but android-latest-release seems to still be too old to have any of these changes from april :-( )"

Thirty-five minutes later, Hughes posted a second comment after checking the internal test suite:

[ RUN      ] wchar.wcscspn
bionic/tests/wchar_test.cpp:(1475) Failure in test wchar.wcscspn
Expected equality of these values:
  2u
    Which is: 2
  wcscspn(L"he\ufffelo", L"lo")
    Which is: 3
wchar.wcscspn exited with exitcode 1.
Enter fullscreen mode Exit fullscreen mode

In the wide string L"he\ufffelo":

  • index 0 is 'h'
  • index 1 is 'e'
  • index 2 is \ufffe (>= 0x100)
  • index 3 is 'l' (the first character matching L"lo")

When the table-lookup optimization was written in April, the accompanying unit test at wchar_test.cpp:1475 asserted 2u — the index where the broken loop stopped on \ufffe — rather than 3u, where 'l' actually sits. Once the bug in wcscspn() was fixed locally, the unit test failed because the test itself had codified the bug.

AOSP source code schedule in 2026: Q2 and Q4 drops vs. shipped Pixel builds

Commenters on GitHub and in the Hacker News thread raised a broader question: why was code written in April and shipped to Pixel phones in September still missing from AOSP in mid-October?

Google collaborator pirama-arumuga-nainar pointed to the official Android Open Source Project site updates page, which carries this notice:

"Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release."

AOSP remains open source; Google has not made Android closed source. However, the publication cadence creates a multi-month gap between shipped quarterly Pixel releases and public branches. When we inspected the public refs/heads/android17-release commit log in platform/bionic on October 14, 2026, the top commit (06356e41c5ed7b12220b24c05ba4fdb873b126a7, Snap for 15110852 ... to 26Q2-release) was dated March 28, 2026, and tests/wchar_test.cpp on that branch contained only four ASCII assertions for wcscspn.

As Google engineer Maciej Żenczykowski (zenczykowski) wrote in the issue thread:

"Yes, but where is the source code for Android 17 QPR1 which is what is actually running on Pixel and has been stable for over a month..."

Until the Q4 source drop lands, outside developers hitting regressions in September's Android 17 QPR1 binaries have to diagnose them from compiled .so files.

Inside Google: Chrome refactoring and the 11-hour overnight ADK run with Gemini 4 Argon

While public AOSP drops follow a twice-yearly schedule, Google's internal teams are publishing case studies on how Gemini 4 Argon is accelerating internal and open-source codebases.

On the DeepMind Gemini 4 Argon page, Google reports that Argon helped the Chrome team separate core webpage handling from a roughly 6-million-line legacy folder of browser features inside Chromium's 40-million-line codebase, piping clean changes across hundreds of files and completing months of architectural refactoring work in weeks. Those numbers are vendor-reported internal claims, and the promised user-facing benefit — moving live webpages between tabs, side panels, and floating windows without reloading — is described as a future unlock.

A more detailed engineering breakdown arrived on October 13 on the Google for Developers Blog: Optimizing a 200,000-line Python codebase overnight with Gemini 4 Argon. Google Cloud engineers George Weale, Bo Yang, and Andrew Biernat ran Argon unattended for 11 hours overnight in Google Antigravity's /goal mode against google/adk-python, which spans roughly 205,000 lines of Python across nearly 800 files and 16,892 unit tests.

ADK overnight optimization proposals shipped vs cut in code review

The most instructive part of that post is what happened during human code review the next morning. Argon opened a pull request proposing six optimizations across 32 files. The human maintainers shipped two and rejected four:

Optimization proposed by Argon Outcome Reason from human code review / internal tests
Filter in-memory session events before deep-copying Shipped Cut pre-model session overhead by ~40% in 50- and 150-turn sessions (158-turn benchmark dropped from 65.6 s to 56.1 s).
Lazy-load heavy modules (import google.adk) Shipped (modified) Deleting top-level imports directly passed all 16,892 open-source tests, yet broke 25 internal Google test targets that patched those module attributes. Rewritten with lazy module accessors (-21% cold import time).
Multi-agent event cache using weak references Cut Sped up a synthetic benchmark by 17%, yet relied on a weak memory reference that could return stale data across sessions if Python reused a memory address after garbage collection.
OpenTelemetry tracer private-attribute check Cut Read a private attribute on OpenTelemetry's tracer implementation that could break silently on a minor library upgrade.
Conversation-history formatting rewrite Cut Reduced readability on a core code path without improving end-to-end latency on the team's independent holdout benchmark.
Workflow event replay lookup index Cut Added state-tracking complexity that only helped synthetic replay tests.

As the Google Cloud authors summarized the workflow: "the agent explores, the maintainer subtracts." Even when a frontier model runs all 16,892 unit tests and audits its own diff, human maintainers still had to reject two-thirds of its optimization ideas and catch 25 broken internal test targets.

Gemini 4 Argon API pricing, tier limits, and the December 1 price increase

When we covered Gemini 4 Argon's initial announcement on October 1 (2026-10-01-gemini-4-argon), we stamped it NEEDS REVIEW because general developers and consumers could not access the model outside the Fairwind cyber-defense program.

On October 13, 2026, the Gemini API Release Notes marked gemini-4-argon generally available (GA), alongside a newly published October 13 Model Card. However, developers checking where they can use Argon will immediately notice a discrepancy between Google's marketing page and its developer documentation:

Gemini 4 Argon API pricing table and AI Pro exclusion note

In Google AI Studio and Google Antigravity, interactive developer access requires Google AI Ultra or a Paid Tier Gemini API key with Cloud Billing enabled. And the API pricing table adds an explicit expiration date to Argon's launch rates:

Gemini API Tier (gemini-4-argon) Through Nov 30, 2026 (per 1M tokens) Starting Dec 1, 2026 (per 1M tokens) Caching & Output Notes
Standard (Paid) $2.00 input / $10.00 output $4.00 input / $20.00 output Output includes thinking tokens. Implicit caching only ($0.10 -> $0.20); explicit cachedContents unsupported.
Batch / Flex $1.00 input / $5.00 output $2.00 input / $10.00 output 50% discount for asynchronous / flexible workloads.
Priority $3.60 input / $18.00 output $7.20 input / $36.00 output 0.3x default standard rate limit allocation.
Free / Google AI Pro (AI Studio) Not available Not available Excluded in AI Studio & Gemini API docs.

Developers migrating to gemini-4-argon via the Interactions API also need to account for three technical constraints documented in the What's new in Gemini 4 Argon guide:

  1. Unified 1,048,576-token window and 64K synchronous cap: Input, thinking, and output tokens share one 1M-token window. Synchronous calls default to a 65,536 (64K) max_output_tokens ceiling. Generating up to 1M output tokens requires background=True (long decode), where Google's servers chain 64K-token continuation steps that your client concatenates from interaction.steps.
  2. 15-minute client timeouts and 44-second time to first answer token: Google's migration checklist recommends setting HTTP client timeouts to at least 15 minutes for hard prompts. On the independent Artificial Analysis benchmark, Gemini 4 Argon (High) scores 53 on the Intelligence Index v4.3.2 (tied with GPT-6 Astra and Claude Fable 5.1, behind Claude Opus 5.5 at 58), and live provider benchmarks measure a median 42.97 seconds (Vertex) to 44.70 seconds (AI Studio) before the first answer token arrives on 10k-token prompts.
  3. Explicit context caching and sampling parameters removed: cachedContents calls fail on gemini-4-argon (only automatic implicit caching on prompts >= 4,096 tokens is supported), and temperature, top_p, and top_k are ignored in favor of thinking_level (low, medium, high).

Google also published Gemini 4 Argon for Robotics on October 13, showing a Boston Dynamics Spot quadruped throwing soda cans into a foot-pedal trash bin. Even there, the workflow reinforces the same engineering lesson: before stepping on the physical pedal, Argon builds an articulated MuJoCo digital twin to practice three-leg tripod balance in simulation, operating inside a human-supplied spot-mobile-manipulation skill and two camera-verification prompts (foot-verifier and hand-verifier).

Verdict: NEEDS REVIEW

With gemini-4-argon now live on the paid Gemini API at $2/$10 per million tokens through November 30, it is worth testing on bounded refactors and long-context engineering tasks where your own test suite and code review can filter out bad proposals. At the same time, Google's twice-yearly AOSP source schedule leaves outside Android developers disassembling shipped Pixel libraries to diagnose regressions that Google's own internal unit tests missed. Fast AI code generation inside the house makes timely public source releases and rigorous tests outside the house even more important.

FAQ

Why did wcscspn() and wcspbrk() break on September 2026 Android 17 Pixel builds?

On Android 17 build CP3A.260905.009, Bionic's new table-lookup path for reject sets with two or more characters < 0x100 compares each input wchar_t against 0x100 (cmp w8, #0x100) and stops scanning whenever a character is >= 0x100. That reports every non-Latin-1 character (U+0100 to U+10FFFF) as a match.

Is the Android Open Source Project (AOSP) still open source in 2026?

Yes. Under Google's 2026 release policy, AOSP remains open source and publishes source code in Q2 and Q4 to align with its trunk-stable model. Because quarterly Pixel releases ship between those drops, the September Android 17 QPR1 binaries on phones ran ahead of the public android17-release branch (which was last snapped in late March 2026 for the 26Q2 release).

Who can access Gemini 4 Argon (gemini-4-argon) and how much does it cost?

As of October 13, 2026, gemini-4-argon is generally available on the paid tier of the Gemini API and in Google AI Studio and Antigravity for Google AI Ultra subscribers (the API pricing and AI Studio plan docs exclude the Free and Google AI Pro tiers). Standard API pricing is $2.00 per 1M input tokens and $10.00 per 1M output tokens through November 30, 2026, doubling to $4.00 input and $20.00 output on December 1, 2026.

How does Gemini 4 Argon rank on independent benchmarks?

On the Artificial Analysis Intelligence Index v4.3.2, Gemini 4 Argon (High) scores 53, tied for second place with GPT-6 Astra (53) and Claude Fable 5.1 (53), five points behind Claude Opus 5.5 (58). Live provider tests record ~100–116 output tokens per second after a median 43–45 second thinking phase before the first answer token.

Sources


This article expands on an episode of **The Daily Diff, a five-minute daily video on what shipped and what broke in tech.
Watch the episode · Subscribe on YouTube · the written diff lands in your inbox every morning at thedailydiff.dev.

Video transcript and primary sources

Top comments (0)