Skip to content

Conversation

linev
Copy link
Member

@linev linev commented Oct 15, 2025

stressGraphics already has different graphics objects so one can test them in SVG generation.
But not only size of produced SVG, but also exact content must match.

So add reference SVG files, created in compact mode, and check that they remains the same.

There are several "known" problem why SVG files differ on different platforms.
Like unnecessary rounding when paint text on the canvas.
Therefore this is draft, which will be permanently tested and modified until reasonable results will be produced.

Once it is working, it will be able replace tests in roottest/graphics/ directory.

Later web mode of SVG content testing will be activated.

@linev linev self-assigned this Oct 15, 2025
@linev linev requested review from bellenot and couet as code owners October 15, 2025 14:21
@linev linev requested a review from dpiparo as a code owner October 15, 2025 14:21
@linev linev marked this pull request as draft October 15, 2025 14:21
Copy link

github-actions bot commented Oct 15, 2025

Test Results

    21 files      21 suites   3d 20h 16m 48s ⏱️
 3 693 tests  3 691 ✅ 0 💤 2 ❌
75 649 runs  75 645 ✅ 0 💤 4 ❌

For more details on these failures, see this check.

Results for commit 2cd6f17.

♻️ This comment has been updated with latest results.

@linev linev force-pushed the stress_svg branch 9 times, most recently from d7e8fb6 to d384a51 Compare October 20, 2025 14:01
Create SVG files in compact or full form
and then compare them with reference files
linev added 7 commits October 21, 2025 10:27
In SVG mode use only GMT time to have reproducible time on all platforms
in all time zones.

To exclude variation of %Z output of strftime on different platforms
just always printout GMT directly
Avoid deviation on graphics due to fit
When caclucating number of extra ticks
which need to be placed on left or right side of axis
add `epsilon` to avoid possible rounding problems.

Ensure that minor tick on very begin or very end of axis range is painted
On some platforms FindVisibleDraw returns
different result for same data.
Either line is not visible at all or extremly small
segment from the line is visible.
In last case do not call paint for gPad

Has effect on 3D axis grid painter and lego painter for
several stressGraphics tests - but only when checking
PS/SVG/PDF content, size reduction is very small
There order of triangles drawing defined by calculated Z value.
For many triangles such Z value is very close to each other and "flip"
on different platforms because of float precision.

To exclude such flipping, add minimal epsilon in Z comparasion.
When both Z are close to each other render order of triangles is not important
To avoid rounding effects in TGraph exclusion points optimization,
use small epsilon in values comparasion.
linev added 2 commits October 21, 2025 10:28
If relative position changes only by small value - ignore this change.
Let exclude rounding effects for testing when compact SVG form created
First provide SVG mode in stressGraphics to let generate only SVG files.
Such SVG created in compact form which is now provided with TSVG class.
When check reference files, compare line by line and print difference
Some canvases disabled because of huge size which should be optimized first

Content of reference SVG files must be exactly the same on all platforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants