Definition (Builder -> immutable shared MachineDef):
- Named hierarchical states, events by name or enum identifier (P2996),
states_from_enum, initial/parallel composites, shallow/deep history,
deferred events, per-state timeouts, guards, entry/exit/transition
actions (coroutine Task<void> or sync, wrapped), internal transitions.
- build() validates (initial children, transition endpoints) and
flattens into index-addressed vectors with depth info for LCA.
Machine (one consumer, many producers):
- post() is lock-free from any thread: Vyukov MPSC push + counting-
semaphore park/wake; the single consumer (owned worker, or embedder
via run_pending) owns all mutable machine state with zero locks.
- Observation via seqlock over a trivially-copyable StateSnapshot of
active leaves; readers retry, writer is wait-free, no heap.
- Run-to-completion: innermost-first transition resolution per region,
LCA-based exit/entry ordering, history snapshotted at exit time,
deferred events re-injected FIFO after each state change, timers via
deadline park (generation counters kill stale fires), orthogonal
regions dispatched independently on the single consumer.
- co_await machine.send(ev) / send_wait() resolve with SendResult after
the step; actions are driven to completion on the consumer's
ManualExecutor before the step ends.
- swap_definition: atomic<shared_ptr> definition swap between steps;
identical active-leaf names adopt seamlessly (no entry re-runs, queue
intact), otherwise initial configuration; history remapped by name.
- serialize_state()/restore_state(): JSON by state *names* for
hot-reload and persistence; restore re-activates silently.
- start() returns only once the initial configuration is entered.
40 new tests: semantics (ordering, guards, internal/self transitions),
hierarchy + both history kinds, defer FIFO, parallel regions, timers,
coroutine actions, awaitable/blocking send, serialize/restore round
trips, seamless + fallback hot swap, and stress: 8 producers x 10k with
per-producer FIFO assertion, 4-reader seqlock tear check, 50 definition
swaps under sustained load. Green under ASan+UBSan, stable across
repeated runs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Void::Log facade (header-only, macro-free):
- Leveled function templates trace/debug/info/warn/error/fatal(module,
fmt, args...) with lazy formatting - a disabled call is one relaxed
atomic load, no allocation, no formatting.
- Global min level + per-module overrides (can raise or lower); empty
sink/Disabled level = logging fully off; set_sink remains the splice
point for external logging libraries.
Void::Logging::Logger - async by default, one class for both modes:
- Mode::Async (default): lock-free MPSC queue + logger-owned worker
delivering batches via on_flush outside any lock; Immediate/Buffered
give synchronous behavior via constructor arg or set_mode at runtime.
- Bounded queue with OverflowPolicy{Block, DropNewest, DropOldest};
flush() (now virtual) blocks until everything submitted is delivered;
base destructor only stops/joins the worker, never touches virtuals.
- Fixed a wakeup race: stale park token + fresh release overflowed the
binary semaphore; wakeup is a counting semaphore (spurious wakes are
absorbed by the worker loop).
New sinks and formatters:
- RotatingFileLogger (size-based rotation, max-files cap), NullLogger,
CallbackLogger, MultiLogger (tee via new Logger::relay), SyslogLogger.
- Formatter interface: PatternFormatter ({time}/{level}/{scopes}/...),
JsonLinesFormatter, LogfmtFormatter; installable on Console/File/
Rotating sinks. Console/File sinks now default to Async.
- Logging::from_config builds the whole sink tree from Config keys;
apply_facade_config drives facade levels.
Configuration:
- Typed get_as<T>/get_or_as<T> (numbers, bool spellings, enums by name,
chrono durations), dotted keys, subtree(), sorted keys().
- New sources: from_env_prefix (APP_LOG__LEVEL -> log.level), from_ini
(sections as prefixes), from_json (objects/arrays flattened),
from_args (--key=value / --key value / --flag).
- Bind.hpp: reflection bind<T>(cfg, prefix) fills aggregates; defaults
in the struct are the schema; nested aggregates, optional, vector.
- Watch.hpp: ConfigWatch reloads on change with per-key diff; parse
failures keep the previous config.
System: new FileSystem::FileWatcher - debounced polling watcher (stable
mtime+size across N polls), callbacks off-thread, deletion events;
shared groundwork for plugin hot-reload.
Sweep: all internal Void::Log::log call sites migrated to the leveled
API ("Umbrella.Feature" labels); Plugin loader now logs load/reload.
918 tests green (28 new), stable across 30 consecutive runs, ASan+UBSan
clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Async (Void::Async):
- MpscQueue<T>: unbounded Vyukov multi-producer/single-consumer queue.
Wait-free push (XCHG + store, no CAS loop); consumer-owned reclamation so
no hazard pointers and no ABA. The transient mid-link empty window is
documented; try_pop/empty are re-poll hints.
- Executor/ManualExecutor: minimal scheduling bridge for Coro::Task with
lock-free post() from any thread and single-thread run_one()/drain();
schedule_on() awaitable and spawn() for detached task launch with a
self-destroying wrapper frame.
Data (Void::Json):
- Reflect.hpp: P2996 to_json/from_json for aggregate structs (field-name
keys; arithmetic/bool/string/enum-by-name/vector/optional/string-map/
nested aggregates), tolerant deserialization (unknown fields ignored,
missing fields keep defaults, mismatches report dotted field paths).
- Versioned envelopes {"__version", "data"} with StateTraits<T> and
MigrationChain for stepwise schema upgrades - groundwork for plugin
hot-reload state transfer.
- Member to_json/from_json customization wins over reflection and is the
only path on compilers without <meta> (Reflectable is false there).
Verified with GCC 16.1 (-freflection): 25 new tests including an
8-producer x 100k MPSC stress with per-producer FIFO assertion, coroutine
frame lifetime checks, and a 3-step v1->v3 migration; suite green under
ASan+UBSan.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Headers move, CMake targets merge, C++ namespaces stay unchanged:
- Core: Scope, Lazy, Counted, Flags, Hash, Bits, Uuid, TypeList, TypeMap, Variant
- Functional: Pipeline, Either, Result, Retry
- Containers: Ring, Pool, PriorityQueue, LRU, Trie, Graph, DisjointSet, Bitset, Interval
- Math: +Matrix, Numeric, Random, Histogram
- Text: Str, Format, Tokenizer, Diff, Encoding, Semver
- Data: Json, Csv, Ini
- Async: Coro, Concurrency, EventBus, Observable
- Time: +Bench
- Log: Log facade + Logging framework (facade now header-only, breaking
the Stacktrace<->Log link cycle the merge would have created)
- System: FileSystem + Process
- Configuration: +Argparse
- Unchanged: Stacktrace, Plugin, StateMachine, Testing, TestingMock, Detail
Module system fixes:
- OPTIONAL_DEPS resolution deferred to void_finalize_modules() so it no
longer depends on the alphabetical discovery order of src/ subdirs
(Testing -> Text would have been silently dropped).
- Every header-only module now has a tracked module.cmake; previously the
empty src/<Name> marker dirs were untracked, so a fresh clone would have
silently skipped those modules.
- VOID_HAS_LOGGING/CONCURRENCY/STR consumers renamed to LOG/ASYNC/TEXT.
Tests move to tests/standalone/<Umbrella>/<Feature>.cpp (Result suite files
prefixed: ResultBasic etc.). Test count verified identical (831) before and
after. README/CLAUDE.md module tables updated.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Completes the in-progress merges (Optional->Either/Opt, Curry+Memo->Pipeline,
ScopeGuard->Scope, String->Str):
- Pipeline/Memo.hpp now carries the full Memo API (memoize with recursion
support, TupleHash, SimpleCache) alongside memoize_fn; old Memo module
and its test dir removed.
- Duplicate Channel module removed; Concurrency::Channel gains empty() and
the unique test cases (drain-after-close, multi-producer, string payloads).
- StopWatch module merged into Time::Stopwatch: one class with explicit
start/stop/laps plus a started() factory for the auto-start RAII style;
ScopedTimer moved along.
- Testing optional dep retargeted String->Str (pad_right lives in Str now).
- Stale empty dirs removed: src/{ScopeGuard,String,Core}, include/Void/{Core,
Filesystem,Memo,Channel,StopWatch}.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Also fixes Diff/Memo/PriorityQueue from previous session: LineDiff is now
an alias for Edit<string> so count_op/apply work on line diffs; Memoized
uses std::apply instead of type-based get to handle duplicate arg types.
874/877 tests pass (3 are platform-gated plugin tests).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Void::Observable — Observable<T> reactive value with typed on_change listeners
and unsubscribe-by-handle; Signal<Args...> event broadcast with connect/disconnect.
Void::Pool — ObjectPool<T,ChunkSize> slab-based pool with unique_ptr<T,Deleter>
ownership; FixedPool<T,N> fixed-capacity in-place pool, returns nullptr when full.
Void::Ring — SpscRing<T,N> single-producer/single-consumer wait-free ring buffer;
MpscRing<T,N> multi-producer/single-consumer ring using CAS on the head pointer.
Both tested under real threads.
39/39 tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds Logging module with thread-safe Logger base class, ScopedContext
RAII guards, Preset helpers, and a FileLogger standalone test/example.
Includes CMake module system for auto-discovery and CTest integration.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>