28class TaskRegistryDebug;
115 bool originating_failure)
noexcept;
124 std::vector<async::NodeInfo const*>
const& read_dependencies,
125 std::vector<async::NodeInfo const*>
const& write_dependencies);
134 static void name_task(std::coroutine_handle<> h, std::string
const& label);
267namespace
uni20::detail
270void initialize_task_registry_diagnostics_from_environment()
noexcept;
271void finalize_task_registry_diagnostics_from_environment()
noexcept;
276[[maybe_unused]]
nifty_counter<initialize_task_registry_diagnostics_from_environment,
277 finalize_task_registry_diagnostics_from_environment> task_registry_diagnostics_lifetime;
Tracks coroutine and epoch-context lifecycle events in debug builds.
Definition task_registry_debug.hpp:34
static GraphvizDumpOptions default_graphviz_dump_options()
Returns default Graphviz file-output options.
static std::string graphviz_dot()
Returns a Graphviz DOT snapshot of the currently tracked async DAG.
static void register_task(std::coroutine_handle<> h)
Registers a newly-created coroutine handle.
static StacktraceOptions default_stacktrace_options()
Returns default stacktrace formatting options.
static void dump_graphviz(std::FILE *stream=stderr)
Prints a Graphviz DOT snapshot to a C stream.
static GraphSnapshot snapshot_best_effort()
Captures a best-effort task/epoch/value DAG snapshot without indefinite lock waits.
static GraphSnapshot snapshot()
Captures the current task/epoch/value DAG as structured data.
static void request_graphviz_dump() noexcept
Queues one Graphviz dump request for scheduler or service processing.
static void leak_task(std::coroutine_handle<> h)
Marks a coroutine handle as leaked.
static void record_task_dependencies(std::coroutine_handle<> h, std::vector< async::NodeInfo const * > const &read_dependencies, std::vector< async::NodeInfo const * > const &write_dependencies)
Records constructor-discovered coarse DAG dependencies for a coroutine.
static std::vector< std::coroutine_handle<> > epoch_reader_tasks(async::EpochContext const *epoch_context)
Returns coroutine handles currently bound as readers.
static bool service_debug_requests()
Processes pending dump requests on the calling thread.
static void bind_epoch_task(async::EpochContext const *epoch_context, std::coroutine_handle<> h, EpochTaskRole role)
Associates a coroutine with an epoch context as reader or writer.
static void reset_stacktrace_options()
Resets active stacktrace formatting options from environment defaults.
static void reset_coroutine_exception_diagnostics_options()
Resets the automatic coroutine-exception diagnostics policy from the environment.
TaskState
Logical lifecycle states tracked for each coroutine handle.
Definition task_registry_debug.hpp:46
static void name_async_value(async::NodeInfo const *node, std::string const &label)
Assigns an optional human-readable label to an async value node.
static void name_task(std::coroutine_handle<> h, std::string const &label)
Assigns an optional human-readable label to a coroutine task.
static bool start_diagnostics_service()
Starts the optional background DAG diagnostics service.
static std::string graphviz_dot_best_effort()
Returns a best-effort Graphviz DOT snapshot without waiting indefinitely for locks.
static void destroy_task(std::coroutine_handle<> h)
Marks a coroutine handle as destroyed.
static bool dump_graphviz_file_best_effort(std::string const &path)
Writes a best-effort Graphviz DOT snapshot to a file.
static bool dump_graphviz_file(std::string const &path)
Writes a Graphviz DOT snapshot to a file.
static DiagnosticsServiceOptions default_diagnostics_service_options()
Returns default diagnostics-service options.
static void stop_diagnostics_service() noexcept
Stops the background DAG diagnostics service if it is running.
static void mark_suspended(std::coroutine_handle<> h)
Marks a coroutine handle as suspended.
static void dump()
Prints global task-registry diagnostics.
static void mark_running(std::coroutine_handle<> h)
Marks a coroutine handle as currently running.
static void record_unhandled_exception(std::coroutine_handle<> h, std::exception_ptr exception, bool originating_failure) noexcept
Records an exception escaping a coroutine and optionally captures its live DAG.
static void set_coroutine_exception_diagnostics_options(CoroutineExceptionDiagnosticsOptions const &options)
Replaces the process-wide automatic coroutine-exception diagnostics policy.
static void register_epoch_context(async::EpochContext const *epoch_context)
Registers an epoch context for debug tracking.
static CoroutineExceptionDiagnosticsOptions coroutine_exception_diagnostics_options()
Returns the active automatic coroutine-exception diagnostics policy.
EpochTaskRole
Role of a coroutine relative to an epoch context.
Definition task_registry_debug.hpp:56
static CoroutineExceptionDiagnosticsOptions default_coroutine_exception_diagnostics_options()
Returns the environment-derived automatic coroutine-exception diagnostics policy.
static void record_await_dependency(std::coroutine_handle<> h, async::NodeInfo const *node, EpochTaskRole role)
Records a buffer dependency discovered at a concrete co_await site.
static std::vector< std::coroutine_handle<> > epoch_writer_tasks(async::EpochContext const *epoch_context)
Returns coroutine handles currently bound as writers.
DumpMode
Verbosity levels for registry dump output.
Definition task_registry_debug.hpp:38
static StacktraceOptions stacktrace_options()
Returns active stacktrace formatting options.
static void dump_epoch_context(async::EpochContext const *epoch_context, char const *reason=nullptr)
Prints diagnostics for a specific epoch context.
static void unbind_epoch_task(async::EpochContext const *epoch_context, std::coroutine_handle<> h, EpochTaskRole role)
Removes a coroutine-role binding from an epoch context.
static std::string default_graphviz_dump_path()
Creates a default DOT output path for the current process.
static GraphDiagnostics diagnose_snapshot(GraphSnapshot const &snapshot)
Diagnoses blocked tasks, missing writers, and dependency cycles in a graph snapshot.
static DumpMode dump_mode() noexcept
Reports the current debug dump mode.
static void record_task_scheduled(std::coroutine_handle<> h)
Records the call stack where a coroutine was submitted to a scheduler.
static void set_stacktrace_options(StacktraceOptions const &options)
Replaces active stacktrace formatting options.
static void destroy_epoch_context(async::EpochContext const *epoch_context)
Removes an epoch context from debug tracking.
No-op task registry implementation for non-debug async builds.
Definition task_registry_dummy.hpp:26
Definition epoch_context.hpp:169
Records node information for DAG/debugging visualization.
Definition async_node.hpp:171
Runs shared initialization before namespace-scope users and shared cleanup after them.
Definition nifty_counter.hpp:26
This represents the reverse-mode adjoint for functions of complex variables, assuming a real-valued s...
Definition async/async.hpp:26
Definition async/async.hpp:26
Provides ordered one-time initialization across translation units.
Runtime policy for diagnostics captured when an exception escapes a coroutine.
Definition task_registry_debug.hpp:70
GraphvizDumpOptions dump_options
Definition task_registry_debug.hpp:73
bool enabled
Definition task_registry_debug.hpp:71
bool write_graphviz
Definition task_registry_debug.hpp:72
Options for the opt-in background DAG diagnostics service.
Definition task_registry_debug.hpp:78
int signal_number
Definition task_registry_debug.hpp:80
std::string request_file
Definition task_registry_debug.hpp:81
int poll_interval_ms
Definition task_registry_debug.hpp:82
bool block_signal_in_calling_thread
Definition task_registry_debug.hpp:83
GraphvizDumpOptions dump_options
Definition task_registry_debug.hpp:79
File-output options for Graphviz DAG dumps.
Definition task_registry_debug.hpp:63
std::string file_prefix
Definition task_registry_debug.hpp:65
std::string output_dir
Definition task_registry_debug.hpp:64
Diagnostics derived from a structured task-registry graph snapshot.
Definition task_registry_snapshot.hpp:114
Structured task-registry graph snapshot.
Definition task_registry_snapshot.hpp:104
Runtime controls for formatting captured task-registry stacktraces.
Definition task_registry_snapshot.hpp:33
Structured async task-registry graph snapshots and diagnostics.