LmCast :: Stay tuned in

Compiler-style optimization for drawing via Skia

Recorded: Sept. 19, 2026, 10 p.m.

Original Summarized

[2603.23696] Semantics for 2D Rasterization

Skip to main content

Search

Submit
Donate

Log in

Search arXiv

Press Enter to search · Advanced search

Computer Science > Programming Languages

arXiv:2603.23696 (cs)

[Submitted on 24 Mar 2026]
Title:Semantics for 2D Rasterization
Authors:Bhargav Kulkarni, Henry Whiting, Pavel Panchekha View a PDF of the paper titled Semantics for 2D Rasterization, by Bhargav Kulkarni and 2 other authors
View PDF
HTML (experimental)

Abstract:Rasterization is the process of determining the color of every pixel drawn by an application. Powerful rasterization libraries like Skia, CoreGraphics, and Direct2D put exceptional effort into drawing, blending, and rendering efficiently. Yet applications are still hindered by the inefficient sequences of operations that they ask these libraries to perform. Even Google Chrome, a highly optimized program co-developed with the Skia rasterization library, still produces inefficient instruction sequences even on the top 100 most visited websites. The underlying reason for this inefficiency is that rasterization libraries have complex semantics and opaque and non-obvious execution models.
To address this issue, we introduce $\mu$Skia, a formal semantics for the Skia 2D graphics library, and mechanize this semantics in Lean. $\mu$Skia covers language and graphics features like canvas state, the layer stack, blending, and color filters, and the semantics itself is split into three strata to separate concerns and enable extensibility. We then identify four patterns of sub-optimal Skia code produced by Google Chrome, and then write replacements for each pattern. $\mu$Skia allows us to verify the replacements are correct, including identifying numerous tricky side conditions. We then develop a high-performance Skia optimizer that applies these patterns to speed up rasterization. On 99 Skia programs gathered from the top 100 websites, this optimizer yields a speedup of 18.7% over Skia's most modern GPU backend, while taking at most 32 $\mu$s for optimization. The speedups persist across a variety of websites, Skia backends, and GPUs. To provide true, end-to-end verification, optimization traces produced by the optimizer are loaded back into the $\mu$Skia semantics and translation validated in Lean.


Comments:
23 pages, 15 figures

Subjects:

Programming Languages (cs.PL)

ACM classes:
I.3; D.3.1; D.3.2

Cite as:
arXiv:2603.23696 [cs.PL]

 
(or
arXiv:2603.23696v1 [cs.PL] for this version)

 
https://doi.org/10.48550/arXiv.2603.23696

Focus to learn more

arXiv-issued DOI via DataCite

Submission history From: Bhargav Kulkarni [view email] [v1]
Tue, 24 Mar 2026 20:14:34 UTC (1,399 KB)

Full-text links:
Access Paper:

View a PDF of the paper titled Semantics for 2D Rasterization, by Bhargav Kulkarni and 2 other authorsView PDFHTML (experimental)TeX Source

view license


Current browse context:
cs.PL

< prev

  |  
next >

new
|
recent
| 2026-03

Change to browse by:

cs

References & Citations

NASA ADSGoogle Scholar
Semantic Scholar

export BibTeX citation
Loading...

BibTeX formatted citation
×

loading...

Data provided by:

Bookmark

Bibliographic Tools

Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer (What is the Explorer?)

Connected Papers Toggle

Connected Papers (What is Connected Papers?)

Litmaps Toggle

Litmaps (What is Litmaps?)

scite.ai Toggle

scite Smart Citations (What are Smart Citations?)

Code, Data, Media

Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv (What is alphaXiv?)

Links to Code Toggle

CatalyzeX Code Finder for Papers (What is CatalyzeX?)

DagsHub Toggle

DagsHub (What is DagsHub?)

GotitPub Toggle

Gotit.pub (What is GotitPub?)

Huggingface Toggle

Hugging Face (What is Huggingface?)

ScienceCast Toggle

ScienceCast (What is ScienceCast?)

Demos

Demos

Replicate Toggle

Replicate (What is Replicate?)

Spaces Toggle

Hugging Face Spaces (What is Spaces?)

Spaces Toggle

TXYZ.AI (What is TXYZ.AI?)

Related Papers

Recommenders and Search Tools

Link to Influence Flower

Influence Flower (What are Influence Flowers?)

Core recommender toggle

CORE Recommender (What is CORE?)

Author
Venue
Institution
Topic

About arXivLabs

arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? |
Disable MathJax (What is MathJax?)

We gratefully acknowledge support from
our major funders,
member institutions, ,
and all contributors.

About
·
Help
·
Contact
·
Subscribe
·
Copyright
·
Privacy
·
Accessibility
·
Operational Status (opens in new tab)

Major funding support from

The research introduces $\mu$Skia, a formal semantics for the Skia 2D graphics library, aimed at addressing the inefficiency arising from the complex and opaque execution models within rasterization systems. While powerful rasterization libraries such as Skia, CoreGraphics, and Direct2D are designed for efficient drawing, applications often execute sequences of operations that are inherently suboptimal. This inefficiency stems from the intricate semantics and execution models embedded within these rasterization libraries.

To formalize this complexity and enable verifiable optimizations, the authors developed $\mu$Skia, which covers critical language and graphics features including canvas state management, the layer stack, blending operations, and color filters. The semantics of $\mu$Skia are structured into three distinct strata to effectively separate concerns, which enhances extensibility of the framework. A key methodological step involved identifying four specific patterns of sub-optimal code generated by Google Chrome and subsequently developing replacements for these patterns. The $\mu$Skia framework was instrumental in verifying that these replacements were correct, including the identification of numerous complex side conditions associated with the operations.

Building upon this formal foundation, the research developed a high-performance Skia optimizer. This optimizer uses the identified sub-optimal patterns to speed up the rasterization process significantly. Empirical testing on 99 Skia programs drawn from the top one hundred visited websites demonstrated that this optimizer achieves an 18.7 percent speedup compared to Skia’s most modern GPU backend, with the optimization process itself requiring at most thirty-two microseconds. These observed speedups were consistent across various websites, Skia backends, and different graphics processing units. Furthermore, true end-to-end verification was achieved by loading the optimization traces produced by the optimizer back into the $\mu$Skia semantics to validate the results. This closed-loop verification process ensures the correctness of the optimizations by validating them against the formal semantics established in Lean.