Browse Source

[library/cpp/hyperscan] Dropsupport ()
commit_hash:f0e4b9bf3cc217402238bf1efcc4b8695f6a3709

sskvor 2 months ago
parent
commit
8317ba3835

+ 3 - 13
library/cpp/regex/hyperscan/hyperscan.cpp

@@ -6,8 +6,6 @@
 #include <contrib/libs/hyperscan/runtime_corei7/hs_runtime.h>
 #include <contrib/libs/hyperscan/runtime_avx2/hs_common.h>
 #include <contrib/libs/hyperscan/runtime_avx2/hs_runtime.h>
-#include <contrib/libs/hyperscan/runtime_avx512/hs_common.h>
-#include <contrib/libs/hyperscan/runtime_avx512/hs_runtime.h>
 
 #include <util/generic/singleton.h>
 #include <util/system/sanitizers.h>
@@ -19,10 +17,9 @@ namespace NHyperscan {
 
     namespace NPrivate {
         ERuntime DetectCurrentRuntime() {
-            // TODO: Remove MSanIsOn check upon DEVTOOLSSUPPORT-49258 resolution
-            if (NX86::HaveAVX512F() && NX86::HaveAVX512BW() && !NSan::MSanIsOn()) {
-                return ERuntime::AVX512;
-            } else if (NX86::HaveAVX() && NX86::HaveAVX2()) {
+            // NOTE: We explicitly disable AVX512 runtime, there are bugs with
+            // trivial string matching. See SPI-122953 & SPI-117618.
+            if (NX86::HaveAVX() && NX86::HaveAVX2()) {
                 return ERuntime::AVX2;
             } else if (NX86::HaveSSE42() && NX86::HavePOPCNT()) {
                 return ERuntime::Corei7;
@@ -41,8 +38,6 @@ namespace NHyperscan {
                     return 0;
                 case ERuntime::AVX2:
                     return CPU_FEATURES_AVX2;
-                case ERuntime::AVX512:
-                    return CPU_FEATURES_AVX512;
             }
         }
 
@@ -78,11 +73,6 @@ namespace NHyperscan {
                     SerializeDatabase = avx2_hs_serialize_database;
                     DeserializeDatabase = avx2_hs_deserialize_database;
                     break;
-                case ERuntime::AVX512:
-                    AllocScratch = avx512_hs_alloc_scratch;
-                    Scan = avx512_hs_scan;
-                    SerializeDatabase = avx512_hs_serialize_database;
-                    DeserializeDatabase = avx512_hs_deserialize_database;
             }
         }
 

+ 0 - 2
library/cpp/regex/hyperscan/hyperscan.h

@@ -11,7 +11,6 @@
 namespace NHyperscan {
     using TCPUFeatures = decltype(hs_platform_info_t::cpu_features);
     constexpr TCPUFeatures CPU_FEATURES_AVX2 = HS_CPU_FEATURES_AVX2;
-    constexpr TCPUFeatures CPU_FEATURES_AVX512 = HS_CPU_FEATURES_AVX512 | HS_CPU_FEATURES_AVX2;
 
     template<typename TNativeDeleter, TNativeDeleter NativeDeleter>
     class TDeleter {
@@ -35,7 +34,6 @@ namespace NHyperscan {
             Core2 = 0,
             Corei7 = 1,
             AVX2 = 2,
-            AVX512 = 3
         };
 
         ERuntime DetectCurrentRuntime();

+ 0 - 1
library/cpp/regex/hyperscan/ut/hyperscan_ut.cpp

@@ -210,7 +210,6 @@ Y_UNIT_TEST_SUITE(HyperscanWrappers) {
             ERuntime::Core2,
             ERuntime::Corei7,
             ERuntime::AVX2,
-            ERuntime::AVX512
         };
 
         // Unfortunately, we cannot emulate runtimes with more capabilities than current machine.

+ 0 - 1
library/cpp/regex/hyperscan/ya.make

@@ -5,7 +5,6 @@ PEERDIR(
     contrib/libs/hyperscan/runtime_core2
     contrib/libs/hyperscan/runtime_corei7
     contrib/libs/hyperscan/runtime_avx2
-    contrib/libs/hyperscan/runtime_avx512
 )
 
 SRCS(

+ 1 - 1
yql/essentials/udfs/common/hyperscan/test/canondata/test.test_Error_/extracted

@@ -3,6 +3,6 @@
     <tmp_path>/program.sql:<main>:8:1: Error: Execution of node: YtMap!
     	SELECT $match(value) AS match FROM Input;
 	^
-        <tmp_path>/program.sql:<main>:6:21: Error: library/cpp/regex/hyperscan/hyperscan.cpp:102: Failed to compile regex: ^*$. Error message (hyperscan): Invalid repeat at index 1.
+        <tmp_path>/program.sql:<main>:6:21: Error: library/cpp/regex/hyperscan/hyperscan.cpp:92: Failed to compile regex: ^*$. Error message (hyperscan): Invalid repeat at index 1.
         	$match = Hyperscan::Match("*");
 	                    ^