CompiledModule#

class brainevent.CompiledModule(so_path, function_names)[source]#

A compiled module loaded from a shared library.

Each function listed at compilation time has a corresponding extern "C" symbol be_<name> in the .so. These are loaded via ctypes and wrapped for use with the JAX FFI system.

Parameters:
  • so_path (str) – Path to the compiled .so shared library.

  • function_names (list[str]) – User function names whose FFI handler symbols to resolve.

property content_hash: str#

SHA-256 (first 16 hex) of the loaded .so bytes.

This is the content identity of the artefact, used as part of the FFI registration key (finding 4): two libraries built from different source (or with a different wrapper ABI) at the same cache path have different content hashes, so re-registration is not mistaken for an idempotent no-op. Computed lazily and memoised — the file is read at most once per module (the “cold path”); an unreadable file degrades to a path-based sentinel rather than raising.

property function_names: list[str]#

Names of available functions.

get_handler(name)[source]#

Return the ctypes function pointer for an FFI handler.

Parameters:

name (str) – User function name (without the be_ prefix).

property path: str#

Path to the loaded .so.