High-performance asynchronous computation framework for system simulation

Overview

Asynchronix

A high-performance asynchronous computation framework for system simulation.

What is this?

Warning: this page is at the moment mostly addressed at interested contributors, but resources for users will be added soon.

In a nutshell, Asynchronix is an effort to develop a framework for discrete-event system simulation, with a particular focus on cyberphysical systems. In this context, a system might be something as large as a spacecraft, or as small as a IoT device.

Asynchronix draws from experience in the space industry but differs from existing tools in a number of respects, including:

  1. open-source license: it is distributed under the very permissive MIT and Apache 2 licenses, with the intent to foster an ecosystem where models can be easily exchanged without reliance on proprietary APIs,
  2. developer-friendly technology: Rust's support for algebraic types and its powerful type system make it ideal for the "cyber" part in cyberphysical, i.e. for modelling digital devices with state machines,
  3. very fast: by leveraging Rust's excellent support for multithreading and async programming, simulation models can run efficiently in parallel with all required synchronization being transparently handled by the simulator.

General design

Asynchronix is an async compute framework for time-based discrete event simulation.

From the perspective of simulation model implementers and users, it closely resembles a flow-based programming framework: a model is essentially an isolated entity with a fixed set of typed inputs and outputs, communicating with other models and with the scheduler through message passing. Unlike in conventional flow-based programming, however, request-response patterns are also possible.

Under the hood, Asynchronix' implementation is based on async Rust and the actor model. All inputs are forwarded to a single "mailbox" (an async channel), preserving the relative order of arrival of input messages.

Computations proceed at discrete times. When executed, models can post events for the future, i.e. request the delayed activation of an input. Whenever the computation at a given time completes, the scheduler selects the nearest future time at which one or several events are scheduled, thus triggering another set of computations.

This computational process makes it difficult to use general-purposes runtimes such as Tokio, because the end of a set of computations is technically a deadlock: the computation completes when all model have nothing left to do and are blocked on an empty mailbox. Also, instead of managing a conventional reactor, the runtime manages a priority queue containing the posted events. For these reasons, it was necessary for Asynchronix to develop a fully custom runtime.

Another crucial aspect of async compute is message-passing efficiency: oftentimes the processing of an input is a simple action, making inter-thread message-passing the bottleneck. This in turns calls for a very efficient channel implementation, heavily optimized for the case of starved receivers since models are most of the time waiting for an input to become available.

Current state

The simulator is rapidly approaching MVP completion and has achieved 2 major milestones:

  • completion of an extremely fast asynchronous multi-threaded channel, demonstrated in the Tachyonix project; this channel is the backbone of the actor model,
  • completion of a custom async executor optimized for message-passing and deadlock detection, which has demonstrated even better performance than Tokio for message-passing; this executor is already in the main branch and can be tested against other executors using the Tachyonix benchmark.

Before it becomes usable, however, further work is required to implement the priority queue, implement model inputs and outputs and adapt the channel.

License

This software is licensed under the Apache License, Version 2.0 or the MIT license, at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You might also like...
A cross-platform graphical process/system monitor with a customizable interface and a multitude of features
A cross-platform graphical process/system monitor with a customizable interface and a multitude of features

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features. Supports Linux, macOS, and Windows. Inspired by both gtop and gotop.

Another TUI based system monitor, this time in Rust!
Another TUI based system monitor, this time in Rust!

Another TUI based system monitor, this time in Rust!

A system clipboard command line tools which inspired by pbcopy & pbpaste but better to use.

rclip A command line tool which supports copy a file contents to the system clipboard or copy the contents of the system clipboard to a file. Install

Simple system monitoring app that runs on terminal. Made purely with Rust.
Simple system monitoring app that runs on terminal. Made purely with Rust.

What is it? RCTOP is a simple WIP system monitoring app that runs purely on terminal and doesn't feature GUI. One can compare it to htop, but more str

Self-contained template system with Handlebars and inline shell scripts

Handlematters Self-contained template system with Handlebars and inline shell scripts Introduction Handlematters is a template system that combines Ha

Modern file system navigation tool on Unix
Modern file system navigation tool on Unix

monat -- Modern file system Navigator 简体中文 Introduction monat is a Unix shell auxiliary command focusing on the navigation of the file system, especia

🌳 A lightning-fast system fetch tool made with Rust.
🌳 A lightning-fast system fetch tool made with Rust.

🌳 treefetch A lightning-fast minimalist system fetch tool made in Rust. Even faster than neofetch and pfetch. Made to practice my new Rust skills 🦀

CLI for the Goki Smart Wallet system.

goki-cli CLI for the Goki Smart Wallet system. Installation First, make sure you have the Solana CLI tools installed. Follow the instructions here. Ne

This is the data collector that gets your system's state and sends it to the backend
This is the data collector that gets your system's state and sends it to the backend

⚡ Installation Linux curl -s https://raw.githubusercontent.com/xornet-cloud/Reporter/main/scripts/install.sh | sudo bash Windows Invoke-Command -Scrip

Owner
Asynchronics
Asynchronics
Source code for our paper "Higher-order finite elements for embedded simulation"

Higher-order Finite Elements for Embedded Simulation This repository contains the source code used to produce the results for our paper: Longva, A., L

Interactive Computer Graphics 18 Sep 30, 2022
High-performance and normalised trading interface capable of executing across many financial venues

High-performance and normalised trading interface capable of executing across many financial venues. Also provides a feature rich simulated exchange to assist with backtesting and dry-trading.

Barter 4 Nov 30, 2022
A modern high-performance open source file analysis library for automating localization tasks

?? Filecount Filecount is a modern high-performance open source file analysis library for automating localization tasks. It enables you to add file an

Babblebase 4 Nov 11, 2022
Macchina - A system information frontend, with an (unhealthy) emphasis on performance.

macchina Fast, minimal and customizable system information frontend. Linux • macOS • Windows • NetBSD • FreeBSD • OpenWrt • Android About macchina let

Macchina CLI 662 Dec 2, 2022
An open source, programmed in rust, privacy focused tool for reading programming resources (like stackoverflow) fast, efficient and asynchronous from the terminal.

Falion An open source, programmed in rust, privacy focused tool for reading programming resources (like StackOverFlow) fast, efficient and asynchronou

Obscurely 16 Sep 25, 2022
rip is a command-line deletion tool focused on safety, ergonomics, and performance

rip (Rm ImProved) rip is a command-line deletion tool focused on safety, ergonomics, and performance. It favors a simple interface, and does not imple

Kevin Liu 751 Nov 29, 2022
png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance.

png_defringe_rs png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance. U

null 2 Nov 17, 2022
Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

Cryptex 12 Nov 30, 2022
Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using ttf-parser and allsorts

rust-fontconfig Pure-Rust rewrite of the Linux fontconfig library (no system dependencies) - using allsorts as a font parser in order to parse .woff,

Felix Schütt 28 Oct 29, 2022