From eaef6ac2b5ff1c579d89446d151065de263626d4 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 20 Oct 2026 14:20:40 -0300 Subject: [PATCH 1/3] gmt_geo_vector: Tolerate round-off when testing a rescaled head against the vector length After +n rescaling the head length equals the limit, so the test that skips the head was decided by floating-point noise (differing per platform). Co-Authored-By: Claude Sonnet 5.5 --- src/gmt_plot.c | 8 ++++---- test/grdvector/met_uv.sh | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gmt_plot.c b/src/gmt_plot.c index 74fe578faf0..7f71d825e6c 100644 --- a/src/gmt_plot.c +++ b/src/gmt_plot.c @@ -5228,7 +5228,7 @@ GMT_LOCAL unsigned int gmtplot_geo_vector_smallcircle (struct GMT_CTRL *GMT, dou az[0] = gmtplot_smallcircle_az (GMT, C.A, S); /* Compute the azimuth from A to B at A along small circle */ scl[0] = (perspective) ? S->v.scale : gmtplot_get_local_scale (GMT, C.lon[0], C.lat[0], 0.001 * C.r, az[0]); /* Get local deg/inch scale at A in az[0] direction */ dr[0] = scl[0] * (head_length - 1.1*dshift[0]); /* This is arrow head length in degrees, approximately, adjusted for ~pen thickness to ensure no gap between head and line (the 1.1 slop) */ - if (dr[0] > h_length_limit) { /* Head length still too long, refuse to plot it */ + if (dr[0] > h_length_limit * (1.0 + GMT_CONV8_LIMIT)) { /* Head length still too long, refuse to plot it */ gmt_M_memcpy (Ax, C.A, 3, double); /* No need to shorten arc at beginning */ heads -= 1; /* Not purse this head any further */ warn = 1; @@ -5252,7 +5252,7 @@ GMT_LOCAL unsigned int gmtplot_geo_vector_smallcircle (struct GMT_CTRL *GMT, dou az[1] = -gmtplot_smallcircle_az (GMT, C.B, S); /* Compute the azimuth from B to A at B along small circle */ scl[1] = (perspective) ? S->v.scale : gmtplot_get_local_scale (GMT, C.lon[1], C.lat[1], 0.01 * C.r, az[1]); /* Get local deg/inch scale */ dr[1] = S->v.scale * (head_length - 1.1*dshift[1]); /* This is arrow head length in degrees, approximately, adjusted for ~pen thickness to ensure no gap between head and line */ - if (dr[1] > h_length_limit) { /* Head length too long, refuse to plot it */ + if (dr[1] > h_length_limit * (1.0 + GMT_CONV8_LIMIT)) { /* Head length too long, refuse to plot it */ gmt_M_memcpy (Bx, C.B, 3, double); /* No need to shorten arc at end */ heads -= 1; /* Not purse this head any further */ warn = 1; @@ -5481,7 +5481,7 @@ GMT_LOCAL unsigned int gmtplot_geo_vector_greatcircle (struct GMT_CTRL *GMT, dou az[0] = gmt_az_backaz (GMT, C.lon[0], C.lat[0], C.lon[1], C.lat[1], false); /* Compute the azimuth from A to B at A along great circle */ scl[0] = (perspective) ? S->v.scale : gmtplot_get_local_scale (GMT, C.lon[0], C.lat[0], 0.001 * C.r, az[0]); /* Get local deg/inch scale at A in az[0] direction */ dr[0] = scl[0] * (head_length - 1.1*dshift[0]); /* This is arrow head length in degrees, approximately, adjusted for ~pen thickness to ensure no gap between head and line */ - if (dr[0] > h_length_limit) { /* Head length still too long, refuse to plot it */ + if (dr[0] > h_length_limit * (1.0 + GMT_CONV8_LIMIT)) { /* Head length still too long, refuse to plot it */ gmt_M_memcpy (Ax, C.A, 3, double); /* No need to shorten arc at beginning */ heads -= 1; /* Not purse this head any further */ warn = 1; @@ -5501,7 +5501,7 @@ GMT_LOCAL unsigned int gmtplot_geo_vector_greatcircle (struct GMT_CTRL *GMT, dou az[1] = gmt_az_backaz (GMT, C.lon[1], C.lat[1], C.lon[0], C.lat[0], false); /* Compute the azimuth from B to A at B along great circle */ scl[1] = (perspective) ? S->v.scale : gmtplot_get_local_scale (GMT, C.lon[1], C.lat[1], 0.01 * C.r, az[1]); /* Get local deg/inch scale */ dr[1] = scl[1] * (head_length - 1.1*dshift[1]); /* This is arrow head length in degrees, approximately, adjusted for ~pen thickness to ensure no gap between head and line */ - if (dr[1] > h_length_limit) { /* Head length still too long, refuse to plot it */ + if (dr[1] > h_length_limit * (1.0 + GMT_CONV8_LIMIT)) { /* Head length still too long, refuse to plot it */ gmt_M_memcpy (Bx, C.B, 3, double); /* No need to shorten arc at end */ heads -= 2; /* Not purse this head any further */ warn = 1; diff --git a/test/grdvector/met_uv.sh b/test/grdvector/met_uv.sh index 216daaf9aa4..ef69c8914ec 100755 --- a/test/grdvector/met_uv.sh +++ b/test/grdvector/met_uv.sh @@ -2,8 +2,6 @@ # testing vector head shrinking and non-plotting for plain and filled geovectors # Using tiny subset of data shown in https://github.com/GenericMappingTools/gmt/issues/6108 # New behavior is skipping of heads when size exceeds length -# GMT_KNOWN_FAILURE_LINUX -# GMT_KNOWN_FAILURE_WINDOWS gmt begin met_uv gmt set MAP_FRAME_TYPE plain FONT_TAG 12p gmt subplot begin 5x1 -Fs14c/4.21c -R84/96/24.75/28 -JM14c -Sct -Srl -M2p -A From abf01a3bad433c5d3c2ddcd67a5419bb0018c473 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 3 Nov 2026 15:13:10 -0300 Subject: [PATCH 2/3] Update grdvector/met_uv baseline --- test/baseline/grdvector.dvc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/baseline/grdvector.dvc b/test/baseline/grdvector.dvc index a2aba9f663a..e0c58b87f72 100644 --- a/test/baseline/grdvector.dvc +++ b/test/baseline/grdvector.dvc @@ -1,5 +1,6 @@ outs: -- md5: 752b35fff020e0e8596263531ca31881.dir +- md5: b89da65807cedb581674f370bf283c99.dir nfiles: 15 path: grdvector hash: md5 + size: 1447408 From 0ffc66a1d3eb726978db9af9c0cf0a077603bef2 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Mon, 16 Nov 2026 09:53:51 -0300 Subject: [PATCH 3/3] Update psxy/flowvectors baseline The geovector head fix now draws two tiny heads (records 14 and 289) that were skipped due to round-off; the output is identical on Linux, macOS and Windows (CI run 41692804604). Co-Authored-By: Claude Opus 5.5 --- test/baseline/psxy.dvc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/baseline/psxy.dvc b/test/baseline/psxy.dvc index b1c26a3594e..f06d69dd755 100644 --- a/test/baseline/psxy.dvc +++ b/test/baseline/psxy.dvc @@ -1,6 +1,6 @@ outs: -- md5: 6dbbc75aa2f8752b1450e4f22b7656f2.dir +- md5: 50c24ac06cd74cec4b0293df19189430.dir nfiles: 147 path: psxy hash: md5 - size: 9555170 + size: 9545509