leptris 1.9.290.0 → 1.9.302.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.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +98 -0
  3. data/Rakefile +1 -1
  4. data/lib/leptris/vendor/aarch64-linux/libleptris.so +0 -0
  5. data/lib/leptris/vendor/aarch64-linux-musl/libleptris.so +0 -0
  6. data/lib/leptris/vendor/arm-linux/libleptris.so +0 -0
  7. data/lib/leptris/vendor/arm-linux-musl/libleptris.so +0 -0
  8. data/lib/leptris/vendor/arm64-darwin/libleptris.dylib +0 -0
  9. data/lib/leptris/vendor/ppc64le-linux/libleptris.so +0 -0
  10. data/lib/leptris/vendor/s390x-linux-musl/libleptris.so +0 -0
  11. data/lib/leptris/vendor/x86_64-darwin/libleptris.dylib +0 -0
  12. data/lib/leptris/vendor/x86_64-linux/libleptris.so +0 -0
  13. data/lib/leptris/vendor/x86_64-linux-musl/libleptris.so +0 -0
  14. data/lib/leptris/version.rb +1 -1
  15. data/lib/leptris/xml/descriptor.rb +19 -0
  16. data/lib/leptris/xml/document.rb +15 -2
  17. data/lib/leptris/xml/ffi.rb +19 -3
  18. data/lib/leptris/xml/xslt.rb +7 -5
  19. data/vendor-src/README.md +1 -1
  20. data/vendor-src/libleptris/CHANGELOG.md +386 -0
  21. data/vendor-src/libleptris/CMakeLists.txt +6 -1
  22. data/vendor-src/libleptris/benchmarks/modification/bench_append_attr_pugixml.cpp +36 -0
  23. data/vendor-src/libleptris/bindings/rust/Cargo.lock +1 -1
  24. data/vendor-src/libleptris/bindings/rust/Cargo.toml +3 -1
  25. data/vendor-src/libleptris/cli/CLI_ARCHITECTURE.md +1 -1
  26. data/vendor-src/libleptris/cli/CMakeLists.txt +1 -0
  27. data/vendor-src/libleptris/cli/cli.c +36 -1
  28. data/vendor-src/libleptris/cli/cli.h +39 -2
  29. data/vendor-src/libleptris/cli/commands/xquery.c +1 -31
  30. data/vendor-src/libleptris/cli/commands/xslt.c +118 -0
  31. data/vendor-src/libleptris/cli/main.c +24 -22
  32. data/vendor-src/libleptris/cli/man/leptris-diff.1.adoc +40 -0
  33. data/vendor-src/libleptris/cli/man/leptris-validate.1.adoc +43 -0
  34. data/vendor-src/libleptris/cli/man/leptris-xquery.1.adoc +44 -0
  35. data/vendor-src/libleptris/cli/man/leptris-xslt.1.adoc +49 -0
  36. data/vendor-src/libleptris/src/CMakeLists.txt +26 -0
  37. data/vendor-src/libleptris/src/include/leptris/descriptor.h +25 -0
  38. data/vendor-src/libleptris/src/include/leptris.h +28 -1
  39. data/vendor-src/libleptris/src/leptris/descriptor/plan.c +17 -0
  40. data/vendor-src/libleptris/src/leptris/dom/compact.c +4 -0
  41. data/vendor-src/libleptris/src/leptris/dom/element_modify.c +30 -19
  42. data/vendor-src/libleptris/src/leptris/dom/mut_recycle.c +112 -0
  43. data/vendor-src/libleptris/src/leptris/dom/mut_recycle.h +50 -0
  44. data/vendor-src/libleptris/src/leptris/leptris.c +62 -8
  45. data/vendor-src/libleptris/src/leptris/leptris_internal.h +7 -0
  46. data/vendor-src/libleptris/src/leptris/xpath/collation.c +494 -0
  47. data/vendor-src/libleptris/src/leptris/xpath/collation.h +66 -0
  48. data/vendor-src/libleptris/src/leptris/xpath/compiler.c +9 -3
  49. data/vendor-src/libleptris/src/leptris/xpath/ducet_table.h +21994 -0
  50. data/vendor-src/libleptris/src/leptris/xpath/evaluator_internal.h +6 -0
  51. data/vendor-src/libleptris/src/leptris/xpath/evaluator_operators.c +53 -5
  52. data/vendor-src/libleptris/src/leptris/xpath/evaluator_types.c +53 -8
  53. data/vendor-src/libleptris/src/leptris/xpath/functions.c +506 -67
  54. data/vendor-src/libleptris/src/leptris/xpath/functions_ext31.c +572 -64
  55. data/vendor-src/libleptris/src/leptris/xpath/vm.c +20 -4
  56. data/vendor-src/libleptris/src/leptris/xpath/xpath_public.c +3 -1
  57. data/vendor-src/libleptris/src/leptris/xquery/xquery.c +23 -1
  58. data/vendor-src/libleptris/test/CMakeLists.txt +14 -0
  59. data/vendor-src/libleptris/test/abi/test_descriptor.cpp +88 -0
  60. data/vendor-src/libleptris/test/cli/test_cli.cpp +61 -0
  61. data/vendor-src/libleptris/test/dom/test_document_children.cpp +92 -0
  62. data/vendor-src/libleptris/test/dom/test_dom.cpp +20 -16
  63. data/vendor-src/libleptris/test/dom/test_element_children.cpp +72 -0
  64. data/vendor-src/libleptris/test/memory/test_mut_recycle.cpp +64 -0
  65. data/vendor-src/libleptris/test/xpath/test_collation.cpp +147 -0
  66. data/vendor-src/libleptris/test/xpath/test_compiled.cpp +92 -0
  67. data/vendor-src/libleptris/test/xpath/test_xslt.cpp +114 -0
  68. data/vendor-src/libleptris/test/xquery/qt3/fn/abs.xml +2085 -0
  69. data/vendor-src/libleptris/test/xquery/qt3/fn/apply.xml +214 -0
  70. data/vendor-src/libleptris/test/xquery/qt3/fn/avg.xml +2199 -0
  71. data/vendor-src/libleptris/test/xquery/qt3/fn/ceiling.xml +961 -0
  72. data/vendor-src/libleptris/test/xquery/qt3/fn/collation-key.xml +331 -0
  73. data/vendor-src/libleptris/test/xquery/qt3/fn/filter.xml +387 -0
  74. data/vendor-src/libleptris/test/xquery/qt3/fn/floor.xml +968 -0
  75. data/vendor-src/libleptris/test/xquery/qt3/fn/fold-left.xml +426 -0
  76. data/vendor-src/libleptris/test/xquery/qt3/fn/fold-right.xml +363 -0
  77. data/vendor-src/libleptris/test/xquery/qt3/fn/for-each-pair.xml +585 -0
  78. data/vendor-src/libleptris/test/xquery/qt3/fn/for-each.xml +170 -0
  79. data/vendor-src/libleptris/test/xquery/qt3/fn/max.xml +2018 -0
  80. data/vendor-src/libleptris/test/xquery/qt3/fn/min.xml +1973 -0
  81. data/vendor-src/libleptris/test/xquery/qt3/fn/round-half-to-even.xml +1336 -0
  82. data/vendor-src/libleptris/test/xquery/qt3/fn/round.xml +2539 -0
  83. data/vendor-src/libleptris/test/xquery/qt3/fn/sum.xml +2043 -0
  84. data/vendor-src/libleptris/test/xquery/qt3/misc/UCACollation.xml +1120 -0
  85. data/vendor-src/libleptris/test/xquery/test_qt3.cpp +226 -14
  86. data/vendor-src/libleptris/test/xquery/test_xquery.cpp +208 -0
  87. data/vendor-src/libleptris/tools/gen_ducet_table.py +110 -0
  88. data/vendor-src/libleptris/vcpkg.json +1 -1
  89. data/vendor-src/libleptris/vendor/ducet/allkeys.txt +39435 -0
  90. metadata +33 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6838f7a55c89398226cfac7d4b10daaff8714a145c3837241e620b5498e04a83
4
- data.tar.gz: d468f7c6ed71c26264ea82989e277d15385e0d0d1d467def593e74002ac64fd9
3
+ metadata.gz: c5007593d092ff504ec69d5682d450e15a65d6992f28a0684231be1fc4590e97
4
+ data.tar.gz: 8a4f49ee8964cd3d2f1ea2f758b82d282b6cd8e904a6a8609a54f9e71cc59b8b
5
5
  SHA512:
6
- metadata.gz: da53446281f453422977498301f5581f81c428f0af970ba66ee88bc733de8580e0a6c031023a1a0aab8388a238919d0200a5c97ed29a1e389034a99e5dfc27df
7
- data.tar.gz: 3517c14069987df979ea335882af3f9ed1375f78e9fc3b9efe3767072a4fa5cdc22f30e2d849917f13292a55768ec637029c40b051717a15b8ce03c66aaf58fa
6
+ metadata.gz: 99fafe4f1c4d8dd2538dbc38621c2eab52fbc287e9f83e86787e0dd43212cfbf4c3b39dbceaa513d97cf4db9e3ef4bcc8cb4c19defe5e297ec7b8d5c2591275a
7
+ data.tar.gz: b565409f1d6477dff43cf4c743d648bb77654be7d70403031ea1f16302abd628491f0c1b6c89d2cd90934371481223047c30e26cc63d84cc61be0a9b2ce90c09
data/CHANGELOG.md CHANGED
@@ -1,3 +1,101 @@
1
+ ## [1.9.302.0] - 2026-10-05
2
+
3
+ ### Engine sync (libleptris 1.9.293-1.9.302)
4
+
5
+ Ten upstream releases ride in this pin — internal fixes and
6
+ performance with NO binding-surface changes (zero header deltas
7
+ 292..302; the audit gate confirms 363/362 unchanged). Highlights:
8
+
9
+ - **XQuery correctness**: a false() bound anywhere read as truthy;
10
+ fn:not uses the effective boolean value; fn:abs(()) is empty;
11
+ string lt/gt are codepoint comparisons; fn:avg edge shapes;
12
+ aggregates atomize array arguments; `instance of xs:integer`
13
+ demands integrality; xs:byte/unsignedByte/unsignedInt
14
+ constructors; fn:sum#2's zero argument.
15
+ - **Collation**: UCA over the vendored DUCET table (slices 1-4) —
16
+ fn:normalize-unicode F&O conformance, collation-aware string
17
+ functions, 71+1078 QT3 cases adopted, implicit weights and
18
+ alternate=blanked.
19
+ - **Performance**: per-thread recycle of mutation blocks (DOM
20
+ create/build/free).
21
+ - **Rust bindings**: first tokenless crates.io release (leptris
22
+ v1.4.1) from CI.
23
+
24
+ ## [1.9.292.0] - 2026-10-03
25
+
26
+ ### Fixed
27
+
28
+ - **Document#root= adopts foreign roots (leptris-ruby#371)**:
29
+ vendored 1.9.292 (engine #1495) — a foreign element is no longer
30
+ rejected with EINVAL; the subtree is deep-copied into this
31
+ document's pool (all node kinds, attributes, namespace
32
+ declarations), the source document loses the element, and the
33
+ detached original stays resolvable until the source frees. The
34
+ binding routes cross-document installs through the new
35
+ leptris_document_set_root_ex and wraps the INSTALLED handle — a
36
+ fresh pointer, not the source. Same-document installs keep the
37
+ native fast path. The old "rejects foreign" construction spec now
38
+ pins adoption.
39
+
40
+ ## [1.9.291.0] - 2026-10-03
41
+ ### Fixed
42
+
43
+ - **Removed nodes leave clean orphans (leptris-ruby#370)**:
44
+ vendored 1.9.291 — `remove_child` / `remove_all_children` clear
45
+ the removed nodes' own sibling links, so a later re-append never
46
+ splices the stale sibling run into the new parent (nodes were
47
+ reachable from two parents, up to self-containing cycles).
48
+ - **`prefix:*` is namespace-scoped (leptris-ruby#368)**: three
49
+ fused compiler sites lowered `//m:*` to the any-element opcode;
50
+ prefixed wildcards now resolve through the caller's bindings.
51
+
52
+ ### Added
53
+
54
+ - **Descriptor row-layout skew gate (engine #1490 follow-up)**:
55
+ the five new struct-size accessors are attached and the
56
+ descriptor face verifies the engine's compiled row sizes against
57
+ the binding's FFI structs before every plan build — version
58
+ skew fails loudly instead of misparsing rows.
59
+
60
+ ## [1.9.290.0] - 2026-10-02
61
+
62
+ ### Fixed
63
+
64
+ - **Params values evaluate as XPath expressions (engine 1.9.288,
65
+ #1481 semantics correction)**: the #360 face shipped briefly on
66
+ raw-string binding — under libleptris 1.9.288+ the value strings
67
+ evaluate as XPath EXPRESSIONS, the libxslt `params` convention
68
+ callers know from nokogiri (whose quote_params exists to add the
69
+ quotes): `"4 * 3"` binds 12, `"'S'"` binds the string `"S"`,
70
+ `string(/r/@v)` reads the source, a malformed expression fails
71
+ the transform. The face docs and specs updated to the corrected
72
+ contract; callers passing pre-quoted values (nokogiri-style)
73
+ are already correct.
74
+
75
+ ### Added — engine sync (1.9.290)
76
+
77
+ - Namespace forms for attribute plan rows: `ns_form` / `ns_uri`
78
+ on the descriptor AttrPlan (#1486/#1487) — the binding packs the
79
+ fields (zero = the historical wire-name lookup); exposing
80
+ ns-exact rows from plan trees lands with the first consumer.
81
+
82
+ ### Performance — engine sync (1.9.288-1.9.289)
83
+
84
+ - Vendored libleptris 1.9.288-1.9.289: the #1481 params semantics
85
+ correction, plus the 289 HTML-path performance work (slice 6 of
86
+ #1218): open-id integer compares for the scope/table-context
87
+ stack walks and id-LUT membership for the foster/formatting
88
+ checks — cumulative ~+15% on the table-rows fixture; the
89
+ 3.4-7x deficit at 1.9.203 is now a 1.3-1.55x lead over
90
+ htmlReadMemory.
91
+ - **Descriptor AttrPlan ABI adoption (#1486)**: the attribute-row
92
+ plan struct gains trailing ns-form fields (additive to the
93
+ frozen v1 ABI — the #1115 pattern). The binding packs the full
94
+ layout (FFI zero-fill keeps unset = the historical wire-name
95
+ lookup); riding 1.9.288+ without the extension reads past the
96
+ allocation and segfaults the descriptor face. Namespace-form
97
+ attribute rows are engine-ready; the binding face follows.
98
+
1
99
  ## [1.9.287.0] - 2026-10-02
2
100
 
3
101
  ### Added
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.290"
11
+ LIBLEPTRIS_VERSION = "1.9.302"
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.290.0"
4
+ VERSION = "1.9.302.0"
5
5
  end
@@ -96,6 +96,25 @@ class Leptris::XML::Descriptor
96
96
  # Ruby-side spec memory is transient (the engine deep-copies).
97
97
  def self.build(tree)
98
98
  abi = Leptris::XML::FFI.leptris_plan_abi_version
99
+ # Row-layout skew gate (1.9.291, engine #1490 follow-up): the
100
+ # engine reports its compiled row sizes; a mismatch means the
101
+ # binding's FFI structs and the vendored engine disagree —
102
+ # fail loudly instead of misparsing rows.
103
+ {
104
+ Leptris::XML::FFI.leptris_plan_spec_struct_size => Leptris::XML::FFI::PlanSpec,
105
+ Leptris::XML::FFI.leptris_plan_element_row_size => Leptris::XML::FFI::ElementPlan,
106
+ Leptris::XML::FFI.leptris_plan_child_row_size => Leptris::XML::FFI::ChildPlan,
107
+ Leptris::XML::FFI.leptris_plan_attr_row_size => Leptris::XML::FFI::AttrPlan,
108
+ Leptris::XML::FFI.leptris_plan_predicate_row_size =>
109
+ Leptris::XML::FFI::AttrPredicate
110
+ }.each do |engine_size, struct|
111
+ next if engine_size == struct.size
112
+
113
+ raise Leptris::XML::Error,
114
+ "descriptor row-layout skew: engine #{engine_size}B vs " \
115
+ "binding #{struct.size}B for #{struct.name} — the vendored " \
116
+ "engine and the binding structs disagree"
117
+ end
99
118
  if abi != Leptris::XML::FFI::PLAN_ABI_VERSION
100
119
  raise Leptris::XML::Error,
101
120
  "descriptor ABI v#{abi} != binding v#{Leptris::XML::FFI::PLAN_ABI_VERSION}"
@@ -384,7 +384,20 @@ class Leptris::XML::Document
384
384
  # TODO.perf/33: gates + bump + engine set_root in one C
385
385
  # dispatch (the FFI call plus the c_ptr materialization fed
386
386
  # ~5% of a fresh-doc build).
387
- if defined?(Leptris::XML::NATIVE_FAST)
387
+ # Cross-document adoption (1.9.292, #371): the engine DEEP-COPIES
388
+ # the foreign subtree into this document's pool and reports the
389
+ # installed element — a fresh handle distinct from the source
390
+ # pointer. Same-document installs keep the native fast path.
391
+ cross = element.document && !element.document.equal?(self)
392
+ installed_ptr = nil
393
+ if cross
394
+ out = ::FFI::MemoryPointer.new(:pointer)
395
+ Leptris::XML::FFI.check_status(
396
+ Leptris::XML::FFI.leptris_document_set_root_ex(
397
+ c_ptr, element.c_ptr, out))
398
+ installed_ptr = out.read_pointer
399
+ @version += 1
400
+ elsif defined?(Leptris::XML::NATIVE_FAST)
388
401
  Leptris::XML::Native.set_binding_root(self, element.c_address)
389
402
  else
390
403
  Leptris::XML::FFI.check_status(
@@ -394,7 +407,7 @@ class Leptris::XML::Document
394
407
  # Seed the root memo through wrap: a cross-document element
395
408
  # must enter THIS document's identity cache with @document
396
409
  # pointing here, not ride its source-document wrapper.
397
- @root = Leptris::XML::Node.wrap(element.c_ptr, self)
410
+ @root = Leptris::XML::Node.wrap(installed_ptr || element.c_ptr, self)
398
411
  @root_version = @version
399
412
  Leptris::XML::Node.invalidate_cross_document!(element, self)
400
413
  element
@@ -300,9 +300,10 @@ module Leptris
300
300
  :predicate_count, :uint16,
301
301
  :pad_pred, :uint16,
302
302
  :predicates, :pointer,
303
- # libleptris 1.9.289 (#1486): attribute-level namespace
304
- # form — ns rows match by (URI, local), wire_name is the
305
- # LOCAL name; NONE keeps wire-name-exact matching.
303
+ # libleptris 1.9.289 (#1486): attribute-level ns
304
+ # form (additive trailing to the frozen v1 ABI —
305
+ # the #1115 child-row pattern). FFI zero-fills, so
306
+ # unset = the historical wire-name lookup.
306
307
  :ns_form, :uint8,
307
308
  :pad_ns, :uint8,
308
309
  :ns_uri, :pointer
@@ -372,6 +373,15 @@ module Leptris
372
373
  attach_function :leptris_node_byte_offset,
373
374
  [:leptris_node_ref], :size_t
374
375
 
376
+ # Struct-size accessors (1.9.291, engine #1490 follow-up):
377
+ # the engine's compiled row layouts — the descriptor face
378
+ # verifies them against the FFI structs it packs and fails
379
+ # loudly on version skew instead of misparsing rows.
380
+ attach_function :leptris_plan_spec_struct_size, [], :size_t
381
+ attach_function :leptris_plan_element_row_size, [], :size_t
382
+ attach_function :leptris_plan_child_row_size, [], :size_t
383
+ attach_function :leptris_plan_attr_row_size, [], :size_t
384
+ attach_function :leptris_plan_predicate_row_size, [], :size_t
375
385
  attach_function :leptris_plan_abi_version, [], :uint32
376
386
  attach_function :leptris_plan_build,
377
387
  [:pointer, :pointer], :leptris_plan
@@ -484,6 +494,12 @@ attach_function :leptris_parse_string,
484
494
  [], :leptris_document
485
495
  attach_function :leptris_document_set_root,
486
496
  [:leptris_document, :leptris_element], :leptris_status
497
+ # 1.9.292 (#371): foreign roots are ADOPTED — deep-copied into
498
+ # this document's pool; out_installed reports the fresh
499
+ # handle (wrap THAT, not the source pointer). Legacy
500
+ # set_root adopts too but cannot report the installed node.
501
+ attach_function :leptris_document_set_root_ex,
502
+ [:leptris_document, :leptris_element, :pointer], :leptris_status
487
503
  attach_function :leptris_document_root,
488
504
  [:leptris_document], :leptris_element
489
505
  # The document node — navigation head over the whole tree
@@ -69,11 +69,13 @@ module Leptris::XML::XSLT
69
69
  # Apply to +document+ (not modified) and return the result tree
70
70
  # as an owning Document — query it with xpath/css like any other.
71
71
  #
72
- # params (#360): top-level xsl:param overrides as a Hash of
73
- # name => value. Values bind as XPath STRINGS verbatim — the
74
- # caller owns numeric/boolean quoting (libxslt conventions:
75
- # pass '7' for a number, matching nokogiri's quote_params).
76
- # Absent names keep the param's select/@default.
72
+ # params (#360, engine 1.9.288 semantics): top-level xsl:param
73
+ # overrides as a Hash of name => value. Values evaluate as
74
+ # XPath EXPRESSIONS — the libxslt `params` convention callers
75
+ # know from nokogiri (whose quote_params exists to add the
76
+ # quotes): "7 * 6" binds 42, "'7'" binds the string "7",
77
+ # "string(/r/@v)" reads the source. A malformed expression
78
+ # fails the transform. Absent names keep select/@default.
77
79
  def apply_to(document, params: nil)
78
80
  raw, buffer, = with_param_pairs(params) do |pairs, count|
79
81
  if pairs
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.290
4
+ - libleptris v1.9.302
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand: