chronon::sender
Namespaces
| Name |
|---|
| chronon::sender::factory |
| chronon::sender::detail |
| chronon::sender::config |
Classes
Types
| Name | |
|---|---|
| enum class | UnitState { Running, Initialized, Error, Created, Completed} |
| enum class uint8_t | TerminationReason { 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() |
| TopoSortResult | topologicalSort(const DirectedGraph & graph) Topological sort via Kahn's algorithm. Time O(V + E), space O(V). |
| SCCResult | tarjanSCC(const DirectedGraph & graph) Strongly connected components via Tarjan. Time O(V + E), space O(V). |
| bool | stageTracePortMatches_(const std::string & name) |
| bool | stageTraceEnabled_() |
| 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). |
| void | recordPortOnOwnerUnit(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). |
| TightCouplingResult | findTightCouplingClusters(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. |
| void | addPortRegistrationToUnit(Unit * unit, std::function< void(const std::string &)> registration) |
Types Documentation
enum UnitState
| Enumerator | Value | Description |
|---|---|---|
| Running | ||
| Initialized | ||
| Error | ||
| Created | ||
| Completed |
enum TerminationReason
| Enumerator | Value | Description |
|---|---|---|
| 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
| Enumerator | Value | Description |
|---|---|---|
| StageSelective | 1 | |
| LegacyFastPath | 0 | |
| General | LegacyFastPath | Backward-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
| Enumerator | Value | Description |
|---|---|---|
| OVERFLOW_FAILED | ||
| LOWER_PRIORITY | ||
| BANK_CONFLICT |
enum BankConflictPriority
| Enumerator | Value | Description |
|---|---|---|
| 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