leptris 1.9.417.0-aarch64-linux → 1.9.418.1-aarch64-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: 04c9ccea0b07bb0494046ce519be95ba181a8fd4486c3a9570f49eb2a4c1a0d0
4
- data.tar.gz: 6cb755a997496cbf4b0e727bd7e4594a21251d6f2be86196fea15fcbf9568f95
3
+ metadata.gz: 42f53f517ba11c68796e707ecc1a69eb479b2081dceccf0c39f11f83941cb47b
4
+ data.tar.gz: 005ce8c17de555369a656a958cd4a8a1b98e4d8bf8d6637241cccfff15828fcc
5
5
  SHA512:
6
- metadata.gz: b229e68e7ea6e1ebd871505d5a0b8569c97b05e6bdfd55292c767d9f5475e441aa17d76f52dd61da4f06c0912317355abc58097f02fbcc66a8144fa4bb4f036b
7
- data.tar.gz: 668c50ac13ef120d87043f438bea9ed0795c4e94738c20d6806ce3085c4d163f5af01d8f8dbc5c76ece1fd63ee0112094a0d331e0fe60fd6f8e4034753cbcb34
6
+ metadata.gz: d4658aaf2c3af8536a12223ed40c7d6cb6521082d33a3f96d23d85388d795ea344493db2df62ce7add0da920afa9e80369469694f016c24b8f35f97dbdc0a371
7
+ data.tar.gz: c0fa8db6ead9ce1a74b01ae0c783f245a4a7a867c5e0c6c232562066e4cf8151d5cb510c4e08ea795539d6a04f33cd4eb7fb7a72741160f3d497a67f5fbe43f8
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.417"
11
+ LIBLEPTRIS_VERSION = "1.9.418"
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
@@ -0,0 +1,35 @@
1
+ # 39 — Hot reads: C-defined parameterized readers, or the hydrated columnar walk
2
+
3
+ Status: QUEUED (leptris-ruby#622, ask 1)
4
+
5
+ Source: the moxml-on-leptris facade's structural-row losses, all at
6
+ the per-read/per-mint Ruby floor. Facade reads sit at ~331ns because
7
+ every read is an `UnboundMethod#bind_call` (one Ruby frame). The
8
+ proven budgets (TODO.perf/32, clean host): native `[]` 71ns, binding
9
+ memo seam ~160ns. The 2x-reads finish line needs the last Ruby frame
10
+ gone. Two acceptable shapes — the owner picks:
11
+
12
+ - **(a)** a binding-side C API that defines hot instance methods on
13
+ arbitrary receiver classes, operating on the receiver's TypedData
14
+ struct — the shape #204's closure sketched ("C-defined hot methods
15
+ parameterized by subclass"). moxml's Identity classes (subclass
16
+ NativeNode, klass-injected via `NativeNode.from`) get C
17
+ `[]`/`name`/`content`/`attribute` readers; the platform matrix
18
+ stays on the leptris dependency (moxml remains pure-Ruby).
19
+ - **(b)** extend `walk_columnar` (TODO.perf/32's face) to a
20
+ **hydrated** walk: the same single crossing returns, per row, the
21
+ flat attr packet + text content alongside names/handles/depths.
22
+ The consumer pipeline (walk + attribute + text reads) then pays
23
+ zero per-read calls — the reads ride the walk crossing.
24
+
25
+ Unlocks: walk+read (warm) 0.67x, walk+read (cold) 0.37x, children
26
+ recursion (cold) 0.46x of raw nokogiri.
27
+
28
+ ## Evidence
29
+
30
+ - lutaml/moxml scoreboard baseline (v0.5.166-era, clean host,
31
+ interleaved A/B per the published protocol).
32
+ - TODO.perf/32's clean-host floor table: `[]` 71ns native / 160ns
33
+ binding seam.
34
+ - leptris-ruby#527's verdict: the engine line is flat — the cold-row
35
+ cost is binding/facade, not an engine regression.
@@ -0,0 +1,10 @@
1
+ # 40 — NodeSet.from_result: klass-injected result materialization
2
+
3
+ Status: QUEUED (leptris-ruby#622, ask 2 — the #204 ask, refiled)
4
+
5
+ `xpath_result_rows_bulk` crosses once but still mints wrappers in a
6
+ Ruby loop (~1.4us/query ask from #204). Mint the result rows in C
7
+ with klass injection so consumers receive their wrapper classes
8
+ directly.
9
+
10
+ Unlocks: xpath `//field` (each) 0.59x of raw nokogiri.
@@ -0,0 +1,11 @@
1
+ # 41 — C set-attribute entry (the write floor)
2
+
3
+ Status: QUEUED (leptris-ruby#622, ask 3)
4
+
5
+ `set_binding_text` landed (adopted behind a face probe); attribute-set
6
+ has no C entry — post-build `set_attribute` pays the binding-layer
7
+ crossing per attribute. `add_element_full` (TODO.sota/04) covers
8
+ build-time attrs only.
9
+
10
+ Unlocks: mutation-heavy/builder lanes (the build add_element row is
11
+ at 0.975x and rides on this for the post-hoc shape).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.417.0"
4
+ VERSION = "1.9.418.1"
5
5
  end
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.417
4
+ - libleptris v1.9.418
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.418] - 2026-11-12
4
+ ## Fixed
5
+
6
+ - **entities: unknown named entities preserve their terminating semicolon**. decode_entity's lenient unknown-entity branch consumed the `;` while copying the name — `©` came back as `&copy` (one character short) on every consumer of the decode face: the attribute accessor's lazy expansion, text content, and the bindings' decode calls. The semicolon is part of the literal spelling; it is now emitted. Pins: unknown entities byte-exact in attributes and text; mixed known/unknown decode (`&` decodes; `©`/` ` stay literal — HTML-only, not XML-predefined).
7
+
8
+ - **attributes: the bulk attribute-pairs export serves decoded values**. `leptris_element_attribute_pairs`' values column read the RAW view while the per-attribute getter decoded — every listing face that routes through the bulk export (the bindings' `attribute_pairs` and the native packet/pairs faces the adapters use) showed literals where the accessor decoded (lutaml/moxml#540: the XSD unicode-block pattern cases flipped to failing between trains). The values column now routes through the per-attribute getter (same decode, cached into the attribute — repeat bulk reads skip the work). The raw views remain on `leptris_element_attributes_raw` (#635).
9
+
10
+ ## Tests
11
+
12
+ - New `test_entity_decode` battery: the unknown-entity byte-exactness contract, mixed known/unknown decode, and the bulk values column. Two pin drafts were discarded for wrong premises (attribute-name NUL behavior; `©`/` ` as XML-predefined — they are HTML-only).
13
+
3
14
  ## [1.9.417] - 2026-11-11
4
15
  ## Performance
5
16
 
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.417
6
+ VERSION 1.9.418
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -335,3 +335,73 @@ near-identical code (the cuts only ADD work-free fast paths) —
335
335
  a 4.8x swing on one leg. Single-run macos attr/text-13MB datapoints
336
336
  MUST NOT drive verdicts; the macos lane needs repeated-run medians
337
337
  before any row there is called a regression or a win.
338
+
339
+ ## Track D addendum 7 — the scanner arc OPENED (2026-11-11 evening)
340
+
341
+ Post-all-cuts text-shape samples (300k-element fixture, no-inline
342
+ build): direct_parse_internal's own body dominates the parse at
343
+ 34-73% across samples — the per-tag dispatch loop (open scan, close
344
+ scan+match, text-run dispatch, elem carve/zero) is THE remaining
345
+ arc, exactly as the ledger predicted. The region split needs
346
+ inFunction attribution: the sample tool cannot see inside one frame,
347
+ so the next session's opening move is the noinline region-wrap probe
348
+ (close-tag region first — biggest single suspect; needs the
349
+ goto/label surgery threaded through DParser).
350
+
351
+ INSTRUMENT LAWS learned tonight: (1) `git checkout main -- <file>`
352
+ on a worktree branch copies from the STALE LOCAL main — always
353
+ `git checkout HEAD --` or origin/<ref>; it silently reverted the
354
+ fast-out mid-profile and produced one void sample. (2) The Bash tool
355
+ shell layers make `$!`/pgrep -f unreliable for backgrounding a
356
+ sample target — pgrep -x with the binary name + the process printing
357
+ its own getpid() is the reliable pattern. (3) Sample files written
358
+ into the wt/ worktree dirs vanished between commands (sandbox
359
+ sweep class) — write samples into the main repo tree and extract in
360
+ the same command.
361
+
362
+ ALSO this session: the interleaved-lane default flip REJECTED
363
+ (1.72x slower on element-dense text; addendum 6), and the
364
+ no-attribute fast-out SHIPPED (PR #2009, ubuntu-x86 attr-13MB to
365
+ parity). Release trains v1.9.416 + v1.9.417 sealed, all registries.
366
+
367
+ ## Track D addendum 8 — the region split MEASURED (probe branch probe/close-region)
368
+
369
+ The close-tag region extracted NOINLINE (dp_close_tag_probe — the
370
+ instrument lives on probe/close-region, DO NOT MERGE) and sampled on
371
+ the post-fast-out text shape (~1250 in-frame samples):
372
+
373
+ - loop residual (open-tag scan + dispatch + elem carve/zero): 21%
374
+ - text-run family (scan_run_neon 17% + scalar wrapper 2.2% +
375
+ dp_text_create 8.5% + set_content 1.5%): ~29%
376
+ - wiring (dp_wire_child 9% + int32 encode 5.8% + edge_idx 0.7%): ~15%
377
+ - CLOSE-TAG REGION (probe 7.2% + pos_close_at 4.4%): 11.6%
378
+ - positions journal (pos_record 6.6% + the close_at share above): ~11%
379
+ - count3 pre-scan: 5.8%
380
+
381
+ Next-cut ranking by (size x boundedness):
382
+ 1. text_scan_run's NEON residual (17% in-kernel — the chunk loop +
383
+ flag handling; an AVX2 mirror also lands for x86).
384
+ 2. The loop residual's elem carve/zeroing (memset per 64-element
385
+ chunk vs explicit-init stores).
386
+ 3. The positions journal (12% combined; SKIP_SOURCE_POSITIONS
387
+ already opts out — the default-on cost is the conformance/positions
388
+ faces' price).
389
+ The close-tag region (11.6%) has no obvious algorithmic cut — memcmp
390
+ fast paths already cover it.
391
+
392
+ ## Track D addendum 8b — the scan-kernel analysis (2026-11-11, ranked cut #1 CLOSED as structural)
393
+
394
+ The text_scan_run NEON kernel read + analysis: the 17% in-kernel
395
+ share for the fixture-class run lengths (30-64B) is dominated by
396
+ PER-RUN FIXED COST — the call, the 3 needle vdup setups, the
397
+ accumulator zeroing, and one vmaxvq reduction per 16B chunk — not
398
+ per-byte throughput. The batched-reduction redesign (8 chunks
399
+ reduction-free, then chunk-rescan on hit) only wins runs >128B;
400
+ the bench-class runs break even or lose. The cut that actually
401
+ moves this block = merging the run scan INTO the caller's loop
402
+ (killing the per-run call+setup for short runs entirely), which is
403
+ the loop-body surgery slice — it inherits the region-wrap probe
404
+ (the text branch wraps the same way the close-tag region did).
405
+
406
+ RANKED CUT #1 therefore moves to the loop-surgery slice with the
407
+ scan-merge as its first step. Nothing ships from the kernel alone.
@@ -147,6 +147,11 @@ size_t decode_entity(const char* input, char* output, size_t outlen) {
147
147
  while (input[in_pos]) {
148
148
  char c = input[in_pos];
149
149
  if (c == ';') {
150
+ /* The ';' belongs to the literal entity —
151
+ * emit it or the preserved spelling loses
152
+ * its terminator (&copy; came back as
153
+ * &copy). */
154
+ if (out_pos < outlen - 1) output[out_pos++] = ';';
150
155
  in_pos++; /* Skip ';' */
151
156
  break;
152
157
  }
@@ -1526,7 +1526,15 @@ LEPTRIS_API size_t leptris_element_attribute_pairs(
1526
1526
  a; a = leptris_attr_next(a)) {
1527
1527
  if (written >= max_count) break;
1528
1528
  if (out_names) out_names[written] = attr_cname(a);
1529
- if (out_values) out_values[written] = attr_cvalue(a);
1529
+ /* The values column serves the SAME view the per-attribute
1530
+ * getter does — decoded (XML 1.0 §4.6: character references
1531
+ * decode in attribute values exactly as in content). The
1532
+ * raw views belong to leptris_element_attributes_raw
1533
+ * (#635). Decoding caches into the attribute (the entities
1534
+ * flag clears), so repeat bulk reads skip the work. The
1535
+ * element's pool carries the decoded copies. */
1536
+ if (out_values) out_values[written] =
1537
+ leptris_attribute_get_value(elem, (LeptrisAttribute)a);
1530
1538
  if (out_attrs) out_attrs[written] = (LeptrisAttribute)a;
1531
1539
  written++;
1532
1540
  }
@@ -119,6 +119,7 @@ leptris_add_test(test_parser parser/test_parser.cpp)
119
119
  leptris_add_test(test_large_docs parser/test_large_documents.cpp)
120
120
  leptris_add_test(test_encoding parser/test_encoding.cpp)
121
121
  leptris_add_test(test_utf8_simd parser/test_utf8_simd.cpp)
122
+ leptris_add_test(test_entity_decode parser/test_entity_decode.cpp)
122
123
  leptris_add_test(test_dom dom/test_dom.cpp)
123
124
  leptris_add_test(test_element_children dom/test_element_children.cpp)
124
125
  leptris_add_test(test_entity_refs dom/test_entity_refs.cpp)
@@ -0,0 +1,54 @@
1
+ // Entity decode: unknown named entities preserved byte-exact in
2
+ // lenient mode (libxml2/pugixml semantics). The decode_entity core
3
+ // consumed the terminating ';' without emitting it — unknown refs
4
+ // came back one character short (&copy 2026). Found via the
5
+ // lutaml/moxml#540 investigation (the binding faces route unknown
6
+ // entities through this same core).
7
+ #include <leptris.h>
8
+ #include <leptris/dom/document.h>
9
+ #include <gtest/gtest.h>
10
+ #include <cstring>
11
+
12
+ TEST(EntityDecode, UnknownNamedEntityPreservesSemicolon) {
13
+ const char* xml = "<r a=\"&copy; 2026\">x &copy; y</r>";
14
+ LeptrisStatus st = LEPTRIS_OK;
15
+ LeptrisDocument doc =
16
+ leptris_parse_string(xml, std::strlen(xml), &st);
17
+ ASSERT_NE(doc, nullptr);
18
+ LeptrisElement root = leptris_document_root(doc);
19
+ EXPECT_STREQ(leptris_element_attribute(root, "a"), "&copy; 2026");
20
+ LeptrisNodeRef t =
21
+ leptris_node_first_child(leptris_element_as_node(root));
22
+ ASSERT_NE(t, nullptr);
23
+ EXPECT_STREQ(leptris_text_node_get_content(t), "x &copy; y");
24
+ leptris_document_free(doc);
25
+ }
26
+
27
+ TEST(EntityDecode, UnknownEntityMixedWithKnownDecodesBoth) {
28
+ /* &copy; and &nbsp; are HTML-only — in XML they are unknown
29
+ * entities and stay literal (byte-exact, semicolons included);
30
+ * only the five predefined entities decode. */
31
+ const char* xml =
32
+ "<r v=\"&amp; &copy; &nbsp; &lt;\">&amp;&lt;</r>";
33
+ LeptrisStatus st = LEPTRIS_OK;
34
+ LeptrisDocument doc =
35
+ leptris_parse_string(xml, std::strlen(xml), &st);
36
+ ASSERT_NE(doc, nullptr);
37
+ LeptrisElement root = leptris_document_root(doc);
38
+ EXPECT_STREQ(leptris_element_attribute(root, "v"),
39
+ "& &copy; &nbsp; <");
40
+ EXPECT_STREQ(
41
+ leptris_text_node_get_content(
42
+ leptris_node_first_child(leptris_element_as_node(root))),
43
+ "&<");
44
+
45
+ /* The bulk pairs export serves the decoded values column too —
46
+ * the binding's listing faces route through it (moxml#540). */
47
+ const char* names[4];
48
+ const char* values[4];
49
+ size_t n = leptris_element_attribute_pairs(
50
+ root, names, values, NULL, 4);
51
+ ASSERT_EQ(n, 1u);
52
+ EXPECT_STREQ(values[0], "& &copy; &nbsp; <");
53
+ leptris_document_free(doc);
54
+ }
@@ -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.417",
4
+ "version": "1.9.418",
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.417.0
4
+ version: 1.9.418.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-11 00:00:00.000000000 Z
11
+ date: 2026-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -108,6 +108,9 @@ files:
108
108
  - TODO.perf/36-raise-in-c-serializer-encoding.md
109
109
  - TODO.perf/37-document-lazy-pointer.md
110
110
  - TODO.perf/38-bulk-walk-and-bench-gate.md
111
+ - TODO.perf/39-hot-c-reads-or-hydrated-walk.md
112
+ - TODO.perf/40-nodeset-c-mint.md
113
+ - TODO.perf/41-c-set-attribute-entry.md
111
114
  - TODO.restructure/01-constraint-compliance-audit.md
112
115
  - TODO.restructure/02-deep-copy-seam.md
113
116
  - TODO.restructure/03-evaluation-context-seam.md
@@ -872,6 +875,7 @@ files:
872
875
  - vendor-src/libleptris/test/memory/test_pool.cpp
873
876
  - vendor-src/libleptris/test/memory/test_pool_arena.cpp
874
877
  - vendor-src/libleptris/test/parser/test_encoding.cpp
878
+ - vendor-src/libleptris/test/parser/test_entity_decode.cpp
875
879
  - vendor-src/libleptris/test/parser/test_interleaved.cpp
876
880
  - vendor-src/libleptris/test/parser/test_large_documents.cpp
877
881
  - vendor-src/libleptris/test/parser/test_parser.cpp