Skip to content

cobalt: Enable memory optimization features on 3P - #12996

Merged
jasonzhangxx merged 1 commit into
youtube:mainfrom
jasonzhangxx:enable-feature-on-3p
Sep 30, 2026
Merged

jasonzhangxx merged 1 commit into
youtube:mainfrom
jasonzhangxx:enable-feature-on-3p

Conversation

@jasonzhangxx

@jasonzhangxx jasonzhangxx commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Makes the following Cobalt features enabled by default on non-Android platforms, while keeping them disabled by default on Android:

  • CobaltInProcessImageTransferCache
  • CobaltInProcessDirectRaster
  • CobaltContentLengthAwareMojoPipeSizing

Adds a feature param kCobaltCCImageCacheLimitItemsMbs to the existing CobaltCCImageCacheLimitItems feature.

Test fixes for the features being enabled by default:

  • Flush GPU tasks while the cache is alive to unref images.
  • Finalize the DisplayItemList before sending it to Raster.

Bug: 545866687
Bug: 545216717
Bug: 520888239

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Enable memory optimizations on 3P

Enable several memory-related features by default for all platforms
except Android. These include CobaltInProcessImageTransferCache,
CobaltInProcessDirectRaster, and CobaltContentLengthAwareMojoPipeSizing.

Additionally, introduce the kCobaltCCImageCacheLimitItemsMbs feature
parameter. This allows the persistent image decode cache budget to be
controlled in megabytes via Finch configuration.

Bug: 545866687
Bug: 545216717
Bug: 520888239

💡 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
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
Context State Description
CI / All Pass ✅ PASS All checks passed
CI / android ✅ PASS Passed
CI / evergreen ✅ PASS Passed
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed

@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 configures several features to be disabled by default on Android while remaining enabled on other platforms, and introduces a new feature parameter kCobaltCCImageCacheLimitItemsMbs to control the image cache size limit in megabytes. Feedback suggests clarifying the comment for the new parameter to accurately state that negative values fallback to the default limit rather than applying no limit, and using base::CheckedNumeric during the megabytes-to-bytes conversion to prevent potential integer overflow.

Comment thread cc/tiles/image_decode_cache_utils.cc Resolved
Comment thread base/features.cc Resolved
Comment thread base/features.cc Resolved
Comment thread base/features.cc Resolved
Comment thread services/network/public/cpp/features.cc Resolved
Makes the following Cobalt features enabled by default on non-Android
platforms, while keeping them disabled by default on Android:
- CobaltInProcessImageTransferCache
- CobaltInProcessDirectRaster
- CobaltContentLengthAwareMojoPipeSizing

Adds a feature param kCobaltCCImageCacheLimitItemsMbs to the existing
CobaltCCImageCacheLimitItems feature.

Bug: 545866687
Bug: 545216717
Bug: 520888239
@jasonzhangxx
jasonzhangxx merged commit d0ee097 into youtube:main Sep 30, 2026
522 of 523 checks passed
@jasonzhangxx
jasonzhangxx deleted the enable-feature-on-3p branch September 30, 2026 20:18
@github-actions github-actions Bot added the cp-27.lts Cherry Pick to the 27.lts branch label Sep 30, 2026
briantting pushed a commit that referenced this pull request Sep 30, 2026
…atures on 3P

Refer to original PR: #12996

Makes the following Cobalt features enabled by default on non-Android
platforms, while keeping them disabled by default on Android:
- CobaltInProcessImageTransferCache
- CobaltInProcessDirectRaster
- CobaltContentLengthAwareMojoPipeSizing

Adds a feature param kCobaltCCImageCacheLimitItemsMbs to the existing
CobaltCCImageCacheLimitItems feature.

Test fixes for the features being enabled by default:
- Flush GPU tasks while the cache is alive to unref images.
- Finalize the DisplayItemList before sending it to Raster.

Bug: 545866687
Bug: 545216717
Bug: 520888239

(cherry picked from commit d0ee097)
briantting pushed a commit that referenced this pull request Sep 30, 2026
…features on 3P (#13040)

Automated cherry-pick roll to staging.

Original pull requests:
- #12996

CONFLICTED files:
```
cc/tiles/gpu_image_decode_cache_unittest.cc
```

To merge these changes, run the autoroll script:

```bash
GITHUB_REPOSITORY=youtube/cobalt python3 cobalt/devinfra/github/autoroll/merge_autoroll.py \
  --source-branch main \
  --target-branch staging
```

⚠️ This PR has conflicts that must be resolved manually (don't forget to
update the `.github/AUTOROLL` file). Use the following commands to
checkout the branch locally and resolve the conflicts in a separate
commit:

```bash
gh pr checkout <pull_request_number> -R youtube/cobalt

# Resolve conflicts and update .github/AUTOROLL then
git add <resolved_files>

# Copy CONFLICTED commit's message and metadata
# Replace CONFLICTED in title with RESOLVED
git commit -c <conflicted_sha>

git push origin autoroll-main-to-staging
```

---------

Co-authored-by: Jason <jasonzh@google.com>
@oxve oxve removed the cp-27.lts Cherry Pick to the 27.lts branch label Oct 5, 2026
abhijeetk added a commit to abhijeetk/cobalt that referenced this pull request Oct 6, 2026
PR youtube#12996 enabled the feature outside Android, which exposed tvOS.

Disable the feature by default on tvOS, as on Android. tvOS then takes
the serialized path, which uploads through the Graphite recorder.

Bug: 568730789
yell0wd0g pushed a commit that referenced this pull request Oct 6, 2026
PR #12996 enabled the feature outside Android, which exposed tvOS.

Disable the feature by default on tvOS, as on Android. tvOS then takes
the serialized path, which uploads through the Graphite recorder.

Bug: 568730789
briantting pushed a commit that referenced this pull request Oct 7, 2026
Refer to original PR: #13107

PR #12996 enabled the feature outside Android, which exposed tvOS.

Disable the feature by default on tvOS, as on Android. tvOS then takes
the serialized path, which uploads through the Graphite recorder.

Bug: 568730789

(cherry picked from commit d477e5f)
briantting pushed a commit that referenced this pull request Oct 16, 2026
…ache on tvOS

Refer to original PR: #13107

PR #12996 enabled the feature outside Android, which exposed tvOS.

Disable the feature by default on tvOS, as on Android. tvOS then takes
the serialized path, which uploads through the Graphite recorder.

Bug: 568730789

(cherry picked from commit d477e5f)
briantting pushed a commit that referenced this pull request Oct 16, 2026
Refer to original PR: #12996

Makes the following Cobalt features enabled by default on non-Android
platforms, while keeping them disabled by default on Android:
- CobaltInProcessImageTransferCache
- CobaltInProcessDirectRaster
- CobaltContentLengthAwareMojoPipeSizing

Adds a feature param kCobaltCCImageCacheLimitItemsMbs to the existing
CobaltCCImageCacheLimitItems feature.

Test fixes for the features being enabled by default:
- Flush GPU tasks while the cache is alive to unref images.
- Finalize the DisplayItemList before sending it to Raster.

Bug: 545866687
Bug: 545216717
Bug: 520888239

(cherry picked from commit d0ee097)
briantting pushed a commit that referenced this pull request Oct 16, 2026
Refer to original PR: #13107

PR #12996 enabled the feature outside Android, which exposed tvOS.

Disable the feature by default on tvOS, as on Android. tvOS then takes
the serialized path, which uploads through the Graphite recorder.

Bug: 568730789

(cherry picked from commit d477e5f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants