Skip to content

0 Initialize variables in the DlComplexityPathReceiver helper - #194540

Merged
gaaclarke merged 1 commit into
flutter:masterfrom
walley892:oops_i_broke_the_tree
Oct 16, 2026
Merged

gaaclarke merged 1 commit into
flutter:masterfrom
walley892:oops_i_broke_the_tree

Conversation

@walley892

@walley892 walley892 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

DlComplexityPathReceiver in dl_complexity_helper.cc:32-35 did not initialize its line_verb_count, quad_verb_count, conic_verb_count, and cubic_verb_count fields, causing ComplexityCalculatorHelper::CalculatePathComplexity to read uninitialized stack memory when computing path complexity.

In DisplayListComplexity.DrawShadow, removing BorderMaskBlur (#194508) shifted symbol addresses in display_list_unittests such that the uninitialized stack values in Linux linux_unopt caused the computed complexity score for display_list_conic to wrap to 0, failing ASSERT_NE(calculator->Compute(display_list_conic.get()), 0u). Zero-initializing the verb counters should fix the bug.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant in-code documentation (doc comments with ///).
  • If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions Bot added the engine flutter/engine related. See also e: labels. label Oct 16, 2026
@walley892

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 initializes the member variables line_verb_count, quad_verb_count, conic_verb_count, and cubic_verb_count to 0u in the DlComplexityPathReceiver class within dl_complexity_helper.cc. There are no review comments, and I have no feedback to provide.

@walley892
walley892 requested a review from gaaclarke October 16, 2026 07:04
@walley892
walley892 marked this pull request as ready for review October 16, 2026 07:04
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the test-exempt label. All reviewers should feel empowered to ask for tests before escalating.

@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 initializes the member variables line_verb_count, quad_verb_count, conic_verb_count, and cubic_verb_count to 0u in the DlComplexityPathReceiver class within dl_complexity_helper.cc. There are no review comments, and I have no additional feedback to provide.

@gaaclarke gaaclarke added the emergency Jump the queue; land PR in front of all others; only use for emergencies label Oct 16, 2026
@flutter-dashboard

Copy link
Copy Markdown

Detected the emergency label.

If you add the autosubmit label, the bot will wait until all presubmits pass but ignore the tree status, allowing fixes for tree breakages while still validating that they don't break any existing presubmits.

The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue".

@gaaclarke
gaaclarke enabled auto-merge October 16, 2026 15:46
@gaaclarke gaaclarke added the CICD Run CI/CD label Oct 16, 2026
@gaaclarke
gaaclarke added this pull request to the merge queue Oct 16, 2026
Merged via the queue into flutter:master with commit a3d71d8 Oct 16, 2026
31 of 37 checks passed
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Oct 16, 2026
flutter/flutter@5c7e45a...a3d71d8

2026-10-16 [email protected] 0 Initialize variables in the DlComplexityPathReceiver helper (flutter/flutter#194540)
2026-10-16 [email protected] Roll Fuchsia Test Scripts from V-qQL4158Nw6L-QLi... to 2T18KC7-LDQtmQiLP... (flutter/flutter#194527)
2026-10-16 [email protected] Remove BorderMaskBlur (flutter/flutter#194508)
2026-10-16 [email protected] Roll Skia from a577264dc087 to 470b8816a261 (1 revision) (flutter/flutter#194526)
2026-10-16 [email protected] [ios] Use DFS traversal to find engines of a scene automatically (rather than manually manage the engines list) (flutter/flutter#192457)
2026-10-16 [email protected] [Skia][DisplayList] Map local bounds through the local matrix in DlLocalMatrixImageFilter (flutter/flutter#193963)
2026-10-16 [email protected] [framework] Fix avoid_setters_without_getters warnings on mixin declarations  (flutter/flutter#193856)
2026-10-16 [email protected] Roll Dart SDK from 84686ea04815 to 55a734a01fb1 (3 revisions) (flutter/flutter#194522)
2026-10-16 [email protected] Roll Skia from d131b7789482 to a577264dc087 (7 revisions) (flutter/flutter#194514)
2026-10-16 [email protected] Roll Fuchsia GN SDK from PDJz3b3CL31uoLOkD... to kFdyRnojbVy0cxvRZ... (flutter/flutter#194510)
2026-10-16 [email protected] Roll GN to f9eca75ae554 (flutter/flutter#194471)
2026-10-16 [email protected] refactor(flutter_tools): migrate RunCommand and RunCommandBase to OptionDescriptor and OptionBundle (flutter/flutter#194362)
2026-10-15 [email protected] refactor(flutter_tools): finish TestCommand OptionDescriptor and OptionBundle migration (flutter/flutter#194361)
2026-10-15 [email protected] [iOS][a11y] Fix VoiceOver announcement for unfocused password fields (flutter/flutter#192851)
2026-10-15 [email protected] Roll pub packages (flutter/flutter#194477)
2026-10-15 [email protected] refactor(flutter_tools): finish DriveCommand OptionDescriptor migration (flutter/flutter#194360)
2026-10-15 [email protected] [flutter_tools] Roll package:vm_service to 15.4.0 (flutter/flutter#194467)
2026-10-15 [email protected] refactor(flutter_tools): migrate AttachCommand to OptionDescriptor and OptionBundle (flutter/flutter#194359)
2026-10-15 [email protected] [flutter_tools] Inject dependencies into update-packages and package_map (flutter/flutter#194046)
2026-10-15 [email protected] [impeller] parallelize opengles shader compiles (flutter/flutter#194022)
2026-10-15 [email protected] Roll pub packages (flutter/flutter#194469)
2026-10-15 [email protected] Restrict web dev server to loopback by default (flutter/flutter#187595)
2026-10-15 [email protected] Roll Packages from a1ed23c to da40eaf (33 revisions) (flutter/flutter#194459)
2026-10-15 [email protected] [web] Render soft hyphens on Skwasm (flutter/flutter#193850)
2026-10-15 [email protected] refactor(flutter_tools): migrate AssembleCommand to OptionDescriptor (flutter/flutter#194358)
2026-10-15 [email protected] [windows] Add OpenGL golden test against ANGLE at D3D11 feature level 10_0 (flutter/flutter#194321)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Oct 17, 2026
…ck (flutter#194576)

This PR enables a linter check that flags uninitialized variables. We
ran into a problem when flutter#194540
landed which was the result of uninitialized variables. This should
catch those kinds of issues earlier. Most of this PR is generated by
clang-tidy's fix operation, gemini operated where that failed.

Description from gemini:

> flutter#194540 fixed uninitialized counters in `DlComplexityPathReceiver`
that caused a flaky `DisplayListComplexity.DrawShadow` failure. None of
the clang-tidy checks we had enabled flag uninitialized members:
`modernize-use-default-member-init` only rewrites existing constructor
initializers, and the static analyzer gives up once the object is passed
by reference to an out-of-line call.
> 
> This enables `cppcoreguidelines-pro-type-member-init` (with
`UseAssignment: true`) and fixes the existing violations:
> 
> * Scalar/pointer/enum members get default member initializers (`= 0`,
`= nullptr`, or an explicit enumerator).
> * Uninitialized locals of trivially-constructible record types
(`FragInfo`, `PointerData`, `struct stat`, ...) are value-initialized
with `{}`.
> * Union-based types where the check reports false positives
(`Vector3`/`Vector4`, `HalfVector*`, `Quaternion`, `Shear`,
`SaveLayerOptions`) are wrapped in `NOLINTBEGIN/END` with an
explanation.
> 
> Default member initializers don't change object size or layout. The
only runtime cost is a few stores at construction, and most of those are
dead stores the optimizer removes.
> 
> Verified locally: `--lint-all` with this check is clean on
`host_debug_unopt_arm64` (macOS) and `android_debug_unopt_arm64`, and
both build. Linux host and iOS simulator lint variants will be checked
by CI.
> 

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/AI-contribution-guidelines.md
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/website]: https://github.com/flutter/website
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…r#194540)

DlComplexityPathReceiver in dl_complexity_helper.cc:32-35 did not
initialize its line_verb_count, quad_verb_count, conic_verb_count, and
cubic_verb_count fields, causing
ComplexityCalculatorHelper::CalculatePathComplexity to read
uninitialized stack memory when computing path complexity.
In DisplayListComplexity.DrawShadow, removing BorderMaskBlur (flutter#194508)
shifted symbol addresses in display_list_unittests such that the
uninitialized stack values in Linux linux_unopt caused the computed
complexity score for display_list_conic to wrap to 0, failing
ASSERT_NE(calculator->Compute(display_list_conic.get()), 0u).
Zero-initializing the verb counters should fix the bug.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…ck (flutter#194576)

This PR enables a linter check that flags uninitialized variables. We
ran into a problem when flutter#194540
landed which was the result of uninitialized variables. This should
catch those kinds of issues earlier. Most of this PR is generated by
clang-tidy's fix operation, gemini operated where that failed.

Description from gemini:

> flutter#194540 fixed uninitialized counters in `DlComplexityPathReceiver`
that caused a flaky `DisplayListComplexity.DrawShadow` failure. None of
the clang-tidy checks we had enabled flag uninitialized members:
`modernize-use-default-member-init` only rewrites existing constructor
initializers, and the static analyzer gives up once the object is passed
by reference to an out-of-line call.
> 
> This enables `cppcoreguidelines-pro-type-member-init` (with
`UseAssignment: true`) and fixes the existing violations:
> 
> * Scalar/pointer/enum members get default member initializers (`= 0`,
`= nullptr`, or an explicit enumerator).
> * Uninitialized locals of trivially-constructible record types
(`FragInfo`, `PointerData`, `struct stat`, ...) are value-initialized
with `{}`.
> * Union-based types where the check reports false positives
(`Vector3`/`Vector4`, `HalfVector*`, `Quaternion`, `Shear`,
`SaveLayerOptions`) are wrapped in `NOLINTBEGIN/END` with an
explanation.
> 
> Default member initializers don't change object size or layout. The
only runtime cost is a few stores at construction, and most of those are
dead stores the optimizer removes.
> 
> Verified locally: `--lint-all` with this check is clean on
`host_debug_unopt_arm64` (macOS) and `android_debug_unopt_arm64`, and
both build. Linux host and iOS simulator lint variants will be checked
by CI.
> 

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/AI-contribution-guidelines.md
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/website]: https://github.com/flutter/website
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD emergency Jump the queue; land PR in front of all others; only use for emergencies engine flutter/engine related. See also e: labels. missing-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants