nexigen-csharp
High-performance .NET 9+ core library for simulator platforms. Engineered with a Zero-Allocation architecture for near real-time performance.
- 0
- MIT
- 4 wk ago
Ultra-high performance, cross-platform C++20 core library for real-time systems and simulator platforms. Features lock-free architecture and deep Linux OS integration.
Repo nexigen-tech/nexigen-cpp, read from GitHub 9 min ago. nexigen-tech has not joined Take My Repo.
nexigen-tech/nexigen-cpp is a public repo on GitHub by nexigen-tech. Ultra-high performance, cross-platform C++20 core library for real-time systems and simulator platforms. Features lock-free architecture and deep Linux OS integration. It declares the MIT license on GitHub. It is written mainly in C++, has 0 stars and last changed on 2026-11-22. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-22.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
The backbone of the nexigen ecosystem β an ultra-high performance C++20 core library designed for hard real-time systems and hardware simulator platforms. Purpose-built for minimum latency execution under Ubuntu 26.04 LTS (and modern Linux environments).
epoll, io_uring, POSIX signals, and high-resolution timers).-march=native), and Link-Time Optimization (LTO) for bare-metal execution speed.AppClass framework handling OS signal intercepts and predictable application lifecycles.nexigen::core unit testsZero-dependency harness (tests/core/core_test.cpp, no GTest/Catch2). Tests build by default;
pass -DNEXIGEN_BUILD_TESTS=OFF at configure time to skip them entirely.
Release (production flags: -O3 -march=native + LTO, -Werror):
cmake -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/release
ctest --test-dir build/release --output-on-failure
ThreadSanitizer (data-race check for lock-free queues and atomics):
cmake -B build/tsan -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DNEXIGEN_ENABLE_TSAN=ON
cmake --build build/tsan
ctest --test-dir build/tsan --output-on-failure
AddressSanitizer/UBSan (leaks and out-of-bounds check):
cmake -B build/asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DNEXIGEN_ENABLE_ASAN=ON
cmake --build build/asan
ctest --test-dir build/asan --output-on-failure
All three modes must report 100% tests passed. TSan and ASan are mutually exclusive β
enabling both at once is a configure-time error.
nexigen::core APIHeader-only, C++23, no exceptions/RTTI, no heap allocation on hot paths. Link the
nexigen::core (alias of nexigen_core) INTERFACE target and include what you use:
<nexigen/core/result.hpp> β the error model. ErrorCode (Ok, BufferFull,
BufferEmpty, InvalidArgument, SystemError, NotInitialized, RateLimited),
constexpr to_string/from_string, to_json/from_json (nlohmann::json, non-throwing
under JSON_NOEXCEPTION=1) and std::formatter<ErrorCode>, plus
Result<T, E = ErrorCode> / Status over std::expected. Branch on has_value()
and read via *res / .error() β never value() (it aborts under -fno-exceptions).<nexigen/core/spsc_ring_buffer.hpp> β SpscRingBuffer<T, Capacity>, a
wait-free bounded SPSC queue. Contract: exactly one producer thread calling
try_push and exactly one consumer thread calling try_pop; any other topology
is outside the contract. Capacity is compile-time and a positive power of two
(rejected otherwise). try_push/try_pop each complete in a bounded number of
steps (1β2 loads + 1 store, no CAS loops) β neither end can stall the other.
size()/is_empty()/is_full() are snapshots for diagnostics, not
synchronization, and to_string() renders a cold-path capacity/occupancy dump. The
queue is non-copyable and non-movable: give it static or long-lived object storage.Serialization contract (all modules): every public type exposes a cold-path
std::string to_string() const + free to_string(const T&); every enum class exposes
constexpr to_string/from_string, ADL to_json/from_json and a std::formatter
specialization. The build resolves nlohmann::json via find_package(nlohmann_json QUIET)
with a FetchContent fallback (pinned v3.11.3) and propagates JSON_NOEXCEPTION=1 publicly,
so the JSON vocabulary compiles everywhere under -fno-exceptions. std::string and
nlohmann::json remain strictly cold-path tools β never on a producer or worker hot path.
Usage example (the same setup as the 1M-element stress test in tests/core/core_test.cpp):
#include <cstdint>
#include <thread>
#include <nexigen/core/spsc_ring_buffer.hpp>
int main() {
static nexigen::core::SpscRingBuffer<std::uint64_t, 8192> queue{};
static constexpr std::uint64_t k_count = 1'000'000;
std::uint64_t sent = 0;
std::uint64_t received = 0;
std::uint64_t order_violations = 0;
std::uint64_t producer_retries = 0;
std::uint64_t consumer_retries = 0;
std::jthread producer{[&] {
while (sent < k_count) {
if (queue.try_push(sent).has_value()) {
++sent;
} else {
++producer_retries; // BufferFull: wait-free, retry immediately
}
}
}};
std::jthread consumer{[&] {
std::uint64_t expected = 0;
while (expected < k_count) {
std::uint64_t got = 0;
if (queue.try_pop(got).has_value()) {
if (got != expected) { ++order_violations; } // strictly increasing, no gaps
++expected;
} else {
++consumer_retries; // BufferEmpty: wait-free, retry immediately
}
}
received = expected;
}};
producer.join();
consumer.join();
return (sent == k_count && received == k_count && order_violations == 0) ? 0 : 1;
}
nexigen::chrono APIShared time primitives for the whole ecosystem (include/nexigen/chrono/, src/chrono/,
tests/chrono/). Link nexigen::chrono (alias of nexigen_chrono; it links nexigen::core
transitively β the error model stays in core). Hot paths remain inline, allocation-free and
lock-free; the compiled units are cold-path only.
<nexigen/chrono/timestamp.hpp> β Timestamp, a trivially copyable 8-byte
nanosecond instant from clock_gettime(CLOCK_MONOTONIC_RAW). Total ordering,
saturating subtraction, deadline arithmetic. Timestamp::now() returns
core::Result<Timestamp> β a failed clock read is SystemError, never a silent zero.<nexigen/chrono/stamp_source.hpp> β Stamp_source: a producer-owned,
single-cache-line monotonic nanosecond clock. calibrate() (cold, sleeps ~2 ms) samples
the TSCβnanosecond scale once on x86-64; the inline sample() hot path then costs a
multiply-shift β no syscall β with a per-source clamp that never lets stamps regress and
a Timestamp::now() fallback on other targets. sample_utc_offset() snapshots the
CLOCK_REALTIME β CLOCK_MONOTONIC_RAW offset on cold paths; utc_from_mono_ns()
converts a record stamp to UTC ns on the consumer thread (never CLOCK_REALTIME on
the hot path).<nexigen/chrono/time_format.hpp> β allocation-free UTC civil math: Civil_time,
days_from_utc_ns, civil_from_utc_ns (Howard Hinnant's civil_from_days, correct for
the pre-epoch negative domain), and format_utc_iso8601_ns rendering exactly
YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ (30 chars + NUL into a caller-owned char (&)[31],
years clamped so the buffer can never overflow). No gmtime_r, no timezone or locale
state.nexigen::logging APIZero-virtual logging built on the concepts::Logger structural contract (set_level/level,
the variadic log(LogLevel, FormatWithLocation<Args...>, Args&&...) noexcept -> void entry
point, the six convenience methods (verbose/debug/info/warning/error/fatal) with
implicit source-location capture, and flush() -> Status). Link nexigen::logging
(alias of nexigen_logging) and include what you use:
<nexigen/logging/format_with_location.hpp> β FormatWithLocation<Args...>: the
consteval wrapper pairing a compile-time-checked std::format_string<Args...> literal
with the std::source_location of the caller's statement. Passing a bare literal is the
normal shape; format/argument mismatches are build errors, not runtime paths.<nexigen/logging/log_level.hpp> β LogLevel (Verbose..Fatal, Off, declared in
severity order so relational < is the ordering), constexpr lowercase to_string,
from_string, to_json/from_json (non-throwing under JSON_NOEXCEPTION=1) and a
std::formatter<LogLevel> so std::format("{}", LogLevel::Warning) β "warning".
The runtime threshold is one relaxed-atomic cell per logger: level() is a snapshot, and
a filtered call ends in β 1 ns without touching the ring.<nexigen/logging/log_record.hpp> β LogRecord<Message_capacity = 128>: the fixed
192-byte alignas(64) trivially-copyable payload crossing the producer/consumer boundary β
calibrated monotonic-ns stamp, cached SYS_gettid thread id, extracted source-location
fields, and a deferred format pack: the raw literal pointer, a type-erased render
callback, and serialized arguments in an inline blob (oversized string copies truncate,
flagged; rendering happens on the consumer thread, never the producer).<nexigen/logging/null_logger.hpp> β NullLogger: the zero-cost stub; at -O1+
nothing survives into the emitted code (objdump-pinned by the tests).<nexigen/logging/console_logger.hpp> β ConsoleLogger<Shard_capacity = 128, Message_capacity = 128, Max_threads = 32>:
asynchronous wait-free plain-text sink; Verbose/Debug/Info β stdout, Warning and above β
stderr, via raw ::write (never std::cout/printf, which allocate). The consumer renders
each deferred pack into a pre-allocated line scratch.<nexigen/logging/file_logger.hpp> β FileLogger<Shard_capacity = 128, Message_capacity = 128, Max_threads = 32>:
asynchronous wait-free JSON-lines writer with a CPU-pinned worker (core_mask), lock-free
windowed throttling with per-cause drop counters and automatic drop-summary records, and
hitch-free Hourly/Daily/Custom directory rotation (Rotation_schedule carries the full
enum vocabulary: to_string/from_string/JSON/std::formatter). Wall time is UTC ISO-8601
with nanoseconds, CLOCK_REALTIMEβCLOCK_MONOTONIC_RAW calibrated at init and re-sampled on
rotation/flush.<nexigen/logging/composite_logger.hpp> β CompositeLogger<Loggers...>: variadic
fan-out over a std::tuple with fold expressions, get<Index>()/get<LoggerType>()
sub-logger access, no virtual dispatch; composites nest and the empty pack is valid.Hot-path rules: each asynchronous logger pre-allocates a pool of Max_threads (default 32)
per-thread SPSC shards; up to 32 distinct producer threads may log to one instance, and the
first call on a thread registers its shard once (thread-local slot; steady state never touches
a shared write index). An accepted enqueue β filter, stamp, argument pack, shard try_push β
measures β€ 20 ns median with zero allocations (Release-gated; the bench carries float +
string_view arguments); a filtered call β 1 ns. Producers never block, spin, lock, or
format, and never notice the consumer or another thread's stall. Threads past the pool capacity
are dropped and counted. Cross-thread set_level/level/dropped/pending/writer_*
are relaxed snapshots β diagnostics and configuration, never synchronization.
flush() is a control-plane barrier outside the never-block guarantee: it waits until
every record accepted before the call is written across all shards (and fsync-ed for the
file sink).
Drop semantics β record methods return void; losses surface through the dropped()
snapshot and the in-stream drop summary:
| Counter | Meaning |
|---|---|
dropped().buffer_full |
the calling thread's shard ring was full; the record was not enqueued |
dropped().rate_limited |
throttle budget spent for the window (file sink); the next window opens with a drop-summary record reporting exact per-cause counts |
dropped().slot_exhausted |
more distinct producer threads than Max_threads; extra threads' records are dropped (never blocking, never corrupting a registered shard) |
Every public type carries the project serialization contract too: cold-path
std::string to_string() const + free to_string(const T&) for diagnostics (Timestamp,
Stamp_source, Civil_time, LogRecord, Dropped_stats, the config structs, every logger,
and the ring itself).
Usage example (console + file in a composite, pinned writer, deferred-format calls from two threads):
#include <nexigen/logging/composite_logger.hpp>
#include <nexigen/logging/console_logger.hpp>
#include <nexigen/logging/file_logger.hpp>
#include <nexigen/logging/log_level.hpp>
#include <thread>
int main() {
using namespace nexigen::logging;
// One static composite owns both sinks (static storage: the shard pools are
// non-movable). initialize() is the pre-real-time phase: it calibrates
// clocks and starts each logger's background writer thread.
static CompositeLogger<ConsoleLogger<>, FileLogger<>> app{};
FileLogger_config file_cfg{};
file_cfg.app_name = "hil-demo";
file_cfg.base_dir = "/tmp/hil-logs";
file_cfg.file_name = "sim.jsonl";
file_cfg.initial_level = LogLevel::Info;
file_cfg.rotation.kind = Rotation_schedule::Hourly;
file_cfg.core_mask = 0x1ULL; // pin the JSON writer thread to core 0
if (!app.get<ConsoleLogger<>>().initialize({}).has_value()) { return 1; }
if (!app.get<FileLogger<>>().initialize(file_cfg).has_value()) { return 1; }
// One set_level call re-thresholds the whole tree...
app.set_level(LogLevel::Info);
// ...and per-sink policy stays available through the typed accessor:
app.get<FileLogger<>>().set_level(LogLevel::Warning); // file keeps Warning+
// Formats are checked at compile time; args pack into the record here and
// render on the writer thread β never on this one:
std::thread sim {[]{
for (int tick = 0; tick < 1000; ++tick) {
app.debug("ΠΡΡΠΌΠΎΠΉ Π²ΡΠ·ΠΎΠ² ΠΌΠ΅ΡΠΎΠ΄Π° debug. ΠΠ°Π²Π»Π΅Π½ΠΈΠ΅: {:.4f}", 0.0025);
app.info("Level is {}", LogLevel::Warning); // enums format directly
}
}};
app.error("actuator position drift"); // console + file
sim.join();
// Control plane: wait until everything accepted so far is durable
// (never call this from the real-time producer path).
if (!app.flush().has_value()) { return 1; }
return 0;
}
nexigen::logging unit testsAll four build modes must report 100% tests passed (the numeric β€ 20 ns latency gate is
Release-only; correctness runs everywhere).
Debug (development: -g, assertions, no numeric gates):
cmake -B build/debug -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build/debug
ctest --test-dir build/debug --output-on-failure
Release (production flags: -O3 -march=native + LTO; enables the latency gates):
cmake -B build/release -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/release
ctest --test-dir build/release --output-on-failure
ThreadSanitizer (data-race check for the relaxed level/throttle/flush patterns):
cmake -B build/tsan -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DNEXIGEN_ENABLE_TSAN=ON
cmake --build build/tsan
ctest --test-dir build/tsan --output-on-failure
AddressSanitizer/UBSan (zero-allocation and fixed-buffer safety proof):
cmake -B build/asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DNEXIGEN_ENABLE_ASAN=ON
cmake --build build/asan
ctest --test-dir build/asan --output-on-failure
Self-contained executables demonstrating the public API end to end. They build by
default (NEXIGEN_BUILD_EXAMPLES=ON); pass -DNEXIGEN_BUILD_EXAMPLES=OFF at configure
time to exclude them entirely.
cmake -B build/debug -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build/debug
Run them directly from the build tree (the logging examples write to
/tmp/nexigen-examples-logs/):
./build/debug/examples/core/ex_spsc_ring_buffer
./build/debug/examples/logging/ex_console_logger
./build/debug/examples/logging/ex_file_logger
./build/debug/examples/logging/ex_composite_logger
ex_spsc_ring_buffer β a two-thread telemetry pipeline over
SpscRingBuffer<TelemetryPacket, 1024>: wait-free try_push/try_pop with classified
BufferFull/BufferEmpty outcomes (has_value() / .error(), never .value()),
direct std::format output of ErrorCode, and a final to_string() queue summary.ex_console_logger β ConsoleLogger<> with several std::jthread producers across
all six severities, runtime set_level() filtering, direct LogLevel formatting,
flush(), and dropped() / to_string() diagnostics.ex_file_logger β FileLogger<> writing JSON lines with hourly rotation, CPU core
pinning, a throttle budget, and a UTF-8 Cyrillic message; the example then reads the
generated JSONL file back and verifies it.ex_composite_logger β CompositeLogger<ConsoleLogger<>, FileLogger<>, NullLogger>
with global set_level() fan-out, per-sink configuration through get<Type>() /
get<Index>(), multi-threaded logging, and one unified flush().Every example is also registered as a CTest smoke test (label examples): each must run
to completion and exit with status 0.
ctest --test-dir build/debug -L examples --output-on-failure
Distributed under the MIT License. Created by Vasily Kovrigin.
nexigen-tech/nexigen-cpp is a public repo on GitHub by nexigen-tech. Ultra-high performance, cross-platform C++20 core library for real-time systems and simulator platforms. Features lock-free architecture and deep Linux OS integration.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-22. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
High-performance .NET 9+ core library for simulator platforms. Engineered with a Zero-Allocation architecture for near real-time performance.
Modern async Python library for the nexigen framework. Tailored for simulator scripting, data analytics, and AI-driven automation
A synthetic reality for your hardware. Real-time, multi-interface HIL testbed driven by a zero-copy Rust service mesh.