Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test errors on PowerPC: 85% tests passed, 16 tests failed out of 110 #316

Open
barracuda156 opened this issue May 20, 2023 · 9 comments
Open

Comments

@barracuda156
Copy link

--->  Testing s2geometry
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_s2geometry/s2geometry/work/build" && /usr/bin/make test 
Running tests...
/opt/local/bin/ctest --force-new-ctest-process 
Test project /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_s2geometry/s2geometry/work/build
        Start   1: encoded_s2cell_id_vector_test
  1/110 Test   #1: encoded_s2cell_id_vector_test ..................***Failed    0.21 sec
        Start   2: encoded_s2point_vector_test
  2/110 Test   #2: encoded_s2point_vector_test ....................Subprocess aborted***Exception:   8.69 sec
        Start   3: encoded_s2shape_index_test
  3/110 Test   #3: encoded_s2shape_index_test .....................Subprocess aborted***Exception:   2.46 sec
        Start   4: encoded_string_vector_test
  4/110 Test   #4: encoded_string_vector_test .....................***Failed    0.10 sec
        Start   5: encoded_uint_vector_test
  5/110 Test   #5: encoded_uint_vector_test .......................***Failed    0.13 sec
        Start   6: id_set_lexicon_test
  6/110 Test   #6: id_set_lexicon_test ............................   Passed    0.10 sec
        Start   7: mutable_s2shape_index_test
  7/110 Test   #7: mutable_s2shape_index_test .....................***Failed    5.56 sec
        Start   8: r1interval_test
  8/110 Test   #8: r1interval_test ................................   Passed    0.14 sec
        Start   9: r2rect_test
  9/110 Test   #9: r2rect_test ....................................   Passed    0.10 sec
        Start  10: s1angle_test
 10/110 Test  #10: s1angle_test ...................................   Passed    0.18 sec
        Start  11: s1chord_angle_test
 11/110 Test  #11: s1chord_angle_test .............................***Failed    1.28 sec
        Start  12: s1interval_test
 12/110 Test  #12: s1interval_test ................................   Passed    0.11 sec
        Start  13: s2boolean_operation_test
 13/110 Test  #13: s2boolean_operation_test .......................   Passed    1.23 sec
        Start  14: s2buffer_operation_test
 14/110 Test  #14: s2buffer_operation_test ........................   Passed    6.57 sec
        Start  15: s2builder_graph_test
 15/110 Test  #15: s2builder_graph_test ...........................   Passed    0.20 sec
        Start  16: s2builder_test
 16/110 Test  #16: s2builder_test .................................   Passed  294.96 sec
        Start  17: s2builderutil_closed_set_normalizer_test
 17/110 Test  #17: s2builderutil_closed_set_normalizer_test .......   Passed    0.27 sec
        Start  18: s2builderutil_find_polygon_degeneracies_test
 18/110 Test  #18: s2builderutil_find_polygon_degeneracies_test ...   Passed    0.18 sec
        Start  19: s2builderutil_get_snapped_winding_delta_test
 19/110 Test  #19: s2builderutil_get_snapped_winding_delta_test ...   Passed    1.07 sec
        Start  20: s2builderutil_lax_polygon_layer_test
 20/110 Test  #20: s2builderutil_lax_polygon_layer_test ...........   Passed    0.17 sec
        Start  21: s2builderutil_lax_polyline_layer_test
 21/110 Test  #21: s2builderutil_lax_polyline_layer_test ..........   Passed    0.19 sec
        Start  22: s2builderutil_s2point_vector_layer_test
 22/110 Test  #22: s2builderutil_s2point_vector_layer_test ........   Passed    0.20 sec
        Start  23: s2builderutil_s2polygon_layer_test
 23/110 Test  #23: s2builderutil_s2polygon_layer_test .............   Passed    0.18 sec
        Start  24: s2builderutil_s2polyline_layer_test
 24/110 Test  #24: s2builderutil_s2polyline_layer_test ............   Passed    0.18 sec
        Start  25: s2builderutil_s2polyline_vector_layer_test
 25/110 Test  #25: s2builderutil_s2polyline_vector_layer_test .....   Passed    0.21 sec
        Start  26: s2builderutil_snap_functions_test
 26/110 Test  #26: s2builderutil_snap_functions_test ..............   Passed  103.56 sec
        Start  27: s2builderutil_testing_test
 27/110 Test  #27: s2builderutil_testing_test .....................   Passed    0.16 sec
        Start  28: s2cap_test
 28/110 Test  #28: s2cap_test .....................................***Failed    0.13 sec
        Start  29: s2cell_test
 29/110 Test  #29: s2cell_test ....................................   Passed   57.64 sec
        Start  30: s2cell_id_test
 30/110 Test  #30: s2cell_id_test .................................   Passed    3.99 sec
        Start  31: s2cell_index_test
 31/110 Test  #31: s2cell_index_test ..............................   Passed    0.33 sec
        Start  32: s2cell_iterator_join_test
 32/110 Test  #32: s2cell_iterator_join_test ......................   Passed    0.17 sec
        Start  33: s2cell_iterator_testing_test
 33/110 Test  #33: s2cell_iterator_testing_test ...................   Passed    0.08 sec
        Start  34: s2cell_range_iterator_test
 34/110 Test  #34: s2cell_range_iterator_test .....................   Passed    0.15 sec
        Start  35: s2cell_union_test
 35/110 Test  #35: s2cell_union_test ..............................   Passed    3.49 sec
        Start  36: s2centroids_test
 36/110 Test  #36: s2centroids_test ...............................   Passed    0.15 sec
        Start  37: s2closest_cell_query_base_test
 37/110 Test  #37: s2closest_cell_query_base_test .................   Passed    0.18 sec
        Start  38: s2closest_cell_query_test
 38/110 Test  #38: s2closest_cell_query_test ......................   Passed    2.17 sec
        Start  39: s2closest_edge_query_base_test
 39/110 Test  #39: s2closest_edge_query_base_test .................   Passed    0.16 sec
        Start  40: s2closest_edge_query_test
 40/110 Test  #40: s2closest_edge_query_test ......................   Passed    1.95 sec
        Start  41: s2closest_point_query_base_test
 41/110 Test  #41: s2closest_point_query_base_test ................   Passed    0.14 sec
        Start  42: s2closest_point_query_test
 42/110 Test  #42: s2closest_point_query_test .....................   Passed    1.91 sec
        Start  43: s2contains_point_query_test
 43/110 Test  #43: s2contains_point_query_test ....................   Passed    0.19 sec
        Start  44: s2contains_vertex_query_test
 44/110 Test  #44: s2contains_vertex_query_test ...................   Passed    0.14 sec
        Start  45: s2convex_hull_query_test
 45/110 Test  #45: s2convex_hull_query_test .......................   Passed    4.24 sec
        Start  46: s2coords_test
 46/110 Test  #46: s2coords_test ..................................   Passed    0.23 sec
        Start  47: s2crossing_edge_query_test
 47/110 Test  #47: s2crossing_edge_query_test .....................   Passed    3.54 sec
        Start  48: s2earth_test
 48/110 Test  #48: s2earth_test ...................................   Passed    0.07 sec
        Start  49: s2edge_clipping_test
 49/110 Test  #49: s2edge_clipping_test ...........................   Passed    0.37 sec
        Start  50: s2edge_crosser_test
 50/110 Test  #50: s2edge_crosser_test ............................   Passed    0.49 sec
        Start  51: s2edge_crossings_test
 51/110 Test  #51: s2edge_crossings_test ..........................***Failed    3.39 sec
        Start  52: s2edge_distances_test
 52/110 Test  #52: s2edge_distances_test ..........................   Passed    0.33 sec
        Start  53: s2edge_tessellator_test
 53/110 Test  #53: s2edge_tessellator_test ........................   Passed  258.25 sec
        Start  54: s2edge_vector_shape_test
 54/110 Test  #54: s2edge_vector_shape_test .......................   Passed    0.20 sec
        Start  55: s2error_test
 55/110 Test  #55: s2error_test ...................................   Passed    0.11 sec
        Start  56: s2furthest_edge_query_test
 56/110 Test  #56: s2furthest_edge_query_test .....................   Passed   11.62 sec
        Start  57: s2hausdorff_distance_query_test
 57/110 Test  #57: s2hausdorff_distance_query_test ................   Passed    0.18 sec
        Start  58: s2latlng_test
 58/110 Test  #58: s2latlng_test ..................................   Passed    0.29 sec
        Start  59: s2latlng_rect_bounder_test
 59/110 Test  #59: s2latlng_rect_bounder_test .....................   Passed    0.27 sec
        Start  60: s2latlng_rect_test
 60/110 Test  #60: s2latlng_rect_test .............................   Passed    1.70 sec
        Start  61: s2lax_loop_shape_test
 61/110 Test  #61: s2lax_loop_shape_test ..........................   Passed    0.20 sec
        Start  62: s2lax_polygon_shape_test
 62/110 Test  #62: s2lax_polygon_shape_test .......................Subprocess aborted***Exception:   6.48 sec
        Start  63: s2lax_polyline_shape_test
 63/110 Test  #63: s2lax_polyline_shape_test ......................Subprocess aborted***Exception:   2.60 sec
        Start  64: s2loop_measures_test
 64/110 Test  #64: s2loop_measures_test ...........................   Passed    1.98 sec
        Start  65: s2loop_test
 65/110 Test  #65: s2loop_test ....................................   Passed    7.00 sec
        Start  66: s2measures_test
 66/110 Test  #66: s2measures_test ................................   Passed    0.24 sec
        Start  67: s2memory_tracker_test
 67/110 Test  #67: s2memory_tracker_test ..........................   Passed    0.09 sec
        Start  68: s2metrics_test
 68/110 Test  #68: s2metrics_test .................................   Passed    0.11 sec
        Start  69: s2max_distance_targets_test
 69/110 Test  #69: s2max_distance_targets_test ....................   Passed    0.22 sec
        Start  70: s2min_distance_targets_test
 70/110 Test  #70: s2min_distance_targets_test ....................   Passed    0.17 sec
        Start  71: s2padded_cell_test
 71/110 Test  #71: s2padded_cell_test .............................   Passed    0.15 sec
        Start  72: s2point_test
 72/110 Test  #72: s2point_test ...................................***Failed    0.25 sec
        Start  73: s2point_vector_shape_test
 73/110 Test  #73: s2point_vector_shape_test ......................   Passed    0.13 sec
        Start  74: s2point_compression_test
 74/110 Test  #74: s2point_compression_test .......................   Passed    0.15 sec
        Start  75: s2point_index_test
 75/110 Test  #75: s2point_index_test .............................   Passed    0.28 sec
        Start  76: s2point_region_test
 76/110 Test  #76: s2point_region_test ............................   Passed    0.09 sec
        Start  77: s2pointutil_test
 77/110 Test  #77: s2pointutil_test ...............................   Passed    0.15 sec
        Start  78: s2polygon_test
 78/110 Test  #78: s2polygon_test .................................***Failed  158.69 sec
        Start  79: s2polyline_alignment_test
 79/110 Test  #79: s2polyline_alignment_test ......................   Passed   17.08 sec
        Start  80: s2polyline_simplifier_test
 80/110 Test  #80: s2polyline_simplifier_test .....................   Passed    0.21 sec
        Start  81: s2polyline_measures_test
 81/110 Test  #81: s2polyline_measures_test .......................   Passed    0.10 sec
        Start  82: s2polyline_test
 82/110 Test  #82: s2polyline_test ................................   Passed    0.13 sec
        Start  83: s2predicates_test
 83/110 Test  #83: s2predicates_test ..............................***Failed   14.50 sec
        Start  84: s2projections_test
 84/110 Test  #84: s2projections_test .............................   Passed    0.13 sec
        Start  85: s2r2rect_test
 85/110 Test  #85: s2r2rect_test ..................................   Passed    0.17 sec
        Start  86: s2region_test
 86/110 Test  #86: s2region_test ..................................***Failed    0.16 sec
        Start  87: s2region_term_indexer_test
 87/110 Test  #87: s2region_term_indexer_test .....................   Passed    3.66 sec
        Start  88: s2region_coverer_test
 88/110 Test  #88: s2region_coverer_test ..........................   Passed   36.43 sec
        Start  89: s2region_union_test
 89/110 Test  #89: s2region_union_test ............................   Passed    0.12 sec
        Start  90: s2shape_index_buffered_region_test
 90/110 Test  #90: s2shape_index_buffered_region_test .............   Passed    0.34 sec
        Start  91: s2shape_index_measures_test
 91/110 Test  #91: s2shape_index_measures_test ....................   Passed    0.10 sec
        Start  92: s2shape_index_region_test
 92/110 Test  #92: s2shape_index_region_test ......................   Passed    0.89 sec
        Start  93: s2shape_index_test
 93/110 Test  #93: s2shape_index_test .............................   Passed    0.07 sec
        Start  94: s2shape_measures_test
 94/110 Test  #94: s2shape_measures_test ..........................   Passed    0.10 sec
        Start  95: s2shape_nesting_query_test
 95/110 Test  #95: s2shape_nesting_query_test .....................   Passed    1.69 sec
        Start  96: s2shapeutil_build_polygon_boundaries_test
 96/110 Test  #96: s2shapeutil_build_polygon_boundaries_test ......   Passed    0.20 sec
        Start  97: s2shapeutil_coding_test
 97/110 Test  #97: s2shapeutil_coding_test ........................Subprocess aborted***Exception:   3.08 sec
        Start  98: s2shapeutil_contains_brute_force_test
 98/110 Test  #98: s2shapeutil_contains_brute_force_test ..........   Passed    0.14 sec
        Start  99: s2shapeutil_conversion_test
 99/110 Test  #99: s2shapeutil_conversion_test ....................   Passed    0.18 sec
        Start 100: s2shapeutil_count_edges_test
