leptris 1.9.405.0-ppc64le-linux → 1.9.406.1-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 +4 -4
- data/Rakefile +1 -1
- data/ext/leptris/native/native.c +25 -0
- data/lib/leptris/version.rb +1 -1
- data/lib/leptris/xml/attr.rb +20 -5
- data/lib/leptris/xml/descriptor.rb +3 -0
- data/lib/leptris/xml/document.rb +3 -0
- data/lib/leptris/xml/element.rb +5 -3
- data/lib/leptris/xml/ffi.rb +2 -0
- data/lib/leptris/xml/native.so +0 -0
- data/lib/leptris/xml/native_3_3.so +0 -0
- data/lib/leptris/xml/native_layer.rb +11 -0
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +13 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/include/leptris/descriptor.h +9 -1
- data/vendor-src/libleptris/src/leptris/descriptor/plan.c +26 -0
- data/vendor-src/libleptris/test/abi/test_descriptor.cpp +39 -0
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46b29dea54ee68d6c509699d970ad377685c39aebb8ed59df4ecdd37b6e42942
|
|
4
|
+
data.tar.gz: ea69400fe5f0cbd7058ff455192670253dc8011f94f99810a019e538216ca54a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fe10864208dd6ee472c1817ea80cd5c77acbbca49be850220601e7f089a1b6a521a50672c06aaddecb7bca898afe55cc2cff2ea76fc91b0ceaf814a50d2259e
|
|
7
|
+
data.tar.gz: f8df0a1dfc047adfece8e2b04f38f855437cc7718f242b4e4ee1e54eb3f252f8af339746292328c556e31d2b35c74ca8693a49f1ee9fc96d547fb7b41e38318f
|
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.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.406"
|
|
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
|
data/ext/leptris/native/native.c
CHANGED
|
@@ -3255,6 +3255,29 @@ static VALUE nf_attribute_rows(VALUE self, VALUE document, VALUE addr)
|
|
|
3255
3255
|
return out;
|
|
3256
3256
|
}
|
|
3257
3257
|
|
|
3258
|
+
/* ruby#586 ask 1: the flat packet face — [name1, value1, ...] in one
|
|
3259
|
+
* crossing, with no per-attribute Attr/Pointer objects, no slice
|
|
3260
|
+
* arrays and no identity-cache writes. Names interned, values fresh.
|
|
3261
|
+
* Read-only consumers zip the flat array themselves. */
|
|
3262
|
+
static VALUE nf_attribute_packet(VALUE self, VALUE document, VALUE addr)
|
|
3263
|
+
{
|
|
3264
|
+
(void)self;
|
|
3265
|
+
(void)document;
|
|
3266
|
+
void *node = (void *)(uintptr_t)NUM2ULL(addr);
|
|
3267
|
+
VALUE out = rb_ary_new();
|
|
3268
|
+
if (f_node_type(node) != WS_NODE_ELEMENT) return out;
|
|
3269
|
+
|
|
3270
|
+
for (void *a = f_attr_first(node); a; a = f_attr_next(a)) {
|
|
3271
|
+
const char *an = f_attr_name(a);
|
|
3272
|
+
const char *av = f_attr_value(node, a);
|
|
3273
|
+
rb_ary_push(out, an ? rb_enc_interned_str(an, strlen(an),
|
|
3274
|
+
rb_utf8_encoding())
|
|
3275
|
+
: Qnil);
|
|
3276
|
+
rb_ary_push(out, av ? rb_utf8_str_new_cstr(av) : Qnil);
|
|
3277
|
+
}
|
|
3278
|
+
return out;
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3258
3281
|
static VALUE nf_plan_structs(VALUE self, VALUE document, VALUE addr,
|
|
3259
3282
|
VALUE spec)
|
|
3260
3283
|
{
|
|
@@ -4266,6 +4289,8 @@ static void leptris_native_setup(void)
|
|
|
4266
4289
|
nf_plan_structs, 3);
|
|
4267
4290
|
rb_define_module_function(m_native, "attribute_rows",
|
|
4268
4291
|
nf_attribute_rows, 2);
|
|
4292
|
+
rb_define_module_function(m_native, "attribute_packet",
|
|
4293
|
+
nf_attribute_packet, 2);
|
|
4269
4294
|
rb_define_module_function(m_native, "create_element_with_attrs",
|
|
4270
4295
|
nf_create_element_with_attrs, 4);
|
|
4271
4296
|
rb_define_module_function(m_native, "register_doc_klasses",
|
data/lib/leptris/version.rb
CHANGED
data/lib/leptris/xml/attr.rb
CHANGED
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
class Leptris::XML::Attr
|
|
9
9
|
attr_reader :name, :value, :element
|
|
10
10
|
|
|
11
|
-
# c_handle is the C LeptrisAttribute
|
|
12
|
-
# element's iteration face — document-owned and borrowed.
|
|
13
|
-
#
|
|
11
|
+
# c_handle is the C LeptrisAttribute handle from the owning
|
|
12
|
+
# element's iteration face — document-owned and borrowed. The rows
|
|
13
|
+
# faces pass the raw Integer address (ruby#586 ask 2: no
|
|
14
|
+
# per-attribute FFI::Pointer on read-only callers); the Pointer is
|
|
15
|
+
# minted lazily on the first namespace read. Hand constructors may
|
|
16
|
+
# pass a Pointer directly, or nil when constructed by hand.
|
|
14
17
|
def initialize(name, value, element, c_handle: nil)
|
|
15
18
|
@name = name
|
|
16
19
|
@value = value
|
|
@@ -37,8 +40,9 @@ class Leptris::XML::Attr
|
|
|
37
40
|
# nil for a no-namespace attribute or an undeclared prefix; xml
|
|
38
41
|
# is prebound to http://www.w3.org/XML/1998/namespace.
|
|
39
42
|
def namespace_uri
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
h = c_handle_ptr
|
|
44
|
+
return nil if h.nil?
|
|
45
|
+
Leptris::XML::FFI.leptris_attribute_namespace_uri(h)
|
|
42
46
|
end
|
|
43
47
|
|
|
44
48
|
def namespace
|
|
@@ -73,4 +77,15 @@ class Leptris::XML::Attr
|
|
|
73
77
|
def inspect
|
|
74
78
|
"#<#{self.class.name} name=#{@name.inspect} value=#{@value.inspect}>"
|
|
75
79
|
end
|
|
80
|
+
|
|
81
|
+
private
|
|
82
|
+
|
|
83
|
+
# Wrap a raw Integer address on first namespace read; Pointer and
|
|
84
|
+
# nil pass through unchanged.
|
|
85
|
+
def c_handle_ptr
|
|
86
|
+
if @c_handle.is_a?(Integer)
|
|
87
|
+
@c_handle = @c_handle.zero? ? nil : FFI::Pointer.new(@c_handle)
|
|
88
|
+
end
|
|
89
|
+
@c_handle
|
|
90
|
+
end
|
|
76
91
|
end
|
|
@@ -388,6 +388,9 @@ class Leptris::XML::Descriptor
|
|
|
388
388
|
element: Leptris::XML::FFI::PLAN_OP_ELEMENT,
|
|
389
389
|
attr: Leptris::XML::FFI::PLAN_OP_ATTR,
|
|
390
390
|
end: Leptris::XML::FFI::PLAN_OP_END,
|
|
391
|
+
# leptris#1941: value carries a host-serialized fragment; the
|
|
392
|
+
# engine stores it as a VALUE_RAW and emits it verbatim.
|
|
393
|
+
raw: Leptris::XML::FFI::PLAN_OP_RAW,
|
|
391
394
|
}.freeze
|
|
392
395
|
private_constant :ROW_OP_KINDS
|
|
393
396
|
|
data/lib/leptris/xml/document.rb
CHANGED
|
@@ -714,6 +714,9 @@ class Leptris::XML::Document
|
|
|
714
714
|
@c_ptr = nil
|
|
715
715
|
@c_address = nil
|
|
716
716
|
@wrapper_cache&.clear
|
|
717
|
+
# ruby#587: release the native identity cache at free time —
|
|
718
|
+
# the wrapper set dies with the document, not at GC time.
|
|
719
|
+
@native_cache = nil
|
|
717
720
|
# Detach the lifetime handle (TODO.perf/12): the memory is
|
|
718
721
|
# already released above — the GC-pass dfree must no-op.
|
|
719
722
|
Leptris::XML::Native.doc_handle_release(self) if defined?(Leptris::XML::NATIVE_FAST)
|
data/lib/leptris/xml/element.rb
CHANGED
|
@@ -411,13 +411,15 @@ class Leptris::XML::Element < Leptris::XML::Node
|
|
|
411
411
|
# address] triples; the Attr value objects are minted from them
|
|
412
412
|
# with zero further engine crossings — identical objects to
|
|
413
413
|
# each_attribute. The win amplifies with attribute density
|
|
414
|
-
# (40-attr elements list ~7x faster than the chain).
|
|
414
|
+
# (40-attr elements list ~7x faster than the chain). The raw
|
|
415
|
+
# Integer address rides along (ruby#586 ask 2) — the FFI::Pointer
|
|
416
|
+
# is minted lazily on the first namespace read, so read-only
|
|
417
|
+
# walkers stop paying one Pointer per attribute.
|
|
415
418
|
def attribute_rows_native
|
|
416
419
|
::Leptris::XML::Native.attribute_rows(@document, @c_address)
|
|
417
420
|
.each_slice(3)
|
|
418
421
|
.map do |name, value, handle|
|
|
419
|
-
::Leptris::XML::Attr.new(name, value, self,
|
|
420
|
-
c_handle: ::FFI::Pointer.new(handle))
|
|
422
|
+
::Leptris::XML::Attr.new(name, value, self, c_handle: handle)
|
|
421
423
|
end
|
|
422
424
|
end
|
|
423
425
|
|
data/lib/leptris/xml/ffi.rb
CHANGED
|
@@ -440,6 +440,8 @@ module Leptris
|
|
|
440
440
|
PLAN_OP_ELEMENT = 1
|
|
441
441
|
PLAN_OP_ATTR = 2
|
|
442
442
|
PLAN_OP_END = 3
|
|
443
|
+
# leptris#1941: splice a host-serialized fragment verbatim.
|
|
444
|
+
PLAN_OP_RAW = 4
|
|
443
445
|
attach_function :leptris_plan_result_build,
|
|
444
446
|
[:leptris_plan, :pointer, :size_t, :pointer], :leptris_plan_result
|
|
445
447
|
# libleptris 1.9.387: the packed-blob lane of the same face
|
data/lib/leptris/xml/native.so
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -105,6 +105,17 @@ class Leptris::XML::Document
|
|
|
105
105
|
@native_cache ||= {}
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
# ruby#587 ask 2: documented drop point for the identity cache —
|
|
109
|
+
# a parse -> hydrate -> discard lane releases the retained wrapper
|
|
110
|
+
# set without waiting for document GC. Surviving wrappers stay
|
|
111
|
+
# valid (they carry their own document + address); new crossings
|
|
112
|
+
# mint fresh wrappers, so the object-identity contract ends where
|
|
113
|
+
# the host says it ends.
|
|
114
|
+
def clear_native_cache
|
|
115
|
+
@native_cache = nil
|
|
116
|
+
self
|
|
117
|
+
end
|
|
118
|
+
|
|
108
119
|
def native_node
|
|
109
120
|
r = root or raise Leptris::XML::Error, "document has no root element"
|
|
110
121
|
Leptris::XML::NativeNode.from(self, r.c_ptr)
|
data/lib/libleptris.so
CHANGED
|
Binary file
|
data/vendor-src/README.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.406] - 2026-11-03
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- descriptor: `LEPTRIS_PLAN_OP_RAW` (op kind 4) — the serializer's escape hatch. Host-side code serializes a fragment (typically a lutaml-model child_deferred subtree) and the plan emits it verbatim as a `VALUE_RAW` row, so ordered/deferred/mixed layouts no longer fall back to per-node `create_element` minting. Closes the engine half of the #1941 wrapper-free serialize face.
|
|
8
|
+
- descriptor: emission rows are stamped with their plan row identity (`row_index` + `container_plan`), which the serializer's CONTENT check requires to address the correct `child_plans` slot.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- descriptor: scalar ops previously left `child_plans[0]` in place for every row, wrapping scalar text in spurious `<>Hi </>` element shells during native emission.
|
|
13
|
+
|
|
14
|
+
Uniword model_serialize: 0.878s vs 2.52s baseline (~3x CPU), allocations 1.22M vs 3.07M (~2.5x). Engine suite 2222/2222.
|
|
15
|
+
|
|
3
16
|
## [1.9.405] - 2026-11-03
|
|
4
17
|
|
|
5
18
|
### Fixed
|
|
@@ -277,7 +277,15 @@ typedef enum {
|
|
|
277
277
|
LEPTRIS_PLAN_OP_SCALAR = 0,
|
|
278
278
|
LEPTRIS_PLAN_OP_ELEMENT = 1,
|
|
279
279
|
LEPTRIS_PLAN_OP_ATTR = 2,
|
|
280
|
-
LEPTRIS_PLAN_OP_END = 3
|
|
280
|
+
LEPTRIS_PLAN_OP_END = 3,
|
|
281
|
+
/* leptris#1941: splice a host-serialized fragment verbatim —
|
|
282
|
+
* `value`/`value_len` carry the fragment; the result stores it as
|
|
283
|
+
* a VALUE_RAW and the serializer emits it without escaping. The
|
|
284
|
+
* ops lane's escape hatch for subtrees the plan cannot address
|
|
285
|
+
* (valued cycle-point rows: the child model serializes through
|
|
286
|
+
* its own lane and rides as text). plan_index/row_index are
|
|
287
|
+
* ignored. */
|
|
288
|
+
LEPTRIS_PLAN_OP_RAW = 4
|
|
281
289
|
} LeptrisPlanRowOpKind;
|
|
282
290
|
|
|
283
291
|
typedef struct {
|
|
@@ -2044,6 +2044,11 @@ static struct leptris_plan_result* plan_result_build_windowed(
|
|
|
2044
2044
|
dp_value_new(LEPTRIS_PLAN_VALUE_SCALAR);
|
|
2045
2045
|
if (!v) goto oom;
|
|
2046
2046
|
const dp_plan* cp = &pool->plans[op->plan_index];
|
|
2047
|
+
/* The row identity drives the serializer's CONTENT check
|
|
2048
|
+
* (bare text vs the wrapper element) and host row
|
|
2049
|
+
* attribution — stamp it from the op. */
|
|
2050
|
+
v->row_index = op->row_index;
|
|
2051
|
+
v->container_plan = op->plan_index;
|
|
2047
2052
|
if (op->row_index < cp->child_count)
|
|
2048
2053
|
v->name = dp_strdup(
|
|
2049
2054
|
cp->child_plans[op->row_index].wire_name);
|
|
@@ -2160,6 +2165,27 @@ static struct leptris_plan_result* plan_result_build_windowed(
|
|
|
2160
2165
|
if (!gn[el->attr_count] || !gv[el->attr_count])
|
|
2161
2166
|
goto oom;
|
|
2162
2167
|
el->attr_count++;
|
|
2168
|
+
} else if (op->kind == LEPTRIS_PLAN_OP_RAW) {
|
|
2169
|
+
/* leptris#1941: the host-serialized fragment rides the
|
|
2170
|
+
* result verbatim (VALUE_RAW; the serializer emits it
|
|
2171
|
+
* without escaping). Ignored by hydration. */
|
|
2172
|
+
struct leptris_plan_result* v =
|
|
2173
|
+
dp_value_new(LEPTRIS_PLAN_VALUE_RAW);
|
|
2174
|
+
if (!v) goto oom;
|
|
2175
|
+
if (!dp_value_set_str(v, op->value ? op->value : "",
|
|
2176
|
+
op->value ? op->value_len : 0))
|
|
2177
|
+
dp_value_set_str(v, "", 0);
|
|
2178
|
+
if (sp == 0) {
|
|
2179
|
+
dp_result_free_rec(v);
|
|
2180
|
+
free(stack);
|
|
2181
|
+
if (status) *status = LEPTRIS_ERROR_INVALID_ARG;
|
|
2182
|
+
return NULL;
|
|
2183
|
+
}
|
|
2184
|
+
v->order_index = (uint32_t)stack[sp - 1]->kid_count;
|
|
2185
|
+
if (!dp_value_push(stack[sp - 1], v)) {
|
|
2186
|
+
dp_result_free_rec(v);
|
|
2187
|
+
goto oom;
|
|
2188
|
+
}
|
|
2163
2189
|
} else if (op->kind == LEPTRIS_PLAN_OP_END) {
|
|
2164
2190
|
if (sp == 0) {
|
|
2165
2191
|
/* Mid-build failure: the arena holds every minted
|
|
@@ -2577,6 +2577,45 @@ TEST(Plan1941, ResultBuildInheritsPlanAndChildPlanBindings) {
|
|
|
2577
2577
|
* the #1115 multi-ns case carry no row binding and take the
|
|
2578
2578
|
* child plan's w14/w15 namespaces, while a row WITH a binding
|
|
2579
2579
|
* keeps it verbatim. */
|
|
2580
|
+
/* leptris#1941: the RAW op splices a host-serialized fragment into
|
|
2581
|
+
* the result verbatim — the ops lane's escape hatch for subtrees
|
|
2582
|
+
* the plan cannot address (valued child_deferred rows: the child
|
|
2583
|
+
* model serializes through its own best lane and rides as text). */
|
|
2584
|
+
TEST(Plan1941, ResultBuildRawOpSplicesVerbatim) {
|
|
2585
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
2586
|
+
leptris_child_plan kids[1] = {};
|
|
2587
|
+
kids[0].wire_name = "p";
|
|
2588
|
+
kids[0].kind = LEPTRIS_PLAN_KIND_SCALAR;
|
|
2589
|
+
kids[0].child_plan_index = -1;
|
|
2590
|
+
leptris_element_plan plans[1] = {};
|
|
2591
|
+
plans[0].element_name = "doc";
|
|
2592
|
+
plans[0].child_count = 1;
|
|
2593
|
+
plans[0].child_plans = kids;
|
|
2594
|
+
leptris_plan_spec spec = {};
|
|
2595
|
+
spec.abi_version = leptris_plan_abi_version();
|
|
2596
|
+
spec.plan_count = 1;
|
|
2597
|
+
spec.plans = plans;
|
|
2598
|
+
LeptrisPlan plan = leptris_plan_build(&spec, &st);
|
|
2599
|
+
ASSERT_NE(plan, nullptr);
|
|
2600
|
+
|
|
2601
|
+
const char* frag = "<w:r xmlns:w=\"urn:w\"><w:t>hi</w:t></w:r>";
|
|
2602
|
+
leptris_plan_row_op ops[] = {
|
|
2603
|
+
{LEPTRIS_PLAN_OP_ELEMENT, 0, UINT32_MAX, NULL, NULL, 0},
|
|
2604
|
+
{LEPTRIS_PLAN_OP_RAW, 0, UINT32_MAX, NULL, frag,
|
|
2605
|
+
(uint32_t)strlen(frag)},
|
|
2606
|
+
{LEPTRIS_PLAN_OP_END, 0, UINT32_MAX, NULL, NULL, 0},
|
|
2607
|
+
};
|
|
2608
|
+
LeptrisPlanResult r = leptris_plan_result_build(plan, ops, 3, &st);
|
|
2609
|
+
ASSERT_NE(r, nullptr);
|
|
2610
|
+
char* out = leptris_plan_serialize(plan, r, &st);
|
|
2611
|
+
ASSERT_NE(out, nullptr);
|
|
2612
|
+
EXPECT_STREQ(out,
|
|
2613
|
+
"<doc><w:r xmlns:w=\"urn:w\"><w:t>hi</w:t></w:r></doc>");
|
|
2614
|
+
leptris_free_string(out);
|
|
2615
|
+
leptris_plan_result_free(r);
|
|
2616
|
+
leptris_plan_free(plan);
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2580
2619
|
TEST(Plan1941, ResultBuildExplicitRowBindingBeatsInheritance) {
|
|
2581
2620
|
LeptrisStatus st = LEPTRIS_OK;
|
|
2582
2621
|
leptris_child_plan root_kids[2] = {};
|
|
@@ -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.
|
|
4
|
+
"version": "1.9.406",
|
|
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.
|
|
4
|
+
version: 1.9.406.1
|
|
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-
|
|
11
|
+
date: 2026-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|