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

8296589: PixelBufferDrawTest fails on some systems #944

Conversation

lukostyra
Copy link
Contributor

@lukostyra lukostyra commented Nov 9, 2022

Issue happening on some hardware due to slightly different pixel values being returned.

Increased tolerance of asserts in compareColor function to allow these tests to pass (0.01 delta is still tighter than other similar tests which use 0.07).


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8296589: PixelBufferDrawTest fails on some systems

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/944/head:pull/944
$ git checkout pull/944

Update a local copy of the PR:
$ git checkout pull/944
$ git pull https://git.openjdk.org/jfx pull/944/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 944

View PR using the GUI difftool:
$ git pr show -t 944

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/944.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 9, 2022

👋 Welcome back lukostyra! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

Assert.assertEquals(exp.getBlue(), act.getBlue(), 0.005);
Assert.assertEquals(exp.getGreen(), act.getGreen(), 0.005);
Assert.assertEquals(exp.getOpacity(), act.getOpacity(), 0.005);
Assert.assertEquals(exp.getRed(), act.getRed(), 0.01);
Copy link
Contributor

Choose a reason for hiding this comment

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

I am curious: what is the source of these differences?
Is it color model (and could we explicitly set the CM?)
Or is it differences in anti-aliasing or some such?

Copy link
Member

Choose a reason for hiding this comment

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

It's a good question, but I note that any number of things can cause such differences on some systems. As I mentioned in the bug report, most of our robot-based tests use 0.07 as a tolerance value. The idea being that these tests aren't trying to check whether the rendering is pixel perfect or that the shaders, etc., produce an exact value. They are just checking whether the pixel is red versus green versus orange, etc.

Copy link
Contributor Author

@lukostyra lukostyra Nov 10, 2022

Choose a reason for hiding this comment

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

I decided to do a bit more digging and I found out that those tests pass with original 0.005 tolerance if you plug in an external display and make it your main. In short:

  • Plugged in a 1080p display via HDMI port
  • Made the 1080p display the main display
  • To be sure tests will execute on it I mirrored 1080p display contents onto built-in Retina XDR display (I couldn't find an option to disable it).

As a result, these tests started to pass again. Hard to say why exactly that happens, could be HiDPI-related, could be no HDR on my 1080p display, could be something else... Regardless, higher tolerance in these tests should still be okay as Kevin mentioned.

@openjdk openjdk bot added the rfr Ready for review label Nov 9, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 9, 2022

Webrevs

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

I confirm that the updated test passes on my Mac M1 system (the existing version fails always).

@openjdk
Copy link

openjdk bot commented Nov 9, 2022

@lukostyra This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8296589: PixelBufferDrawTest fails on some systems

Reviewed-by: kcr, angorya

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the master branch:

  • 7dc284d: 8221708: Update Eclipse project files

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kevinrushforth) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Nov 9, 2022
Issue happening on some hardware due to slightly different pixel values being returned.

Increased tolerance of asserts in compareColor function to allow these tests to pass
(0.01 delta is tighter than other tests which use 0.07).
@lukostyra lukostyra force-pushed the JDK-8296589-PixelBufferDrawTest-tolerance branch from 46665a4 to 082cd74 Compare November 10, 2022 14:53
@openjdk openjdk bot removed the ready Ready to be integrated label Nov 10, 2022
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

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

I would have made it a static field, but this is also acceptable.

@kevinrushforth
Copy link
Member

lukostyra force-pushed the JDK-8296589-PixelBufferDrawTest-tolerance branch from 46665a4 to 082cd74

@lukostyra Please don't force push to your branch once the PR has been published as rfr. See item 3 of the pull request section in CONTRIBUTING.md.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

Updated fix looks fine.

@openjdk openjdk bot added the ready Ready to be integrated label Nov 12, 2022
@lukostyra
Copy link
Contributor Author

lukostyra force-pushed the JDK-8296589-PixelBufferDrawTest-tolerance branch from 46665a4 to 082cd74

@lukostyra Please don't force push to your branch once the PR has been published as rfr. See item 3 of the pull request section in CONTRIBUTING.md.

Sorry about that! I'll make sure to not do it in the future.

@lukostyra
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Nov 14, 2022
@openjdk
Copy link

openjdk bot commented Nov 14, 2022

@lukostyra
Your change (at version 082cd74) is now ready to be sponsored by a Committer.

@kevinrushforth
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 14, 2022

Going to push as commit 0ee116d.
Since your change was applied there has been 1 commit pushed to the master branch:

  • 7dc284d: 8221708: Update Eclipse project files

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 14, 2022
@openjdk openjdk bot closed this Nov 14, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review sponsor Ready to sponsor labels Nov 14, 2022
@openjdk
Copy link

openjdk bot commented Nov 14, 2022

@kevinrushforth @lukostyra Pushed as commit 0ee116d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@lukostyra lukostyra deleted the JDK-8296589-PixelBufferDrawTest-tolerance branch November 17, 2022 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants