leptris 1.9.410.0-ppc64le-linux → 1.9.412.0-ppc64le-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e9df634a005763f8f065eebabb700417b47ab6cd3a320619337fe97726b4dc8
4
- data.tar.gz: 7d279c4991b4c9de3a9df0c3ff4068eb3cee16dca5fcfde9d8d7411816aede99
3
+ metadata.gz: 361044e35813c1a1d507a69be2292750519255798db7a70390461ebe1c7533b3
4
+ data.tar.gz: d08f261f2ddd69c9a1541c7de393c77a479083c035d2a2ac60586c547497c97b
5
5
  SHA512:
6
- metadata.gz: 2ec9b74a2330a1ffc6b5c45c734b0b616c5c5e876182396d36469d879f5cd7e3a7179f1688da5dc9138f26d78785292f66c4c7e4345d4c179d50b3537467aef0
7
- data.tar.gz: 8789a7004c2d9ef1749c0336498b02ebd84dc88f67a75cb9219b6b416c68503212c5f512cf0ff7d98c1a68d4847da456cae6722cd3e0d5bdbff26b4120fd95ca
6
+ metadata.gz: b7289417c0ddaac9f882c034d71c0941913f79494f218c42ab07351ce1c7d1c6e653010de4c1147949fa395511fd64cc2304bbf77692a54fb0af90ade55d1da2
7
+ data.tar.gz: 7b70624e5218ad39a212cee4bf25669cdf385f86ee25e08e689e75ee072b8c02dead226cd91092872c155f36057772ae0364910f9ad904e056b3b450f84bf510
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  # Pin for `rake compile` and the platform-gem builds. Keep in lockstep
9
9
  # with .github/workflows/build.yml (which calls `rake compile`) and the
10
10
  # CHANGELOG when libleptris releases.
11
- LIBLEPTRIS_VERSION = "1.9.410"
11
+ LIBLEPTRIS_VERSION = "1.9.411"
12
12
  # Vendored alongside libleptris for fn:normalize-unicode (TODO
13
13
  # .restructure/20): built per platform with a RELOCATABLE @rpath
14
14
  # install name, loaded by ffi.rb before libleptris so the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.410.0"
4
+ VERSION = "1.9.412.0"
5
5
  end
@@ -119,6 +119,13 @@ module Leptris
119
119
  %w[libutf8proc.3.dylib libutf8proc.so.3 libutf8proc.so
120
120
  utf8proc.dll].map { |n| File.join(d, n) }
121
121
  },
122
+ # linux platform gems pack the vendored utf8proc flat in lib/
123
+ # (lib/libutf8proc.so.3) — the vendor-tree layout only exists on
124
+ # darwin; without the .so spellings the dlopen-first hack never
125
+ # loads it and libleptris.so dies on its DT_NEEDED
126
+ # (metanorma-docker alpine smoke, leptris 1.9.411.0)
127
+ File.expand_path("../../libutf8proc.so.3", __dir__),
128
+ File.expand_path("../../libutf8proc.so", __dir__),
122
129
  File.expand_path("../../libutf8proc.3.dylib", __dir__),
123
130
  File.expand_path("../../libutf8proc.so.3", __dir__),
124
131
  File.expand_path("../../libutf8proc.so", __dir__),
data/lib/libleptris.so CHANGED
Binary file
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.410
4
+ - libleptris v1.9.411
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.411] - 2026-11-06
4
+
5
+ ### Performance
6
+
7
+ - **parse**: the element-open name scan is FUSED with the hash split — `dp_scan_name_fused` produces the extent, the FNV-1a chain, and the last-colon offset in one 4-byte-unrolled walk instead of two passes over the name bytes (#1842 slice 3; line-level-profiled at ~7% of parse on the serialbench shape — attrs 473 / text-scan 405 / wire 219 / name-scan 130 / hash-split 82; ABBA x6 median 1.018x parse, all pairs positive). Hash semantics proven identical to `dp_split_hash_name` and `leptris_name_hash_compute` — parsed and mutated elements keep matching in the child-axis hash lookups.
8
+
9
+ ### Tests
10
+
11
+ - engine-level pins for the leptris-rs#47 faces (reG8 char-range + the Cyrillic `\p{IsCyrillic}` block escape — the sweep showed the regex corpus scoring identically on 1.9.406/407/410 with the engine leading libxml2 1400 vs 1390)
12
+ - the vendored W3C schG2 composition (compile_file + both compile_set unit orders + the roundtrip artifact) riding the #1976 no-ns resolution fix
13
+ - the bench harness gained `LEPTRIS_BENCH_ITERS` for sampling-window profiling
14
+
15
+
16
+
3
17
  ## [1.9.410] - 2026-11-05
4
18
 
5
19
  ### Fixed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.410
6
+ VERSION 1.9.411
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -138,7 +138,11 @@ void bench_children_iterator(void* ctx) {
138
138
  }
139
139
 
140
140
  int main(void) {
141
- const size_t ITERATIONS = 1000;
141
+ /* LEPTRIS_BENCH_ITERS: profiling hook — `sample` needs a
142
+ * multi-second window; the default 1000 finishes too fast. */
143
+ const char* iters_env = getenv("LEPTRIS_BENCH_ITERS");
144
+ const size_t ITERATIONS =
145
+ iters_env ? (size_t)strtoul(iters_env, NULL, 10) : 1000;
142
146
 
143
147
  printf("\n");
144
148
  printf("================================================================\n");
@@ -348,6 +348,69 @@ static LEPTRIS_ALWAYS_INLINE void dp_scan_name_p(char** pos) {
348
348
  *pos = s;
349
349
  }
350
350
 
351
+ /* Fused element-open name scan (#1842 slice 3): the extent walk
352
+ * doubles as dp_split_hash_name's FNV-1a hash + last-colon finder,
353
+ * so the name bytes are walked ONCE instead of twice (the profile's
354
+ * name-scan + hash-split cluster, ~7% of parse). Semantics match
355
+ * dp_split_hash_name exactly: h_since restarts at each colon (the
356
+ * split's hash chain), h_all never resets (the hash a colon-bearing
357
+ * name shorter than 3 bytes must keep — the guard would have skipped
358
+ * its colon test), and `colon` is the LAST colon's offset (-1 when
359
+ * none). Returns the scan end. */
360
+ static LEPTRIS_ALWAYS_INLINE char* dp_scan_name_fused(
361
+ char* s, uint16_t* hash_out, ptrdiff_t* colon_out, size_t* len_out) {
362
+ unsigned h_since = 0x811C;
363
+ unsigned h_all = 0x811C;
364
+ ptrdiff_t colon = -1;
365
+ size_t len = 0;
366
+ for (;;) {
367
+ char c = s[0];
368
+ if (DP_UNLIKELY(!IS_NAME_CHAR(c))) break;
369
+ c = s[1];
370
+ if (DP_UNLIKELY(!IS_NAME_CHAR(c))) {
371
+ h_since = ((h_since ^ (unsigned char)s[0]) * 0x0193) & 0xFFFF;
372
+ h_all = ((h_all ^ (unsigned char)s[0]) * 0x0193) & 0xFFFF;
373
+ if (s[0] == ':') { colon = len; h_since = 0x811C; }
374
+ len += 1;
375
+ s += 1;
376
+ break;
377
+ }
378
+ c = s[2];
379
+ if (DP_UNLIKELY(!IS_NAME_CHAR(c))) {
380
+ for (int i = 0; i < 2; i++) {
381
+ h_since = ((h_since ^ (unsigned char)s[i]) * 0x0193) & 0xFFFF;
382
+ h_all = ((h_all ^ (unsigned char)s[i]) * 0x0193) & 0xFFFF;
383
+ if (s[i] == ':') { colon = len; h_since = 0x811C; }
384
+ len += 1;
385
+ }
386
+ s += 2;
387
+ break;
388
+ }
389
+ c = s[3];
390
+ if (DP_UNLIKELY(!IS_NAME_CHAR(c))) {
391
+ for (int i = 0; i < 3; i++) {
392
+ h_since = ((h_since ^ (unsigned char)s[i]) * 0x0193) & 0xFFFF;
393
+ h_all = ((h_all ^ (unsigned char)s[i]) * 0x0193) & 0xFFFF;
394
+ if (s[i] == ':') { colon = len; h_since = 0x811C; }
395
+ len += 1;
396
+ }
397
+ s += 3;
398
+ break;
399
+ }
400
+ for (int i = 0; i < 4; i++) {
401
+ h_since = ((h_since ^ (unsigned char)s[i]) * 0x0193) & 0xFFFF;
402
+ h_all = ((h_all ^ (unsigned char)s[i]) * 0x0193) & 0xFFFF;
403
+ if (s[i] == ':') { colon = len; h_since = 0x811C; }
404
+ len += 1;
405
+ }
406
+ s += 4;
407
+ }
408
+ *hash_out = (uint16_t)((colon >= 0 && len < 3) ? h_all : h_since);
409
+ *colon_out = (colon >= 0 && len >= 3) ? colon : -1;
410
+ *len_out = len;
411
+ return s;
412
+ }
413
+
351
414
  static LEPTRIS_ALWAYS_INLINE void dp_scan_name(DParser* p) {
352
415
  dp_scan_name_p(&p->pos);
353
416
  }
@@ -1993,8 +2056,11 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
1993
2056
  * AFTER dp_parse_attrs returns. */
1994
2057
  p.pos++; /* skip '<' */
1995
2058
  char* name_start = p.pos;
1996
- dp_scan_name(&p);
1997
- size_t name_len = p.pos - name_start;
2059
+ uint16_t name_hash;
2060
+ ptrdiff_t name_colon;
2061
+ size_t name_len;
2062
+ p.pos = dp_scan_name_fused(p.pos, &name_hash, &name_colon,
2063
+ &name_len);
1998
2064
 
1999
2065
  /* Parse attributes (scans from the delimiter position). */
2000
2066
  int self_closing = dp_parse_attrs(&p, elem);
@@ -2010,8 +2076,23 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2010
2076
  * has finished scanning the open tag. */
2011
2077
  if (dp_nul(&p, name_start + name_len)) goto fail;
2012
2078
 
2013
- if (dp_split_hash_name(&p, elem, name_start, name_len))
2014
- goto fail;
2079
+ /* #1842 slice 3: the hash + colon split point came out
2080
+ * of the fused name scan — the second walk is gone. */
2081
+ elem->name_hash = name_hash;
2082
+ if (name_colon >= 0) {
2083
+ char* colon = name_start + name_colon;
2084
+ *colon = '\0';
2085
+ leptris_elem_set_prefix(elem, name_start, p.pool);
2086
+ elem_set_name(elem, colon + 1);
2087
+ size_t local_len =
2088
+ name_len - (size_t)(colon + 1 - name_start);
2089
+ elem->name_len =
2090
+ (local_len > 254) ? 0xFF : (uint8_t)local_len;
2091
+ } else {
2092
+ elem_set_name(elem, name_start);
2093
+ elem->name_len =
2094
+ (name_len > 254) ? 0xFF : (uint8_t)name_len;
2095
+ }
2015
2096
 
2016
2097
  /* Wire into parent. */
2017
2098
  if (p.depth > 0) {
@@ -0,0 +1 @@
1
+ <doc xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='Cyrillic.xsd' value='&#x0400;&#x0401;&#x0402;&#x0403;&#x0404;&#x0405;&#x0406;&#x0407;&#x0408;&#x0409;&#x040A;&#x040B;&#x040C;&#x040D;&#x040E;&#x040F;&#x0410;&#x0411;&#x0412;&#x0413;&#x0414;&#x0415;&#x0416;&#x0417;&#x0418;&#x0419;&#x041A;&#x041B;&#x041C;&#x041D;&#x041E;&#x041F;&#x0420;&#x0421;&#x0422;&#x0423;&#x0424;&#x0425;&#x0426;&#x0427;&#x0428;&#x0429;&#x042A;&#x042B;&#x042C;&#x042D;&#x042E;&#x042F;&#x0430;&#x0431;&#x0432;&#x0433;&#x0434;&#x0435;&#x0436;&#x0437;&#x0438;&#x0439;&#x043A;&#x043B;&#x043C;&#x043D;&#x043E;&#x043F;&#x0440;&#x0441;&#x0442;&#x0443;&#x0444;&#x0445;&#x0446;&#x0447;&#x0448;&#x0449;&#x044A;&#x044B;&#x044C;&#x044D;&#x044E;&#x044F;&#x0450;&#x0451;&#x0452;&#x0453;&#x0454;&#x0455;&#x0456;&#x0457;&#x0458;&#x0459;&#x045A;&#x045B;&#x045C;&#x045D;&#x045E;&#x045F;&#x0460;&#x0461;&#x0462;&#x0463;&#x0464;&#x0465;&#x0466;&#x0467;&#x0468;&#x0469;&#x046A;&#x046B;&#x046C;&#x046D;&#x046E;&#x046F;&#x0470;&#x0471;&#x0472;&#x0473;&#x0474;&#x0475;&#x0476;&#x0477;&#x0478;&#x0479;&#x047A;&#x047B;&#x047C;&#x047D;&#x047E;&#x047F;&#x0480;&#x0481;&#x0482;&#x0483;&#x0484;&#x0485;&#x0486;&#x0487;&#x0488;&#x0489;&#x048A;&#x048B;&#x048C;&#x048D;&#x048E;&#x048F;&#x0490;&#x0491;&#x0492;&#x0493;&#x0494;&#x0495;&#x0496;&#x0497;&#x0498;&#x0499;&#x049A;&#x049B;&#x049C;&#x049D;&#x049E;&#x049F;&#x04A0;&#x04A1;&#x04A2;&#x04A3;&#x04A4;&#x04A5;&#x04A6;&#x04A7;&#x04A8;&#x04A9;&#x04AA;&#x04AB;&#x04AC;&#x04AD;&#x04AE;&#x04AF;&#x04B0;&#x04B1;&#x04B2;&#x04B3;&#x04B4;&#x04B5;&#x04B6;&#x04B7;&#x04B8;&#x04B9;&#x04BA;&#x04BB;&#x04BC;&#x04BD;&#x04BE;&#x04BF;&#x04C0;&#x04C1;&#x04C2;&#x04C3;&#x04C4;&#x04C5;&#x04C6;&#x04C7;&#x04C8;&#x04C9;&#x04CA;&#x04CB;&#x04CC;&#x04CD;&#x04CE;&#x04CF;&#x04D0;&#x04D1;&#x04D2;&#x04D3;&#x04D4;&#x04D5;&#x04D6;&#x04D7;&#x04D8;&#x04D9;&#x04DA;&#x04DB;&#x04DC;&#x04DD;&#x04DE;&#x04DF;&#x04E0;&#x04E1;&#x04E2;&#x04E3;&#x04E4;&#x04E5;&#x04E6;&#x04E7;&#x04E8;&#x04E9;&#x04EA;&#x04EB;&#x04EC;&#x04ED;&#x04EE;&#x04EF;&#x04F0;&#x04F1;&#x04F2;&#x04F3;&#x04F4;&#x04F5;&#x04F6;&#x04F7;&#x04F8;&#x04F9;&#x04FA;&#x04FB;&#x04FC;&#x04FD;&#x04FE;&#x04FF;'/>
@@ -0,0 +1,8 @@
1
+ <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
2
+ <xs:element name='doc'><xs:complexType><xs:attribute name='value'>
3
+ <xs:simpleType>
4
+ <xs:restriction base='xs:string'>
5
+ <xs:pattern value='\p{IsCyrillic}+'/>
6
+ </xs:restriction>
7
+ </xs:simpleType>
8
+ </xs:attribute></xs:complexType></xs:element></xs:schema>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0"?>
2
+ <doc xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
3
+ xsi:noNamespaceSchemaLocation='reG8.xsd' >
4
+
5
+ <!--
6
+ base='string', pattern='[0-z]*', value='1234567890:;&lt;=>?@Azaz', type='valid', RULE='12,13,14,17'
7
+ -->
8
+
9
+ <elem att='1234567890:;&lt;=>?@Azaz'/>
10
+
11
+ </doc>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0"?>
2
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
+ >
4
+
5
+ <!--
6
+ base='string', pattern='[0-z]*', value='1234567890:;&lt;=>?@Azaz', type='valid', RULE='12,13,14,17'
7
+ -->
8
+
9
+ <xsd:element name="doc">
10
+ <xsd:complexType>
11
+ <xsd:choice>
12
+ <xsd:element name="elem" type="Regex" minOccurs="1" maxOccurs="unbounded"/>
13
+ </xsd:choice>
14
+ </xsd:complexType>
15
+ </xsd:element>
16
+
17
+ <xsd:complexType name="Regex">
18
+ <xsd:attribute name="att">
19
+ <xsd:simpleType>
20
+ <xsd:restriction base="xsd:string">
21
+ <xsd:pattern value="[0-z]*"/>
22
+ </xsd:restriction>
23
+ </xsd:simpleType>
24
+ </xsd:attribute>
25
+ </xsd:complexType>
26
+
27
+
28
+
29
+ </xsd:schema>
@@ -177,3 +177,19 @@ TEST(XsdSubstNs, NamespacedChildTypedByMemberNotUnqualifiedParticle) {
177
177
  leptris_document_free(d);
178
178
  leptris_xsd_free(s);
179
179
  }
180
+
181
+ // ---- leptris-rs#47: the 1.9.407 regex-wave regression claim -------
182
+ // reG8: char-range [0-z]* over ASCII punctuation; Cyrillic: the
183
+ // \p{IsCyrillic} block escape over block members. Both expected VALID.
184
+
185
+ TEST(XsdRegexRs47, ReG8CharRangeStaysValid) {
186
+ EXPECT_EQ(validate_case(cases_path("rs47-regex/reG8.xsd"),
187
+ cases_path("rs47-regex/reG8.xml")), 1);
188
+ }
189
+
190
+ TEST(XsdRegexRs47, CyrillicBlockEscapeStaysValid) {
191
+ EXPECT_EQ(validate_case(cases_path("rs47-regex/Cyrillic.xsd"),
192
+ cases_path("rs47-regex/Cyrillic.xml")), 1);
193
+ }
194
+
195
+
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3
3
  "name": "leptris",
4
- "version": "1.9.410",
4
+ "version": "1.9.411",
5
5
  "description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
6
6
  "homepage": "https://github.com/leptris/leptris",
7
7
  "license": "MIT",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.410.0
4
+ version: 1.9.412.0
5
5
  platform: ppc64le-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-05 00:00:00.000000000 Z
11
+ date: 2026-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -1541,6 +1541,10 @@ files:
1541
1541
  - vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/stZ072.xsd
1542
1542
  - vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/test95960_1.xml
1543
1543
  - vendor-src/libleptris/test/xsd/libxml2-cases/rs35_w3c/test95960_1.xsd
1544
+ - vendor-src/libleptris/test/xsd/libxml2-cases/rs47-regex/Cyrillic.xml
1545
+ - vendor-src/libleptris/test/xsd/libxml2-cases/rs47-regex/Cyrillic.xsd
1546
+ - vendor-src/libleptris/test/xsd/libxml2-cases/rs47-regex/reG8.xml
1547
+ - vendor-src/libleptris/test/xsd/libxml2-cases/rs47-regex/reG8.xsd
1544
1548
  - vendor-src/libleptris/test/xsd/libxml2-cases/scc-no-xmlns_0.xml
1545
1549
  - vendor-src/libleptris/test/xsd/libxml2-cases/scc-no-xmlns_0.xsd
1546
1550
  - vendor-src/libleptris/test/xsd/libxml2-cases/scc-no-xsi_0.xml