Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5350 closed defect (fixed)

Extra sensitiveness of gdalwarp average tests

Reported by: Even Rouault Owned by: etourigny
Priority: normal Milestone:
Component: Autotest Version: unspecified
Severity: normal Keywords:
Cc:

Description

Etienne,

I get failures on the average/mode warping tests on my machine with GCC 4.4.3. I get also similar failures on MinGW (which must be a 4.6.3) which cause the Travis MinGW build to fail systematically (e.g. http://travis-ci.org/rouault/gdal_coverage/builds/16780051). I guess there must numerical precision issues in the rounding done in compute corners in source crs. Under debugger I see values very close to integers, so depending on compiler version and optimization level, you can easily be below or above the integer boundary.

TEST: warp_31 ... Diff at pixel (0, 2) : -13.000000

Diff at pixel (1, 2) : -10.000000 Diff at pixel (2, 2) : -3.000000 Diff at pixel (3, 2) : -1.000000 Diff at pixel (4, 2) : -2.000000 Diff at pixel (5, 2) : 2.000000 Diff at pixel (6, 2) : 1.000000 Diff at pixel (7, 2) : -1.000000 Diff at pixel (8, 2) : 3.000000 Diff at pixel (36, 2) : -15.000000 Diff at pixel (42, 2) : 29.000000 Diff at pixel (4, 17) : 30.000000 Diff at pixel (48, 20) : 31.000000 Diff at pixel (21, 23) : 33.000000 Diff at pixel (3, 50) : -36.000000 Max diff : 36 Number of diffs : 1073 fail

line 1004: Image too different from reference

TEST: warp_32 ... Diff at pixel (0, 2) : -13.000000

Diff at pixel (1, 2) : -10.111115 Diff at pixel (2, 2) : -2.666672 Diff at pixel (3, 2) : -1.250000 Diff at pixel (4, 2) : -2.277779 Diff at pixel (5, 2) : 1.722221 Diff at pixel (6, 2) : 1.250000 Diff at pixel (7, 2) : -1.000000 Diff at pixel (8, 2) : 3.222221 Diff at pixel (35, 2) : -13.277771 Diff at pixel (36, 2) : -14.416672 Diff at pixel (42, 2) : 29.333328 Diff at pixel (4, 17) : 30.222214 Diff at pixel (48, 20) : 30.833328 Diff at pixel (21, 23) : 32.833328 Diff at pixel (3, 50) : -36.333336 Max diff : 36 Number of diffs : 1118 fail

line 1023: Image too different from reference

TEST: warp_33 ... Diff at pixel (10, 2) : -17.000000

Diff at pixel (19, 2) : 16.000000 Diff at pixel (24, 2) : -17.000000 Diff at pixel (26, 2) : -25.000000 Diff at pixel (27, 2) : 8.000000 Diff at pixel (38, 2) : -49.000000 Diff at pixel (41, 2) : 41.000000 Diff at pixel (47, 2) : -107.000000 Diff at pixel (48, 2) : -24.000000 Diff at pixel (1, 20) : -115.000000 Diff at pixel (52, 47) : 123.000000 Diff at pixel (28, 50) : -131.000000 Max diff : 131 Number of diffs : 287 fail

line 1042: Image too different from reference

TEST: warp_34 ... Diff at pixel (10, 2) : -17.000000

Diff at pixel (19, 2) : 16.000000 Diff at pixel (24, 2) : -17.000000 Diff at pixel (26, 2) : -25.000000 Diff at pixel (27, 2) : 8.000000 Diff at pixel (38, 2) : -49.000000 Diff at pixel (41, 2) : 41.000000 Diff at pixel (47, 2) : -107.000000 Diff at pixel (48, 2) : -24.000000 Diff at pixel (1, 20) : -115.000000 Diff at pixel (52, 47) : 123.000000 Diff at pixel (28, 50) : -131.000000 Max diff : 131 Number of diffs : 287 fail

line 1061: Image too different from reference

TEST: warp_35 ... Diff at pixel (10, 2) : -17.000000

Diff at pixel (19, 2) : 16.000000 Diff at pixel (24, 2) : -17.000000 Diff at pixel (26, 2) : -25.000000 Diff at pixel (27, 2) : 8.000000 Diff at pixel (1, 5) : -17.000000 Diff at pixel (6, 5) : 8.000000 Diff at pixel (10, 5) : -8.000000 Diff at pixel (13, 5) : -16.000000 Diff at pixel (31, 5) : -90.000000 Diff at pixel (6, 17) : 99.000000 Diff at pixel (1, 20) : -115.000000 Max diff : 115 Number of diffs : 103 fail

line 1080: Image too different from reference

TEST: warp_36 ... Diff at pixel (10, 2) : -17.000000

Diff at pixel (19, 2) : 16.000000 Diff at pixel (24, 2) : -17.000000 Diff at pixel (26, 2) : -25.000000 Diff at pixel (27, 2) : 8.000000 Diff at pixel (38, 2) : -49.000000 Diff at pixel (41, 2) : 41.000000 Diff at pixel (47, 2) : -107.000000 Diff at pixel (48, 2) : -24.000000 Diff at pixel (1, 20) : -115.000000 Diff at pixel (52, 47) : 123.000000 Diff at pixel (28, 50) : -131.000000 Max diff : 131 Number of diffs : 287 fail

line 1099: Image too different from reference

Attachments (2)

log1.txt (4.1 KB) - added by etourigny 4 years ago.
output of alg/warp.py
patch1.txt (1.2 KB) - added by etourigny 4 years ago.
simple patch, that works with gcc-4.7

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by etourigny

Attachment: log1.txt added

output of alg/warp.py

comment:1 Changed 4 years ago by etourigny

I do not see this error with gcc 4.7.3 , but other errors in warp_3 warp_3_short warp_8 and warp_37, see attached file.

Could you post an example .tif file (by converting the .vrt file to a .tif file), so I can have a better idea of what is happening?

I don't have access to mingw, but I could try with gcc 4.4 (ubuntu). Does the error happen systematically with gcc 4.4?

Changed 4 years ago by etourigny

Attachment: patch1.txt added

simple patch, that works with gcc-4.7

comment:2 Changed 4 years ago by etourigny

I've just added a patch that seems to not break things with gcc-4.7. Please test with mingw and gcc-4.4

comment:3 Changed 4 years ago by Even Rouault

Resolution: fixed
Status: newclosed

Thanks Etienne. I couldn't reproduce any longer the original issue on my Linux 64bit GCC 4.4. Don't know what I did... But the issue on MinGW was real and your patch fixes it both in non-optimized and optimized mode. So now all Travis targets are back to green :-)

trunk r26846 "Average/mode kernels of warp: make them less sensitive to numerical precision issues (should fix failures on MinGW32) (patch by Etienne Tourigny, #5350)"

comment:4 Changed 4 years ago by etourigny

excellent!

comment:5 Changed 4 years ago by etourigny

Also applied to 1.10 branch in r26849

comment:6 Changed 4 years ago by Even Rouault

Etienne, the autotests for warp_31 and friends now fail on Travis with 1.10 : https://s3.amazonaws.com/archive.travis-ci.org/jobs/17192100/log.txt . I kind of remember you had updated the reference images in trunk some time ago, so perhaps that would need to be backported to 1.10 as well so that the test pass ?

comment:7 Changed 4 years ago by etourigny

fixes autotest in r26851 . Funny it wasn't failing after r26697 - I had updates gdalwarpkernel.cpp but not the tests.

Note: See TracTickets for help on using tickets.