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.1.1-cp314-cp314t-manylinux_2_28_x86_64.whl (43.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

rulex_runtime-0.1.1-cp314-cp314-manylinux_2_28_x86_64.whl (43.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

rulex_runtime-0.1.1-cp313-cp313t-manylinux_2_28_x86_64.whl (43.4 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ x86-64

rulex_runtime-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl (43.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

File details

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

File metadata

File hashes

Hashes for rulex_runtime-0.1.1-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 94e5c4dde525f0ed0178b75373ba8a2b604f842cc9f07f62c66a18d15f1d38df
MD5 e905b265a5c92736bfb0745f88501af4
BLAKE2b-256 7cea64e27640c7184f3c43cb50cce9108eb09655360b7650e974fbff8c4decf7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rulex_runtime-0.1.1-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6d7e26ced2576fc10c3049f68140ef032296a9f5aaa4c4cbc4137a08cc1e05c7
MD5 98a4417128611cb94fb0fe54d96e284a
BLAKE2b-256 7b04626287ad676cb26fbd4755232608374e01be5a36f774887fdc8b77b6d4f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rulex_runtime-0.1.1-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 490fde37d5068446e3e08c3264960e6418868a0f7c62066298e410b4f61f48c7
MD5 919f6a37cf9dc058a232a295ac5a6fe0
BLAKE2b-256 ccfd763893f209b983b31f816efa80adbda7017156d9f4029c2835d80bffeff9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rulex_runtime-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 29818f9d3ea352d920d9869bd35d171007eef4de56c15636d7f41e5625ce9ed0
MD5 449b0ce70802a12a024074cd582597af
BLAKE2b-256 5abbe7d896a73495a463374bf8e2f43370adf264bae2a3bcf1ba552e9cce772a

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