{"record":{"id":"b8b737456ed6195a","repo":"tracel-ai/burn","slug":"deserialize-identifier-is-not-implemented","errorCode":null,"errorMessage":"deserialize_identifier is not implemented","messagePattern":"deserialize_identifier is not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-store/src/nested/de.rs","lineNumber":423,"sourceCode":"            let result = cloned_visitor.visit_enum(ProbeEnumAccess::<A>::new(\n                value.clone(),\n                variant.to_owned(),\n                self.default_for_missing_fields,\n            ));\n\n            if result.is_ok() {\n                return result;\n            }\n        }\n\n        Err(custom_err(\"No variant match\"))\n    }\n\n    fn deserialize_identifier<V>(self, _visitor: V) -> Result<V::Value, Self::Error>\n    where\n        V: Visitor<'de>,\n    {\n        unimplemented!(\"deserialize_identifier is not implemented\")\n    }\n}\n\n/// A sequence access for a vector in the nested value data structure.\nstruct VecSeqAccess<A: BurnModuleAdapter, I> {\n    iter: Box<dyn Iterator<Item = I>>,\n    default_for_missing_fields: bool,\n    phantom: std::marker::PhantomData<A>,\n}\n\nimpl<A: BurnModuleAdapter> VecSeqAccess<A, NestedValue> {\n    fn new(vec: NestedValue, default_for_missing_fields: bool) -> Result<Self, Error> {\n        match vec {\n            NestedValue::Vec(v) => Ok(VecSeqAccess {\n                iter: Box::new(v.into_iter()),\n                default_for_missing_fields,\n                phantom: std::marker::PhantomData,\n            }),","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-store/src/nested/de.rs#L405-L441","documentation":"This panic comes from the custom serde Deserializer in burn-store's nested value module. deserialize_identifier is a serde hook used when deserializing enum variant names (unit variants via identifier). The burn module adapter does not support deserializing enum identifiers from nested values, so the method is explicitly unimplemented — any deserializer path that reaches it panics.","triggerScenarios":"Deserializing a type containing an enum whose variants are deserialized via the identifier path (e.g. serde's externally tagged unit variant representation) from a NestedValue, causing Deserializer::deserialize_identifier to be called.","commonSituations":"Loading a recorded model/state whose serialized types include enums (e.g. option-like enums, tagged unions) through burn-store's nested deserializer; usually surfaces after a type or record format change adds enum fields the adapter never anticipated.","solutions":["Remove or avoid enum types in the data structure being deserialized through the nested de path (use plain structs/primitives)","Serialize enum data as a struct variant or value the adapter supports instead of relying on identifier-based deserialization","Open an issue or patch crates/burn-store/src/nested/de.rs to implement deserialize_identifier by matching the visitor's identifier (visit_u32/visit_str)","Use a different serialization backend (e.g. standard serde format) for types with enums"],"exampleFix":"// before\n#[derive(Serialize, Deserialize)]\nenum Activation { Relu, Gelu }\n\n// after\n#[derive(Serialize, Deserialize)]\nstruct Activation { kind: String }","handlingStrategy":"validation","validationCode":"fn uses_enum_identifier<T: 'static>() -> bool {\n    // prefer: keep enums out of types deserialized via burn-store nested de\n    std::any::TypeId::of::<T>() != std::any::TypeId::of::<()>() && !cfg!(feature = \"nested-enum-de\")\n}\n// simpler: assert record structs contain no enum fields before saving/loading","typeGuard":null,"tryCatchPattern":"// burn returns Error from Deserialize; catch panic at the boundary\nlet result = std::panic::catch_unwind(|| {\n    MyRecord::deserialize(nested_value)\n});\nmatch result {\n    Ok(v) => v,\n    Err(_) => fallback_to_serde_backend(),\n}","preventionTips":["Keep enums out of structs serialized through burn-store's nested record format","Prefer struct/unit representations over tagged enum variants in model records","Test save/load round-trips in CI so unimplemented deserializer paths surface early"],"tags":["rust","serde","deserialization","burn"],"backgroundTag":"unimplemented-serde-deserializer","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"}