Skip to main content

Runtime engine to power RuleX APIs

Project description

rulex-runtime

Runtime engine powering the RuleX APIs. Executes pre-compiled WASM rule modules with high performance via LLVM-backed AOT compilation.

Features

  • Execute compiled rule modules (.wasmu) against spreadsheet-like cell inputs
  • AOT-compiled WASM via LLVM for maximum execution performance
  • Multi-version executor support — artifacts are version-locked and multiple executor versions are bundled
  • Thread-safe, concurrent execution
  • Supports free-threaded Python (3.13t, 3.14t)

Requirements

  • Linux x86_64 or aarch64
  • Python 3.13+

Usage

import rulex_runtime

# Initialize the runner (optionally specify max concurrency)
runner = rulex_runtime.initialize()

# Load a pre-compiled .wasmu artifact
with open("rule.wasmu", "rb") as f:
    wasmu_bytes = f.read()

# Compile a .wasm module to a portable .wasmu artifact
with open("rule.wasm", "rb") as f:
    wasm_bytes = f.read()

version, wasmu_bytes = rulex_runtime.compile_wasm(wasm_bytes)

# Get a calculator for a specific interface and executor version
# Interface version is currently fixed to 1
calculator = runner.get_calculator((1, version), wasmu_bytes)

# Run a calculation
cell_ref = rulex_runtime.CellRef("Sheet1", "A1")
result = calculator.run(
    inputs=[(cell_ref, 42)],
    outputs=[cell_ref],
)
print(result.output)
print(result.cacheable)

Concurrency

Calculator is thread-safe. calculator.run() is fully isolated and does not mutate any shared state, so it can be called concurrently from multiple threads with different inputs and outputs.

The concurrency parameter to initialize() controls the size of the executor thread pool. It should not exceed the total number of physical CPU cores on the machine. When running the runtime across multiple processes, ensure that the sum across all processes respects this constraint:

process_count × concurrency ≤ physical_cpu_count

Supported Versions

rulex_runtime.SUPPORTED_VERSIONS is a frozenset of (interface version, executor version) tuples indicating which executor versions are available. The latest is always used for new compilations.

License

Proprietary — Copyright © CoverStack Technologies. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rulex_runtime-0.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

rulex_runtime-0.2.0-cp314-cp314-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

rulex_runtime-0.2.0-cp313-cp313t-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ x86-64

rulex_runtime-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl (38.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

File details

Details for the file rulex_runtime-0.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rulex_runtime-0.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c813de5de641b27ab382d689c0615d211277cbdb78bd53aba8c005d3e7d775bf
MD5 22569f37cb6014ed24cacd067c473fae
BLAKE2b-256 04a6fe02e5aa12fb09b832af1ee4f7bc9d6095cce664db31f0e6015b50b78b84

See more details on using hashes here.

File details

Details for the file rulex_runtime-0.2.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rulex_runtime-0.2.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 de2f80a0f40da5b4d1e3600b23a30250b87f0d02421504ecd414a21b1ac6ac60
MD5 e93e7c55509d3096107e0964ff1aa037
BLAKE2b-256 c664e715c27e2efd80bfef62386fc5ba47db189a319a3f79bc6832e5da61f51b

See more details on using hashes here.

File details

Details for the file rulex_runtime-0.2.0-cp313-cp313t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rulex_runtime-0.2.0-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 332c5523b4263119578f9742e63ae0ed7593bff5f42f65aafcf38ddcb3d2d450
MD5 6722c735ba7d41069bf3de3b0edb1569
BLAKE2b-256 0a0ea9dfc930835bb55ccacb209fdc6e4cad1c0d5e3ab404f85c23e33c8316d9

See more details on using hashes here.

File details

Details for the file rulex_runtime-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rulex_runtime-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b411f085f348ca8f81ca26f771974c4cc9aa12d14ee410adb49abc424ca5481b
MD5 287bb4fc434d1bfb899dcc784b2bad70
BLAKE2b-256 d4eb8ebf2d42808e05e99bd93708065931d23852b5d02648eba99d2c3a7dc63a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page