100/110 Test #100: s2shapeutil_count_edges_test ...................   Passed    0.18 sec
        Start 101: s2shapeutil_edge_iterator_test
101/110 Test #101: s2shapeutil_edge_iterator_test .................   Passed    0.21 sec
        Start 102: s2shapeutil_get_reference_point_test
102/110 Test #102: s2shapeutil_get_reference_point_test ...........   Passed    0.24 sec
        Start 103: s2shapeutil_visit_crossing_edge_pairs_test
103/110 Test #103: s2shapeutil_visit_crossing_edge_pairs_test .....   Passed    0.19 sec
        Start 104: s2testing_test
104/110 Test #104: s2testing_test .................................   Passed    5.04 sec
        Start 105: s2text_format_test
105/110 Test #105: s2text_format_test .............................   Passed    0.45 sec
        Start 106: s2wedge_relations_test
106/110 Test #106: s2wedge_relations_test .........................   Passed    0.09 sec
        Start 107: s2winding_operation_test
107/110 Test #107: s2winding_operation_test .......................   Passed    0.14 sec
        Start 108: s2wrapped_shape_test
108/110 Test #108: s2wrapped_shape_test ...........................   Passed    0.15 sec
        Start 109: sequence_lexicon_test
109/110 Test #109: sequence_lexicon_test ..........................   Passed    0.11 sec
        Start 110: value_lexicon_test
110/110 Test #110: value_lexicon_test .............................   Passed    0.10 sec

85% tests passed, 16 tests failed out of 110

Total Test time (real) = 1052.21 sec

The following tests FAILED:
	  1 - encoded_s2cell_id_vector_test (Failed)
	  2 - encoded_s2point_vector_test (Subprocess aborted)
	  3 - encoded_s2shape_index_test (Subprocess aborted)
	  4 - encoded_string_vector_test (Failed)
	  5 - encoded_uint_vector_test (Failed)
	  7 - mutable_s2shape_index_test (Failed)
	 11 - s1chord_angle_test (Failed)
	 28 - s2cap_test (Failed)
	 51 - s2edge_crossings_test (Failed)
	 62 - s2lax_polygon_shape_test (Subprocess aborted)
	 63 - s2lax_polyline_shape_test (Subprocess aborted)
	 72 - s2point_test (Failed)
	 78 - s2polygon_test (Failed)
	 83 - s2predicates_test (Failed)
	 86 - s2region_test (Failed)
	 97 - s2shapeutil_coding_test (Subprocess aborted)
Errors while running CTest
@barracuda156
Copy link
Author

@jmr Could you please take a look?
s2_ppc_tests.log

@jmr
Copy link
Member

jmr commented May 20, 2023

The ones involving encoding/decoding are expected. Most of that code assumes little endian. There should be more checks like this. They could be fixed if you can find all the places and do it in a way that doesn't affect little-endian performance.

F0000 00:00:1684583674.764805       1 encoded_s2point_vector.cc:172] Not implemented on big-endian architectures

Some of the other failures are surprising.

[ RUN      ] S2Cap.GetCellUnionBoundLevel1Radius
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_math_s2geometry/s2geometry/work/s2geometry-7773d518b1f29caa1c2045eb66ec519e025be108/src/s2/s2cap_test.cc:308: Failure
Expected equality of these values:
  3
  covering.size()
    Which is: 6
[  FAILED  ] S2Cap.GetCellUnionBoundLevel1Radius (0 ms)

You'll have to debug these since I don't have access to the architecture.

@barracuda156
Copy link
Author

@jmr By the way, assumed LE is a bug introduced in the current version or it existed all through?

@jmr
Copy link
Member

jmr commented May 21, 2023

I wouldn't call it a bug. It's an intended limitation since big endian is no longer common. It's always been like this, it's just that more encode/decode classes/functions have been added over the years.

@barracuda156
Copy link
Author

barracuda156 commented May 21, 2023

I wouldn't call it a bug. It's an intended limitation since big endian is no longer common. It's always been like this, it's just that more encode/decode classes/functions have been added over the years.

Well, I am not hugely surprised that MacOS PPC is not specifically supported, but there are plenty of current BE systems around: several BSDs, several versions of Linux, AIX. And modern CPUs supporting BE (even though being bi-endian).
Healthy code should be bi-endian as long as technology is bi-endian. IMO.

Also, if something genuinely cannot be supported, it should be rather skipped in tests or marked as known fail.

@barracuda156
Copy link
Author

@jmr Maybe you could use Qemu on Linux? Big-endian issues will be common to any OS, so any Linux distro should do, or a BSD system.

@barracuda156
Copy link
Author

Test results from s2geometry v. 0.11.1:

85% tests passed, 16 tests failed out of 110

Total Test time (real) = 828.31 sec

The following tests FAILED:
	  1 - encoded_s2cell_id_vector_test (Failed)
	  2 - encoded_s2point_vector_test (Subprocess aborted)
	  3 - encoded_s2shape_index_test (Subprocess aborted)
	  4 - encoded_string_vector_test (Failed)
	  5 - encoded_uint_vector_test (Failed)
	  7 - mutable_s2shape_index_test (Failed)
	 11 - s1chord_angle_test (Failed)
	 28 - s2cap_test (Failed)
	 51 - s2edge_crossings_test (Failed)
	 62 - s2lax_polygon_shape_test (Subprocess aborted)
	 63 - s2lax_polyline_shape_test (Subprocess aborted)
	 72 - s2point_test (Failed)
	 78 - s2polygon_test (Failed)
	 83 - s2predicates_test (Failed)
	 86 - s2region_test (Failed)
	 97 - s2shapeutil_coding_test (Subprocess aborted)
Errors while running CTest

I.e. nothing changed.

@jmr
Copy link
Member

jmr commented Feb 19, 2024

At this point big endian is uncommon enough that it's not a priority. Whoever wants this will need to send a PR. If you want to give this a shot, the little-endian code path should be unaffected or close to it.

There are some classes that could help, like: https://github.com/google/s2geometry/blob/master/src/s2/util/endian/endian.h

@jmr
Copy link
Member

jmr commented Apr 5, 2024

You need to find places that are doing a plain load / unaligned load and change them to use LittleEndian::Load64/32/...().

For example:

if (sizeof(T) == 8) return ABSL_INTERNAL_UNALIGNED_LOAD64(ptr);

Based on the tests that are failing, it should be easy to find most of the places.

Calls to Encoder::putn and Decoder::getn will need to be updated to to handle the byte swapping. It couldn't hurt to look at all uses of Encoder/Decoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants