pulsatrix
Loading...
Searching...
No Matches
pulsatrix::CircuitGraph Class Reference

A copyable, self-contained circuit graph: every node of one forward pass with an ablation importance score, plus the weighted edges between them. More...

#include <circuit_graph.hpp>

Public Member Functions

 CircuitGraph (std::vector< CircuitNode > nodes, std::vector< CircuitEdge > edges)
 Constructs a circuit graph from already-computed nodes and edges.
 
const std::vector< CircuitNode > & nodes () const
 Every scored node, in topological order as of build time.
 
const std::vector< CircuitEdge > & edges () const
 Every weighted edge, in source-node order as of build time.
 

Detailed Description

A copyable, self-contained circuit graph: every node of one forward pass with an ablation importance score, plus the weighted edges between them.

Note
Raw data only. This type deliberately ships no rendering – no plotting, no DOT/JSON export, no dependency on any visualization stack. That is an explicit decision recorded by this campaign (Phase 5 scoping, 2026-09-24), not an oversight: drawing a circuit graph belongs to campaign_exai_dl_library_phase5_bindings Mission 2's still-planned visualization work, and is deferred to whenever that activates (or to a later mission if it is delayed further). Nothing here is committed to a particular renderer.
Holds no reference to the ComputationGraph or ExplainerContext it was built from, for the same reason ActivationSnapshot does not: ExplainerContext replaces its graph wholesale on every forward pass, so a circuit that referred back to either would be invalidated by the very next one. Copying the small per-node metadata instead makes the artifact outlive the analysis that produced it.
Constructed by ExplainerContext::build_circuit_graph(), not assembled by hand.

Constructor & Destructor Documentation

◆ CircuitGraph()

pulsatrix::CircuitGraph::CircuitGraph ( std::vector< CircuitNode >  nodes,
std::vector< CircuitEdge >  edges 
)
inline

Constructs a circuit graph from already-computed nodes and edges.

Parameters
nodesScored nodes, in topological order.
edgesWeighted edges.
Note
No cross-validation between the two arguments (e.g. that every edge endpoint names a node in the list): this constructor is reached only from ExplainerContext::build_circuit_graph(), which builds both from one consistent graph in a single pass – the same rationale ActivationSnapshot's constructor documents. An empty circuit, and a single-node/zero-edge circuit, are both well-formed values rather than errors; the latter is what a one-node graph genuinely produces.

Member Function Documentation

◆ edges()

const std::vector< CircuitEdge > & pulsatrix::CircuitGraph::edges ( ) const
inline

Every weighted edge, in source-node order as of build time.

◆ nodes()

const std::vector< CircuitNode > & pulsatrix::CircuitGraph::nodes ( ) const
inline

Every scored node, in topological order as of build time.


The documentation for this class was generated from the following file: