Skip to content

Enable test suite rendering on Mac#2675

Merged
jstone-lucasfilm merged 15 commits intoAcademySoftwareFoundation:mainfrom
kwokcb:test_render_mac
Nov 19, 2025
Merged

Enable test suite rendering on Mac#2675
jstone-lucasfilm merged 15 commits intoAcademySoftwareFoundation:mainfrom
kwokcb:test_render_mac

Conversation

@kwokcb
Copy link
Copy Markdown
Contributor

@kwokcb kwokcb commented Nov 13, 2025

Change

  • Turn on rendering of test suite for Mac CI runners

Changes

  • Add in a CMake flag (MATERIALX_RENDER_MSL_ONLY) on render in paths supprting Metal. This allows CI to run without also trying to run GLSL renders which are not supported.
  • When set this will enable the existing MATERIALX_TEST_RENDER flag to trigger test suite rendering.
  • Add in an archive and upload test of the resources folder results.

Results

  • Run through entire test suite succesfully.
  • The renders are very fast (total unit test time is about 1.5 min with render time a percentage of that)
  • Packaged downloaded resources area contains rendered images. Below is a snapshot of the downloaded renders unzipped locally:
image
  • Downloaded tests are the same as local rendering with the exception of resources/Materials/TestSuite/pbrlib/surfaceshader/usd_normal_map which for some reason is rendering the shader from the incorrect path. This occurred 1 out of 3 runs and left to be resolved separate from activation. One other test has a RMS diff of 0.00001
image

Some other sample renderings (cannot attach full pdf results into github as file is too large)

image

Comment thread .github/workflows/main.yml Outdated
TEST_RENDER_CONFIG="-DMATERIALX_TEST_RENDER=OFF"
if [ "${{ matrix.test_render }}" == "ON" ]; then
if [ "${{ runner.os }}" == "macOS" ]; then
TEST_RENDER_CONFIG="$TEST_RENDER_CONFIG -DMATERIALX_TEST_RENDER=ON -DMATERIALX_RENDER_MSL_ONLY=ON"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Key change: Turn on test rendering for MSL but not GLSL.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps we can merge the existing EXTENDED_BUILD_CONFIG with your new TEST_RENDER_CONFIG, naming the combined variable ADDITIONAL_BUILD_CONFIG for generality?

That should help to keep the final cmake build call as compact and clear as possible, as it's becoming a bit hard to read!

Comment thread .github/workflows/main.yml Outdated
path: build/render/*.png

- name: Archive Resources (macOS)
if: matrix.test_render == 'ON' && runner.os == 'macOS'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Post results.

Comment thread CMakeLists.txt
endif()

# Validate MSL-only rendering option
if(MATERIALX_RENDER_MSL_ONLY)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Turn off GLSL rendering. For some reason there a renderGLSL module dependency for renderMSL. Not touching that dependency here.

add_subdirectory(MaterialXRender)
target_link_libraries(MaterialXTest MaterialXRender)
if(MATERIALX_BUILD_GEN_GLSL)
if(MATERIALX_BUILD_GEN_GLSL AND NOT MATERIALX_RENDER_MSL_ONLY)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Turn off GLSL rendering if want MSL only

jstone-lucasfilm pushed a commit that referenced this pull request Nov 14, 2025
## Change

- Turn on headless rendering on Mac for MaterialXView
- Added to the MacOS_Xcode_16_Python313 workflow as that already does shader validation testing.

Notes:

- MaterialxGraphEditor rendering not enabled as it's using OpenGL which has issues running headless. (A[ new issue](#2672) has been logged to support Metal rendering here. If / when it is available then it can be turned on)
- The Metal environment set up here is the same pre-requisite as for this [PR for full test suite enabling](#2675).
@kwokcb kwokcb changed the title Proposal : Test render suite for Mac Enable test suite rendering on Mac Nov 15, 2025
@kwokcb kwokcb marked this pull request as ready for review November 15, 2025 05:18
Copy link
Copy Markdown
Contributor

@ld-kerley ld-kerley left a comment

Choose a reason for hiding this comment

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

This looks like a great step forwards to me - the most testing we're able to do the better.

I hope we can even build on top of this to introduce regression testing for renders

Comment thread .github/workflows/main.yml Outdated
ls -la build/bin || true
exit 1
fi
zip -r build/artifacts/resources.zip build/bin/resources
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the motivation for manually generating a zip archive of the folder, rather than leveraging the built-in zip functionality in actions/upload-artifact?

Would it make sense to align this with our other upload steps (e.g. Upload Reference Shaders, Upload Renders) and use the existing system in actions/upload-artifact?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I had this "cherry picking" images at one point but reverted that as it's better to produce a "results" folder as part of test. Will revert this to the simpler rule.

Copy link
Copy Markdown
Contributor Author

@kwokcb kwokcb left a comment

Choose a reason for hiding this comment

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

Review changes in.

Note: I will need to get some help to triage why the single case that renders the
the incorrect shader sporadically. 2 out of 3 runs were good.

- name: CMake Generate
shell: bash
run: |
EXTENDED_BUILD_CONFIG=""
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Small fix: This was not initialized so would error out if none of the "extended" conditions were set.

Copy link
Copy Markdown
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks @kwokcb!

@jstone-lucasfilm jstone-lucasfilm merged commit 9dc75c2 into AcademySoftwareFoundation:main Nov 19, 2025
32 checks passed
@kwokcb kwokcb deleted the test_render_mac branch November 22, 2025 02:51
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.

3 participants