The CVL CORE Sidecar IPC Bus governs crash-isolated, out-of-process communication between the Authoritative Spatial Micro-Kernel and auxiliary domain microservices on loopback port 127.0.0.1:55557. All non-spatial application workloads—including relational persistence, ledger accounting, chat networks, and external REST/ERP connectors—execute in autonomous operating system processes, isolating the 30Hz simulation heartbeat from blocking database I/O and external faults with 0.00 ms tick overhead.
Monolithic simulation and game servers routinely suffer from tick starvation and frame jitter because database queries, HTTP calls, and chat fan-out execute in-process on the main simulation thread. When a relational query blocks or an external API stutters, the physics frame budget collapses.
CVL CORE eliminates this failure mode by enforcing a strict Transport-Only Server Boundary. The spatial micro-kernel operates purely as a domain-agnostic coordinate conductor; it holds zero internal awareness of banking schemas, inventory tables, or chat channels. Auxiliary services run as independent operating system processes communicating across loopback TCP (127.0.0.1:55557).
SIDECAR_MAX_PAYLOAD_SIZE = 4096 bytes), and routes OP_GAME_EVENT binary frames directly into the lock-free Sidecar Ingress Conduit without waking or stalling the Authoritative Simulation Orchestrator.127.0.0.1:55557): An isolated background daemon thread owning a dedicated OS I/O selector. The broker authenticates external sidecar processes via constant-time SHA-256 HMAC digests, indexes services in O(1) time across a fixed 256-slot routing table, and bridges responses directly back to the client egress pipeline.chat_service.py, banking_service.py, or custom enterprise connectors) built on the zero-dependency BaseSidecarService SDK (sidecar_sdk.py) that execute transactional logic and database writes completely outside the 30Hz frame budget.Rather than deploying monolithic engine containers that consume 1.5 GB to 4.2+ GB of RAM, the CVL CORE multi-process stack locks the spatial micro-kernel under Sub-55.0 MB Linux VmRSS (~54.4 MB verified VPS baseline) while external sidecars scale cleanly based on your chosen language stack:
| Component Process | Process Boundary | Memory Footprint (VmRSS) |
Operational Responsibilities |
|---|---|---|---|
| CVL CORE Spatial Micro-Kernel | Primary Headless Daemon (cvlcore_engine) |
~54.4 MB (Locked Flatline) | 30Hz spatial kinematics, 9-cell broadphase, anti-cheat authority, IPC router. |
| Reference Chat Sidecar | Subprocess (chat_service.py) |
~25.0 – 30.0 MB | Global broadcasts, targeted private whispers, rotational channel logs. |
| Reference Banking Sidecar | Subprocess (banking_service.py) |
~30.0 – 35.0 MB | SQLite WAL ledger transactions, atomic 64-bit currency accounting. |
| Reference Bug Report Sidecar | Subprocess (bug_report_service.py) |
~25.0 – 30.0 MB | In-world QA telemetry capture, JSONL audit logs, async Discord/Slack webhooks. |
| Total Node Stack (Python Stack) | Complete Host Footprint | ~145.0 MB – 175.0 MB | Full multi-process node operating comfortably on a $19.60 AUD/mo VPS. |
(For complete node RAM projections using C# (.NET), C++ / Rust / Go native sidecars, or a co-hosted PostgreSQL / Redis instance, see FAQ // 07.)
All OP_GAME_EVENT traffic bypasses the 30Hz simulation loop on both ingress and egress. The Asymmetric Network Reactor and the Sidecar IPC Broker communicate exclusively via lock-free Single-Producer Single-Consumer (SPSC) queues passing immutable byte slices and authenticated 16-byte EID tokens.
+-----------------------------------------------------------------------------------+| CLIENT PRESENTATION BRIDGE (SDK) || [CVLEngineAPI.SendGameEvent] ---> Packs 7B Wire Header + Payload (OP_GAME_EVENT) |+-------------------------------------------------|---------------------------------+ | TCP Ingress (Port 55555) v+-----------------------------------------------------------------------------------+| CVL CORE ASYMMETRIC NETWORK REACTOR || [Zero-Copy Binary Stream Reader] || |-- Validates Outer Frame (4B <= Payload <= 4096B) || +-- Bypasses 30Hz Simulation Orchestrator (0.00ms Tick Impact) || | || +---> Enqueues (NetID, 16B Auth EID, Raw Slice) || | || v [Sidecar Ingress Conduit] || || [SIDECAR IPC BROKER DAEMON (Loopback 127.0.0.1:55557)] || |-- Dedicated Non-Blocking OS Selector || |-- O(1) 256-Slot Service Routing Table (Indexed by uint8 Service ID) || +-- Unmapped / Offline Slot? ---> Immediate 1.37ms Fast-Fail Bounce (0x07) |+----------------------|---------------------------------------------------^--------+ | Forward IPC Frame (24B Header) | Egress Response (23B Header) v |+--------------------------------------------------------------------------+--------+| CRASH-ISOLATED OUT-OF-PROCESS SIDECAR DAEMONS || || [Chat Service (Service ID 0x01)] [Banking Ledger Service (Service 0x02)]|| |-- Global Broadcast (0x01) |-- Balance Inquiry (0x01) || |-- Private Whisper (0x03) |-- Atomic Deposit (0x02) || +-- Rotational Chat Log Persistence +-- Atomic Withdrawal (0x03 - WAL) |+-----------------------------------------------------------------------------------+3.0s Gate)To prevent unauthorized local processes from binding to the IPC bus, every sidecar daemon connecting to 127.0.0.1:55557 must complete a cryptographic handshake within a strict 3.0-second window:
serviceId (0 to 255) and a 32-byte SHA-256 digest of the shared SIDECAR_AUTH_TOKEN.serviceId inside the broker’s fixed 256-slot routing array. Handshake failures or timeouts (> 3.0s) sever the connection immediately and record a loopback security strike.1.37 ms RTT)If a client dispatches an OP_GAME_EVENT request targeting a serviceId slot that is currently unmapped (or if an external microservice crashes mid-operation), the Sidecar IPC Broker never stalls or drops the client request silently. Instead, the broker immediately synthesizes an 8-byte OP_GAME_EVENT response carrying STATUS_ERR_SERVICE_OFFLINE (0x07) and routes it directly to the client’s Critical FIFO Buffer. Automated fault benchmarks verify end-to-end client offline bounce notifications in 1.37 ms RTT with 0.00 ms impact on the 30Hz simulation loop.
NetID Recycling SafetyIn high-concurrency servers where unsigned 16-bit NetID tokens are recycled immediately upon disconnect, routing asynchronous database callbacks by NetID creates a severe race condition: if Client A initiates a slow 150 ms database write, abruptly disconnects (TCP RST), and Client B connects and inherits the recycled NetID while the query is still in flight, a naive server will deliver Client A’s private response to Client B.
Client A (NetID: 42, EID: "P_ALICE") ====> [ Dispatches 150ms Ledger Query ] | +---> Abrupt Disconnect (TCP RST) ---> NetID 42 Recycled Immediately! | Client B (NetID: 42, EID: "P_BOB") <---------------+ (Inherits NetID 42)
[ 150ms Ledger Query Completes ] | +---> Sidecar returns 23B Egress Header targeting EID "P_ALICE" IPC Broker queries Active Socket Registry for "P_ALICE" ---> None! Result: Frame dropped safely. Client B (NetID 42) receives 0 leaked bytes.CVL CORE eliminates this vulnerability by routing all Sidecar IPC responses strictly by the immutable 16-byte permanent EID string, never the transient NetID. If the originating EID has disconnected while the sidecar transaction was in flight, the active socket lookup resolves to None and the stale response is discarded cleanly.
The Sidecar pipeline utilizes three fixed-header binary envelopes across the client-to-broker and broker-to-sidecar boundaries, encapsulated inside the standalone sidecar_sdk.py developer library.
OP_GAME_EVENT — 7 Bytes + Payload): Encapsulates the outer opcode, 16-bit wire length, 8-bit serviceId, 8-bit subOpcode, and 16-bit requestId.24 Bytes + Payload): Appends the server-authenticated auth_net_id and permanent 16-byte auth_eid so the sidecar never relies on client-asserted identity strings.23 Bytes + Payload): Specifies the 16-byte Target EID (or the 0xFFFF broadcast sentinel), serviceId, subOpcode, requestId, and 1-byte Status Code.Target EID field with a specific entity handle for point-to-point replies, or supply the broadcast sentinel NET_TARGET_BROADCAST_ALL (0xFFFF) to fan the payload out to all active entities via the Asymmetric Network Reactor.1 Byte):
0x00 STATUS_OK: Operation completed successfully.0x01 STATUS_ERR_GENERIC: Unhandled internal sidecar exception.0x02 STATUS_ERR_NOT_FOUND: Target entity, record, or item does not exist.0x03 STATUS_ERR_NO_FUNDS: Insufficient account balance or capacity.0x06 STATUS_ERR_RATE_LIMIT: Request throttled by sidecar rate governor.0x07 STATUS_ERR_SERVICE_OFFLINE: Target microservice slot is offline (synthesized automatically by the broker).chat_service.py)Built on BaseSidecarService (sidecar_sdk.py), the reference Chat daemon binds to Service ID 0x01 and processes public broadcasts (Sub-Opcode 0x01), targeted private whispers (Sub-Opcode 0x03), and administrative alerts (Sub-Opcode 0x04) while persisting audit trails to rotational log files:
from sidecar_sdk import BaseSidecarService, STATUS_OK
chat_service = BaseSidecarService(service_id=0x01, service_name="ChatService")
@chat_service.on_action(sub_opcode=0x01)def handle_global_say(auth_eid: str, req_id: int, payload: bytes) -> None: message_text = payload.decode("utf-8", errors="ignore") broadcast_payload = f"[{auth_eid}]: {message_text}".encode("utf-8")
# Fan out to all active entities via the 0xFFFF broadcast sentinel chat_service.broadcast(req_id, STATUS_OK, broadcast_payload, sub_opcode=0x01)
@chat_service.on_action(sub_opcode=0x03)def handle_private_whisper(auth_eid: str, req_id: int, payload: bytes) -> None: decoded = payload.decode("utf-8", errors="ignore") if "|" not in decoded: return target_eid, msg = decoded.split("|", 1) whisper_bytes = f"[Whisper from {auth_eid}]: {msg}".encode("utf-8")
# Route point-to-point strictly by permanent 16-byte EID handle chat_service.send_reply(target_eid, req_id, STATUS_OK, whisper_bytes, sub_opcode=0x03)banking_service.py)The reference Banking daemon binds to Service ID 0x02 and implements ACID-compliant 64-bit currency accounting (uint64) backed by SQLite in Write-Ahead Logging mode (PRAGMA journal_mode=WAL;), supporting balance inquiries (0x01), deposits (0x02), and overdraft-protected withdrawals (0x03):
from sidecar_sdk import ( BaseSidecarService, STATUS_OK, STATUS_ERR_NO_FUNDS, pack_uint64, unpack_uint64,)
banking_service = BaseSidecarService(service_id=0x02, service_name="BankingService")
@banking_service.on_action(sub_opcode=0x03)def handle_withdraw(auth_eid: str, req_id: int, payload: bytes) -> None: withdraw_amount = unpack_uint64(payload)
with db_transaction_cursor() as cur: cur.execute("SELECT balance FROM accounts WHERE eid = ?", (auth_eid,)) row = cur.fetchone() current_bal = row[0] if row else 0
if current_bal < withdraw_amount: # Atomic rejection: Insufficient funds (zero balance mutation) banking_service.send_reply( auth_eid, req_id, STATUS_ERR_NO_FUNDS, pack_uint64(current_bal), sub_opcode=0x03 ) return
new_bal = current_bal - withdraw_amount cur.execute("UPDATE accounts SET balance = ? WHERE eid = ?", (new_bal, auth_eid)) banking_service.send_reply( auth_eid, req_id, STATUS_OK, pack_uint64(new_bal), sub_opcode=0x03 )The Sidecar IPC Bus is verified under adversarial load using the automated fault-tolerance test suite:
| Benchmark Test Vector | Test Condition | Observed Result | Architectural Invariant Verified |
|---|---|---|---|
| High-Throughput RPC Burst | 2,000 rapid RPC frames alternating between ledger queries and offline bounces. | 7,500+ RPC/sec sustained (2,000 / 2,000 replies in ~240 ms). |
0.00 ms degradation of the 30Hz simulation loop; zero dropped frames. |
| Fast-Fail Offline Bounce | Dispatching client RPCs to an unmapped test service (0x99). |
1.37 ms end-to-end client return with STATUS_ERR_SERVICE_OFFLINE (0x07). |
Unregistered service slots fail fast without stalling client state. |
| Mid-Transaction Disconnect | Firing a 150 ms query followed immediately by a hard TCP RST (SO_LINGER=0). |
0 leaked frames delivered to the subsequent peer inheriting the recycled NetID. |
Canonical 16-byte EID routing prevents cross-session data leakage. |
| Overdraft Protection | Requesting withdrawal of 99,999,999 units on an account holding 500 units. | Immediate STATUS_ERR_NO_FUNDS (0x03); ledger balance unchanged. |
Atomic SQLite WAL transaction rollbacks preserve financial parity. |
Developers do not have to hand-roll raw socket framing or write backend boilerplate from scratch:
BaseSidecarService in sidecar_sdk.py) handling SHA-256 HMAC authentication, binary framing, and EID-keyed routing out of the box, bundled with three stress-tested reference microservices (Chat, and Atomic SQLite WAL Banking).~10–20 MB) native microservices.CVLSetupWizard to emit matching C# client stubs and sidecar handlers automatically.Maintaining deterministic isolation between the 30Hz spatial micro-kernel and external sidecar processes requires strict adherence to payload sizing, status code boundaries, and identity routing rules.
4,096 Bytes)Individual OP_GAME_EVENT payloads are strictly bounded between a minimum of 4 bytes (the inner client routing header) and a maximum of SIDECAR_MAX_PAYLOAD_SIZE = 4096 bytes. If a client transmits an OP_GAME_EVENT envelope outside [4, 4096] bytes, the Asymmetric Network Reactor immediately records an IP violation strike and severs the connection prior to queuing.
The server core and ProtocolConstants.cs define strictly transport-level invariants (SIDECAR_IPC_PORT = 55557, SIDECAR_MAX_PAYLOAD_SIZE = 4096, broadcast sentinels, and transport status codes 0x00, 0x01, 0x06, 0x07). Domain-specific service identifiers (SERVICE_CHAT = 0x01, SERVICE_BANKING = 0x02) and application status codes (STATUS_ERR_NOT_FOUND = 0x02, STATUS_ERR_NO_FUNDS = 0x03, STATUS_ERR_BAG_FULL = 0x04, STATUS_ERR_COOLDOWN = 0x05) are excluded from the micro-kernel and reside exclusively in sidecar_sdk.py and client application scripts.
EID BindingRelational database drivers, file I/O, and external HTTP requests must never be imported or executed inside the main simulation process. Furthermore, sidecar database tables and in-memory caches must key records exclusively by the permanent 16-byte EID string (auth_eid) rather than auth_net_id, guaranteeing immunity against NetID recycling during rapid reconnection cycles.
1. Zero In-Process Blocking: Never run SQL queries, disk I/O, or HTTP calls inside the 30Hz micro-kernel; always deploy auxiliary logic as an out-of-process Sidecar on 127.0.0.1:55557.
2. Key by 16-Byte EID (Never NetID): Always index database tables and send replies using auth_eid to prevent stale transaction delivery when uint16 NetID tokens recycle.
3. Respect the 4,096-Byte Envelope Cap: Keep OP_GAME_EVENT payloads within 4 to 4,096 bytes to avoid inline reactor flood strikes and socket severance.
Client developers dispatch and receive Sidecar RPC payloads through CVLEngineAPI.SendGameEvent and CVLEngineAPI.OnGameEventReceived using zero-allocation ReadOnlySpan<byte> slices leased from ArrayPool<byte>.Shared.
CVLEngineAPI.cs)using System;using System.Text;using UnityEngine;using CVLCore.SDK;
public class SidecarClientBridge : MonoBehaviour{ private const byte SERVICE_CHAT = 0x01; private const byte SUB_OP_GLOBAL_SAY = 0x01; private ushort _requestSeq = 1;
private void OnEnable() { CVLEngineAPI.OnGameEventReceived += HandleSidecarEvent; }
private void OnDisable() { CVLEngineAPI.OnGameEventReceived -= HandleSidecarEvent; }
public void SendGlobalChatMessage(string message) { // Stack-allocate UTF-8 bytes (capped well below SIDECAR_MAX_PAYLOAD_SIZE = 4096) Span<byte> utf8Buffer = stackalloc byte[256]; int byteCount = Encoding.UTF8.GetBytes(message.AsSpan(), utf8Buffer);
CVLEngineAPI.SendGameEvent( serviceId: SERVICE_CHAT, subOpcode: SUB_OP_GLOBAL_SAY, requestId: _requestSeq++, payload: utf8Buffer.Slice(0, byteCount) ); }
private void HandleSidecarEvent( byte serviceId, byte subOpcode, ushort requestId, byte statusCode, ReadOnlySpan<byte> payload) { if (statusCode == (byte)SidecarStatusCode.ServiceOffline) { Debug.LogWarning($"Sidecar Service 0x{serviceId:X2} is currently offline (Fast-Fail 0x07)."); return; }
if (serviceId == SERVICE_CHAT && subOpcode == SUB_OP_GLOBAL_SAY && statusCode == 0x00) { string chatLine = Encoding.UTF8.GetString(payload); Debug.Log(chatLine); } }}OP_GAME_EVENT): Review the outer binary wire contract and payload encapsulation rules on the Authoritative Binary Wire Protocol & Master Opcodes page.CVLEngineAPI event surface (OnGameEventReceived, SendGameEvent, and ArrayPool<byte> lifecycle management), see Public Delegation Broker & Telemetry Controller.