Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzy reftests #16656

Open
emilio opened this issue Apr 29, 2017 · 4 comments
Open

Fuzzy reftests #16656

emilio opened this issue Apr 29, 2017 · 4 comments
Labels

Comments

@emilio
Copy link
Member

@emilio emilio commented Apr 29, 2017

We need the ability to run fuzzy reftests to allow testing radial gradients and similar stuff (see #16385).

I don't have a lot of knowledge in the reftest infra, perhaps @jdm does?

This is probably a good project for starters, though I can't mentor it (I don't know where our image comparison lives).

@emilio emilio added the A-testing label Apr 29, 2017
@emilio emilio mentioned this issue Apr 29, 2017
3 of 5 tasks complete
@jdm
Copy link
Member

@jdm jdm commented Apr 29, 2017

http://web-platform-tests.org/writing-tests/reftests.html says there's no way standardized for fuzzy matching yet. https://lists.w3.org/Archives/Public/www-svg/2016Dec/0018.html is the last time I'm aware this missing feature was brought up. The WPT reference test comparison code just takes a hash of the two screenshots and compares them right now: https://github.com/w3c/wptrunner/blob/ebcd2639205a5268ea41a9389fd1e42746de722d/wptrunner/executors/base.py#L232-L248

@jdm
Copy link
Member

@jdm jdm commented Apr 29, 2017

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Apr 29, 2017

http://searchfox.org/mozilla-central/source/layout/tools/reftest/README.txt

2. A test item

   [ <failure-type> | <preference> ]* [<http>] <type> <url> <url_ref>

   where

   a. <failure-type> (optional) is one of the following:

[…]

      fuzzy(maxDiff, diffCount)
          This allows a test to pass if the pixel value differences are <=
          maxDiff and the total number of different pixels is <= diffCount.
          It can also be used with '!=' to ensure that the difference is
          greater than maxDiff.

      fuzzy-if(condition, maxDiff, diffCount)
          If the condition is met, the test is treated as if 'fuzzy' had been
          specified. This is useful if there are differences on particular
          platforms.
@pyfisch
Copy link
Contributor

@pyfisch pyfisch commented Dec 16, 2017

We need the ability to run fuzzy reftests to allow testing radial gradients and similar stuff

I have written this radial gradient code that seemed to need fuzzy reftests. It turned out that the two images where indeed different and the result of a bug. One included the border in calculations and the other did not. Fuzzy gradients would have masked this issue.

Writing tests with gradients does not require any form of fuzzy matching in my experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.