Skip to content

Document testing in Rerun#8989

Merged
Wumpf merged 7 commits intomainfrom
andreas/test-docs
Feb 18, 2025
Merged

Document testing in Rerun#8989
Wumpf merged 7 commits intomainfrom
andreas/test-docs

Conversation

@Wumpf
Copy link
Copy Markdown
Member

@Wumpf Wumpf commented Feb 11, 2025

Addition of many image comparison tests highlighted that we need to document our tests.
Took the opportunity to list all test types we have that I could think of and how to run time.

Furthermore, this now now serves as an faq for "but why does machine X produce a different image than machine Y??" (A: it's a wonder they're as close as they are ;-))

@Wumpf Wumpf added 📖 documentation Improvements or additions to documentation 🔨 testing testing and benchmarks include in changelog labels Feb 11, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 11, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
2fb4121 https://rerun.io/viewer/pr/8989 +nightly +main

Note: This comment is updated whenever you push a commit.

@emilk
Copy link
Copy Markdown
Member

emilk commented Feb 12, 2025

Rendered

Copy link
Copy Markdown
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

This is great - thank you 🙏

CONTRIBUTING.md Outdated
Comment on lines +169 to +199

First check whether the difference is due to a change in enabled rendering features, potentially due to difference in hardware (/software renderer) capabilitites - our setup generally avoids this by enforcing the same set of features, but this may happen nonetheless.

However, smaller discrepancies may be caused by a variety of implementation details depending on the concrete GPU/driver (even between different versions of the same driver).
For instance:
* multi-sample anti-aliasing
* sample placement and sample resolve steps are implementation defined
* alpha-to-coverage algorithm/pattern can wary wildly between implementations
* by default we render without anti-aliasing
* texture filtering
* different implementations may apply different optimizations *even* for simple linear texture filtering
* out of bounds texture access (via `textureLoad`)
* implementations are free to return indeterminate values instead of clamping
* floating point evaluation, for details see [WGSL spec § 15.7. Floating Point Evaluation](https://www.w3.org/TR/WGSL/#floating-point-evaluation). Notably:
* rounding mode may be inconsistent
* floating point math "optimizations" may occur
* depending on output shading language, different arithmetic optimizations may be performed upon floating point operations even if they change the result
* floating point denormal flush
* even on modern implementations, denormal float values may be flushed to zero
* `NaN`/`Inf` handling
* whenever the result of a function should yield `NaN`/`Inf`, implementations may free to yield an indeterminate value instead
* builtin-function function precision & error handling (trigonometric functions and others)
* [partial derivatives (dpdx/dpdx)](https://www.w3.org/TR/WGSL/#dpdx-builtin)
* implementations are free to use either `dpdxFine` or `dpdxCoarse`
* [...]


Whenever you can't avoid these problems there's two types of thresholds you can tweak:
* threshold for when a pixel is considered different (see [`egui_kittest::SnapshotOptions::threshold`])
* how many pixels are allowed to differ (see [`HarnessExt::snapshot_with_broken_pixels_threshold`])
TODO(emilk/egui#5683): this should be natively supported by kittest
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.

This is a wonderful section that would be great to have in the egui_kittest README.md. Then we could just link to it from here instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll create a PR against egui_kittest!

//! However, GPUs are notoriously bad at processing instances with a small batch size as
//! [various](https://gamedev.net/forums/topic/676540-fastest-way-to-draw-quads/5279146/)
//! [people](https://gamedev.net/forums/topic/702292-performance-fastest-quad-drawing/5406023/)
//! However, at least historically GPUs are notoriously bad at processing instances with a small batch size as
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.

This is change intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, the other links broke and ci complained about it. Also I read by now that modern GPUs no longer have this issue (... on the GameDev Tech Slack, so can't post a source), do doesn't hurt to tune it down

@Wumpf
Copy link
Copy Markdown
Member Author

Wumpf commented Feb 12, 2025

Wumpf added a commit to emilk/egui that referenced this pull request Feb 18, 2025
Guidelines & why images may differ

Based on (but slightly altered):
* rerun-io/rerun#8989
@Wumpf Wumpf merged commit f4ef3a1 into main Feb 18, 2025
35 checks passed
@Wumpf Wumpf deleted the andreas/test-docs branch February 18, 2025 08:57
lucasmerlin pushed a commit to emilk/egui that referenced this pull request Mar 3, 2025
Guidelines & why images may differ

Based on (but slightly altered):
* rerun-io/rerun#8989

(cherry picked from commit 40f002f)
@emilk emilk mentioned this pull request Apr 11, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 documentation Improvements or additions to documentation include in changelog 🔨 testing testing and benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants