Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package simdutf for openSUSE:Factory checked in at 2026-12-04 15:23:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/simdutf (Old) and /work/SRC/openSUSE:Factory/.simdutf.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "simdutf" Fri Dec 4 15:23:56 2026 rev:14 rq:1402504 version:9.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/simdutf/simdutf.changes 2026-11-25 16:12:04.579127110 +0100 +++ /work/SRC/openSUSE:Factory/.simdutf.new.1340718/simdutf.changes 2026-12-04 15:24:31.088411996 +0100 @@ -1,0 +2,6 @@ +Tue Dec 1 08:46:08 UTC 2026 - Dominique Leuenberger <[email protected]> + +- Update to version 9.5.1: + * Base64: keep the fixed-line path off clean inputs (icelake, arm64) + +------------------------------------------------------------------- Old: ---- simdutf-9.5.0.tar.xz New: ---- simdutf-9.5.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ simdutf.spec ++++++ --- /var/tmp/diff_new_pack.neeFYX/_old 2026-12-04 15:24:32.972492157 +0100 +++ /var/tmp/diff_new_pack.neeFYX/_new 2026-12-04 15:24:32.973492200 +0100 @@ -19,7 +19,7 @@ %define lib_ver 39.0.0 %define so_ver 39 Name: simdutf -Version: 9.5.0 +Version: 9.5.1 Release: 0 Summary: Unicode validation and transcoding at billions of characters per second ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.neeFYX/_old 2026-12-04 15:24:33.001493391 +0100 +++ /var/tmp/diff_new_pack.neeFYX/_new 2026-12-04 15:24:33.004493519 +0100 @@ -1,7 +1,7 @@ -mtime: 1795505658 -commit: 269642f63ef6c69ed819ad49b889af68408b9bcf41338abea66a5389018c3bd6 +mtime: 1796114819 +commit: 6bb4d6e3cf437df9d8fa6f520917839c5ba824382ce1268aa3fe8be4b2d81c67 url: https://src.opensuse.org/GNOME/simdutf -revision: 269642f63ef6c69ed819ad49b889af68408b9bcf41338abea66a5389018c3bd6 +revision: 6bb4d6e3cf437df9d8fa6f520917839c5ba824382ce1268aa3fe8be4b2d81c67 trackingbranch: factory projectscmsync: https://src.opensuse.org/GNOME/_ObsPrj ++++++ _service ++++++ --- /var/tmp/diff_new_pack.neeFYX/_old 2026-12-04 15:24:33.022494285 +0100 +++ /var/tmp/diff_new_pack.neeFYX/_new 2026-12-04 15:24:33.025494412 +0100 @@ -3,7 +3,7 @@ <service name="obs_scm" mode="manual"> <param name="scm">git</param> <param name="url">https://github.com/simdutf/simdutf.git</param> - <param name="revision">v9.5.0</param> + <param name="revision">v9.5.1</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="versionrewrite-pattern">v?(.*)\+0</param> <param name="versionrewrite-replacement">\1</param> ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-12-01 09:46:59.000000000 +0100 @@ -0,0 +1,5 @@ +*.obscpio +*.osc +_build.* +.pbuild +osc-collab.* ++++++ simdutf-9.5.0.tar.xz -> simdutf-9.5.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/CMakeLists.txt new/simdutf-9.5.1/CMakeLists.txt --- old/simdutf-9.5.0/CMakeLists.txt 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/CMakeLists.txt 2026-11-30 14:03:27.000000000 +0100 @@ -3,7 +3,7 @@ project(simdutf DESCRIPTION "Fast Unicode validation, transcoding and processing" LANGUAGES C CXX - VERSION 9.5.0 + VERSION 9.5.1 ) include (TestBigEndian) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/Doxyfile new/simdutf-9.5.1/Doxyfile --- old/simdutf-9.5.0/Doxyfile 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/Doxyfile 2026-11-30 14:03:27.000000000 +0100 @@ -38,7 +38,7 @@ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "9.5.0" +PROJECT_NUMBER = "9.5.1" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/README.md new/simdutf-9.5.1/README.md --- old/simdutf-9.5.0/README.md 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/README.md 2026-11-30 14:03:27.000000000 +0100 @@ -175,7 +175,7 @@ 1. Pull the library in a directory ``` - wget https://github.com/simdutf/simdutf/releases/download/v9.5.0/singleheader.zip + wget https://github.com/simdutf/simdutf/releases/download/v9.5.1/singleheader.zip unzip singleheader.zip ``` You can replace `wget` by `curl -OL https://...` if you prefer. @@ -216,7 +216,7 @@ ## Single-header version -You can create a single-header version of the library where all of the code is put into two files (`simdutf.h` and `simdutf.cpp`). We publish a zip archive containing these files, e.g., see https://github.com/simdutf/simdutf/releases/download/v9.5.0/singleheader.zip +You can create a single-header version of the library where all of the code is put into two files (`simdutf.h` and `simdutf.cpp`). We publish a zip archive containing these files, e.g., see https://github.com/simdutf/simdutf/releases/download/v9.5.1/singleheader.zip You may generate it on your own using a Python script. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/include/simdutf/simdutf_version.h new/simdutf-9.5.1/include/simdutf/simdutf_version.h --- old/simdutf-9.5.0/include/simdutf/simdutf_version.h 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/include/simdutf/simdutf_version.h 2026-11-30 14:03:27.000000000 +0100 @@ -4,7 +4,7 @@ #define SIMDUTF_SIMDUTF_VERSION_H /** The version of simdutf being used (major.minor.revision) */ -#define SIMDUTF_VERSION "9.5.0" +#define SIMDUTF_VERSION "9.5.1" namespace simdutf { enum { @@ -19,7 +19,7 @@ /** * The revision (major.minor.REVISION) of simdutf being used. */ - SIMDUTF_VERSION_REVISION = 0 + SIMDUTF_VERSION_REVISION = 1 }; } // namespace simdutf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/src/arm64/arm_base64.cpp new/simdutf-9.5.1/src/arm64/arm_base64.cpp --- old/simdutf-9.5.0/src/arm64/arm_base64.cpp 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/src/arm64/arm_base64.cpp 2026-11-30 14:03:27.000000000 +0100 @@ -605,6 +605,25 @@ vst3q_u8((uint8_t *)out, outvec); } +// decode a block of 64 sextets, already in registers, and output 48 bytes +simdutf_really_inline void base64_decode_block(char *out, const block64 &b) { + // De-interleave as vld4q_u8 would: str.val[k] holds the bytes at 4i + k. + const uint8x16_t even0 = vuzp1q_u8(b.chunks[0], b.chunks[1]); + const uint8x16_t odd0 = vuzp2q_u8(b.chunks[0], b.chunks[1]); + const uint8x16_t even1 = vuzp1q_u8(b.chunks[2], b.chunks[3]); + const uint8x16_t odd1 = vuzp2q_u8(b.chunks[2], b.chunks[3]); + uint8x16x4_t str; + str.val[0] = vuzp1q_u8(even0, even1); + str.val[1] = vuzp1q_u8(odd0, odd1); + str.val[2] = vuzp2q_u8(even0, even1); + str.val[3] = vuzp2q_u8(odd0, odd1); + uint8x16x3_t outvec; + outvec.val[0] = vsliq_n_u8(vshrq_n_u8(str.val[1], 4), str.val[0], 2); + outvec.val[1] = vsliq_n_u8(vshrq_n_u8(str.val[2], 2), str.val[1], 4); + outvec.val[2] = vsliq_n_u8(str.val[3], str.val[2], 6); + vst3q_u8((uint8_t *)out, outvec); +} + static size_t compress_block_single(block64 *b, uint64_t mask, char *output) { const size_t pos64 = trailing_zeroes(mask); const int8_t pos = pos64 & 0xf; @@ -682,15 +701,17 @@ template <bool base64_url, bool default_or_url> simdutf_really_inline void decode_fixed_lines_impl(char *&dst, const char *&src, - const char *srcend) { + const char *srcend, + size_t consumed) { base64_lines::plan plan; - if (!base64_lines::make_plan(src, size_t(srcend - src), plan, 256)) { + // Lines up to 256 characters: with longer lines, line breaks are rare + // enough that the general decoder is faster on Apple M4. + if (!base64_lines::make_plan(src, size_t(srcend - src), plan, 256, consumed, + 256)) { return; } - constexpr size_t batch = 8; - char local[batch * 64]; - size_t n = 0; - size_t i = 0; + src += plan.skip; + size_t i = plan.start; while (base64_lines::has_room(src, srcend)) { const base64_lines::step &s = plan.steps[i]; block64 b; @@ -700,38 +721,50 @@ if (m != 0 || base64_lines::check_eol(src, s) != 0) { break; } - copy_block(&b, local + 64 * n); + // Decode in registers: staging the block in a stack buffer made the + // speed depend on the relative alignment of the input and the output. + base64_decode_block(dst, b); + dst += 48; src += s.advance; i = i + 1 == plan.cycle ? 0 : i + 1; - if (++n == batch) { - for (size_t k = 0; k < batch; k++) { - base64_decode_block(dst + 48 * k, local + 64 * k); - } - dst += 48 * batch; - n = 0; - } - } - for (size_t k = 0; k < n; k++) { - base64_decode_block(dst + 48 * k, local + 64 * k); } - dst += 48 * n; } +// consumed: characters before src, decoded as plain base64 (no line break). template <bool base64_url, bool default_or_url> static inline base64_lines::progress -decode_fixed_lines(char *dst, const char *src, const char *srcend) { +decode_fixed_lines(char *dst, const char *src, const char *srcend, + size_t consumed) { char *out = dst; const char *in = src; - decode_fixed_lines_impl<base64_url, default_or_url>(out, in, srcend); + decode_fixed_lines_impl<base64_url, default_or_url>(out, in, srcend, + consumed); return {size_t(in - src), size_t(out - dst)}; } template <bool base64_url, bool default_or_url> static inline base64_lines::progress -decode_fixed_lines(char *, const char16_t *, const char16_t *) { +decode_fixed_lines(char *, const char16_t *, const char16_t *, size_t) { return {0, 0}; } +// Whether the first line could be 64 to 127 characters long, as with PEM (64) +// and MIME (76): a line break among characters 64 to 127. Shorter lines do +// not take the fast path. The caller ensures 128 readable bytes. +static simdutf_really_inline bool early_line_break(const char *src) { + const uint8_t *in = reinterpret_cast<const uint8_t *>(src) + 64; + const uint8x16_t nl = vdupq_n_u8('\n'); + const uint8x16_t any = vorrq_u8( + vorrq_u8(vceqq_u8(vld1q_u8(in), nl), vceqq_u8(vld1q_u8(in + 16), nl)), + vorrq_u8(vceqq_u8(vld1q_u8(in + 32), nl), + vceqq_u8(vld1q_u8(in + 48), nl))); + return vmaxvq_u8(any) != 0; +} + +static simdutf_really_inline bool early_line_break(const char16_t *) { + return false; +} + template <bool base64_url, bool ignore_garbage, bool default_or_url, typename char_type> full_result @@ -763,9 +796,14 @@ constexpr size_t block_size = 10; simdutf_indeterminate char buffer[block_size * 64]; char *bufferptr = buffer; - { + // Fixed-length lines (see base64_lines.h): short lines are found here, + // longer ones when the first line break reaches the loop below. Clean + // inputs never search for a line break past their first 128 characters. + bool try_lines = size_t(srcend - src) >= 256; + if (try_lines && early_line_break(src)) { + try_lines = false; const base64_lines::progress p = - decode_fixed_lines<base64_url, default_or_url>(dst, src, srcend); + decode_fixed_lines<base64_url, default_or_url>(dst, src, srcend, 0); src += p.read; dst += p.written; } @@ -792,6 +830,26 @@ return {error_code::INVALID_BASE64_CHARACTER, size_t(src - srcinit), size_t(dst - dstinit)}; } + // With long fixed-length lines, this is the first line break. Every + // block before it was clean and is still whole in the buffer. + if (try_lines) { + try_lines = false; + for (const char *pending = buffer; pending < bufferptr; + pending += 64) { + base64_decode_block(dst, pending); + dst += 48; + } + bufferptr = buffer; + const char_type *block = src - 64; + const base64_lines::progress p = + decode_fixed_lines<base64_url, default_or_url>( + dst, block, srcend, size_t(block - srcinit)); + if (p.read != 0) { + src = block + p.read; + dst += p.written; + continue; + } + } } if (ignore_garbage && badcharmask != 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/src/generic/base64_lines.h new/simdutf-9.5.1/src/generic/base64_lines.h --- old/simdutf-9.5.0/src/generic/base64_lines.h 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/src/generic/base64_lines.h 2026-11-30 14:03:27.000000000 +0100 @@ -29,6 +29,8 @@ struct plan { size_t cycle; size_t eol; + size_t skip; // line-ending characters at src, before the first block + size_t start; // step of the first block step steps[max_cycle + max_group - 1]; }; @@ -43,19 +45,28 @@ return size_t(srcend - src) >= offset + 68; } +// Plans for lines of 64 to max_line characters (max_line <= 1022). +// +// The first line starts `consumed` characters before src. The caller has +// already decoded those characters as plain base64 blocks, so they hold no +// line break; consumed is a multiple of 64. The plan resumes at step +// consumed / 64 of the cycle, or, if the first line ends exactly at src, +// after its line ending (skip), at the start of the cycle. static inline bool make_plan(const char *src, size_t len, plan &p, - size_t min_len) { - if (len < min_len) { + size_t min_len, size_t consumed = 0, + size_t max_line = 1022) { + if (len < min_len || consumed > max_line) { return false; } - const void *newline = std::memchr(src, '\n', len < 1024 ? len : 1024); + const size_t limit = max_line + 2 - consumed; + const void *newline = std::memchr(src, '\n', len < limit ? len : limit); if (newline == nullptr) { return false; } - const size_t n = size_t(static_cast<const char *>(newline) - src); - const size_t eol = (n > 0 && src[n - 1] == '\r') ? 2 : 1; - const size_t line = n + 1 - eol; - if (line < 64) { + const size_t r = size_t(static_cast<const char *>(newline) - src); + const size_t eol = (r > 0 && src[r - 1] == '\r') ? 2 : 1; + const size_t line = consumed + r + 1 - eol; + if (line < 64 || line > max_line || line < consumed) { return false; } size_t g = line, h = 64; @@ -70,6 +81,10 @@ } p.cycle = cycle; p.eol = eol; + // When line == consumed, the first line ends at src: skip its line ending + // and start a new cycle (consumed / 64 == cycle). + p.skip = line == consumed ? eol : 0; + p.start = line == consumed ? 0 : consumed / 64; const uint8_t eol_bytes[2] = {uint8_t(eol == 2 ? '\r' : '\n'), uint8_t('\n')}; const uint8_t full_bytes[2] = {0xff, uint8_t(eol == 2 ? 0xff : 0)}; uint16_t expect; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/src/icelake/icelake_base64.inl.cpp new/simdutf-9.5.1/src/icelake/icelake_base64.inl.cpp --- old/simdutf-9.5.0/src/icelake/icelake_base64.inl.cpp 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/src/icelake/icelake_base64.inl.cpp 2026-11-30 14:03:27.000000000 +0100 @@ -428,13 +428,16 @@ simdutf_really_inline void decode_fixed_lines_impl(char *&dst, const char *&src, const char *srcend, const __m512i lookup0, - const __m512i lookup1) { + const __m512i lookup1, + size_t consumed) { base64_lines::plan plan; - if (!base64_lines::make_plan(src, size_t(srcend - src), plan, 2048)) { + if (!base64_lines::make_plan(src, size_t(srcend - src), plan, 2048, + consumed)) { return; } + src += plan.skip; const size_t cycle = plan.cycle; - size_t i = 0; + size_t i = plan.start; for (;;) { const base64_lines::step &s0 = plan.steps[i]; const base64_lines::step &s1 = plan.steps[i + 1]; @@ -480,21 +483,35 @@ } } +// consumed: characters before src, decoded as plain base64 (no line break). static inline base64_lines::progress decode_fixed_lines(char *dst, const char *src, const char *srcend, - const __m512i lookup0, const __m512i lookup1) { + const __m512i lookup0, const __m512i lookup1, + size_t consumed) { char *out = dst; const char *in = src; - decode_fixed_lines_impl(out, in, srcend, lookup0, lookup1); + decode_fixed_lines_impl(out, in, srcend, lookup0, lookup1, consumed); return {size_t(in - src), size_t(out - dst)}; } static inline base64_lines::progress decode_fixed_lines(char *, const char16_t *, const char16_t *, const __m512i, - const __m512i) { + const __m512i, size_t) { return {0, 0}; } +// Whether the first line could be 64 to 127 characters long, as with PEM (64) +// and MIME (76): a line break among characters 64 to 127. Shorter lines do +// not take the fast path. The caller ensures 128 readable bytes. +static simdutf_really_inline bool early_line_break(const char *src) { + return _mm512_cmpeq_epi8_mask(_mm512_loadu_si512(src + 64), + _mm512_set1_epi8('\n')) != 0; +} + +static simdutf_really_inline bool early_line_break(const char16_t *) { + return false; +} + template <bool base64_url, bool ignore_garbage, bool default_or_url, typename chartype> full_result @@ -538,9 +555,14 @@ constexpr size_t block_size = 6; simdutf_indeterminate char buffer[block_size * 64]; char *bufferptr = buffer; - { + // Fixed-length lines (see base64_lines.h): short lines are found here, + // longer ones when the first line break stops the clean loop below. Clean + // inputs never search for a line break past their first 128 characters. + bool try_lines = size_t(srcend - src) >= 2048; + if (try_lines && early_line_break(src)) { + try_lines = false; const base64_lines::progress p = - decode_fixed_lines(dst, src, srcend, lookup0, lookup1); + decode_fixed_lines(dst, src, srcend, lookup0, lookup1, 0); src += p.read; dst += p.written; } @@ -598,6 +620,13 @@ const __m512i p6 = base64_pack(t6); const __m512i p7 = base64_pack(t7); if (simdutf_unlikely(_mm512_movepi8_mask(any) != 0)) { + // With long fixed-length lines, the first line break stops this loop. + if (try_lines) { + const base64_lines::progress p = decode_fixed_lines( + dst, src, srcend, lookup0, lookup1, size_t(src - srcinit)); + src += p.read; + dst += p.written; + } break; } // Overlapping 64-byte stores for all but the last of the group: a later diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/simdutf-9.5.0/tests/base64_tests.cpp new/simdutf-9.5.1/tests/base64_tests.cpp --- old/simdutf-9.5.0/tests/base64_tests.cpp 2026-11-24 01:38:05.000000000 +0100 +++ new/simdutf-9.5.1/tests/base64_tests.cpp 2026-11-30 14:03:27.000000000 +0100 @@ -4470,9 +4470,15 @@ TEST(base64_decode_fixed_line_lengths) { std::mt19937 gen((std::mt19937::result_type)(seed)); std::uniform_int_distribution<int> byte_generator{0, 255}; - for (size_t line : {64, 65, 72, 76, 77, 100, 128, 200}) { + // Lines of 128 characters or more (512 on icelake) are found once the + // decoder has consumed whole blocks of the first line as plain base64; + // multiples of 64 end exactly at a block boundary. arm64 takes lines up to + // 256 characters, icelake up to 1022. + for (size_t line : + {64, 65, 72, 76, 77, 100, 127, 128, 192, 200, 256, + 257, 320, 511, 512, 513, 576, 600, 1000, 1022, 1023, 1024}) { for (const char *eol : {"\n", "\r\n"}) { - for (size_t len : {200, 1000, 3001}) { + for (size_t len : {200, 1000, 3001, 8000}) { std::vector<char> source(len); for (char &c : source) { c = char(byte_generator(gen)); ++++++ simdutf.obsinfo ++++++ --- /var/tmp/diff_new_pack.neeFYX/_old 2026-12-04 15:24:33.504514793 +0100 +++ /var/tmp/diff_new_pack.neeFYX/_new 2026-12-04 15:24:33.507514921 +0100 @@ -1,5 +1,5 @@ name: simdutf -version: 9.5.0 -mtime: 1795480685 -commit: 9064366fa571fac03bcd28db35af597e97fba842 +version: 9.5.1 +mtime: 1796043807 +commit: 9392cd2a86fbf5639facf778f0da6888b19cb90b
