Subject : Using SkMD5 for cross‑platform snapshot (pixel) testing in Skia

58 views
Skip to first unread message

SONAIPANDI SONAIPANDI

unread,
Jul 4, 2026, 9:22:55 AMJul 4
to skia-discuss

Hello Team,

We are developing a 2D rendering application using Skia that needs to support all major desktop and mobile operating systems. For visual regression tests, our idea is to render a frame, compute an MD5 hash of the pixel buffer using SkMD5, and compare it against a stored “golden” hash to detect changes.

We have reviewed this approach, but we would like feedback on what disadvantages or pitfalls we might face when using an SkMD5‑based hasher for snapshot testing, especially in a cross‑platform setup. For example, are there known issues such as platform‑dependent rendering differences, floating‑point variations, or MD5 being too sensitive / not ideal for image comparison?

Any guidance or experience using SkMD5 (or other Skia‑based approaches) for snapshot/pixel testing would be very helpful.

Thanks in advance.

Florin Malita

unread,
Jul 6, 2026, 11:20:07 AMJul 6
to skia-d...@googlegroups.com
There are definitely pixel differences across platforms, backends, build options, etc. Depending on your target test matrix, you'll likely have to deal with multiple correct results.

You may want to look at our Gold infra tools, which cover a similar use case.  The code is open source, I think you should be able to run your own instance.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/skia-discuss/5d03e611-c565-4d1f-a28b-d28c4c4cfb2bn%40googlegroups.com.

SONAIPANDI SONAIPANDI

unread,
Jul 7, 2026, 1:31:15 AMJul 7
to skia-discuss

Thanks for your valuable input, Florin.

One more thing I’d like to mention is that we are rendering to a GPU‑backed surface. Does this MD5‑based approach (using SkMD5 on the pixel buffer) still work reliably in that case, or will it be difficult to manage?

Compared to a CPU‑backed (raster) surface, will writing snapshot tests for a GPU‑backed surface be significantly more complex? If so, could you explain what kinds of difficulties we might face when writing test cases for GPU‑backed rendering (for example, driver differences, non‑deterministic results, or backend‑specific behavior)?

Thanks in advance.

Florin Malita

unread,
Jul 8, 2026, 3:12:42 PMJul 8
to skia-d...@googlegroups.com
On Tue, Jul 7, 2026 at 1:31 AM SONAIPANDI SONAIPANDI <sonaipandis...@gmail.com> wrote:

Thanks for your valuable input, Florin.

One more thing I’d like to mention is that we are rendering to a GPU‑backed surface. Does this MD5‑based approach (using SkMD5 on the pixel buffer) still work reliably in that case, or will it be difficult to manage?

Compared to a CPU‑backed (raster) surface, will writing snapshot tests for a GPU‑backed surface be significantly more complex? If so, could you explain what kinds of difficulties we might face when writing test cases for GPU‑backed rendering (for example, driver differences, non‑deterministic results, or backend‑specific behavior)?

I don't think tests targeting Skia's GPU backends are fundamentally more complex, but there are some additional considerations.  Setting up the backend takes extra steps, you'll likely have to run the tests serially, and there are more entropy sources like the ones you mentioned.  But once you allow for multiple correct pixel variations, which you need regardless of the backend, it's just a matter of scaling -- the workflow doesn't change.
 
Thanks in advance.

On Monday, 6 July 2026 at 20:50:07 UTC+5:30 Florin Malita wrote:
There are definitely pixel differences across platforms, backends, build options, etc. Depending on your target test matrix, you'll likely have to deal with multiple correct results.

You may want to look at our Gold infra tools, which cover a similar use case.  The code is open source, I think you should be able to run your own instance.

On Sat, Jul 4, 2026 at 9:23 AM SONAIPANDI SONAIPANDI <sonaipandis...@gmail.com> wrote:

Hello Team,

We are developing a 2D rendering application using Skia that needs to support all major desktop and mobile operating systems. For visual regression tests, our idea is to render a frame, compute an MD5 hash of the pixel buffer using SkMD5, and compare it against a stored “golden” hash to detect changes.

We have reviewed this approach, but we would like feedback on what disadvantages or pitfalls we might face when using an SkMD5‑based hasher for snapshot testing, especially in a cross‑platform setup. For example, are there known issues such as platform‑dependent rendering differences, floating‑point variations, or MD5 being too sensitive / not ideal for image comparison?

Any guidance or experience using SkMD5 (or other Skia‑based approaches) for snapshot/pixel testing would be very helpful.

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/skia-discuss/5d03e611-c565-4d1f-a28b-d28c4c4cfb2bn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages