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

Document testing in Rerun #8989

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Document testing in Rerun #8989

wants to merge 7 commits into from

Conversation

Wumpf
Copy link
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
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Copy link

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
Member

emilk commented Feb 12, 2025

Rendered

Copy link
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 Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
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
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
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
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
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
Member Author

Wumpf commented Feb 12, 2025

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