From b378e18088399bb70c3f5a005c42bb6d9c692d4e Mon Sep 17 00:00:00 2001 From: miro Date: Tue, 24 Dec 2024 01:49:16 +0000 Subject: [PATCH] more notes --- docs/18_binarization.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/18_binarization.md b/docs/18_binarization.md index d99d240..16bcd71 100644 --- a/docs/18_binarization.md +++ b/docs/18_binarization.md @@ -1,8 +1,8 @@ # Binarization Protocol -The HiveMind Binarization Protocol is designed to efficiently serialize and deserialize structured messages into compact binary formats for network transmission. This document provides a high-level description of the protocol, including its structure, encoding rules, and the rationale behind key design decisions. The binary format is protocol-versioned to support backward compatibility and future extensions. +> ⚠️ **EXPERIMENTAL**: subject to change without warning -> 💡 the binarization scheme allows the hivemind protocol to be implemented by just flashing a light +The HiveMind Binarization Protocol is designed to efficiently serialize and deserialize structured messages into compact binary formats for network transmission. This document provides a high-level description of the protocol, including its structure, encoding rules, and the rationale behind key design decisions. The binary format is protocol-versioned to support backward compatibility and future extensions. ## Protocol Versions @@ -209,22 +209,29 @@ Where: | | | | | | | ``` -A binarized message +A binarized **uncompressed** message + +``` +1 | 1 | XXXXXXXX | XXXXX | 0 | XXXXXXXX | | +``` +A **unversioned** and **compressed** binarized message ``` -1 | 1 | XXXXXXXX | XXXXX | X | XXXXXXXX | | +1 | 0 | XXXXX | 1 | XXXXXXXX | | ``` -A **unversioned** binarized message +A binary **uncompressed** payload message ``` -1 | 0 | XXXXX | X | XXXXXXXX | | +1 | 1 | XXXXXXXX | 01100 | 0 | XXXXXXXX | | XXXX | ``` -A binary payload message +A **unversioned** and **compressed** binary payload message ``` -1 | 1 | XXXXXXXX | XXXXX | X | XXXXXXXX | | XXXX | +1 | 0 | 01100 | 1 | XXXXXXXX | | XXXX | ``` +> 💡 the binarization scheme allows the hivemind protocol to be implemented by just flashing a light + ## Compression Metrics Compression significantly reduces payload size for larger messages but is not always efficient for small messages. Benchmarks indicate a reduction of up to **50%** for text-heavy payloads, while small payloads may see negligible benefits.