Skip to content

Implement DisplayList canonicalization - #986

Merged
Kyle-Ye merged 6 commits into
mainfrom
feature/dl_canonicalization
Aug 9, 2026
Merged

Implement DisplayList canonicalization#986
Kyle-Ye merged 6 commits into
mainfrom
feature/dl_canonicalization

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

  • normalize empty and identity display-list items while preserving required content
  • collapse compatible paint, clip, mask, and color-filter paths
  • add dual coverage across canonicalization branches and reuse the shared SwiftUI version gate

Validation

  • all 40 parameterized canonicalization fixtures pass
  • the DisplayList printer dual-test suite passes

@github-actions github-actions Bot added area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. type: feature New API, behavior, platform support, or user-facing capability. labels Aug 9, 2026
@Kyle-Ye
Kyle-Ye marked this pull request as ready for review August 9, 2026 17:51
@augmentcode

augmentcode Bot commented Aug 9, 2026

Copy link
Copy Markdown

PR Risk Analyzer Agent 🛡️

👀 Human review needed

Justification

This is a type: feature change that introduces substantive new production logic in core rendering — Sources/OpenSwiftUICore/Render/DisplayList/DisplayList.swift (+250/−47).

The reworked DisplayList.Item.canonicalize(options:) implements non-trivial branching that rewrites how display-list items are normalized and collapsed: empty/identity normalization, unit/zero opacity folding, identity-transform and identity-filter collapsing, clip→shape paint substitution, mask→clip/filter fusion, backdrop color-matrix fusion, and required-content preservation. Supporting helpers (opaqueContentPath, paint(in:), colorMatrix(size:), backdropFilter(size:)) and an effect-protocol relocation are also added.

These transformations directly affect rendered output correctness and edge-case behavior (e.g. opacity thresholds, opaque-paint detection, frame/offset handling, .required feature gating). This is well outside any automatic low-risk change class, so per policy I fail closed and route it to human review. The accompanying dual-test suite (40 canonicalization fixtures) is helpful signal but does not by itself substitute for human review of the core logic.

Reviewed commit bc9c273

Pair Reviewer 🧭

Pair Review in progress — view session

@augmentcode

augmentcode Bot commented Aug 9, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR implements canonicalization for DisplayList.Item values.

Changes:

  • Removes empty content and effect items when they do not carry required content.
  • Flattens identity effects, unit opacity, identity affine transforms, and identity filters.
  • Collapses compatible clip-and-paint paths into shape content.
  • Converts eligible opaque masks into clips and masked backdrop filters into vibrant color-matrix filters.
  • Fuses nested compatible color-matrix filters.
  • Moves effect-animation protocols and transform accessors into focused extensions without behavior changes.
  • Adds a Darwin symbol stub and parameterized dual tests covering canonicalization branches.
  • Reuses the shared SwiftUI 6.5-to-before-7.0 runtime gate in printer dual tests.
Technical Notes: Rewrites preserve item identity/frame/version handling where identity effects are eliminated and honor `.disableCanonicalization` plus required-content features.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

Review completed with 0 suggestions.

Reviewed commit: bc9c273

@Kyle-Ye
Kyle-Ye merged commit f36a53c into main Aug 9, 2026
3 of 8 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/dl_canonicalization branch August 9, 2026 18:02
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 164 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.61%. Comparing base (c343337) to head (bc9c273).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...enSwiftUICore/Render/DisplayList/DisplayList.swift 0.00% 164 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #986      +/-   ##
==========================================
- Coverage   14.66%   14.61%   -0.05%     
==========================================
  Files         690      690              
  Lines       47615    47762     +147     
==========================================
- Hits         6983     6982       -1     
- Misses      40632    40780     +148     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tuist

tuist Bot commented Aug 9, 2026

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Cache hit rate Tests Skipped Ran Commit
OpenSwiftUI 0 % 1012 0 1012 931fdf8b7

Failed Tests ❌

  • OpenSwiftUI: 6 failed tests (View all)

  • viewListUsageRendersStaticAndOptionalAliasSources() · OpenSwiftUITests · ViewAliasTests
    (optionalPresentDisplayList → "(display-list (item #:identity 8 #:version 17 (frame (0.0 0.0; 100.0 100.0)) (content-seed 33) (color #000000FF)))"…

  • nestedUnaryViewRoot() · OpenSwiftUICoreTests · VariadicViewTests
    (displayList.description → "(display-list (item #:identity 7 #:version 1005 (frame (0.0 0.0; 100.0 100.0)) (effect (item #:identity 10 #:version…

  • nestedMultiViewRoot() · OpenSwiftUICoreTests · VariadicViewTests
    (displayList.description → "(display-list (item #:identity 14 #:version 1008 (frame (0.0 0.0; 100.0 100.0)) (content-seed 2015) (color #FF3B30FF))…

  • optionalViewAliasDynamicProperty() · OpenSwiftUITests · ViewAliasTests
    (displayList → "(display-list (item #:identity 4 #:version 10 (frame (0.0 0.0; 100.0 100.0)) (content-seed 19) (color #000000FF)))").contains(effe…

  • optionalViewAliasUsage(sourceIsPresent:) · OpenSwiftUITests · ViewAliasTests
    (displayList → "(display-list (item #:identity 1 #:version 3 (frame (0.0 0.0; 100.0 100.0)) (content-seed 5) (color #000000FF)))").contains(effect…

Showing 5 of 6 failed tests. See links above for full details.

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI 1m 38s 931fdf8b7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant