MyNixOS website logo
Description

Data serialization, communication, and operation verification implementation.

Please see the README on GitHub at https://github.com/athanclark/symbiote#readme

Symbiote

Iteration of the Symbiotic-Data Test Suite.

This project aims to be a network agnostic and data format agnostic serialization verifier - it's main purpose is to verify that data, operations on that data, and serialization of that data is all consistent for multiple platforms. This project defines a trivial protocol that can be re-implemented in any platform, over any network medium.

How the Protocol Works

It's a pretty simple idea:

Setting

Basically, the test suite envolves two peers - we'll call them Peer A and Peer B, and they're connected by some network. Likewise, they are both using (possibly different) systems, which we've denoted as Lang A (like Haskell) and Lang B (like PureScript / JavaScript).

The goal of this suite is to ensure that the same idea defined on these different platforms have the same representation - both operationally (i.e., QuickCheck laws) and through some encoding (like printing the data to JSON or a ByteString).

In the diagram above, each system has some idea of what "Type T" looks and feels like, but could be completely different implementations on each system. Again, though, we care about their outcome being identical; so we disambiguate the idea from the data.

Protocol

The first step in the protocol is for the generating party (Peer A) to generate an instance of Type T, and an operation on that type - this operation, too, needs a serialization implementation (but for most intents and purposes, the implementation will be only for the scope of use with this test suite).

Peer A then does two things: it serializes both the operation and instance to the network-acceptable format, and it "performs" the operation on that instance to get an expected result. Basically, Peer A is using Peer B as a remote procedure call for that operation, and verifying that the result obtained remotely is identical to the result obtained locally.

Remote Procedure Call

As just stated, Peer A then sends the serialized instance and operation to Peer B over that network, where Peer B decodes the data, and performs the operation. Peer B then encodes the result, and sends it back to Peer A.

Verification

Peer A now receives the performed data from Peer B, and can now decode it, and test to see if it is equal to the expected result. If it is, it will tell Peer B that it's "their turn" to generate data.

All of this relies on QuickCheck to generate the data - with the size of the generated data increasing at each step, until a maximum is reached (which is clarified in the documentation).


For an example, check out the tests - they are performed both locally in an asynchronous channel, and remotely with its sister package - purescript-symbiote.

Metadata

Version

0.0.5

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows