{"record":{"id":"7c021489135ae605","repo":"tracel-ai/burn","slug":"capture-graph-graph-id-was-not-registered","errorCode":null,"errorMessage":"capture graph {graph_id:?} was not registered","messagePattern":"capture graph (.+?) was not registered","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-capture/src/capture.rs","lineNumber":565,"sourceCode":"        bindings: GraphBindings,\n    ) {\n        let graph = Graph::new(relative_graph);\n        let bound = graph.bind(bindings);\n        let mut state = self.state().lock();\n        state.graphs.insert(graph_id, graph);\n        for operation in bound.operations {\n            state.register_op(operation);\n        }\n    }\n\n    fn execute_graph(&self, graph_id: GraphId, bindings: GraphBindings) {\n        let graph = self\n            .state()\n            .lock()\n            .graphs\n            .get(&graph_id)\n            .cloned()\n            .unwrap_or_else(|| panic!(\"capture graph {graph_id:?} was not registered\"));\n        let bound = graph.bind(bindings);\n        let mut state = self.state().lock();\n        for operation in bound.operations {\n            state.register_op(operation);\n        }\n    }\n\n    fn register_alias(&self, new_id: TensorId, src_id: TensorId) {\n        let mut state = self.state().lock();\n        state.assert_open();\n        let source = state.resolve_alias(src_id);\n        if source != new_id {\n            state.aliases.insert(new_id, source);\n        }\n    }\n}\n\n#[cfg(test)]","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-capture/src/capture.rs#L547-L583","documentation":"Replaying/attaching a graph by id requires that the graph was previously recorded and stored in the capture client's state. Looking up `graphs[graph_id]` fails when the id is unknown, indicating the graph was never registered or its state was already consumed/dropped.","triggerScenarios":"Calling the operation-bind/replay API with a `graph_id` that was never produced by a capture run; reusing a graph id after the capture state was reset; a typo/stale id from a previous process or session.","commonSituations":"Replaying recorded graphs in a new client instance without re-recording; caching graph ids across capture sessions; concurrent capture runs where one scope's ids are used in another.","solutions":["Register the graph first (record it in a capture scope) before referencing its id.","Confirm the graph_id comes from the same capture client/session you are replaying on.","Check for state resets or client recreation between recording and replay; re-record if needed."],"exampleFix":"// before\nclient.bind_graph(GraphId(7), bindings); // never recorded in this client\n// after\nlet graph_id = device.capture_scope(|device| {\n    // build ops, record graph\n    recorded_graph_id\n});\nclient.bind_graph(graph_id, bindings);","handlingStrategy":"validation","validationCode":"// Record the graph first, keep the returned id, then bind\nlet graph_id = device.capture_scope(|_d| { /* record */ recorded_graph_id });\nassert!(state_has_graph(&client, &graph_id), \"graph must be registered before binding\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use graph ids returned from the same capture session/client","Re-record graphs after client recreation or state reset","Don't persist graph ids across process restarts"],"tags":["rust","burn","graph-capture","state"],"backgroundTag":"graph-not-registered","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}