Skip to content

Review FAILED tests #8910

Open
Open

Description

@ES-Solar

When I run tests on the master branch in macos, it is reporting 91 failed tests. For the first couple I looked at, the resulting ps files look good or maybe better (better formatting) than the original baseline. It would be helpful to better understand the failures and determine which actually represent problems.
So I'm creating this issue to help document my review of the chronically failing tests.

Activity

  1. github-actions commented on Feb 23, 2026

    @github-actions
    Contributor

    👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

    Please make sure you read our Contributing Guide and abide by our Code of Conduct.

  2. seisman commented on Feb 24, 2026

    @seisman
    Member

    Have you set GMT_DATA_SERVER to static when you run the tests locally? The CI uses the static server, and there are only a few failing tests.

  3. joa-quim commented on Feb 24, 2026

    @joa-quim
    Member

    Extending a bit more what Dongdong said, we have the DVC exactly because of this. Before we used to have the PS files directly included in the GMT repo, but that was making the repo's size increase fast and not stop. That happened, for example, whenever data from one of the hosted data sources (earth_relief, for example) was updated. Because of this we have a collection of remote files used in tests that are not updated. To use them, the GMT_DATA_SERVER must be set to static.

  4. ES-Solar commented on Feb 24, 2026

    @ES-Solar
    CollaboratorAuthor

    I was not aware of needing to set the GMT_DATA_SERVER variable to static, thanks for the guidance.

  5. ES-Solar commented on Feb 24, 2026

    @ES-Solar
    CollaboratorAuthor

    I reran the test with the GMT_DATA_SERVER set to static and got the same results, 91 failures. Is that not close to what youwould expect?
    I am including the examples in the docs as well as the 'tests', ie:
    set (DO_EXAMPLES TRUE)
    set (DO_TESTS TRUE)

  6. joa-quim commented on Feb 24, 2026

    @joa-quim
    Member

    To be honest, I also have troubles with that GMT_DATA_SERVER setting and since I've no patience to fight scripts, I set
    set (GMT_DATA_SERVER static)
    in ConfigUser.cmake before running the tests.

  7. MarceloBanik commented on Feb 26, 2026

    @MarceloBanik
    Contributor

    changing line 212 in ConfigUserAdvanced.cmake from

    # set (GMT_DATA_SERVER "static")
    

    to

    set (GMT_DATA_SERVER "static")
    

    I went from 80 tests failed out of 1194 to 31 tests failed out of 1194.

  8. ES-Solar commented on Feb 26, 2026

    @ES-Solar
    CollaboratorAuthor

    Thanks for the comment, I had changed that line but I must have missed something in getting the change to be picked up in the ctest run. I'll review my re-building procedures

  9. added
    discussion
    on Feb 26, 2026
  10. ES-Solar commented on Mar 4, 2026

    @ES-Solar
    CollaboratorAuthor

    I think I've got the server settings and I enabled all examples and supplemental test to match what I saw in the CI configuration so now I see 41 failures out of 1300 tests. Several of the first few tests seem to fail because of differences in how the resulting images are being cropped by psconvert.
    I've found this line in the gmt_modern.h file:
    #define GMT_SESSION_CONVERT "A" /* Default psconvert options in gmt figure */
    I'm wondering if this option was in some update after the original baseline images were generated. Perhaps I should just update the baseline images with the auto-cropped versions?

  11. seisman commented on Mar 4, 2026

    @seisman
    Member

    what's your gs version?

  12. joa-quim commented on Mar 4, 2026

    @joa-quim
    Member

    Maybe the gs, maybe the baseline images are not what they should be. We (I?) and de CI have not those failures so the solution is not to change the baseline PSs.

  13. ES-Solar commented on Mar 4, 2026

    @ES-Solar
    CollaboratorAuthor

    I have GPL Ghostscript 10.05.1 (2025-04-29)

  14. Esteban82 commented on Mar 4, 2026

    @Esteban82
    Member

    I have GPL Ghostscript 10.05.1 (2025-04-29)

    I had some issues with gs 10.05 (#8840). Try using 10.06 instead.

  15. ES-Solar commented on Mar 4, 2026

    @ES-Solar
    CollaboratorAuthor

    Also, I thought that the CI tests for the PRs typically fail because of problems with the dvc pull request. For example, the PR for "Bump actions/checkout from 6.0.1 to 6.0.2 #2894" reports a failure for "Pull baseline image data from dvc remote" for all 3 platforms. So, I'm confused about where the CI tests are passing. I think I'm missing something fundamental in how the automated workflow is working and how to investigate the errors.

  16. joa-quim commented on Mar 4, 2026

    @joa-quim
    Member

    I am also confused when I see failures due to "Pull baseline image data from dvc remote" but I think that happens whenever a missing PS baseline image occurs. Last PRs, however, have run to the end and have only a few failures (3 or 4) and not the same in all platforms.

  17. seisman commented on Mar 5, 2026

    @seisman
    Member

    I have GPL Ghostscript 10.05.1 (2025-04-29)

    I had some issues with gs 10.05 (#8840). Try using 10.06 instead.

    The CI is using ghostscript 10.03.0. Different ghostscript versions usually cause minor changes in baselines. I can try to upgrade it to 10.06 instead.

    I am also confused when I see failures due to "Pull baseline image data from dvc remote" but I think that happens whenever a missing PS baseline image occurs. Last PRs, however, have run to the end and have only a few failures (3 or 4) and not the same in all platforms.

    There are mainly two reasons for the "DVC failures" in CI:

    1. The PR author (e.g., PRs from external contributors) doesn't have access to the DVC images
    2. Someone forgot to run dvc push to push the new/updated images to dvc when they make changes to baseline images.
  18. ES-Solar commented on Mar 5, 2026

    @ES-Solar
    CollaboratorAuthor

    I looked through the some of the recent closed PRs and saw a couple in the last few weeks that only had 1 or 3 failed tests for the macos version.
    I would be curious to know if the failure rate changes if the CI ghostscript is upgraded. but I'll try to examine those workflows to see if there's any other reason that would explain why I'm getting more than 10 times more failures in my local tests.

  19. ES-Solar commented on Mar 17, 2026

    @ES-Solar
    CollaboratorAuthor

    I have been doing a deep dive (with help from Copilot) into why CI tests are matching the baseline images very well in the 1300 tests, but my local runs are coming up with 40 or so failed tests. From looking at two specific test cases that failed for me it looks like the main issue is the difference between the Intel and Mac hardware:
    This is the key insight. Both symptoms point to the same root cause: ARM64 vs Intel x86_64 floating-point arithmetic.

    lsfit — LSQFIT/SVDFIT line differs, points are the same: These operations use BLAS matrix decomposition. ARM64 Accelerate (AMEX/NEON instructions) produces slightly different rounding than Intel SSE/AVX for the same input data.

    oblsuite_N — az:0 panel flipped about vertical axis: The oblique Mercator -Joa.../0/... projection hits a near-zero trig value in the rotation matrix. A tiny floating-point difference between architectures flips the sign, which mirrors the map.(is this an edge case that should be treated better?)

    The root cause is ARM64 vs Intel x86_64 floating-point arithmetic:

    The [64-bit] tag in GMT's PS header is specifically emitted on x86_64 but not on arm64. The CI Intel x86_64 binary uses SSE/AVX for BLAS (Accelerate) and trig operations, producing slightly different floating-point rounding.

    lsfit LSQFIT/SVDFIT: BLAS matrix factorizations on ARM64 NEON/AMX produce a slightly different least-squares solution than Intel SSE — same data, different mantissa rounding path.

    oblsuite_N az:0 flip: The oblique Mercator rotation matrix has a near-zero determinant component at azimuth=0. Intel and ARM64 trig round that differently, flipping its sign and mirroring the map.

    This is not a code bug — it's an expected numerical divergence between architectures. The fact that CI passes (RMS 0.0022, threshold 0.0045) but local fails strongly suggests the tracked baseline was generated on Intel and the local ARM64 output diverges beyond the tolerance.

  20. joa-quim commented on Mar 17, 2026

    @joa-quim
    Member

    But your Mac is ARM right? So is Dongdong's (and likely CI's) and they don't have those failures. Can you post the list of your failures?

  21. ES-Solar commented on Mar 17, 2026

    @ES-Solar
    CollaboratorAuthor

    These are the test that failed locally for me.

    The following tests FAILED:
    240 - doc/examples/ex38/ex38.sh (Failed)
    356 - test/gmtbinstats/nonweighted.sh (Failed)
    357 - test/gmtbinstats/nonweightedrect.sh (Failed)
    358 - test/gmtbinstats/weighted.sh (Failed)
    359 - test/gmtbinstats/weightedrect.sh (Failed)
    386 - test/gmtmath/lsfit.sh (Failed)
    413 - test/gmtspatial/duplicate.sh (Failed)
    504 - test/grdfft/power2D.sh (Failed)
    521 - test/grdgradient/aspect.sh (Failed)
    527 - test/grdgradient/illum_var.sh (Failed)
    539 - test/grdimage/globalgrid.sh (Failed)
    546 - test/grdimage/grdread.sh (Failed)
    552 - test/grdimage/lonshift.sh (Failed)
    641 - test/grdvector/met_uv.sh (Failed)
    656 - test/grdview/gouraud.sh (Failed)
    661 - test/grdview/texture.sh (Failed)
    662 - test/grdview/texture2_classic.sh (Failed)
    663 - test/grdview/texture2_modern.sh (Failed)
    683 - test/kml/gmt2kml.sh (Failed)
    694 - test/mapproject/oblmerc_up.sh (Failed)
    726 - test/movie/movie_indicator_f_ver.sh (Failed)
    752 - test/potential/flexure_e.sh (Failed)
    753 - test/potential/flexure_en.sh (Failed)
    832 - test/psbasemap/subplot_south_pole.sh (Failed)
    846 - test/pscoast/oblsuite_N.sh (Failed)
    886 - test/pshistogram/histlegend.sh (Failed)
    891 - test/pshistogram/wrappedhisto.sh (Failed)
    926 - test/pspolar/pspolar_02.sh (Failed)
    1031 - test/psxy/clip_ellipse.sh (Failed)
    1117 - test/psxy/repeat1.sh (Failed)
    1181 - test/psxyz/vec_choice.sh (Failed)
    1188 - test/sample1d/smooth.sh (Failed)
    1191 - test/segy/segy_01.sh (Failed)
    1192 - test/segy/segy_02.sh (Failed)
    1202 - test/seis/psmeca_radius.sh (Failed)
    1215 - test/spectrum1d/power1D.sh (Failed)
    1268 - test/surface/periodic_pix.sh (Failed)

    and these are difference images comparing the images generated in the CI test and my local test for two of the failures, lsfit and oblsuite_N.

    Image Image
  22. ES-Solar commented on Mar 17, 2026

    @ES-Solar
    CollaboratorAuthor

    I don't know about Dong Dong's hardware, but the AI seems to think that the Github CI is intel based hardware.

  23. joa-quim commented on Mar 17, 2026

    @joa-quim
    Member

    I honestly don't think the blame is on the AMD vs Intel hardware. Compiles are very strict on following IEEE arithmetics up to last ULP, and Paul had AMD's chips and this issue, at least so numerous, never came out. Also, I think test/gmtspatial/duplicate.sh does number comparisons not calculations that could differ when using different compilers.

  24. joa-quim commented on Mar 17, 2026

    @joa-quim
    Member

    Ping @remkos

  25. ES-Solar commented on Mar 17, 2026

    @ES-Solar
    CollaboratorAuthor

    There is a section in the .github/workflows/test.yml file that defines the runner matix which explicitly calls for the macos-15-intel for the macos tests. So the CI tests are using the intel hardware.
    I feel a little silly just now noticing the comment on the macos line which notes 'many failures' with the M1 chips.

      matrix:
        include:
          - name: Linux
            os: ubuntu-latest
          - name: macOS
            os: macos-15-intel # macos-14 use M1 chips, which causes many failures
          - name: Windows
            os: windows-latest
    
  26. remkos commented on Mar 29, 2026

    @remkos
    Contributor

    Ping @remkos

    I you want my opinion ... I have not run the tests locally for ages, relying on CI instead. I'm still on macos-15-intel myself.
    But I did remember Paul complaining that when he went to M1 chips he had a bunch of failures.
    While @joa-quim is right that our code and compilation should be consistent, we cannot be sure that ghostscript is. So in the comparison on the PS files, I would not be surprised that we do find a lot of changes.

    I don't know about Dong Dong's hardware, but the AI seems to think that the Github CI is intel based hardware.

    I've given up to trust anything that AI is saying. Don't forget these are language models. They don't actually "know" anything. They are just repeating "what they heard". With any response from AI always ask "are you sure" or simply "you're wrong" and it will change its mind, even after being very affirmative the first time around.

    That's not saying that the answer is wrong (50% chance the answer is right in any case). But I would check that.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions