Repository navigation
v1.0.0: Rewrite native extension, Ruby API, packaging, and CI from scratch - #2
Merged
Merged
Conversation
added 4 commits
November 19, 2026 19:10
…ct Ruby C API Drop Rice to eliminate rb_raise longjmp-past-destructor UB by construction, hide all internal symbols (exporting only Init_executorch), release the GVL around module load and execution with per-method locking, capture PAL logs, support all 13 numeric/bool dtypes, NHWC dim_order normalization, zero-copy IO::Buffer, out: buffer reuse, and dsize/gc memory pressure tracking.
…tcher Introduce Executorch::Module (.open with mmap default, Pathname, .ptd data_files, block cleanup, .from_bytes), MethodMeta/TensorInfo introspection, explicit-width canonical dtypes, Numo/Torch adapters, and a stdlib SHA-256-verified ExecuTorch 1.6.0 C++ SDK fetcher with fat platform gem packaging.
…benchmarks Replace silently skipped model tests with real golden-verified .pte/.ptd fixtures (0 skips) plus adversarial OOB/overflow, reentrancy, GC.stress/compact, GVL-release concurrency, symbol-visibility, and RSS leak checks.
added 3 commits
November 19, 2026 23:54
…and platform matrix
…r GC.compact Prevents stale class VALUE pointers after GC.compact on Ruby 3.2+ (caught by SafetyTest running GC.compact before ModuleTest#test_method_meta_and_lifecycle). Also synchronize ticker thread startup in the GVL-release test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete from-scratch v1.0.0 rewrite targeting ExecuTorch 1.6.0 and Ruby
>= 3.2:Key changes:
noexceptC++17 core + direct Ruby C API, eliminatingrb_raiselongjmp-past-destructor UB, hidden per-elementrb_protectoverhead, and unboundedrice >= 4.3coupling.rb_thread_call_without_gvlwith per-method mutex locking;dsize+rb_gc_adjust_memory_usage;rb_global_variableregistration forGC.compactsafety;RUBY_TYPED_FROZEN_SHAREABLE; strict symbol hiding (Init_executorchonly on Linux ELF and macOS Mach-O); overflow-safe shapes, reentrancy-safe single-pass C++ nested-array flattening, andNHWCstrided contiguous normalization.Executorch::Module(openwith:mmapdefault,Pathname, block cleanup,.ptddata_files,from_bytes,meta,load_method/unload_method,execute/forward/call,close), all 13 numeric/bool dtypes with explicit canonical names (:float32,:int64, etc.), 0-D#item, zero-copyIO::Buffer,out:buffer reuse, symmetricEValuecoercion, runtime introspection (backends,kernel_count,num_threads=), and typedExecutorch::Errorsubclasses carrying#codeand#pal_log.lib/executorch/sdk.rb), fat platform gem packaging (rake package_platformwith$ORIGIN/../vendor/@loader_path/../vendorrpath), launch-readyREADME.md, CI matrix across Linuxx86_64/arm64+ macOSarm64+ Ruby 3.2–3.4 + ASan/UBSan + zero-skip real.pte/.ptdfixtures, and CI-gated OIDCrelease.yml.Calls for Ben to review
[scope]Primary distribution via precompiled fat platform gems (x86_64-linux,aarch64-linux,arm64-darwin) bundling official ExecuTorch 1.6.0 shared libs + auto-fetching source fallback.[scope]Minimum Ruby version raised to>= 3.2.0(forIO::Buffer).[scope]Clean v1.0.0 break:Executorch::ModulereplacesExecutorch::Model; canonical dtypes are explicit-width (:float32,:int64, accepting short aliases on input).Evidence
Init_executorch/_Init_executorch, passes all 32 tests (7 real.pte/.ptdmodels, 0 skips) across Linuxx86_64/arm64& macOSarm64on Ruby 3.2–3.4bundle exec rake compile && bundle exec rake testEXECUTORCH_SANITIZE=1 bundle exec rake compile && bundle exec rake testGEM_HOMEon Linux & macOSbundle exec rake package_platform && gem install --local pkg/executorch-*-*.gemmaster@b03ddcd): Uninstallable from scratch (missing-fPIC, missingmodule.h, Rice 4.12 compile break), 8/59 tests silently skipped (0 executed model tests),rb_raiselongjmpUB, GVL held during inference, portable-only kernels.v1-rewrite@ca36fcff9c85ce6ea55d5607e72e84b50a668c4b): 9/9 CI jobs green (run 44813001012); 32 runs / 247,422 assertions / 0 failures / 0 errors / 0 skips on Linuxx86_64, Linuxarm64, macOSarm64, Ruby 3.2–3.4, and ASan+UBSan; isolated fat-gem smoke tests green on Ubuntu and macOS; localadd_mulzero-copyout:p506.3 µs.Merge Danger
Door: Two-way (prior to publishing v1.0.0 to RubyGems).
Blast Radius: Breaking
Replaces
Executorch::ModelwithExecutorch::Module, changes canonical dtype symbols to explicit widths (:float32,:int64), and raises minimum Ruby to>= 3.2.0. Superseded PR #1 is closed in favor of this PR.