Skip to content

Mark grdtrend/trend_xy_plot.sh as known failure on Windows - #9274

Open
Esteban82 wants to merge 1 commit into
masterfrom
grdtrend-known-failure-windows
Open

Esteban82 wants to merge 1 commit into
masterfrom
grdtrend-known-failure-windows

Conversation

@Esteban82

Copy link
Copy Markdown
Member

The test fails only in the Windows CI, so mark it with GMT_KNOWN_FAILURE_WINDOWS.

Closes #9261.

The Windows CI reads the 1-row netCDF grid with a collapsed y range.
See #9261.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Esteban82 Esteban82 added the maintenance Boring but important stuff for the core devs label Oct 19, 2026
@Esteban82
Esteban82 requested review from joa-quim and seisman October 20, 2026 22:42
@Esteban82

Copy link
Copy Markdown
Member Author

This is ready to be approved.

@joa-quim

Copy link
Copy Markdown
Member

I'm not sure I like the idea of hiding the problem. Again, I don't see this problem in my local build.

@Esteban82

Copy link
Copy Markdown
Member Author

I ran the Windows CI with MSVC toolset 14.44 (same /O2 /Ob2, same code as master, including #9266): trend_xy_plot passes and the 6x1 grid reads correctly (https://github.com/GenericMappingTools/gmt/actions/runs/39526751996). With the default 14.51.36231 the same code still fails (https://github.com/GenericMappingTools/gmt/actions/runs/39503790223). So it depends on the compiler version, which would explain why it doesn't show in your local build. I couldn't test 14.50 (used for the 6.7.0 binaries), it's not on the runner.

@joa-quim

Copy link
Copy Markdown
Member

I just updated my MSVC and have 14.51.36231 (maybe I already had it) and

gmt grdmath -R-1.2/1.2/-0.2/0.2 -I0.4 -r 0.5 X ADD X X MUL ADD X 3 POW ADD = row.grd

still works fine for me.

@ccroftwhite-undo

Copy link
Copy Markdown

This is an MSVC 14.51 optimiser bug, and it's already reported to Microsoft: https://developercommunity.visualstudio.com/t/MSVC-1951-x64-O2-and-O1-omit-a-call-t/11169239

In gmtnc_grd_info, 14.51 skips the nc_get_att_double call for the y actual_range (src/gmt_nc.c line 803) when has_vector is false, which it always is for a 1-row grid, so dummy keeps its default of 0 0. 14.50 compiles it correctly, but the 14.52 release candidate still gets it wrong, so it won't go away with the next Visual Studio update. It only happens with optimisation on, so a Debug build reads the grid correctly with 14.51, which may be why @joa-quim doesn't see it locally.

Reading the range into its own array avoids it. With this change GMT built with 14.51 reads the grid correctly, and an extract of the function gives the right answer with 14.43, 14.50, 14.51, and 14.52:

-		has_range = (!nc_get_att_double (ncid, ids[HH->xy_dim[1]], "actual_range", dummy));
+		{	/* gmt#9261: MSVC 14.51 and 14.52 skip this call when has_vector is false (MSVC DevCom 11169239)  */
+			double range[2];
+			has_range = (!nc_get_att_double (ncid, ids[HH->xy_dim[1]], "actual_range", range));
+			if (has_range) dummy[0] = range[0], dummy[1] = range[1];
+		}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows CI: a 1-row netCDF grid is read back with a collapsed y range (test/grdtrend/trend_xy_plot.sh)

3 participants