leptris 1.9.412.3 → 1.9.413.0

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: 23754da81606e76e6815c12c8b77546c0783c05bb603d5420124fc1a3bc0b2ac
4
- data.tar.gz: fd0891a2b1e2d9d50baee2d5502027824166b8aacba64ebbf68896bdef267edb
3
+ metadata.gz: 6987095d8cec83d46a8531f793ec4a9c4111c5a513465434ab728cbf66c63643
4
+ data.tar.gz: 32e33704fa73dbc13b09faf25227696d8f94a09e3b91acb68c41c5f8167a7bdc
5
5
  SHA512:
6
- metadata.gz: 1215b67e2ef2289b06899397cf59d1793597e7fe411d64a5b07f4a7bb4fb642b2114c8b3f51e614ad73958bf7778a3cd292892f35107be01bb12949a99c4d530
7
- data.tar.gz: 4e751fc8332cdfc223acd66d86904dd7b882aad66e51d2eafec4e9eb3526192552aa869c1188d13d7ec9a5d158eb0e1a91826ac0001ce613c5a53449ebd165ae
6
+ metadata.gz: 124754f08467ef8fec781e332edee292a02505d33cc7c4b1d179302cb1a337e349fa9f78737e8e3e11baae241e07d247a967de346c61a6ca90e99d00cb7ee0e4
7
+ data.tar.gz: 14790770579a2f413b97b80d3a134856ee6a591db6bf05dc1d2c9330ec34acb71a5331ba036f81e293aa42256c2cca091b1be3ff719e1a668fa381ce6f50c77a
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.412"
11
+ LIBLEPTRIS_VERSION = "1.9.413"
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
@@ -107,9 +107,21 @@ task :compile do
107
107
  u8_prefix = File.join(u8_dir, "prefix")
108
108
  rm_rf(u8_dir)
109
109
  mkdir_p(u8_dir)
110
- fetch_tarball.call(
111
- "https://github.com/JuliaStrings/utf8proc/releases/download/v#{UTF8PROC_VERSION}/utf8proc-#{UTF8PROC_VERSION}.tar.gz",
112
- u8_dir)
110
+ # The releases/download asset URL is a CDN edge path — a stale 504
111
+ # there poisons EVERY CI lane at once (2026-11-08: all 19 lanes died
112
+ # on it while the rest of GitHub stayed healthy). The codeload
113
+ # archive of the same tag serves identical bytes from a different
114
+ # path: try the asset first, fall back when it exhausts its retries.
115
+ begin
116
+ fetch_tarball.call(
117
+ "https://github.com/JuliaStrings/utf8proc/releases/download/v#{UTF8PROC_VERSION}/utf8proc-#{UTF8PROC_VERSION}.tar.gz",
118
+ u8_dir)
119
+ rescue StandardError
120
+ warn "releases/download URL failed — falling back to codeload"
121
+ fetch_tarball.call(
122
+ "https://codeload.github.com/JuliaStrings/utf8proc/tar.gz/refs/tags/v#{UTF8PROC_VERSION}",
123
+ u8_dir)
124
+ end
113
125
  sh "cmake -B #{u8_dir}/build -S #{u8_dir} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DUTF8PROC_ENABLE_TESTING=OFF"
114
126
  sh "cmake --build #{u8_dir}/build --config Release -j 4"
115
127
  sh "cmake --install #{u8_dir}/build --prefix #{u8_prefix}"
@@ -193,9 +205,15 @@ task :compile do
193
205
  # gate on it. The `\$` survives Rake's `sh` (a shell).
194
206
  # macOS keeps @rpath + the ffi pre-load (working, and $ORIGIN is not
195
207
  # the macOS spelling); Windows has no rpath at all.
208
+ # The whole -D value must be ONE shell word: cmake_base runs through
209
+ # Rake's `sh` (bash), and an unquoted space splits it — cmake then
210
+ # sees SHARED_LINKER_FLAGS="-Wl,-z,origin" (rpath lost as a stray
211
+ # positional; the 1.9.412.3 gems shipped without the $ORIGIN RUNPATH
212
+ # for exactly this reason). The embedded double quotes survive bash;
213
+ # the backslash keeps $ORIGIN literal through the same shell.
196
214
  origin_rpath =
197
215
  if RUBY_PLATFORM =~ /linux/
198
- "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,origin -Wl,-rpath,\\$ORIGIN"
216
+ '"-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,origin -Wl,-rpath,\\$ORIGIN"'
199
217
  else
200
218
  ""
201
219
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.412.3"
4
+ VERSION = "1.9.413.0"
5
5
  end
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.412
4
+ - libleptris v1.9.413
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,16 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.413] - 2026-11-08
4
+ ## Performance
5
+
6
+ - **parse: the loop-invariant parser fields hoisted to const locals** (#1842 A4 slice 1). The main parse loop read `line_offsets_ok` / `drop_ws_text` / `keep_entity_refs` / `recover` from the parser struct per node — all written once before the loop, but un-hoistable by the compiler across the parser-pointer-taking callees, so every node paid memory loads. ABBA x6 on the parse-only scoreboard shape: **+3.5% median parse, 9/9 pairs positive**. Suite 2250/2250.
7
+
8
+ ## Documentation
9
+
10
+ - A4 function-level inventory: the tokenizer's remaining arc precisely scoped (dispatch own body ~39%, text scan already 25% SIMD, wiring near-optimal) — the roadmap for the next parse slices.
11
+
12
+ ## [1.9.412] - 2026-11-07
13
+
3
14
  ## Changed
4
15
 
5
16
  - **XPath: `//a | //b` fuses to one doc-ordered pass** (#1842 Track C lever 2). The scoreboard's first XPath query shape (serialbench-c bench.c:104) compiled to two fused descendant walks plus the generic union operator — per-eval concatenation then an O(n log n) doc-order sort. Both bare plain-name descendant branches now compile to one `XPATH_BC_ABSOLUTE_UNION_NAMES` opcode: one combined pre-order walk when the element index is not yet built, an O(n+m) two-pointer merge over the parse-offset keys once it is, and a single bucket copy for same-name unions. Wildcards, prefixed names, predicates, and deep branches stay on the generic path. Measured (ABBA x6, fresh RelWithDebInfo+LTO builds, serialbench medium.xml): union-only shape +8.5%, full scoreboard row (parse + 3 canonical queries) **888 → 945 ops/s (+6.4%)**, all pairs positive. Seven new `XPathUnionFusion` pins, including the interleaved-layout document-order trap a branch-concatenation would get wrong.
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.412
6
+ VERSION 1.9.413
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -110,6 +110,18 @@ whole tree to assign ranks (#485 table).
110
110
  LTO behavior on gcc-win vs clang-mac?) and port whatever
111
111
  wins back to the other legs.
112
112
 
113
+ **A4 INVENTORY COMPLETE (2026-11-07, non-LTO function-level
114
+ profile, parse-only scoreboard shape)**: tokenizer own body
115
+ ~39% (the arc itself — char dispatch + element-open/close),
116
+ NEON text scan ~25% (already SIMD; residual = loop overhead
117
+ + scalar tails), dp_wire_child ~15% (branchless, memory-bound
118
+ — near-optimal), dp_text_create 6.3% (carved, lean), pos
119
+ journal 2.8%. Named sub-levers in the element-open region:
120
+ dp_parse_attrs call site (~1300), the source-position gate +
121
+ record (~600), the close-tag scan (dp_scan_name NOT fused —
122
+ a bounded fusion lever ~300). Evidence: #1842 comment
123
+ (function-level table).
124
+
113
125
  ## Laws
114
126
 
115
127
  - CI benchmark legs (quiet runners) gate every number; local A/B
@@ -1743,6 +1743,18 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
1743
1743
  p.pos += 3;
1744
1744
  }
1745
1745
 
1746
+ /* #1842 A4 slice: the loop-invariant DParser fields hoisted to
1747
+ * const locals — written once above, never inside the loop, but
1748
+ * every per-node read pays a memory load because the compiler
1749
+ * cannot prove the DParser*-taking callees (dp_parse_attrs and
1750
+ * friends) never store through p. The A4 parse profile's
1751
+ * dispatch stubs carry those loads. */
1752
+ const int ho_line_offsets_ok = p.line_offsets_ok;
1753
+ const int ho_drop_ws_text = p.drop_ws_text;
1754
+ const int ho_keep_entity_refs = p.keep_entity_refs;
1755
+ const int ho_recover = p.recover;
1756
+ #define P_LINE_OFFSETS_OK line_offsets_ok
1757
+ (void)ho_drop_ws_text; (void)ho_keep_entity_refs; (void)ho_recover;
1746
1758
  while (p.pos < p.end) {
1747
1759
  /* Top-level whitespace: a TEXT child of the document node —
1748
1760
  * chained like prolog comments/PIs so /node() counts it and
@@ -1776,7 +1788,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
1776
1788
  * dropped only when every byte up to the next markup
1777
1789
  * delimiter is whitespace; otherwise the text path sees
1778
1790
  * the leading whitespace untouched. */
1779
- if (p.drop_ws_text &&
1791
+ if (ho_drop_ws_text &&
1780
1792
  (*p.pos == ' ' || *p.pos == '\t' || *p.pos == '\n' ||
1781
1793
  *p.pos == '\r')) {
1782
1794
  char* q = p.pos + 1;
@@ -1798,7 +1810,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
1798
1810
  * [text_start, lt) only. */
1799
1811
  char* text_start = p.pos;
1800
1812
  uint32_t text_off =
1801
- p.line_offsets_ok
1813
+ ho_line_offsets_ok
1802
1814
  ? (uint32_t)(text_start - p.buf) + 1u : 0u;
1803
1815
  char* lt = NULL;
1804
1816
  int has_amp = 0;
@@ -1847,7 +1859,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
1847
1859
 
1848
1860
  if (tlen == 0) continue;
1849
1861
  /* (ws handling lives at the text-branch ENTRY — see the
1850
- * drop_ws_text fast path before text_start.) */
1862
+ * ho_drop_ws_text fast path before text_start.) */
1851
1863
  if (p.depth == 0) {
1852
1864
  /* Whitespace-only between root and PIs. */
1853
1865
  for (char* c = text_start; c < p.pos; c++) {
@@ -1866,7 +1878,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
1866
1878
  * character references still expand lazily on read);
1867
1879
  * named references become ENTITY_REF nodes. A '&' that
1868
1880
  * is not a well-formed reference stays literal text. */
1869
- if (p.keep_entity_refs && has_amp) {
1881
+ if (ho_keep_entity_refs && has_amp) {
1870
1882
  const char* seg = text_start;
1871
1883
  const char* tq = text_start;
1872
1884
  const char* t_end = text_start + tlen;
@@ -2011,7 +2023,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2011
2023
  if (IS_NAME_START(next)) {
2012
2024
  /* Element. Snapshot line BEFORE scanning the open tag so
2013
2025
  * the element reports the line where '<' appeared. */
2014
- uint32_t elem_off = p.line_offsets_ok
2026
+ uint32_t elem_off = ho_line_offsets_ok
2015
2027
  ? (uint32_t)(p.pos - p.buf) + 1u : 0u;
2016
2028
  LeptrisElement elem;
2017
2029
  if (elem_idx < est_elems) {
@@ -2065,7 +2077,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2065
2077
  /* Parse attributes (scans from the delimiter position). */
2066
2078
  int self_closing = dp_parse_attrs(&p, elem);
2067
2079
  if (self_closing < 0) goto fail;
2068
- if (p.line_offsets_ok &&
2080
+ if (ho_line_offsets_ok &&
2069
2081
  !(p.skip_flags & LEPTRIS_PARSE_SKIP_SOURCE_POSITIONS)) {
2070
2082
  uint32_t ste = (uint32_t)(p.pos - p.buf);
2071
2083
  p.pos_slot_stack[p.depth] = leptris_elem_pos_record(
@@ -2248,7 +2260,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2248
2260
  "Element %s closed implicitly by </%.*s>",
2249
2261
  elem_name(ce),
2250
2262
  (int)close_local_len, close_local);
2251
- if (p.line_offsets_ok) {
2263
+ if (ho_line_offsets_ok) {
2252
2264
  leptris_elem_pos_close_at(
2253
2265
  p.doc,
2254
2266
  p.pos_slot_stack[p.depth - 1],
@@ -2270,7 +2282,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2270
2282
  }
2271
2283
  }
2272
2284
  close_matched:
2273
- if (p.line_offsets_ok) {
2285
+ if (ho_line_offsets_ok) {
2274
2286
  /* Round 10: fill the open element's journal slot in
2275
2287
  * place — no hash probe, and the recorded start offset
2276
2288
  * survives verbatim. open_stack[p.depth-1] is `open`;
@@ -2288,7 +2300,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2288
2300
  }
2289
2301
  else if (next == '!') {
2290
2302
  /* Comment, CDATA, or DOCTYPE. */
2291
- uint32_t markup_off = p.line_offsets_ok
2303
+ uint32_t markup_off = ho_line_offsets_ok
2292
2304
  ? (uint32_t)(p.pos - p.buf) + 1u : 0u;
2293
2305
  if (p.end - p.pos >= 4 && p.pos[2] == '-' && p.pos[3] == '-') {
2294
2306
  /* Comment: <!-- ... --> */
@@ -2378,7 +2390,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2378
2390
  }
2379
2391
  else if (next == '?') {
2380
2392
  /* PI: <?target data?> or XML declaration. */
2381
- uint32_t pi_off = p.line_offsets_ok
2393
+ uint32_t pi_off = ho_line_offsets_ok
2382
2394
  ? (uint32_t)(p.pos - p.buf) + 1u : 0u;
2383
2395
  p.pos += 2;
2384
2396
  char* target_start = p.pos;
@@ -2493,7 +2505,7 @@ static struct leptris_document* direct_parse_internal(char* buf, size_t len,
2493
2505
  LEPTRIS_DIAG_UNCLOSED_ELEMENT, NULL,
2494
2506
  "Element %s still open at end of document",
2495
2507
  elem_name(ce));
2496
- if (p.line_offsets_ok) {
2508
+ if (ho_line_offsets_ok) {
2497
2509
  leptris_elem_pos_close_at(
2498
2510
  p.doc, p.pos_slot_stack[p.depth - 1],
2499
2511
  (uint32_t)(p.pos - p.buf));
@@ -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.412",
4
+ "version": "1.9.413",
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.412.3
4
+ version: 1.9.413.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-07 00:00:00.000000000 Z
11
+ date: 2026-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi