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

Approximate image comparison for render tests #182

Open
jbush001 opened this issue May 26, 2019 · 0 comments
Open

Approximate image comparison for render tests #182

jbush001 opened this issue May 26, 2019 · 0 comments
Labels

Comments

@jbush001
Copy link
Owner

Currently, the render tests compute a SHA-1 checksum of the output from the renderer, then compare that to a known value to determine if the test passes. This is fragile, because minor floating point differences (even that are spec compliant) can cause minor variations, which break tests. For example, the emulator and verilator need different checksums.

Instead, make the test harness load the reference image and perform a pixel-wise comparison, computing the mean squared error between them. If this is below a threshold, the test should pass.

Currently, this is handled in tests/test_harness.py, run_render_test. Since the project now uses the Python Imaging Library (PIL), that could be used to load the reference image and possibly to help with the comparison.

@jbush001 jbush001 added the test label May 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant