google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.34k stars 309 forks source link

Does s2 work on i586? #348

Open Vedingrot opened 10 months ago

Vedingrot commented 10 months ago
Test project /usr/src/RPM/BUILD/libs2geometry-0.11.0/i586-alt-linux
        Start   1: encoded_s2cell_id_vector_test
  1/110 Test   #1: encoded_s2cell_id_vector_test ..................   Passed    0.01 sec
        Start   2: encoded_s2point_vector_test
  2/110 Test   #2: encoded_s2point_vector_test ....................   Passed    0.25 sec
        Start   3: encoded_s2shape_index_test
  3/110 Test   #3: encoded_s2shape_index_test .....................Subprocess aborted***Exception:   0.36 sec
        Start   4: encoded_string_vector_test
  4/110 Test   #4: encoded_string_vector_test .....................   Passed    0.01 sec
        Start   5: encoded_uint_vector_test
  5/110 Test   #5: encoded_uint_vector_test .......................   Passed    0.00 sec
        Start   6: id_set_lexicon_test
  6/110 Test   #6: id_set_lexicon_test ............................   Passed    0.00 sec
        Start   7: mutable_s2shape_index_test
  7/110 Test   #7: mutable_s2shape_index_test .....................Subprocess aborted***Exception:   0.02 sec
        Start   8: r1interval_test
  8/110 Test   #8: r1interval_test ................................   Passed    0.00 sec
        Start   9: r2rect_test
  9/110 Test   #9: r2rect_test ....................................   Passed    0.00 sec
        Start  10: s1angle_test
 10/110 Test  #10: s1angle_test ...................................***Failed    0.00 sec
        Start  11: s1chord_angle_test
 11/110 Test  #11: s1chord_angle_test .............................   Passed    0.13 sec
        Start  12: s1interval_test
 12/110 Test  #12: s1interval_test ................................***Failed    0.01 sec
        Start  13: s2boolean_operation_test
 13/110 Test  #13: s2boolean_operation_test .......................Subprocess aborted***Exception:   0.01 sec
        Start  14: s2buffer_operation_test
 14/110 Test  #14: s2buffer_operation_test ........................Subprocess aborted***Exception:   0.02 sec
        Start  15: s2builder_graph_test
 15/110 Test  #15: s2builder_graph_test ...........................   Passed    0.00 sec
        Start  16: s2builder_test
 16/110 Test  #16: s2builder_test .................................Subprocess aborted***Exception:   0.00 sec
        Start  17: s2builderutil_closed_set_normalizer_test
 17/110 Test  #17: s2builderutil_closed_set_normalizer_test .......Subprocess aborted***Exception:   0.01 sec
        Start  18: s2builderutil_find_polygon_degeneracies_test
 18/110 Test  #18: s2builderutil_find_polygon_degeneracies_test ...   Passed    0.00 sec
        Start  19: s2builderutil_get_snapped_winding_delta_test
 19/110 Test  #19: s2builderutil_get_snapped_winding_delta_test ...   Passed    0.15 sec
        Start  20: s2builderutil_lax_polygon_layer_test
 20/110 Test  #20: s2builderutil_lax_polygon_layer_test ...........Subprocess aborted***Exception:   0.01 sec
        Start  21: s2builderutil_lax_polyline_layer_test
 21/110 Test  #21: s2builderutil_lax_polyline_layer_test ..........   Passed    0.01 sec
        Start  22: s2builderutil_s2point_vector_layer_test
 22/110 Test  #22: s2builderutil_s2point_vector_layer_test ........   Passed    0.00 sec
        Start  23: s2builderutil_s2polygon_layer_test
 23/110 Test  #23: s2builderutil_s2polygon_layer_test .............Subprocess aborted***Exception:   0.00 sec
        Start  24: s2builderutil_s2polyline_layer_test
 24/110 Test  #24: s2builderutil_s2polyline_layer_test ............   Passed    0.00 sec
        Start  25: s2builderutil_s2polyline_vector_layer_test
 25/110 Test  #25: s2builderutil_s2polyline_vector_layer_test .....   Passed    0.00 sec
        Start  26: s2builderutil_snap_functions_test
 26/110 Test  #26: s2builderutil_snap_functions_test ..............***Failed    6.46 sec
        Start  27: s2builderutil_testing_test
 27/110 Test  #27: s2builderutil_testing_test .....................   Passed    0.01 sec
        Start  28: s2cap_test
 28/110 Test  #28: s2cap_test .....................................***Failed    0.00 sec
        Start  29: s2cell_test
 29/110 Test  #29: s2cell_test ....................................Subprocess aborted***Exception:   0.95 sec
        Start  30: s2cell_id_test
 30/110 Test  #30: s2cell_id_test .................................   Passed    1.02 sec
        Start  31: s2cell_index_test
 31/110 Test  #31: s2cell_index_test ..............................   Passed    0.03 sec
        Start  32: s2cell_iterator_join_test
 32/110 Test  #32: s2cell_iterator_join_test ......................   Passed    0.00 sec
        Start  33: s2cell_iterator_testing_test
 33/110 Test  #33: s2cell_iterator_testing_test ...................   Passed    0.00 sec
        Start  34: s2cell_range_iterator_test
 34/110 Test  #34: s2cell_range_iterator_test .....................   Passed    0.00 sec
        Start  35: s2cell_union_test
 35/110 Test  #35: s2cell_union_test ..............................   Passed    0.81 sec
        Start  36: s2centroids_test
 36/110 Test  #36: s2centroids_test ...............................   Passed    0.01 sec
        Start  37: s2closest_cell_query_base_test
 37/110 Test  #37: s2closest_cell_query_base_test .................   Passed    0.00 sec
        Start  38: s2closest_cell_query_test
 38/110 Test  #38: s2closest_cell_query_test ......................   Passed    0.55 sec
        Start  39: s2closest_edge_query_base_test
 39/110 Test  #39: s2closest_edge_query_base_test .................   Passed    0.00 sec
        Start  40: s2closest_edge_query_test
 40/110 Test  #40: s2closest_edge_query_test ......................Subprocess aborted***Exception:   0.01 sec
        Start  41: s2closest_point_query_base_test
 41/110 Test  #41: s2closest_point_query_base_test ................   Passed    0.00 sec
        Start  42: s2closest_point_query_test
 42/110 Test  #42: s2closest_point_query_test .....................   Passed    0.40 sec
        Start  43: s2contains_point_query_test
 43/110 Test  #43: s2contains_point_query_test ....................   Passed    0.02 sec
        Start  44: s2contains_vertex_query_test
 44/110 Test  #44: s2contains_vertex_query_test ...................   Passed    0.00 sec
        Start  45: s2convex_hull_query_test
 45/110 Test  #45: s2convex_hull_query_test .......................Subprocess aborted***Exception:   0.00 sec
        Start  46: s2coords_test
 46/110 Test  #46: s2coords_test ..................................   Passed    0.04 sec
        Start  47: s2crossing_edge_query_test
 47/110 Test  #47: s2crossing_edge_query_test .....................Subprocess aborted***Exception:   1.19 sec
        Start  48: s2earth_test
 48/110 Test  #48: s2earth_test ...................................   Passed    0.01 sec
        Start  49: s2edge_clipping_test
 49/110 Test  #49: s2edge_clipping_test ...........................   Passed    0.03 sec
        Start  50: s2edge_crosser_test
 50/110 Test  #50: s2edge_crosser_test ............................   Passed    0.06 sec
        Start  51: s2edge_crossings_test
 51/110 Test  #51: s2edge_crossings_test ..........................***Failed    0.37 sec
        Start  52: s2edge_distances_test
 52/110 Test  #52: s2edge_distances_test ..........................***Failed    0.07 sec
        Start  53: s2edge_tessellator_test
 53/110 Test  #53: s2edge_tessellator_test ........................   Passed    5.25 sec
        Start  54: s2edge_vector_shape_test
 54/110 Test  #54: s2edge_vector_shape_test .......................   Passed    0.01 sec
        Start  55: s2error_test
 55/110 Test  #55: s2error_test ...................................   Passed    0.00 sec
        Start  56: s2furthest_edge_query_test
 56/110 Test  #56: s2furthest_edge_query_test .....................   Passed    2.96 sec
        Start  57: s2hausdorff_distance_query_test
 57/110 Test  #57: s2hausdorff_distance_query_test ................   Passed    0.01 sec
        Start  58: s2latlng_test
 58/110 Test  #58: s2latlng_test ..................................   Passed    0.05 sec
        Start  59: s2latlng_rect_bounder_test
 59/110 Test  #59: s2latlng_rect_bounder_test .....................***Failed    0.11 sec
        Start  60: s2latlng_rect_test
 60/110 Test  #60: s2latlng_rect_test .............................***Failed    0.47 sec
        Start  61: s2lax_loop_shape_test
 61/110 Test  #61: s2lax_loop_shape_test ..........................   Passed    0.01 sec
        Start  62: s2lax_polygon_shape_test
 62/110 Test  #62: s2lax_polygon_shape_test .......................Subprocess aborted***Exception:   0.00 sec
        Start  63: s2lax_polyline_shape_test
 63/110 Test  #63: s2lax_polyline_shape_test ......................   Passed    0.00 sec
        Start  64: s2loop_measures_test
 64/110 Test  #64: s2loop_measures_test ...........................***Failed    0.72 sec
        Start  65: s2loop_test
 65/110 Test  #65: s2loop_test ....................................Subprocess aborted***Exception:   0.01 sec
        Start  66: s2measures_test
 66/110 Test  #66: s2measures_test ................................***Failed    0.02 sec
        Start  67: s2memory_tracker_test
 67/110 Test  #67: s2memory_tracker_test ..........................   Passed    0.00 sec
        Start  68: s2metrics_test
 68/110 Test  #68: s2metrics_test .................................   Passed    0.00 sec
        Start  69: s2max_distance_targets_test
 69/110 Test  #69: s2max_distance_targets_test ....................   Passed    0.01 sec
        Start  70: s2min_distance_targets_test
 70/110 Test  #70: s2min_distance_targets_test ....................   Passed    0.00 sec
        Start  71: s2padded_cell_test
 71/110 Test  #71: s2padded_cell_test .............................   Passed    0.01 sec
        Start  72: s2point_test
 72/110 Test  #72: s2point_test ...................................   Passed    0.03 sec
        Start  73: s2point_vector_shape_test
 73/110 Test  #73: s2point_vector_shape_test ......................   Passed    0.00 sec
        Start  74: s2point_compression_test
 74/110 Test  #74: s2point_compression_test .......................Subprocess aborted***Exception:   0.02 sec
        Start  75: s2point_index_test
 75/110 Test  #75: s2point_index_test .............................   Passed    0.01 sec
        Start  76: s2point_region_test
 76/110 Test  #76: s2point_region_test ............................   Passed    0.00 sec
        Start  77: s2pointutil_test
 77/110 Test  #77: s2pointutil_test ...............................   Passed    0.01 sec
        Start  78: s2polygon_test
 78/110 Test  #78: s2polygon_test .................................Subprocess aborted***Exception:   0.00 sec
        Start  79: s2polyline_alignment_test
 79/110 Test  #79: s2polyline_alignment_test ......................   Passed    0.29 sec
        Start  80: s2polyline_simplifier_test
 80/110 Test  #80: s2polyline_simplifier_test .....................***Failed    0.01 sec
        Start  81: s2polyline_measures_test
 81/110 Test  #81: s2polyline_measures_test .......................   Passed    0.01 sec
        Start  82: s2polyline_test
 82/110 Test  #82: s2polyline_test ................................   Passed    0.01 sec
        Start  83: s2predicates_test
 83/110 Test  #83: s2predicates_test ..............................***Failed    1.06 sec
        Start  84: s2projections_test
 84/110 Test  #84: s2projections_test .............................   Passed    0.00 sec
        Start  85: s2r2rect_test
 85/110 Test  #85: s2r2rect_test ..................................   Passed    0.00 sec
        Start  86: s2region_test
 86/110 Test  #86: s2region_test ..................................Subprocess aborted***Exception:   0.00 sec
        Start  87: s2region_term_indexer_test
 87/110 Test  #87: s2region_term_indexer_test .....................   Passed    0.45 sec
        Start  88: s2region_coverer_test
 88/110 Test  #88: s2region_coverer_test ..........................   Passed    0.87 sec
        Start  89: s2region_union_test
 89/110 Test  #89: s2region_union_test ............................***Failed    0.01 sec
        Start  90: s2shape_index_buffered_region_test
 90/110 Test  #90: s2shape_index_buffered_region_test .............Subprocess aborted***Exception:   0.04 sec
        Start  91: s2shape_index_measures_test
 91/110 Test  #91: s2shape_index_measures_test ....................   Passed    0.00 sec
        Start  92: s2shape_index_region_test
 92/110 Test  #92: s2shape_index_region_test ......................Subprocess aborted***Exception:   0.00 sec
        Start  93: s2shape_index_test
 93/110 Test  #93: s2shape_index_test .............................   Passed    0.00 sec
        Start  94: s2shape_measures_test
 94/110 Test  #94: s2shape_measures_test ..........................   Passed    0.00 sec
        Start  95: s2shape_nesting_query_test
 95/110 Test  #95: s2shape_nesting_query_test .....................   Passed    0.25 sec
        Start  96: s2shapeutil_build_polygon_boundaries_test
 96/110 Test  #96: s2shapeutil_build_polygon_boundaries_test ......   Passed    0.01 sec
        Start  97: s2shapeutil_coding_test
 97/110 Test  #97: s2shapeutil_coding_test ........................Subprocess aborted***Exception:   0.00 sec
        Start  98: s2shapeutil_contains_brute_force_test
 98/110 Test  #98: s2shapeutil_contains_brute_force_test ..........   Passed    0.01 sec
        Start  99: s2shapeutil_conversion_test
 99/110 Test  #99: s2shapeutil_conversion_test ....................Subprocess aborted***Exception:   0.00 sec
        Start 100: s2shapeutil_count_edges_test
100/110 Test #100: s2shapeutil_count_edges_test ...................   Passed    0.00 sec
        Start 101: s2shapeutil_edge_iterator_test
101/110 Test #101: s2shapeutil_edge_iterator_test .................   Passed    0.00 sec
        Start 102: s2shapeutil_get_reference_point_test
102/110 Test #102: s2shapeutil_get_reference_point_test ...........   Passed    0.01 sec
        Start 103: s2shapeutil_visit_crossing_edge_pairs_test
103/110 Test #103: s2shapeutil_visit_crossing_edge_pairs_test .....   Passed    0.01 sec
        Start 104: s2testing_test
104/110 Test #104: s2testing_test .................................   Passed    0.60 sec
        Start 105: s2text_format_test
105/110 Test #105: s2text_format_test .............................Subprocess aborted***Exception:   0.03 sec
        Start 106: s2wedge_relations_test
106/110 Test #106: s2wedge_relations_test .........................   Passed    0.00 sec
        Start 107: s2winding_operation_test
107/110 Test #107: s2winding_operation_test .......................   Passed    0.01 sec
        Start 108: s2wrapped_shape_test
108/110 Test #108: s2wrapped_shape_test ...........................   Passed    0.00 sec
        Start 109: sequence_lexicon_test
109/110 Test #109: sequence_lexicon_test ..........................   Passed    0.00 sec
        Start 110: value_lexicon_test
