leptris 1.9.334.0 → 1.9.334.1

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: 5dfd1dfebd00bb7ab6d9a9e0f77f179eeb3f8094ddc306c794c37f38f53dfb98
4
- data.tar.gz: '070320094ebe012843ca02e827cc742151f3ff65f9cc0f6da8283c0589ba6026'
3
+ metadata.gz: a2ce64e718bb9df81b15dc1f2cdb30678e21de904adbeae1e94bb587ffb5ccb1
4
+ data.tar.gz: 40eb5ec70f4d5a303e71bd26c1787028ff0841821ba7fe7009abe5bbbc09391c
5
5
  SHA512:
6
- metadata.gz: 8682a0d0e841e843f5f91450ad8669dbdb36558e3e51a72cd15b2ee535a5149f5f14ca02524d32dd9587446a5558c5d5dcc52806a97d352ea74ab116d689c84e
7
- data.tar.gz: 0b38084330e2ac9992b51de4022a85bd0a5907f63e93ad0a27b765f48b0faeb9c21dba7796bdd2b76f06b264b354c2764645a5d268bab069433f88c5c77a5e5a
6
+ metadata.gz: 204d14fd5b43b060571e7d7a67559adf717032da76b2ea27746ffd85d57ac9148bf0afdf17f40e9de6f263eeed501d2f1b7357bb1a5f194b6121b82ebe458a96
7
+ data.tar.gz: ae0ee8c6a2b3484685ea1648e514c7fa8ef593d60f0a51b9ae95e2b6823347e21a35ac557428e89c8d349415b0febe6f5f9519d436fd03574ca7655d6e02a12f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [1.9.334.1] - 2026-10-10
2
+
3
+ ### Performance
4
+
5
+ - **The attach paths stop minting FFI::Pointer wrappers per node
6
+ (#408 Ask 1)**: every native fast path read the canonical
7
+ Integer address through `c_ptr.address` — lazily materializing
8
+ a Pointer per node handed to one C call — instead of the
9
+ `c_address` twin. The FFI-fallback append paths route through
10
+ `leptris_element_add_child_addr` (both sides as Integers; same
11
+ status contract). Measured on the object-mode build(500):
12
+ FFI::Pointer allocations 1002 → 2 (the document/root wrappers
13
+ that genuinely need one), ~4% CPU off the build row under
14
+ load. Ask 2's face (`Descriptor#build_result`) shipped in
15
+ 1.9.334.0.
16
+
1
17
  ## [1.9.334.0] - 2026-10-10
2
18
 
3
19
  ### Added — engine sync (libleptris 1.9.332-1.9.334)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.334.0"
4
+ VERSION = "1.9.334.1"
5
5
  end
@@ -386,7 +386,7 @@ class Leptris::XML::Element < Leptris::XML::Node
386
386
  # build appends.
387
387
  return true unless node.is_a?(Leptris::XML::Element)
388
388
  return false unless defined?(Leptris::XML::NATIVE_FAST)
389
- !Leptris::XML::Native.ns_lift_needed?(node.c_ptr.address)
389
+ !Leptris::XML::Native.ns_lift_needed?(node.c_address)
390
390
  end
391
391
 
392
392
  # A node is foreign to +document+ when it belongs to another one
@@ -445,7 +445,7 @@ class Leptris::XML::Element < Leptris::XML::Node
445
445
  end
446
446
  if native_fast_children?
447
447
  unless Leptris::XML::Native.insert_binding_child(
448
- @document, @c_address, node.c_ptr.address, 1).nil?
448
+ @document, @c_address, node.c_address, 1).nil?
449
449
  return node
450
450
  end
451
451
  end
@@ -478,7 +478,7 @@ class Leptris::XML::Element < Leptris::XML::Node
478
478
  end
479
479
  if native_fast_children?
480
480
  unless Leptris::XML::Native.insert_binding_child(
481
- @document, @c_address, node.c_ptr.address, 2).nil?
481
+ @document, @c_address, node.c_address, 2).nil?
482
482
  return node
483
483
  end
484
484
  end
@@ -511,7 +511,7 @@ class Leptris::XML::Element < Leptris::XML::Node
511
511
  end
512
512
  if native_fast_children?
513
513
  unless Leptris::XML::Native.insert_binding_child(
514
- @document, @c_address, node.c_ptr.address, 3).nil?
514
+ @document, @c_address, node.c_address, 3).nil?
515
515
  return node
516
516
  end
517
517
  end
@@ -556,7 +556,7 @@ class Leptris::XML::Element < Leptris::XML::Node
556
556
  end
557
557
  cross = nodes.any? { |n| Leptris::XML::Element.foreign_to?(n, @document) }
558
558
  if native_fast_children?
