Skip to content

Swap the positions of Real and AbstractGray in promote_rule - #234

Merged
kimikage merged 1 commit into
JuliaGraphics:masterfrom
kimikage:promote_gray_real
Nov 15, 2026
Merged

kimikage merged 1 commit into
JuliaGraphics:masterfrom
kimikage:promote_gray_real

Conversation

@kimikage

@kimikage kimikage commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

While this isn't a fundamental solution or a silver bullet, experience has shown that it might reduce the risk of invalidation.

In addition, since this package does not specify the actual rules to be followed when no component type is specified, this narrows down the scope to AbstractGray{T}.

julia> eltype(Gray)
Any

julia> eltype(AbstractGray)
Any

The invalidation counts in CairoMakie TTFX Benchmark
https://perf.julialang.org/?tab=bench-ttfx&tt=14&tk=CairoMakie%2FPlot-A-Sine-Wave

Julia 1.13.4 Julia 1.15.0-DEV.743
Tuple{typeof(promote_rule), Type{T}, Type{C}} where {T<:Real, C<:ColorTypes.AbstractGray} 237 175

Since those invalidations occur in methods whose first argument is a type of Real, this change should at least resolve them.

@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.69%. Comparing base (ffc0017) to head (0ac0f66).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #234   +/-   ##
=======================================
  Coverage   96.69%   96.69%           
=======================================
  Files           3        3           
  Lines         272      272           
=======================================
  Hits          263      263           
  Misses          9        9           

☔ 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.

@kimikage kimikage changed the title Swap the positions of Real and AbstractGray in the promotion rules Swap the positions of Real and AbstractGray in the promotion rule Nov 15, 2026
@kimikage kimikage changed the title Swap the positions of Real and AbstractGray in the promotion rule Swap the positions of Real and AbstractGray in promote_rule Nov 15, 2026
@kimikage
kimikage merged commit 7cc5544 into JuliaGraphics:master Nov 15, 2026
11 checks passed
@kimikage
kimikage deleted the promote_gray_real branch November 15, 2026 02:22
@kimikage

kimikage commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

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.

1 participant