-
Notifications
You must be signed in to change notification settings - Fork 402
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
base: main
Are you sure you want to change the base?
Conversation
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
There was a problem hiding this 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
|
||
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is change intentional?
There was a problem hiding this comment.
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
|
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 ;-))