Skip to main content

chronon::sender

Namespaces

Name
chronon::sender::factory
chronon::sender::detail
chronon::sender::config

Classes

Name
classchronon::sender::VersionedRegister
Lock-free ring buffer of (value, cycle) versions for lookahead-safe shared state.
classchronon::sender::Unit
structchronon::sender::TopoSortResult
Result of topologicalSort(); order is partial if has_cycle is true.
structchronon::sender::TightCouplingResult
Tight-coupling cluster assignment from findTightCouplingClusters().
classchronon::sender::TickableUnit
structchronon::sender::TickSimulationConfig
classchronon::sender::TickSimulation
classchronon::sender::TickException
structchronon::sender::ThreadProgress
structchronon::sender::ThreadCrossDep
structchronon::sender::TerminationRequest
Context for a termination request: reason, exit code, cycle, unit, message.
classchronon::sender::TerminationController
classchronon::sender::StageReg
N-pipe pipeline register with ping-pong slots and runtime write tracking.
classchronon::sender::StagePipeline
Groups heterogeneous StageReg / SingleStageReg instances for batch lifecycle calls.
classchronon::sender::SingleThreadQueueAdapter
classchronon::sender::SingleThreadMessageQueue
classchronon::sender::SingleStageReg
Single-entry pipeline register with ping-pong slots and runtime write tracking.
structchronon::sender::SimpleCycle
A simple cycle in the graph with summed edge weight.
structchronon::sender::SCCResult
SCC decomposition produced by tarjanSCC().
structchronon::sender::ResolvedDep
classchronon::sender::PriorityArbiter
Declarative N-pipe priority arbiter with overflow, bank-conflict, and idle-fill.
classchronon::sender::PortDirectory
classchronon::sender::PortBindingRegistry
classchronon::sender::PortBase
classchronon::sender::PhasedTickableUnit
structchronon::sender::Phase1
Phase tag for odd cycles; reads slot 1, writes slot 0.
structchronon::sender::Phase0
Phase tag for even cycles; reads slot 0, writes slot 1.
classchronon::sender::OutPortHandle
Typed handle for output ports.
classchronon::sender::OutPort
classchronon::sender::MultiProducerQueueAdapter
classchronon::sender::MessageQueueAdapter
classchronon::sender::MessageQueue
classchronon::sender::LockFreeQueueAdapter
classchronon::sender::LockFreeMessageQueue
classchronon::sender::InPortHandle
Typed handle for input ports.
classchronon::sender::InPort
classchronon::sender::IPortHandle
classchronon::sender::IMessageQueue
classchronon::sender::IArbitratablePort
classchronon::sender::DirectedGraph
Directed graph with weighted edges; weights encode communication delay in cycles.
classchronon::sender::CrashHandler
classchronon::sender::ConnectionBase
classchronon::sender::Connection
structchronon::sender::BlockedClusterInfo
structchronon::sender::ArbWinner
Winning request on a pipe; bank_conflict marks a priority win blocked by a conflict.
structchronon::sender::ArbResult
Per-tick arbitration result: winners by pipe, losers, and request counts.
structchronon::sender::ArbRequest
A single arbitration request for one source on one pipe.
structchronon::sender::ArbLoser
A losing request with the reason it was rejected.

Types

Name
enum classUnitState { Running, Initialized, Error, Created, Completed}
enum class uint8_tTerminationReason { UserRequested =
UserInterrupted, UserInterrupted = 4, None = 0, MaxCyclesReached = 5, ExitSyscall = 2, Error = 3, Completed = 1, CheckpointRequested = 6, Checkpoint =
CheckpointRequested}<br>Why the simulation is being terminated. |

| enum class uint8_t | PortPolicy { StageSelective = 1, LegacyFastPath = 0, General = LegacyFastPath} | | enum class uint8_t | LoseReason { OVERFLOW_FAILED, LOWER_PRIORITY, BANK_CONFLICT} | | enum class uint8_t | BankConflictPriority { LowerPipeIndex, HigherPipeIndex} |

Functions

Name
template <ValidPhase P>
std::size_t
write_slot_index()
TopoSortResulttopologicalSort(const DirectedGraph & graph)
Topological sort via Kahn's algorithm. Time O(V + E), space O(V).
SCCResulttarjanSCC(const DirectedGraph & graph)
Strongly connected components via Tarjan. Time O(V + E), space O(V).
boolstageTracePortMatches_(const std::string & name)
boolstageTraceEnabled_()
template <ValidPhase P,std::size_t N,typename Src ,typename Dst >
void
simpleForwardAll(Src & src, Dst & dst)
Forward all pipes from src to dst with stall-aware retention.
template <ValidPhase P,typename Src ,typename Dst >
bool
simpleForward(Src & src, Dst & dst, std::size_t pipe)
template <ValidPhase P,typename Src ,typename Dst >
bool
simpleForward(Src & src, Dst & dst)
Single-entry overload (for SingleStageReg).
voidrecordPortOnOwnerUnit(Unit * unit, PortBase * port)
template <ValidPhase P>
std::size_t
read_slot_index()
template <ValidPhase P,typename Src ,typename Dst ,typename Fn >
bool
processForward(Src & src, Dst & dst, std::size_t pipe, Fn && fn)
template <ValidPhase P,typename Src ,typename Dst ,typename Fn >
bool
processForward(Src & src, Dst & dst, Fn && fn)
Forward with processing (single-entry): fn(data&) called before write.
std::vector< SimpleCycle >johnsonAllCycles(const DirectedGraph & graph, size_t max_cycles =0)
All simple cycles via Johnson. max_cycles caps results (0 = unlimited).
std::vector< std::vector< uint32_t > >floydWarshall(const DirectedGraph & graph)
All-pairs shortest paths via Floyd-Warshall. Time O(V^3), space O(V^2).
TightCouplingResultfindTightCouplingClusters(const DirectedGraph & graph)
Union-Find clustering over zero-weight edges. Time O(E·α(V)), space O(V).
std::vector< std::vector< size_t > >findIndependentSubgraphs(const DirectedGraph & graph)
Group nodes by undirected connectivity into independent subgraphs.
template <ValidPhase P,typename Src ,typename Dst ,typename Convert >
bool
convertForward(Src & src, Dst & dst, std::size_t pipe, Convert && convert)
template <ValidPhase P,typename Src ,typename Dst ,typename Convert >
bool
convertForward(Src & src, Dst & dst, Convert && convert)
Cross-type forward (single-entry): convert(src_data) returns dst_data.
voidaddPortRegistrationToUnit(Unit * unit, std::function< void(const std::string &)> registration)

Types Documentation

enum UnitState

EnumeratorValueDescription
Running
Initialized
Error
Created
Completed

enum TerminationReason

EnumeratorValueDescription
UserRequested=
UserInterrupted| Backward-compatible alias. |

| UserInterrupted | 4| External stop (e.g., Ctrl+C, API call) | | None | 0| | | MaxCyclesReached | 5| Hit cycle limit. | | ExitSyscall | 2| Exit syscall encountered. | | Error | 3| Error condition detected. | | Completed | 1| Normal completion (e.g., retired N instructions) | | CheckpointRequested | 6| Checkpoint reached (for save/restore) | | Checkpoint | = CheckpointRequested| Backward-compatible alias. |

Why the simulation is being terminated.

enum PortPolicy

EnumeratorValueDescription
StageSelective1
LegacyFastPath0
GeneralLegacyFastPathBackward-compatible alias.

PortPolicy - Selects InPort cancellation/dispatch behavior.

  • LegacyFastPath (default): legacy behavior. cancelYoungerThan/cancelOlderThan use the receiver-side generation/min-key/max-key bound mechanism. The sender path (enqueueStored_, pushFromThread) early-rejects messages that already look canceled. This is the backward-compatible default. Carries the known #7 overlapping-flush gap and #8 generation race in parallel mode; new code that needs strong cancellation guarantees should use StageSelective.
  • StageSelective: optimized for delay=1 stage-register ports with selective cancellation. Each message carries enqueue_cycle (producer's localCycle at push time). cancelYoungerThan(key) installs a StagePredicate {flush_cycle = receiver localCycle, max_keep = key}; predicates are stored in a small fixed-size slot array and retired when the receiver advances past flush_cycle. The sender side does NOT consult receiver state — the filter is applied receiver-side only on pop. This eliminates the cross-thread receiver-atomic read that races in parallel mode (#8) and the overlapping-flush zombie escape (#7).

enum LoseReason

EnumeratorValueDescription
OVERFLOW_FAILED
LOWER_PRIORITY
BANK_CONFLICT

enum BankConflictPriority

EnumeratorValueDescription
LowerPipeIndex
HigherPipeIndex

Functions Documentation

function write_slot_index

template <ValidPhase P>
std::size_t write_slot_index()

function topologicalSort

inline TopoSortResult topologicalSort(
const DirectedGraph & graph
)

Topological sort via Kahn's algorithm. Time O(V + E), space O(V).

function tarjanSCC

inline SCCResult tarjanSCC(
const DirectedGraph & graph
)

Strongly connected components via Tarjan. Time O(V + E), space O(V).

function stageTracePortMatches_

inline bool stageTracePortMatches_(
const std::string & name
)

function stageTraceEnabled_

inline bool stageTraceEnabled_()

StageSelective cancellation tracing (NUCLEUS_STAGE_TRACE env).

Permanent diagnostic feature. Emits one line per install/retire/ shouldCancel on a StageSelective InPort, for investigating flush and cancellation behavior in production builds.

Enable: NUCLEUS_STAGE_TRACE=1 (or any non-empty value) Optional filter: NUCLEUS_STAGE_TRACE_PORT=

function simpleForwardAll

template <ValidPhase P,
std::size_t N,
typename Src ,
typename Dst >
void simpleForwardAll(
Src & src,
Dst & dst
)

Forward all pipes from src to dst with stall-aware retention.

function simpleForward

template <ValidPhase P,
typename Src ,
typename Dst >
bool simpleForward(
Src & src,
Dst & dst,
std::size_t pipe
)

Simple stall-aware forward for a single pipe. If dst already has a write pending for this pipe, retains in src. Returns true if forwarded, false if retained (stalled).

function simpleForward

template <ValidPhase P,
typename Src ,
typename Dst >
bool simpleForward(
Src & src,
Dst & dst
)

Single-entry overload (for SingleStageReg).

function recordPortOnOwnerUnit

inline void recordPortOnOwnerUnit(
Unit * unit,
PortBase * port
)

Records a PortBase* on its owning Unit so TickableUnit::executeTick can walk the ports to drive consumer-tick-driven MPSC arbitration.

function read_slot_index

template <ValidPhase P>
std::size_t read_slot_index()

function processForward

template <ValidPhase P,
typename Src ,
typename Dst ,
typename Fn >
bool processForward(
Src & src,
Dst & dst,
std::size_t pipe,
Fn && fn
)

Forward with processing: fn(pipe, data&) called on consumed data before writing to dst. Returns true if forwarded, false if stalled.

function processForward

template <ValidPhase P,
typename Src ,
typename Dst ,
typename Fn >
bool processForward(
Src & src,
Dst & dst,
Fn && fn
)

Forward with processing (single-entry): fn(data&) called before write.

function johnsonAllCycles

inline std::vector< SimpleCycle > johnsonAllCycles(
const DirectedGraph & graph,
size_t max_cycles =0
)

All simple cycles via Johnson. max_cycles caps results (0 = unlimited).

function floydWarshall

inline std::vector< std::vector< uint32_t > > floydWarshall(
const DirectedGraph & graph
)

All-pairs shortest paths via Floyd-Warshall. Time O(V^3), space O(V^2).

function findTightCouplingClusters

inline TightCouplingResult findTightCouplingClusters(
const DirectedGraph & graph
)

Union-Find clustering over zero-weight edges. Time O(E·α(V)), space O(V).

function findIndependentSubgraphs

inline std::vector< std::vector< size_t > > findIndependentSubgraphs(
const DirectedGraph & graph
)

Group nodes by undirected connectivity into independent subgraphs.

function convertForward

template <ValidPhase P,
typename Src ,
typename Dst ,
typename Convert >
bool convertForward(
Src & src,
Dst & dst,
std::size_t pipe,
Convert && convert
)

Cross-type forward: convert(pipe, src_data) returns dst_data. Returns true if forwarded, false if stalled.

function convertForward

template <ValidPhase P,
typename Src ,
typename Dst ,
typename Convert >
bool convertForward(
Src & src,
Dst & dst,
Convert && convert
)

Cross-type forward (single-entry): convert(src_data) returns dst_data.

function addPortRegistrationToUnit

inline void addPortRegistrationToUnit(
Unit * unit,
std::function< void(const std::string &)> registration
)

Defined here (free function) to avoid the Port.hpp → Unit.hpp circular dependency: Port constructors only see a forward-declared Unit.

Defined in Unit.hpp; declared here so port constructors can register auto-registration callbacks without including Unit.hpp.


Updated on 2026-05-26 at 05:42:32 +0000