559
- addrs = nodes.map { |n| n.c_ptr.address }
559
+ addrs = nodes.map { |n| n.c_address }
560
560
  done = Leptris::XML::Native.append_binding_children(
561
561
  @document, @c_address, addrs)
562
562
  done = 0 unless done.is_a?(Integer)
@@ -698,7 +698,7 @@ class Leptris::XML::Element < Leptris::XML::Node
698
698
  # The face raises on failure (TODO.perf/36); Qnil = the
699
699
  # child needs the lift — the full path handles it.
700
700
  unless Leptris::XML::Native.append_binding_child(
701
- @document, @c_address, node_or_markup.c_ptr.address).nil?
701
+ @document, @c_address, node_or_markup.c_address).nil?
702
702
  return node_or_markup
703
703
  end
704
704
  end
@@ -706,8 +706,11 @@ class Leptris::XML::Element < Leptris::XML::Node
706
706
  unless Leptris::XML::Element.skip_adoption_lift?(node_or_markup)
707
707
  Leptris::XML::Element.lift_namespaces_for_adoption(node_or_markup, namespaces)
708
708
  end
709
+ # Address-based attach (#408): same status contract, no
710
+ # FFI::Pointer mint for either side.
709
711
  Leptris::XML::FFI.check_status(
710
- Leptris::XML::FFI.leptris_element_append_child(c_ptr, node_or_markup.c_ptr))
712
+ Leptris::XML::FFI.leptris_element_add_child_addr(
713
+ @c_address, node_or_markup.c_address))
711
714
  node_or_markup
712
715
  when String
713
716
  # TODO.perf/34: one dispatch parses the markup and appends
@@ -732,7 +735,8 @@ class Leptris::XML::Element < Leptris::XML::Node
732
735
  added = []
733
736
  frag.children.each do |n|
734
737
  Leptris::XML::FFI.check_status(
735
- Leptris::XML::FFI.leptris_element_append_child(c_ptr, n.c_ptr))
738
+ Leptris::XML::FFI.leptris_element_add_child_addr(
739
+ @c_address, n.c_address))
736
740
  added << n
737
741
  end
738
742
  Leptris::XML::NodeSet.new(@document, added)
@@ -753,7 +757,8 @@ class Leptris::XML::Element < Leptris::XML::Node
753
757
  Leptris::XML::Element.lift_namespaces_for_adoption(node, namespaces)
754
758
  end
755
759
  Leptris::XML::FFI.check_status(
756
- Leptris::XML::FFI.leptris_element_append_child(c_ptr, node.c_ptr))
760
+ Leptris::XML::FFI.leptris_element_add_child_addr(
761
+ @c_address, node.c_address))
757
762
  Leptris::XML::Node.invalidate_cross_document!(node, @document)
758
763
  remove_from_source_original(node)
759
764
  last_installed
@@ -27,6 +27,12 @@ begin
27
27
  if Gem.win_platform?
28
28
  require "leptris/xml/native_#{RUBY_VERSION[/\A\d+\.\d+/].tr('.', '_')}"
29
29
  else
30
+ # #1623: the bundle beside this file must carry a valid
31
+ # signature before dyld maps it — pre-verify and re-stamp.
32
+ Leptris.resign_bundle_if_needed(
33
+ File.expand_path(
34
+ "native#{RUBY_PLATFORM.include?('darwin') ? '.bundle' : '.so'}",
35
+ __dir__))
30
36
  require "leptris/xml/native"
31
37
  end
32
38
  rescue LoadError => e
data/lib/leptris.rb CHANGED
@@ -3,6 +3,23 @@
3
3
  require "leptris/version"
4
4
 
5
5
  module Leptris
6
+ # leptris#1623: macOS 14.x dyld intermittently SIGKILLs native
7
+ # bundles whose adhoc signature went stale (post-build byte
8
+ # rewrites) or is absent (x86_64 links carry none by default).
9
+ # A kill cannot be rescued — pre-verify and re-stamp BEFORE dyld
10
+ # ever sees the binary. Adhoc is deterministic and needs no
11
+ # identity; Developer ID rides owner secrets when wired.
12
+ def self.resign_bundle_if_needed(path)
13
+ return false unless path && File.exist?(path)
14
+ return false unless RUBY_PLATFORM.include?("darwin")
15
+ return true if system("codesign", "--verify", path.to_s,
16
+ out: File::NULL, err: File::NULL)
17
+ system("codesign", "--force", "--sign", "-", path.to_s,
18
+ out: File::NULL, err: File::NULL) &&
19
+ system("codesign", "--verify", path.to_s,
20
+ out: File::NULL, err: File::NULL)
21
+ end
22
+
6
23
  autoload :XML, "leptris/xml"
7
24
  # One file, three entry constants (HTML/HTML4/HTML5) — each
8
25
  # autoload maps so any reference loads the facade.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.334.0
4
+ version: 1.9.334.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.