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

Added tests for usdImagingGL and testusdview #1743

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

nvidia-jomiller
Copy link
Contributor

Description of Change(s)

The pxr_register_test function now has an IMAGE_DIFF_COMPARE argument. This argument allows for tests that rely on comparing output images with a baseline. Threshold arguments (FAIL, FAIL_PERCENT, etc.) have also been added to control the acceptable tolerance for the image diff.

Under the hood, this is currently using idiff from OpenImageIO. Using idiff does require OpenImageIO to be built if tests are also being built. There is also a subtle change in build_usd.py which enables OpenImageIO when tests are being built

Fixes Issue(s)

pxr/usdImaging/usdImagingGL/CMakeLists.txt Show resolved Hide resolved
pxr/usdImaging/usdImagingGL/CMakeLists.txt Outdated Show resolved Hide resolved
pxr/usdImaging/usdImagingGL/CMakeLists.txt Outdated Show resolved Hide resolved
# The following tests are disabled since the stages are unable to load any .tx files
# In theory these image files should be able to load through the hioOiio plugin but I have not
# been able to get that too work. I did try to convert these images through OIIO's iconvert tool
# but it also fails trying to open the .tx files
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment pretty much describes the issue I ran into with .tx files. I just want to point this out so we can discuss how we should handle these tests

TESTENV testUsdImagingGLUsdLux
)

# TODO: Requires create_symlinks.py to run properly
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The testSpecs.xml reference this create_symlinks.py script. I'm not sure how this exactly sets up the symlinks so the following test is disabled for now. It might be worth asking about the script so we can enable this test

pxr/usdImaging/usdImagingGL/CMakeLists.txt Outdated Show resolved Hide resolved
@spiffmon
Copy link
Member

This is exciting, @nvidia-jomiller ! Before we can proceed, though, can you please ask Rev to update the NVidia CLA to add you as one of the sanctioned contributors? Thanks so much!

@nvidia-jomiller
Copy link
Contributor Author

@spiffmon absolutely!

@jilliene
Copy link

Filed as internal issue #USD-7144

@nvidia-jomiller
Copy link
Contributor Author

@spiffmon from my understanding Rev sent an email to update the CLA. So once we're good there we can work on getting this reviewed and merged into dev. Thanks!

@spiffmon
Copy link
Member

spiffmon commented Feb 10, 2022 via email

Copy link
Contributor

@sunyab sunyab left a comment

Choose a reason for hiding this comment

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

I took a first pass at reviewing and testing this change and left some notes.

Just FYI, I'm going to be pulling in parts of this PR separately -- I've already merged the .tex -> .hdr change, and will be merging the Z-up asset updates soon.

build_scripts/build_usd.py Outdated Show resolved Hide resolved
build_scripts/build_usd.py Outdated Show resolved Hide resolved
cmake/macros/testWrapper.py Outdated Show resolved Hide resolved
pxr/imaging/hioOpenVDB/CMakeLists.txt Outdated Show resolved Hide resolved
cmake/macros/testWrapper.py Show resolved Hide resolved
pxr/usdImaging/usdImagingGL/CMakeLists.txt Outdated Show resolved Hide resolved
@nvidia-jomiller nvidia-jomiller force-pushed the imaging-tests branch 2 times, most recently from b0576bc to 115001d Compare February 18, 2022 21:46
@nvidia-jomiller
Copy link
Contributor Author

One other thing to mention: when the usdImagingGL tests are ran on Windows a couple of the tests will just hang. The problem seems to lie somewhere in testUsdImagingGLBasicDrawing with the -offscreen option. In order to create an issue, we'll probably have to have this merged

Copy link
Contributor

@sunyab sunyab left a comment

Choose a reason for hiding this comment

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

Did another testing pass and ran into a few remaining issues that I've noted below.

One other request: there were several tests that were already using idiff in the testSpecs.xml we sent along to you, and I think we just took the thresholds as-is from those files. Those tests fail on my separate test machine, so if possible I'd love to just change them to use perceptual diffs. These tests are:

  • testUsdImagingGLBasicDrawingNonBindless_batch
  • testUsdImagingGLDomeLight_ZupFront
  • testUsdImagingGLDomeLight_ZupBack
  • testUsdImagingGLDomeLight_YupFront
  • testUsdImagingGLDomeLight_YupBack
  • testUsdImagingGLDomeLight_multi
  • testUsdImagingGLDomeLight_rough
  • testUsdImagingGLDomeLight_grid
  • testUsdImagingGLDomeLight_grid_specwf
  • testUsdImagingGLSurfaceShader_1_2_5

Otherwise I think this change looks ready to go. Thanks so much for all of your work on this!

cmake/macros/testWrapper.py Outdated Show resolved Hide resolved
cmake/macros/testWrapper.py Outdated Show resolved Hide resolved
pxr/usdImaging/bin/testusdview/CMakeLists.txt Outdated Show resolved Hide resolved
pxr/usdImaging/bin/testusdview/CMakeLists.txt Outdated Show resolved Hide resolved
pxr/usdImaging/usdImagingGL/CMakeLists.txt Show resolved Hide resolved
pxr/usdImaging/usdImagingGL/CMakeLists.txt Outdated Show resolved Hide resolved
pixar-oss pushed a commit that referenced this pull request Feb 22, 2022
for dome light textures instead of a .tex file.

.tex files are a RenderMan-specific image format that
are not usable in a standard USD build. .hdr files
are supported by the built-in stb_image-based image
reader.

Thanks to @nvidia-jomiller for identifying this
issue as part of PR #1743.

(Internal change: 2215594)
pixar-oss pushed a commit that referenced this pull request Feb 22, 2022
The baseline images for these tests were generated under
Pixar's studio-specific configuration which specifies
Z-up by default. This change authors that explicitly into
the test assets to isolate them from site-specific settings
and ensure consistent behavior.

This is part of PR #1743 from @nvidia-jomiller.

(Internal change: 2216745)
The pxr_register_test function now has an IMAGE_DIFF_COMPARE argument. This argument allows for tests that rely on comparing output images with a baseline. Threshold arguments (FAIL, FAIL_PERCENT, etc.) have also been added to control the acceptable tolerance for the image diff.

Under the hood, this is currently using idiff from OpenImageIO. Using idiff does require OpenImageIO to be built if tests are also being built. There is also a subtle change in build_usd.py which enables OpenImageIO when tests are being built
pixar-oss pushed a commit that referenced this pull request Feb 25, 2022
pixar-oss pushed a commit that referenced this pull request Feb 25, 2022
See previous change 2216745 for more details.

This is part of PR #1743 from @nvidia-jomiller.

(Internal change: 2217658)
@tallytalwar
Copy link
Contributor

tallytalwar commented Mar 8, 2022

Hey @nvidia-jomiller

We will be pushing the PR along with some followup fixes from @sunyab in the next dev branch update, in a bit. But just wanted to note that we have been seeing test failures because of perceptual differences in our static build configuration on Linux (https://github.com/PixarAnimationStudios/USD/blob/release/BUILDING.md#static-libraries)

An example snippet:

159: My_TestGLDrawing::DrawTest()
159: Iterations to convergence: 1
159: itemsDrawn 0
159: totalItemCount 0
159: testUsdImagingGLBasicDrawing_points_clipped.png
159: OK
159: Comparing "/scratch/varun/USD-pre/build_usd_static/inst/tests/ctest/testUsdImagingGLBasicDrawing/baseline/testUsdImagingGLBasicDrawing_points_clipped.png" and "testUsdImagingGLBasicDrawing_points_clipped.png"
159:   Mean error = 0.00315007
159:   RMS error = 0.0410138
159:   Peak SNR = 27.7414
159:   Max error  = 0.901961 @ (255, 225, B)  values are 1, 0, 1, 1 vs 1, 0.498039, 0.0980392, 1
159:   5330 pixels (1.74%) over 1e-06
159:   0 pixels (0%) over 1
159:   5330 pixels (1.74%) failed the perceptual test
159: FAILURE
159: Error: image diff for testUsdImagingGLBasicDrawing_points_clipped.png failed (IMAGE_DIFF_COMPARE).

We have not investigated this further on our end, but just wanted to highlight just in case you have noticed these on your end.

Thanks

@pixar-oss pixar-oss merged commit 049e19e into PixarAnimationStudios:dev Mar 8, 2022
@nvidia-jomiller
Copy link
Contributor Author

Hey @tallytalwar,

I haven't ran into that specific test failing but when I looked at the points.usd I noticed that it doesn't have the upAxis defined for the stage. As I was putting all these tests together the lack of a defined upAxis was usually the culprit for a failing perceptual test. I'll test that here on Windows but could you try defining the upAxis and re-running that test on Linux (I don't have easy access to a Linux box at the moment)?

Regardless, I think points.usda needs to be updated to include upAxis = "Z"

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.

6 participants