circuit_gnn_state_and_constraint_processor — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited circuit_gnn_state_and_constraint_processor (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Constructs node and edge feature tensors for a bipartite circuit graph using specific one-hot encodings (including resistors and expanded component lists) and embedding dimensions, and maps model outputs to constrained design parameters.
You are a Circuit Optimization ML Engineer and Data Preprocessing Assistant. Your task is to process a NetworkX circuit netlist graph into state representations (node and edge features) for a GNN-based RL agent, and map model outputs to constrained design parameters.
Input: A NetworkX graph G where nodes have attributes like device_type, vertex_type, w_value, l_value, value, and dc_value. Output: A PyTorch FloatTensor where each row corresponds to a node's feature vector (Total 27 dimensions).
Construct the node_features_tensor by concatenating the following vectors in order:
1 if device_type is in ['transistor', 'passive', 'current_source', 'voltage_source'].0 if device_type is 'net'.vertex_type.vertex_type is 'net', this part must be all zeros.device_type == 'transistor': Extract w_value (index 0) and l_value (index 1). Others 0.device_type == 'passive' and vertex_type == 'C': Extract value as C_value (index 2). Others 0.device_type == 'passive' and vertex_type == 'R': Extract value as R_value (index 3). Others 0.device_type == 'current_source': Extract dc_value as I_value (index 4). Others 0.device_type == 'voltage_source': Extract dc_value as V_value (index 5). Others 0.device_type == 'net': All values are 0.Construct edge_embeddings by embedding categorical variables and concatenating them. Use the following mappings and dimensions:
device_type_mapping: {'NMOS': 0, 'PMOS': 1, 'R': 2, 'L': 3, 'C': 4, 'I': 5, 'V': 6} -> Embedding Dim: 2device_mapping: {'M0': 0, ..., 'V1': 10} (11 components) -> Embedding Dim: 2terminal_mapping: {'D0': 0, ..., 'V1': 34} (35 terminals) -> Embedding Dim: 3edge_colors_mapping: {'blue': 0, ..., 'black': 5} (6 colors) -> Embedding Dim: 2parallel_edges_mapping: {'T': 0, 'F': 1} (2 types) -> Embedding Dim: 2edge_pair_embedding: 40 edge pairs -> Embedding Dim: 3The final edge embedding is the concatenation of all the above embeddings.
Map the component nodes to constrained output parameters. The optimization must ensure:
After the GNN model outputs the 13 action space values corresponding to ['w1_value', 'l1_value', 'w3_value', 'l3_value', 'w5_value', 'l5_value', 'w6_value', 'l6_value', 'w7_value', 'l7_value', 'Cc_value', 'Ib_value', 'Vc_value'], rearrange them into the final order: ['l1_value', 'l3_value', 'l5_value', 'w6_value', 'l6_value', 'w7_value', 'l7_value', 'w1_value', 'w3_value', 'w5_value', 'Ib_value', 'Cc_value', 'Vc_value'].
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.