Skip to content

Autoroll from main to 27.lts - #884

Open
cobalt-github-releaser-bot wants to merge 10 commits into
27.ltsfrom
autoroll-main-to-27.lts
Open

cobalt-github-releaser-bot wants to merge 10 commits into
27.ltsfrom
autoroll-main-to-27.lts

Conversation

@cobalt-github-releaser-bot

@cobalt-github-releaser-bot cobalt-github-releaser-bot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Automated cherry-pick roll to 27.lts.

Original pull requests:

  • #11234
  • #10951
  • #11291
  • #11304
  • #11317
  • #11296
  • #11290
  • #11287
  • #11318
  • #11248

To merge these changes, run the autoroll script:

GITHUB_REPOSITORY=youtube/cobalt_sandbox python3 cobalt/devinfra/github/autoroll/merge_autoroll.py \
  --source-branch main \
  --target-branch 27.lts

sacuff and others added 10 commits September 8, 2026 23:14
Refer to original PR: #11234

This disables the pre-existing `enable_devtools_frontend` buildflag on
Cobalt builds and conditionally removes `devtools_resources.pak` from
`//cobalt/shell:pak`, plus some other changes to ensure non-Android
builds succeed. Remote devtools are still functional.

`enable_devtools_frontend` is already disabled upstream on Android, so
there should be no impact there. For 3P builds, this reduces the size of
`cobalt_shell.pak` from 5.3 MB to 2.0 MB.

Bug: 525402992
Bug: 523267920

(cherry picked from commit f5e2be9)
Refer to original PR: #10951

This PR adds the `cobalt-rdk-deploy` agent skill to the repository under
`.agent/skills/`.

The skill provides guidelines and execution protocols for Gemini/Jetski
to build, deploy, run, and debug Cobalt on RDK devices using the
`deploy_rdk.py` script.

### Guidelines included:
1. **Rely on help:** Always run `--help` first to discover available
execution modes and flags.
2. **Execute via script:** Formulate and run the `deploy_rdk.py` script
directly to interact with the device.
3. **Avoid manual device interaction:** Explicitly forbids running raw
shell commands (via `adb shell` or `ssh`) directly on the target device
for pre-flight checks (trusting the script to handle them).
4. **Toolchain assumptions:** Assume the compilation toolchain is
present by default and do not run `--setup-toolchain` or perform manual
pre-emptive checks (like checking `$RDK_HOME`) unless compilation fails.
5. **No-RBE default:** Avoid passing `--no-rbe` by default (only use it
if compilation fails).

Bug: 502702565

TAG=agy
CONV=e3d4c794-091a-4ae7-8cd1-810eebeb07ee

(cherry picked from commit aa9aef6)
….pak

Refer to original PR: #11291

This saves 700 KB by removing the resources required for the
chrome://tracing page, which can't be accessed on Cobalt. The tracing
backend is untouched.

Bug: 523267920

(cherry picked from commit 939e473)
Refer to original PR: #11304

This not only adds functionality to support a second to staging
autoroll, but also adds functionality to support a non-main source
branch.

To handle various .gitmodules issues such as corruption or conflicts,
the logic in resolve_conflicts was updated.

Due to the larger and more complex Chromium source cherry-picks, the
checkouts can no longer be sparse / none blobs.

Bug: 522987128

(cherry picked from commit b7ec7db)
Refer to original PR: #11317

The Crashpad handler executable is now expected to be under a
"native_target" parent directory, which is itself alongside the loader
app executable. This was originally thought of as a "hack" but we have
sinced aligned on the decision to promote this path as our new stanard
(see #9841).

Issue: 476394156

(cherry picked from commit a67bc99)
…4 Android builds

Refer to original PR: #11296

This change limits the compilation of the validating command decoder to
64-bit Android builds (target_cpu == "arm64").

Since Nvidia Shield is the only Android TV device that runs on an arm64
chip and requires the validating command decoder as a fallback (due to
driver bugs under the passthrough decoder), keeping it on arm64 ensures
Shield remains functional. Disabling it on 32-bit arm builds saves ~320
KB of binary size on all other memory-constrained Android TVs.

Bug: 521911827
TAG=agy
CONV=821cb3d0-a384-4064-bf2a-e82940e74df9

(cherry picked from commit 92b3f5d)
…headers

Refer to original PR: #11290

This fixes an issue with diagrams in codeblocks expanding to include
surrounding text in the `starboard/event.h` file. Additionally there
were some deletions to raspberry pi docs so regenerating for that too.

Bug: 529822255

(cherry picked from commit b3d03bd)
Refer to original PR: #11287

Turn SB_DCHECK_GE to SB_CHECK_GE in MediaCodecDecoder when receiving
input and output buffers from Android MediaCodec. This ensures that
invalid negative indices are caught immediately in all builds.

Bug: 329686979

(cherry picked from commit 73e5cf5)
Refer to original PR: #11318

Due to AOSP need, StarboardBrdige was renamed. This PR reverts the
rename and instead put shared code in a new base class that
StarboardBridge inherits from.

Bug: 533443758

(cherry picked from commit fb366eb)
…ache

Refer to original PR: #11248

DRAFT

This PR introduces the EnableOptimizedV8CodeCache switch. When enabled:
1. Increases the V8 Generated Code Cache quota to 5 MB in
`CobaltContentBrowserClient::GetGeneratedCodeCacheSettings`.
2. Filters out small (< 1 KB) bytecode snippets in
`GeneratedCodeCache::WriteEntry` to avoid LRU table clutter.

YouTube Living Room's compiled V8 script payload (kabuki.base,
kabuki.main, and tv-player-es6.js) sums to ~3.96 MB. Under the default 3
MB V8 code cache quota, core scripts continuously evict each other
across warm starts.

Locally on ADT-4, seeing reducing warm startup time to video player
ready by ~855 ms (from 2,477 ms to 1,622 ms).

Bug: 532266766

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

(cherry picked from commit e91d641)
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Roll main changes to 27.lts

Perform an automated roll of cherry-picked changes from the main
branch to the 27.lts branch. This update synchronizes the LTS branch
with changes from pull requests #11234, #10951, #11291, #11304,
#11317, #11296, #11290, #11287, #11318, and #11248.

Bug: None

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Android Starboard bridge by introducing BaseStarboardBridge and simplifying StarboardBridge, disables the DevTools frontend for Cobalt to optimize binary size, restricts the validating command decoder to 64-bit Android builds, and introduces an optimized V8 code cache option. Feedback has been provided regarding a potential AttributeError in the LTS autoroll script when resolving submodule conflicts, and an unsafe publication of this in the BaseStarboardBridge constructor before its final fields are fully initialized.

Comment on lines +140 to +146
match = re.search(r'160000 ([a-f0-9]+) 3', ls_files_out)
theirs_sha = match.group(1)
run([
'git', 'update-index', '--add', '--cacheinfo',
f'160000,{theirs_sha},{path}'
])
unmerged_files.pop(path, None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

In a modify/delete conflict on a submodule, the stage 3 ('theirs') entry will not exist in the git index. In this scenario, re.search will return None, and calling match.group(1) will raise an AttributeError, crashing the autoroll script. We should check if match is not None before extracting the SHA.

Suggested change
match = re.search(r'160000 ([a-f0-9]+) 3', ls_files_out)
theirs_sha = match.group(1)
run([
'git', 'update-index', '--add', '--cacheinfo',
f'160000,{theirs_sha},{path}'
])
unmerged_files.pop(path, None)
match = re.search(r'160000 ([a-f0-9]+) 3', ls_files_out)
if match:
theirs_sha = match.group(1)
run([
'git', 'update-index', '--add', '--cacheinfo',
f'160000,{theirs_sha},{path}'
])
unmerged_files.pop(path, None)
else:
log(f'Failed to find stage 3 SHA for submodule {path}')

Comment on lines +122 to +129
// Make sure the JNI stack is properly initialized first as there is a
// race condition as soon as any of the following objects creates a new thread.
BaseStarboardBridgeJni.get().initJNI(this);

mAppContext = appContext;
mActivityHolder = activityHolder;
mServiceHolder = serviceHolder;
mArgs = args;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Initializing the final fields (mAppContext, mActivityHolder, mServiceHolder, mArgs) after passing this to BaseStarboardBridgeJni.get().initJNI(this) exposes an incompletely constructed object to native code. If the native code synchronously invokes any @CalledByNative methods or spawns a thread that accesses these fields, it can result in a NullPointerException or memory visibility issues under the Java Memory Model. These simple reference assignments should be moved to the top of the constructor before initJNI(this).

Suggested change
// Make sure the JNI stack is properly initialized first as there is a
// race condition as soon as any of the following objects creates a new thread.
BaseStarboardBridgeJni.get().initJNI(this);
mAppContext = appContext;
mActivityHolder = activityHolder;
mServiceHolder = serviceHolder;
mArgs = args;
mAppContext = appContext;
mActivityHolder = activityHolder;
mServiceHolder = serviceHolder;
mArgs = args;
// Make sure the JNI stack is properly initialized first as there is a
// race condition as soon as any of the following objects creates a new thread.
BaseStarboardBridgeJni.get().initJNI(this);

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.

9 participants