110/110 Test #110: value_lexicon_test .............................   Passed    0.00 sec

68% tests passed, 35 tests failed out of 110

Total Test time (real) =  26.61 sec

The following tests FAILED:
      3 - encoded_s2shape_index_test (Subprocess aborted)
      7 - mutable_s2shape_index_test (Subprocess aborted)
     10 - s1angle_test (Failed)
     12 - s1interval_test (Failed)
     13 - s2boolean_operation_test (Subprocess aborted)
     14 - s2buffer_operation_test (Subprocess aborted)
     16 - s2builder_test (Subprocess aborted)
     17 - s2builderutil_closed_set_normalizer_test (Subprocess aborted)
     20 - s2builderutil_lax_polygon_layer_test (Subprocess aborted)
     23 - s2builderutil_s2polygon_layer_test (Subprocess aborted)
     26 - s2builderutil_snap_functions_test (Failed)
     28 - s2cap_test (Failed)
     29 - s2cell_test (Subprocess aborted)
     40 - s2closest_edge_query_test (Subprocess aborted)
     45 - s2convex_hull_query_test (Subprocess aborted)
     47 - s2crossing_edge_query_test (Subprocess aborted)
     51 - s2edge_crossings_test (Failed)
     52 - s2edge_distances_test (Failed)
     59 - s2latlng_rect_bounder_test (Failed)
     60 - s2latlng_rect_test (Failed)
     62 - s2lax_polygon_shape_test (Subprocess aborted)
     64 - s2loop_measures_test (Failed)
     65 - s2loop_test (Subprocess aborted)
     66 - s2measures_test (Failed)
     74 - s2point_compression_test (Subprocess aborted)
     78 - s2polygon_test (Subprocess aborted)
     80 - s2polyline_simplifier_test (Failed)
     83 - s2predicates_test (Failed)
     86 - s2region_test (Subprocess aborted)
     89 - s2region_union_test (Failed)
     90 - s2shape_index_buffered_region_test (Subprocess aborted)
     92 - s2shape_index_region_test (Subprocess aborted)
     97 - s2shapeutil_coding_test (Subprocess aborted)
     99 - s2shapeutil_conversion_test (Subprocess aborted)
    105 - s2text_format_test (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /usr/src/RPM/BUILD/libs2geometry-0.11.0/i586-alt-linux/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

When I try to test on i586 it fails and looks like unsupported. Could you please take a look? LastTest.log

jmr commented 10 months ago

It used to work on i586. I can't remember if it always had SSE/SSE2 or could also run with x87 fp. S2 is very picky about rounding.

These failures look precision-related. You might try with -ffloat-store. What does lscpu say? Can you use use -msse or -msse2?

[ RUN      ] S2LoopTestBase.GetRectBound
F0000 00:00:1706803242.415047  322031 s2loop.cc:200] Check failed: subregion_bound_.Contains(bound_) 
[ RUN      ] S1Angle.DegreesVsRadians
/usr/src/RPM/BUILD/libs2geometry-0.11.0/src/s2/s1angle_test.cc:190: Failure
Expected: (S1Angle::Degrees(3)) != (S1Angle::Radians(3.14159265358979323846 / 60)), actual: 3.0000000 vs 3.0000000
[ RUN      ] S1IntervalTestBase.GetCenter
/usr/src/RPM/BUILD/libs2geometry-0.11.0/src/s2/s1interval_test.cc:128: Failure
Expected equality of these values:
  quad12.GetCenter()
    Which is: 1.5707963267948968
  1.57079632679489661923
    Which is: 1.5707963267948966

