Skip to content

NodeppOfficial/nodepp-redux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 NodePP Redux - Deterministic State Management for High-Density Systems.

nodepp::redux_t is a header-only C++11 library that implements Silicon-Logic Parity. It provides 64-bit opaque handles with intrinsic arithmetic validation, enabling direct memory access with the security of a managed database.

🧠 The Redux Philosophy

Unlike traditional Hash Maps that suffer from "Hardware Tax" — latency caused by collisions and cache misses — Redux utilizes algorithmic Pointer Authentication Codes (PAC). It transforms memory addresses into secure 8-byte tokens that validate their own integrity in $O(1)$ without ever consulting an external index.

✨ Features

  • Zero-Overhead Abstracted Memory: Memory access at silicon speeds without the risks of raw pointers.
  • O(1) Self-Validating Handles: Integrated 16-bit checksum prevents Use-After-Free and data corruption.
  • Green Computing Ready: Designed for 0% CPU Idle overhead, ideal for ESP32, WASM, and ultra-high-density servers.
  • Agnostic Architecture: Identical behavior across embedded systems and x86_64 architectures.
  • No GC / No Lookup Tables: No garbage collection pauses or search table latency.

🔧 Quick Start

#include <nodepp/nodepp.h>
#include <redux/redux.h>

using namespace nodepp;

struct Player { float x, y; int health; };

void onMain(){

    redux_t<Player> players;
    
    auto h_player = players.create();
    
    players.update({ 100.0f, 200.0f, 100 }, h_player);

    auto p = players.read( h_player );

    if ( p.has_value() ) { auto x = p.value();
         console::log( x.x, x.y, x.health );
    }
    
    players.remove( h_player );
    
}

🛰️ The "Why": Memory as a Protocol

In traditional distributed systems, when you send a request, you store the context in a Lookup Table (HashMap) and wait for a response with a request_id. When the response arrives, the server wastes cycles searching, hashing, and resolving collisions to find the original state.

NodePP Redux changes the game:

  • State to Handle: Instead of a random ID, Redux converts the actual memory pointer of your state into a PAC-Verified Handle ─ Pointer Authentication Code (64-bit token).
  • Opaque Request: You send this 8-byte handle over the wire as your request_id.
  • Direct Recovery: When the hook returns, the handle is the memory address.
  • Zero-Search Validation: Redux validates the handle's integrity in $O(1)$. If it’s valid, you have instant access to your state without a single hash table lookup.

🎯 Benchmarking the Logic

Feature nodepp::redux_t std::unordered_map Raw Pointer
Access Speed $O(1)$ (Direct) $O(1)$ (Average) $O(1)$ (Fastest)
Memory Overhead 0% (No index) High (Hash tables) 0%
Safety PAC Verified Key Existence None (Risky)
Serializability Native (U64) Complex Impossible
Hardware Tax Minimal High (Cache misses) None

🚀 Performance for Microservices

Engineered for c10M scale, redux_t allows millions of entities to coexist in a single process with predictable latencies. It eliminates the "stop-the-world" pauses typical of managed languages like Go or Node.js.

About

NodePP Redux - Deterministic State Management for High-Density Systems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors