{"id":480021,"date":"2026-05-17T16:31:52","date_gmt":"2026-05-17T16:31:52","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=480021"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=480021","title":{"rendered":"GLM-5.1 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/2db\/0f0\/9d7\/2db0f09d7d022095904970a50f7dedc0.jpg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/2db\/0f0\/9d7\/2db0f09d7d022095904970a50f7dedc0.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/2db\/0f0\/9d7\/2db0f09d7d022095904970a50f7dedc0.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0414\u0440\u0443\u0437\u044c\u044f, \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d \u0432\u043e\u0441\u043f\u0435\u0432\u0430\u043d\u0438\u0435\u043c AI, \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u044e\u0434\u0435\u0439 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432) \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 C\/C++. \u042f \u043d\u0435 AI-\u043f\u0440\u043e\u043f\u043e\u0432\u0435\u0434\u043d\u0438\u043a \u2013 \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0438 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f AI-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b AI (\u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435, opencode + GLM-5.1) \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447, \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e, \u0438 \u043e\u043d \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u042d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0440\u044b\u0432\u043d\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0430\u0437\u0431\u043e\u0433\u0430\u0442\u0435\u044e, \u043d\u043e \u043e\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439: \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u043d\u043e\u0432\u044b\u0439. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u201c\u0434\u0430\u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u043d\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u043c\u0438\u043d\u0443\u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0439 \u0440\u0430\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443\u201d<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b AI \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b AI \u043f\u0438\u0441\u0430\u043b \u0447\u0442\u043e-\u0442\u043e \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0435 \u043d\u0430 C++<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 RMQ\/LCA.<\/p>\n<h3>\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0443 \u0441 \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438: \u043f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <img decoding=\"async\" class=\"formula inline\" source=\"B:\\{1, \\ldots, n\\}\\rightarrow \\{0, 1\\}\" alt=\"B:\\{1, \\ldots, n\\}\\rightarrow \\{0, 1\\}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/4c\/4ca\/4ca56c7da53ebafe21ac4d406b91f520.svg\" width=\"176\" height=\"16\" data-width=\"22.445\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/4c\/4ca\/4ca56c7da53ebafe21ac4d406b91f520.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/4c\/4ca\/4ca56c7da53ebafe21ac4d406b91f520.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0433\u0434\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"B[i]\" alt=\"B[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a9\/a90\/a9006d4272e212cc211fad85d4ac35b5.svg\" width=\"24\" height=\"16\" data-width=\"3.756\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a9\/a90\/a9006d4272e212cc211fad85d4ac35b5.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a9\/a90\/a9006d4272e212cc211fad85d4ac35b5.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u2013 <img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" data-width=\"0.781\" data-height=\"1.52\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u0439 \u0431\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c excess \u043a\u0430\u043a <img decoding=\"async\" class=\"formula inline\" source=\"E_B:\\{0, \\ldots, n\\}\\rightarrow \\mathbb{Z}\" alt=\"E_B:\\{0, \\ldots, n\\}\\rightarrow \\mathbb{Z}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/02b\/02bf6eab7417ab6adeb07248fabf712a.svg\" width=\"152\" height=\"16\" data-width=\"19.778\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/02b\/02bf6eab7417ab6adeb07248fabf712a.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/02b\/02bf6eab7417ab6adeb07248fabf712a.svg 781w\" loading=\"lazy\" decode=\"async\"\/>:<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"E_B[i] = \\sum_{j=1}^i 2B[j]-1,\" alt=\"E_B[i] = \\sum_{j=1}^i 2B[j]-1,\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a1\/a17\/a17ac1d7c4582eeb09f3c9d05834d8c9.svg\" width=\"168\" height=\"48\" data-width=\"21.336\" data-height=\"6.9\" data-vertical-align=\"-2.884\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a1\/a17\/a17ac1d7c4582eeb09f3c9d05834d8c9.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a1\/a17\/a17ac1d7c4582eeb09f3c9d05834d8c9.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u0422.\u0435. <img decoding=\"async\" class=\"formula inline\" source=\"E_B[i]\" alt=\"E_B[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/11\/11a\/11a8498935e32c0e76720a2929a3508b.svg\" width=\"40\" height=\"16\" data-width=\"5.11\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/11\/11a\/11a8498935e32c0e76720a2929a3508b.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/11\/11a\/11a8498935e32c0e76720a2929a3508b.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u2013 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u043c\u0438\u043d\u0443\u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0439 \u0432 \u043f\u0435\u0440\u0432\u044b\u0445 <img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" data-width=\"0.781\" data-height=\"1.52\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0431\u0438\u0442\u0430\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <img decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg\" width=\"12\" height=\"12\" data-width=\"1.717\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430: \u0434\u0430\u043d\u043e <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"12\" height=\"12\" data-width=\"1.179\" data-height=\"1.595\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0438\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" data-width=\"0.781\" data-height=\"1.52\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0447\u0442\u043e <img decoding=\"async\" class=\"formula inline\" source=\"E_B[i]=k\" alt=\"E_B[i]=k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/ad\/ad3\/ad30341317e6791e18b2150a62ea581f.svg\" width=\"72\" height=\"16\" data-width=\"9.306\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/ad\/ad3\/ad30341317e6791e18b2150a62ea581f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/ad\/ad3\/ad30341317e6791e18b2150a62ea581f.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2013 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0430\u0440\u043d\u0443\u044e \u0441\u043a\u043e\u0431\u043a\u0443 \u0438\u043b\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0443\u044e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043f\u0430\u0440\u0443 \u0441\u043a\u043e\u0431\u043e\u043a. \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e? \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c \u0447\u0435\u0440\u0435\u0437 \u0441\u043a\u043e\u0431\u043e\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041d\u0435 \u0445\u043e\u0447\u0443 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438; \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 BP-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f: \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0445\u043e\u0434 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0441\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0438\u0436\u0435, \u043f\u0438\u0448\u0435\u043c 1, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c\u0441\u044f \u2013 0.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/e81\/eac\/d5e\/e81eacd5e1ad3653eea28d07f9b7a4cb.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/e81\/eac\/d5e\/e81eacd5e1ad3653eea28d07f9b7a4cb.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/e81\/eac\/d5e\/e81eacd5e1ad3653eea28d07f9b7a4cb.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/d70\/3b2\/712\/d703b27120952226b32f6759b52d2fb1.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/d70\/3b2\/712\/d703b27120952226b32f6759b52d2fb1.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/d70\/3b2\/712\/d703b27120952226b32f6759b52d2fb1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430 \u0441\u043a\u043e\u0431\u043e\u043a, \u0430 \u0432\u0441\u0451 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u043e\u0431\u043e\u043a \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u043a\u043e\u0431\u043a\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0435\u0451 \u043f\u0430\u0440\u043d\u0443\u044e. \u0412 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435: <em>\u0434\u0430\u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 <img decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg\" width=\"12\" height=\"12\" data-width=\"1.717\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u043f\u043e\u0437\u0438\u0446\u0438\u044f <img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" data-width=\"0.781\" data-height=\"1.52\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"12\" height=\"12\" data-width=\"1.179\" data-height=\"1.595\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u041d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 <img decoding=\"async\" class=\"formula inline\" source=\"j\\geq i\" alt=\"j\\geq i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/11\/118\/11869e7219dd2e2bc575f8e5e65bfc84.svg\" width=\"32\" height=\"16\" data-width=\"4.73\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/11\/118\/11869e7219dd2e2bc575f8e5e65bfc84.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/11\/118\/11869e7219dd2e2bc575f8e5e65bfc84.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e <img decoding=\"async\" class=\"formula inline\" source=\"E_B[j]=E_B[i]+k\" alt=\"E_B[j]=E_B[i]+k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/84\/847\/84719acbf91fec52eab08cdceb903d00.svg\" width=\"136\" height=\"16\" data-width=\"17.333\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/84\/847\/84719acbf91fec52eab08cdceb903d00.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/84\/847\/84719acbf91fec52eab08cdceb903d00.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/em>. \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2013 range min-max tree, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u041e\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0437\u0430 <img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log n)\" alt=\"\\mathcal{O}(\\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg\" width=\"64\" height=\"16\" data-width=\"8.187\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u0430\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h3>Baseline<\/h3>\n<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043c\u043d\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 range min-max tree.<\/p>\n<p><a href=\"https:\/\/github.com\/simongog\/sdsl-lite\/blob\/master\/include\/sdsl\/bp_support_algorithm.hpp#L48\" rel=\"noopener noreferrer nofollow\">Sdsl-Lite<\/a><\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <img decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg\" width=\"12\" height=\"12\" data-width=\"1.717\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438\u0437 8 \u0431\u0438\u0442 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"12\" height=\"12\" data-width=\"1.179\" data-height=\"1.595\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u043a\u0430 <img decoding=\"async\" class=\"formula inline\" source=\"E_B[i]=k\" alt=\"E_B[i]=k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/ad\/ad3\/ad30341317e6791e18b2150a62ea581f.svg\" width=\"72\" height=\"16\" data-width=\"9.306\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/ad\/ad3\/ad30341317e6791e18b2150a62ea581f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/ad\/ad3\/ad30341317e6791e18b2150a62ea581f.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u0414\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <img decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg\" width=\"12\" height=\"12\" data-width=\"1.717\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u0435\u0451 \u043d\u0430 \u0431\u043b\u043e\u043a\u0438 \u043f\u043e 8 \u0431\u0438\u0442, \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0431\u043b\u043e\u043a\u0430\u043c, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"12\" height=\"12\" data-width=\"1.179\" data-height=\"1.595\" data-vertical-align=\"-0.025\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e excess \u0432\u0441\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a <code>2*popcount(B)-8<\/code>.<\/p>\n<h3>\u0427\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b GLM-5.1<\/h3>\n<p>\u0412 SIMD \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>pshufb<\/code>, \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u044d\u0442\u043e\u043c. \u041d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>pshufb<\/code> \u043d\u0443\u0436\u043d\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430 16; GLM-5.1 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \u0438\u0437 <img decoding=\"async\" class=\"formula inline\" source=\"4\" alt=\"4\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a8\/a87\/a87ff679a2f3e71d9181a67b7542122c.svg\" width=\"12\" height=\"12\" data-width=\"1.131\" data-height=\"1.532\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a8\/a87\/a87ff679a2f3e71d9181a67b7542122c.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a8\/a87\/a87ff679a2f3e71d9181a67b7542122c.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0431\u0438\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c excess \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 4 \u043f\u043e\u0437\u0438\u0446\u0438\u0439; \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0438\u0437 \u043d\u0438\u0445 \u2013 excess \u0432\u0441\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b excess \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0432\u0441\u0435\u0445 4-\u0431\u0438\u0442\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e 4-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430 <code>i<\/code> \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f 0, 1, 2, 3 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0440\u0430\u0432\u043d\u043e \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>target-E[4i]<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u043e\u0434\u043d\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043c\u0430\u0441\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/1ff\/e7c\/434\/1ffe7c4345ac25d42a9cea276e3ccb38.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/\/post_images\/1ff\/e7c\/434\/1ffe7c4345ac25d42a9cea276e3ccb38.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/\/post_images\/1ff\/e7c\/434\/1ffe7c4345ac25d42a9cea276e3ccb38.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u2013 \u044d\u0442\u043e 4 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 128, 256 \u0438\u043b\u0438 512 \u0431\u0438\u0442.<\/p>\n<details class=\"spoiler\">\n<summary>\u0422\u0430\u0431\u043b\u0438\u0446\u044b excess \u0434\u043b\u044f AVX-2<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/ LUT for total excess change across a 4-bit nibblestatic inline const __m256i excess_lut_delta = _mm256_setr_epi8(    -4, -2, -2,  0, \/\/ 0000, 0001, 0010, 0011    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011     0,  2,  2,  4, \/\/ 1000, 1001, 1010, 1011    -4, -2, -2,  0, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)     0,  2,  2,  4  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));static inline const __m256i excess_lut_pos0 = _mm256_setr_epi8(    -1,  1, -1,  1, \/\/ 0000, 0001, 0010, 0011    -1,  1, -1,  1, \/\/ 0100, 0101, 0110, 0111    -1,  1, -1,  1, \/\/ 1000, 1001, 1010, 1011    -1,  1, -1,  1, \/\/ 1100, 1101, 1110, 1111    -1,  1, -1,  1, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1, -1,  1, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1, -1,  1, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1, -1,  1  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));static inline const __m256i excess_lut_pos1 = _mm256_setr_epi8(    -2,  0,  0,  2, \/\/ 0000, 0001, 0010, 0011    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011    -2,  0,  0,  2, \/\/ 1100, 1101, 1110, 1111    -2,  0,  0,  2, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));static inline const __m256i excess_lut_pos2 = _mm256_setr_epi8(    -3, -1, -1,  1, \/\/ 0000, 0001, 0010, 0011    -1,  1,  1,  3, \/\/ 0100, 0101, 0110, 0111    -3, -1, -1,  1, \/\/ 1000, 1001, 1010, 1011    -1,  1,  1,  3, \/\/ 1100, 1101, 1110, 1111    -3, -1, -1,  1, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1,  1,  3, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -3, -1, -1,  1, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1,  1,  3  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<p>\u041f\u0440\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0445 \u0441\u0443\u043c\u043c \u2013 \u044d\u0442\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u043e\u043c:<\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0438\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f 0-based \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f: \u043c\u0430\u0441\u0441\u0438\u0432 <code>B<\/code> \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 <code>n<\/code>, \u0430 <code>E<\/code> \u2013 \u0434\u043b\u0438\u043d\u0443 <code>n + 1<\/code>.<\/p>\n<pre><code class=\"cpp\">E[0] = 0;for (size_t i = 1; i &lt;= n; ++i) {  E[i] = E[i - 1] + B[i - 1];}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0438 \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 <img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(n)\" alt=\"\\mathcal{O}(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg\" width=\"32\" height=\"16\" data-width=\"4.919\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0414\u043b\u044f SIMD-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c:<\/p>\n<pre><code class=\"cpp\">std::copy(B.begin(), B.end(), std::next(E.begin(), 1));E[0] = 0;for (size_t offset = 1; offset &lt; n; offset *= 2) {  for (size_t i = n; i &gt;= offset; --i) {    E[i] += E[i - offset];  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0446\u0438\u043a\u043b \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c, \u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0446\u0438\u043a\u043b \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e <img decoding=\"async\" class=\"formula inline\" source=\"\\log_2 n\" alt=\"\\log_2 n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/672\/6728eba779a6f39a9d12cbb243f96655.svg\" width=\"40\" height=\"16\" data-width=\"5.614\" data-height=\"2.262\" data-vertical-align=\"-0.566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/672\/6728eba779a6f39a9d12cbb243f96655.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/67\/672\/6728eba779a6f39a9d12cbb243f96655.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u0412\u043e\u0442 \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b \u043f\u043e \u0431\u0430\u0439\u0442\u0430\u043c:<\/p>\n<pre><code class=\"cpp\">ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 1));ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 2));ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 4));ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 8));<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0423\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u0438\u043d\u043e\u0439 64\/128 \u0431\u0438\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 128\/256 \u0431\u0438\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e; \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 512-\u0431\u0438\u0442\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u044f \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e 128 \u0431\u0438\u0442.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u2013 \u0434\u0435\u043b\u043e \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. GLM-5.1 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0443\u044e, \u043d\u043e \u0441\u043b\u0435\u0433\u043a\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e <code>cmpeq-&gt;movemask-&gt;pdep<\/code>; \u043d\u0438\u0436\u0435 \u2013 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 workflow \u043e\u0442 AI:<\/p>\n<pre><code>word \u2500\u2500\u25ba nibble extraction \u2500\u2500\u25ba nibbles[0..15]                                    \u2502              \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510              \u25bc                     \u25bc                     \u25bc     vpshufb(delta)          vpshufb(pos_j)         vpshufb(delta)         deltas                   rel_j                  rel_3              \u2502                     \u2502                     \u2502              \u25bc                     \u2502                     \u2502     prefix sum (4 steps)           \u2502                     \u2502              \u2502                     \u2502                     \u2502              \u25bc                     \u2502                     \u2502     shift left 1 byte              \u2502                     \u2502     \u2192 excl (exclusive psum)        \u2502                     \u2502              \u2502                     \u2502                     \u2502              \u25bc                     \u2502                     \u2502     base = excl - target_local     \u2502                     \u2502              \u2502                     \u2502                     \u2502              \u25bc                     \u25bc                     \u25bc     base + rel_j \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba cmpeq(0) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba movemask \u2192 bits_j                                                           \u2502              \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524              \u25bc                  \u25bc                  \u25bc      \u25bc           pdep(0x1\u2026)       pdep(0x2\u2026)       pdep(0x4\u2026)  pdep(0x8\u2026)              \u2502                   \u2502                \u2502      \u2502              \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 OR \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518      \u2502                                  \u2502                       \u2502                                  \u25bc                       \u2502                              out[w] \u25c4\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0442\u0430\u0434\u0438\u044f\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0438 \u0441\u0436\u0430\u0442\u0438\u0435\u043c \u0447\u0438\u0441\u0435\u043b\/\u043c\u0430\u0441\u043e\u043a: \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 4-\u0431\u0438\u0442\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e 8-\u0431\u0438\u0442\u043d\u044b\u0445, \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043c\u0430\u0441\u043a\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0434\u043e 16 \u0431\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 <code>movemask<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043d\u0443\u0436\u043d\u044b\u043c \u0431\u0438\u0442\u0430\u043c \u0441 \u0448\u0430\u0433\u043e\u043c \u0432 4 \u0447\u0435\u0440\u0435\u0437 <code>pdep<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u043b\u044f <code>pdep<\/code> \u043d\u0435 \u0442\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443, \u0430 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 \u044d\u0442\u043e 64-\u0431\u0438\u0442\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438\u0437 BMI2, SIMD-\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<\/p>\n<p><a href=\"https:\/\/github.com\/Malkovsky\/pixie\/blob\/afe4b2ed4fc452a575acb8965bd21482d00d4fc1\/include\/pixie\/bits.h#L771\" rel=\"noopener noreferrer nofollow\">pixie\/bits.h<\/a><\/p>\n<p>\u041f\u043e\u043b\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e \u043e\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/opncd.ai\/share\/UdTGAEAW\" rel=\"noopener noreferrer nofollow\">https:\/\/opncd.ai\/share\/UdTGAEAW<\/a><\/p>\n<p>(\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441; \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043c\u043e\u0433\u0443 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c md.)<\/p>\n<h3>\u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>\u0412\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/summary>\n<div class=\"spoiler__content\">\n<p><code>X<\/code> \u2013 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 excess, \u0432\u0441\u0435 \u0437\u0430\u043c\u0435\u0440\u044b \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043b\u0438\u043d\u044b 512.<\/p>\n<pre><code>----------------------------------------------------Benchmark                CPU     Cycles      Instr----------------------------------------------------Baseline\/X:-64         317 ns   1.36953k   7.18206kBaseline\/X:-8          400 ns   1.74562k   7.20476kBaseline\/X:0           449 ns   1.93589k   7.21562kBaseline\/X:8           397 ns   1.73994k   7.20387kBaseline\/X:64          317 ns   1.37449k   7.18206kLUTOffset\/X:-64       11.2 ns    48.5127    169.882LUTOffset\/X:-8        18.4 ns    81.4704    250.885LUTOffset\/X:0         18.8 ns      81.94    250.927LUTOffset\/X:8         18.6 ns    81.7102    250.853LUTOffset\/X:64        10.7 ns    46.7245    166.554LUTTransform\/X:-64    16.2 ns    70.4105    260.969LUTTransform\/X:-8     27.5 ns     119.56    409.788LUTTransform\/X:0      26.9 ns   118.3430    409.865LUTTransform\/X:8      27.3 ns   119.1410    409.730LUTTransform\/X:64     15.8 ns    68.7241    254.855LUTOffset512\/X:-64    12.7 ns    54.7855    184.717LUTOffset512\/X:-8     18.8 ns    81.4390    228.987LUTOffset512\/X:0      18.4 ns    79.5516    228.987LUTOffset512\/X:8      17.7 ns    78.0454    228.973LUTOffset512\/X:64     12.6 ns    54.9331    182.469Expand16\/X:-64        51.2 ns   221.2250    823.130Expand16\/X:-8         84.8 ns   366.6420   1.37054kExpand16\/X:0          84.9 ns   366.7350   1.37077kExpand16\/X:8          85.7 ns   368.6010   1.37031kExpand16\/X:64         49.7 ns   219.0660    795.162Expand8\/X:-64         18.7 ns    80.4250    327.100Expand8\/X:-8          49.1 ns   213.1080    732.712Expand8\/X:0           47.6 ns   205.9740    740.490Expand8\/X:8           47.3 ns   205.6490    733.577Expand8\/X:64          18.1 ns    78.4455    326.288Expand8_512\/X:-64     22.5 ns    98.3215    255.677Expand8_512\/X:-8      37.1 ns   161.9560    336.860Expand8_512\/X:0       36.7 ns   160.9130    336.951Expand8_512\/X:8       36.8 ns   161.6340    336.823Expand8_512\/X:64      22.1 ns    96.5108    253.321<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<p><code>LUTOffset<\/code> \u2013 \u044d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435; baseline \u2013 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u2013 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 20 \u0440\u0430\u0437. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 <code>pdep<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 20% \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0442\u043e \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<h3>\u041d\u043e\u0432\u044b\u0439 \u043b\u0438 \u043f\u043e\u0434\u0445\u043e\u0434?<\/h3>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u043a\u0430\u043a \u0431\u043e\u0434\u0440\u043e AI \u0435\u0433\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b, \u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0436\u0435 \u0433\u0434\u0435-\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0438 \u043f\u0440\u0438\u0448\u0451\u043b \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0430\u043c:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u044e\u043a\u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0438 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f (4-\u0431\u0438\u0442\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0445 \u0441\u0443\u043c\u043c, \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0441 <code>pdep<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u0418\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0430 \u0432 \u0435\u0434\u0438\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u2013 \u043d\u043e\u0432\u0430\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043c\u043e\u044f \u0440\u043e\u043b\u044c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0432\u0435\u043b\u0430\u0441\u044c \u043a \u043f\u0440\u043e\u043c\u043f\u0442\u0443: \u201c\u041f\u043e\u0434\u0443\u043c\u0430\u0439, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043d\u0430\u0434 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0434\u043b\u044f excess \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 4-\u0431\u0438\u0442\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u201d.<\/p>\n<h3>\u0427\u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 AI<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d <code>kilocode<\/code>; \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0433\u043e CLI-\u0432\u0435\u0440\u0441\u0438\u044f \u2013 \u044d\u0442\u043e <code>OpenCode<\/code> \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u0414\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 C+\u00b1\u043a\u043e\u0434\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043d\u0430\u0432\u044b\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u044e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 workflow, \u0441\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 Google Benchmark \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0412\u0441\u0451, \u0447\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0440\u0435\u043d\u043e, \u2013 \u044d\u0442\u043e \u0434\u043e\u043c\u044b\u0441\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 Google Test \u0434\u043b\u044f \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438: \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u043d\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u0432\u043b\u0438\u044f\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<\/p>\n<p><a href=\"https:\/\/github.com\/Malkovsky\/pixie\/tree\/main\/.kilo\/skills\" rel=\"noopener noreferrer nofollow\">pixie\/.kilo\/skills<\/a><\/p>\n<p>\u041f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0437 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0432\u0438\u0436\u0443 \u0441\u0435\u0439\u0447\u0430\u0441, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b AI \u043f\u043e\u043c\u043e\u0433\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 C++, \u043d\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u044d\u0442\u0438\u043c \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u0442\u044c: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c, \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d AddressSanitizer, AI \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0448\u0435\u0442, \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u043e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u0441\u0430\u043c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 ASan-\u0441\u0431\u043e\u0440\u043a\u0443, \u0435\u0441\u043b\u0438 \u044f\u0432\u043d\u043e \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c. AI \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u043e\u0439; \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u0435\u0440\u0438\u0442\u0435, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0442 \u044d\u0442\u043e \u0432\u0438\u0434\u0435\u043e \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e <a href=\"https:\/\/www.youtube.com\/watch?v=DwhAucfHJjs\" rel=\"noopener noreferrer nofollow\">CppCon<\/a>, \u043d\u043e \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<h3>P. S.<\/h3>\n<p>\u0424\u0438\u043b\u044c\u043c \u201c\u042f, \u0420\u043e\u0431\u043e\u0442\u201d, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043c\u0435\u043c \u043f\u0440\u043e \u201c\u0410 \u0442\u044b \u043c\u043e\u0436\u0435\u0448\u044c?\u201d \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043e\u043f\u0435\u0440\u0435\u0434\u0438\u043b \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f (\u043a\u0430\u043a \u0438 \u0435\u0433\u043e \u0438\u0441\u0442\u043e\u043a\u0438), \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 2035 \u0433\u043e\u0434\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u0430\u043a\u0438\u043c \u0443\u0436 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c. \u0412\u043e\u0442 \u0432\u0430\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0446\u0438\u0442\u0430\u0442\u0430 \u043e\u0442\u0442\u0443\u0434\u0430: \u201c\u0414\u0430, \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u0432\u0430\u0448 \u043e\u0442\u0435\u0446 \u043b\u0438\u0448\u0438\u043b\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0437-\u0437\u0430 \u0440\u043e\u0431\u043e\u0442\u043e\u0432. \u041c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435 \u043b\u0438\u0448\u0438\u043b\u0438\u0441\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439?\u201d<\/p>\n<hr\/>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u043b\u044e\u0441, \u0430\u0432\u0442\u043e\u0440\u0443 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0446\u0435\u043d\u044f\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u0430\u0441 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043c\u043e\u0439 \u043a\u0430\u043d\u0430\u043b <a href=\"https:\/\/t.me\/a_zachem_eto_nuzhno\" rel=\"noopener noreferrer nofollow\">\u0410 \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e?<\/a> \u0433\u0434\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u0432 \u0431\u0438\u0433\u0442\u0435\u0445\u0438.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u044f \u0437\u0430\u0432\u0435\u043b \u0441\u0430\u0439\u0442, \u0433\u0434\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, \u0441\u0430\u043c\u0430 \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c\/\u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0430\u0445<\/p>\n<p><a href=\"https:\/\/malkovsky.github.io\/personal-site\/ru\/blog\/posts\/2026-05-17_ai_inventing_cpp_algorithm\/\" rel=\"noopener noreferrer nofollow\">GLM-5.1 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043d\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/a><\/p>\n<p><a href=\"https:\/\/malkovsky.github.io\/personal-site\/en\/blog\/posts\/2026-05-17_ai_inventing_cpp_algorithm\/\" rel=\"noopener noreferrer nofollow\">GLM-5.1 Invented a New Algorithm for Me<\/a><\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1036118\/\">https:\/\/habr.com\/ru\/articles\/1036118\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0440\u0443\u0437\u044c\u044f, \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d \u0432\u043e\u0441\u043f\u0435\u0432\u0430\u043d\u0438\u0435\u043c AI, \u0447\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u044e\u0434\u0435\u0439 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432) \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 C\/C++. \u042f \u043d\u0435 AI-\u043f\u0440\u043e\u043f\u043e\u0432\u0435\u0434\u043d\u0438\u043a \u2013 \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0438 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f AI-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b AI (\u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435, opencode + GLM-5.1) \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447, \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e, \u0438 \u043e\u043d \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e. \u042d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0440\u044b\u0432\u043d\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0430\u0437\u0431\u043e\u0433\u0430\u0442\u0435\u044e, \u043d\u043e \u043e\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439: \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u043d\u043e\u0432\u044b\u0439. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443:\u041a\u0430\u043a \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u201c\u0434\u0430\u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u043d\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u043c\u0438\u043d\u0443\u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0439 \u0440\u0430\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443\u201d\u0427\u0442\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b AI \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438\u0427\u0442\u043e \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b AI \u043f\u0438\u0441\u0430\u043b \u0447\u0442\u043e-\u0442\u043e \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0435 \u043d\u0430 C++\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 RMQ\/LCA.\u041f\u0440\u0435\u0430\u043c\u0431\u0443\u043b\u0430\u041d\u0430\u0447\u043d\u0443 \u0441 \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438: \u043f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c , \u0433\u0434\u0435  \u2013 -\u0439 \u0431\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c excess \u043a\u0430\u043a :\u0422.\u0435.  \u2013 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u043c\u0438\u043d\u0443\u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0439 \u0432 \u043f\u0435\u0440\u0432\u044b\u0445  \u0431\u0438\u0442\u0430\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 . \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430: \u0434\u0430\u043d\u043e , \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0438\u0435 , \u0447\u0442\u043e . \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2013 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0430\u0440\u043d\u0443\u044e \u0441\u043a\u043e\u0431\u043a\u0443 \u0438\u043b\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0443\u044e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u043f\u0430\u0440\u0443 \u0441\u043a\u043e\u0431\u043e\u043a. \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e? \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c \u0447\u0435\u0440\u0435\u0437 \u0441\u043a\u043e\u0431\u043e\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041d\u0435 \u0445\u043e\u0447\u0443 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438; \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 BP-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f: \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0445\u043e\u0434 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0441\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0438\u0436\u0435, \u043f\u0438\u0448\u0435\u043c 1, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c\u0441\u044f \u2013 0.\u041a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0430\u0440\u0430 \u0441\u043a\u043e\u0431\u043e\u043a, \u0430 \u0432\u0441\u0451 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0434\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u043e\u0431\u043e\u043a \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u043a\u043e\u0431\u043a\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0435\u0451 \u043f\u0430\u0440\u043d\u0443\u044e. \u0412 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435: \u0434\u0430\u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 , \u043f\u043e\u0437\u0438\u0446\u0438\u044f  \u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 . \u041d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435  \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e . \u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u2013 range min-max tree, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c:\u041e\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0437\u0430 \u0414\u043b\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u0430\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u0430 \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.\u0412\u043e\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.Baseline\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u043c\u043d\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 range min-max tree.Sdsl-Lite\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438  \u0438\u0437 8 \u0431\u0438\u0442 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f  \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u043a\u0430 . \u0414\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438  \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u043c \u0435\u0451 \u043d\u0430 \u0431\u043b\u043e\u043a\u0438 \u043f\u043e 8 \u0431\u0438\u0442, \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434 \u043f\u043e \u0431\u043b\u043e\u043a\u0430\u043c, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c . \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e excess \u0432\u0441\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043b\u0435\u0433\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a 2*popcount(B)-8.\u0427\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b GLM-5.1\u0412 SIMD \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e pshufb, \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u044d\u0442\u043e\u043c. \u041d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 pshufb \u043d\u0443\u0436\u043d\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430 16; GLM-5.1 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:\u0414\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \u0438\u0437  \u0431\u0438\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c excess \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 4 \u043f\u043e\u0437\u0438\u0446\u0438\u0439; \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0438\u0437 \u043d\u0438\u0445 \u2013 excess \u0432\u0441\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430.\u041f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b excess \u043d\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0432\u0441\u0435\u0445 4-\u0431\u0438\u0442\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e 4-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430 i \u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f 0, 1, 2, 3 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0440\u0430\u0432\u043d\u043e \u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 target-E[4i].\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u043e\u0434\u043d\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043c\u0430\u0441\u043a\u0443.\u041f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u2013 \u044d\u0442\u043e 4 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 128, 256 \u0438\u043b\u0438 512 \u0431\u0438\u0442.\u0422\u0430\u0431\u043b\u0438\u0446\u044b excess \u0434\u043b\u044f AVX-2\/\/ LUT for total excess change across a 4-bit nibblestatic inline const __m256i excess_lut_delta = _mm256_setr_epi8(    -4, -2, -2,  0, \/\/ 0000, 0001, 0010, 0011    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011     0,  2,  2,  4, \/\/ 1000, 1001, 1010, 1011    -4, -2, -2,  0, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)     0,  2,  2,  4  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));static inline const __m256i excess_lut_pos0 = _mm256_setr_epi8(    -1,  1, -1,  1, \/\/ 0000, 0001, 0010, 0011    -1,  1, -1,  1, \/\/ 0100, 0101, 0110, 0111    -1,  1, -1,  1, \/\/ 1000, 1001, 1010, 1011    -1,  1, -1,  1, \/\/ 1100, 1101, 1110, 1111    -1,  1, -1,  1, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1, -1,  1, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1, -1,  1, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1, -1,  1  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));static inline const __m256i excess_lut_pos1 = _mm256_setr_epi8(    -2,  0,  0,  2, \/\/ 0000, 0001, 0010, 0011    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011    -2,  0,  0,  2, \/\/ 1100, 1101, 1110, 1111    -2,  0,  0,  2, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -2,  0,  0,  2  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));static inline const __m256i excess_lut_pos2 = _mm256_setr_epi8(    -3, -1, -1,  1, \/\/ 0000, 0001, 0010, 0011    -1,  1,  1,  3, \/\/ 0100, 0101, 0110, 0111    -3, -1, -1,  1, \/\/ 1000, 1001, 1010, 1011    -1,  1,  1,  3, \/\/ 1100, 1101, 1110, 1111    -3, -1, -1,  1, \/\/ 0000, 0001, 0010, 0011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1,  1,  3, \/\/ 0100, 0101, 0110, 0111 (\u043f\u043e\u0432\u0442\u043e\u0440)    -3, -1, -1,  1, \/\/ 1000, 1001, 1010, 1011 (\u043f\u043e\u0432\u0442\u043e\u0440)    -1,  1,  1,  3  \/\/ 1100, 1101, 1110, 1111 (\u043f\u043e\u0432\u0442\u043e\u0440));\u041f\u0440\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0445 \u0441\u0443\u043c\u043c \u2013 \u044d\u0442\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u043e\u043c:\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0438\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f 0-based \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f: \u043c\u0430\u0441\u0441\u0438\u0432 B \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 n, \u0430 E \u2013 \u0434\u043b\u0438\u043d\u0443 n + 1.E[0] = 0;for (size_t i = 1; i &lt;= n; ++i) {  E[i] = E[i &#8212; 1] + B[i &#8212; 1];}\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0438 \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442  \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0414\u043b\u044f SIMD-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c:std::copy(B.begin(), B.end(), std::next(E.begin(), 1));E[0] = 0;for (size_t offset = 1; offset &lt; n; offset *= 2) {  for (size_t i = n; i &gt;= offset; &#8212;i) {    E[i] += E[i &#8212; offset];  }}\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0446\u0438\u043a\u043b \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c, \u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0446\u0438\u043a\u043b \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e  \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u0412\u043e\u0442 \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b \u043f\u043e \u0431\u0430\u0439\u0442\u0430\u043c:ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 1));ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 2));ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 4));ps = _mm256_add_epi8(ps, _mm256_slli_si256(ps, 8));\u0423\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u0438\u043d\u043e\u0439 64\/128 \u0431\u0438\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 128\/256 \u0431\u0438\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e; \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 512-\u0431\u0438\u0442\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b, \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u044f \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e 128 \u0431\u0438\u0442.\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u2013 \u0434\u0435\u043b\u043e \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. GLM-5.1 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0443\u044e, \u043d\u043e \u0441\u043b\u0435\u0433\u043a\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0443\u044e \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e cmpeq-&gt;movemask-&gt;pdep; \u043d\u0438\u0436\u0435 \u2013 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 workflow \u043e\u0442 AI:word \u2500\u2500\u25ba nibble extraction \u2500\u2500\u25ba nibbles[0..15]                                    \u2502              \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510              \u25bc                     \u25bc                     \u25bc     vpshufb(delta)          vpshufb(pos_j)         vpshufb(delta)         deltas                   rel_j                  rel_3              \u2502                     \u2502                     \u2502              \u25bc                     \u2502                     \u2502     prefix sum (4 steps)           \u2502                     \u2502              \u2502                     \u2502                     \u2502              \u25bc                     \u2502                     \u2502     shift left 1 byte              \u2502                     \u2502     \u2192 excl (exclusive psum)        \u2502                     \u2502              \u2502                     \u2502                     \u2502              \u25bc                     \u2502                     \u2502     base = excl &#8212; target_local     \u2502                     \u2502              \u2502                     \u2502                     \u2502              \u25bc                     \u25bc                     \u25bc     base + rel_j \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba cmpeq(0) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba movemask \u2192 bits_j                                                           \u2502              \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524              \u25bc                  \u25bc                  \u25bc      \u25bc           pdep(0x1\u2026)       pdep(0x2\u2026)       pdep(0x4\u2026)  pdep(0x8\u2026)              \u2502                   \u2502                \u2502      \u2502              \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 OR \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518      \u2502                                  \u2502                       \u2502                                  \u25bc                       \u2502                              out[w] \u25c4\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0446\u0435\u043b\u043e\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0432\u0441\u0435\u0445 \u0441\u0442\u0430\u0434\u0438\u044f\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0438 \u0441\u0436\u0430\u0442\u0438\u0435\u043c \u0447\u0438\u0441\u0435\u043b\/\u043c\u0430\u0441\u043e\u043a: \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 4-\u0431\u0438\u0442\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e 8-\u0431\u0438\u0442\u043d\u044b\u0445, \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043c\u0430\u0441\u043a\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0434\u043e 16 \u0431\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 movemask, \u0430 \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043d\u0443\u0436\u043d\u044b\u043c \u0431\u0438\u0442\u0430\u043c \u0441 \u0448\u0430\u0433\u043e\u043c \u0432 4 \u0447\u0435\u0440\u0435\u0437 pdep. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u043b\u044f pdep \u043d\u0435 \u0442\u0430\u043a \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443, \u0430 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 \u044d\u0442\u043e 64-\u0431\u0438\u0442\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438\u0437 BMI2, SIMD-\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442.\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c:pixie\/bits.h\u041f\u043e\u043b\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e \u043e\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c: https:\/\/opncd.ai\/share\/UdTGAEAW(\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0430\u043c \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441; \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043c\u043e\u0433\u0443 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c md.)\u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438\u0412\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445X \u2013 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 excess, \u0432\u0441\u0435 \u0437\u0430\u043c\u0435\u0440\u044b \u043d\u0430 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u043b\u0438\u043d\u044b 512.&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-Benchmark                CPU     Cycles      Instr&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-Baseline\/X:-64         317 ns   1.36953k   7.18206kBaseline\/X:-8          400 ns   1.74562k   7.20476kBaseline\/X:0           449 ns   1.93589k   7.21562kBaseline\/X:8           397 ns   1.73994k   7.20387kBaseline\/X:64          317 ns   1.37449k   7.18206kLUTOffset\/X:-64       11.2 ns&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-480021","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480021"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480021\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}