Add RefDiffer, --no-render shader generation, and CI workflow docs - #33
Merged
Conversation
- Add no_render flag to render_material(): generates and dumps shaders without GPU program creation, rendering, or image capture. - Re-add _RefDiffer (filecmp.cmp) and _check_shader_baselines(): in CI mode (--output-dir set), compares dumped .glsl files against committed baselines and fails on mismatch or missing baseline. - Add RenderEnvironment.is_ci_mode and get_baseline_dir() to detect when output diverges from the committed tree. - _render_elements always generates shaders (no_render skips GPU only, not shader gen), and runs RefDiffer automatically in CI mode. - Update README CI workflow: correct test run sequence, document Metashade repo test dependency. Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>
ppenenko
force-pushed
the
metashade/refdiffer-no-render
branch
from
July 29, 2026 19:34
1382daa to
d1f06da
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the MaterialX render-test tooling to support shader-only generation (skipping GPU work) and introduces a CI-friendly shader baseline gate by comparing dumped GLSL against committed references when output is redirected outside contrib/. It also updates the contributor test README to document the correct CI invocation order (baseline renders → Metashade repo tests → override renders/compare).
Changes:
- Add a
no_renderpath inrender_material()and thread it through the render test runner via--no-render. - Add a lightweight RefDiffer-style shader baseline comparison that runs in CI mode when
--output-diris set. - Update
contrib/tests/README.mdCI workflow instructions to reflect the intended sequencing and baseline behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| contrib/utilities/scripts/rendertest/mtlxutils/render_material.py | Adds no_render shader-generation-only path and ensures shaders can still be dumped without GPU rendering. |
| contrib/tests/test_render.py | Wires --no-render through the test runner and adds CI-mode shader baseline comparison utilities (_RefDiffer, _check_shader_baselines, baseline dir mapping). |
| contrib/tests/README.md | Updates CI workflow documentation and explains when RefDiffer runs and how to use --no-render in GPU-less CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+65
to
+67
| When *no_render* is ``True``, shader source is generated and dumped | ||
| to *output_path* but GPU program creation, rendering and image | ||
| capture are skipped. |
- Use filecmp.cmp(shallow=False) in _RefDiffer for byte-for-byte comparison instead of stat metadata (size + mtime). - Clarify render_material docstring: shader dumping is conditional on output_path being provided. - Update metashade submodule to include the matching shallow=False fix (metashade/metashade#202). Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
no_renderflag inrender_material(): generates and dumps shader sourcewithout GPU program creation, rendering, or image capture. Wired through
render_element()and_render_elements()via--no-renderCLI option._RefDiffer(usingfilecmp.cmp,mirroring
metashade.util.testing.RefDiffer) and_check_shader_baselines().In CI mode (
--output-dirset), dumped.glslfiles are compared againstcommitted baselines; mismatches or missing baselines fail the test.
RenderEnvironment.is_ci_mode/get_baseline_dir(): detect whenoutput_rootdiverges fromrepo_root / "contrib"and map output pathsback to committed baseline locations.
run between
test_render.py(baseline renders) andtest_render_metashade.py(override renders + comparison).
Test plan
--no-rendergenerates shaders without rendering (2.3s vs 30s)--output-dir /tmp/...) when baselines match