etc.

/usr/src/RPM/BUILD/libs2geometry-0.11.0/i586-alt-linux/...

Is this ALT Linux? Most distributions have dropped i586 and are talking about requiring x86-64-v3.

Vedingrot commented 10 months ago

Neither -ffloat-store nor -msse2 helps to fix tests.

I tried it in a qemu. lscpu output:

Architecture:                       i686
CPU op-mode(s):                     32-bit
Address sizes:                      36 bits physical, 32 bits virtual
Byte Order:                         Little Endian
CPU(s):                             8
On-line CPU(s) list:                0-7
Vendor ID:                          GenuineIntel
Model name:                         QEMU Virtual CPU version 2.5+
CPU family:                         6
Model:                              6
Thread(s) per core:                 1
Core(s) per socket:                 8
Socket(s):                          1
Stepping:                           3
BogoMIPS:                           3992.52
Flags:                              fpu de pse tsc msr pae mce cx8 apic sep pge cmov mmx fxsr sse sse2 ht cpuid pni hypervisor
L1d cache:                          256 KiB (8 instances)
L1i cache:                          256 KiB (8 instances)
L2 cache:                           32 MiB (8 instances)
L3 cache:                           16 MiB (1 instance)
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Mitigation: VMX unsupported
Vulnerability L1tf:                 Vulnerable
Vulnerability Mds:                  Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Meltdown:             Vulnerable
Vulnerability Mmio stale data:      Unknown: No mitigations
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

In ALT Linux, i586 is used mainly for wine, Steam and other consumers of 32-bit libraries. S2 is not needed in this form, but when you are trying to build a package, it is desirable that it works correctly under i586 too.