{"record":{"id":"d0f2ba73fd97ff54","repo":"zed-industries/zed","slug":"parent-absolute-outer-origin-should-be-cached","errorCode":null,"errorMessage":"parent absolute outer origin should be cached","messagePattern":"parent absolute outer origin should be cached","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui/src/taffy.rs","lineNumber":367,"sourceCode":"\n    pub fn layout_bounds(&mut self, id: LayoutId, scale_factor: f32) -> Bounds<Pixels> {\n        if let Some(layout) = self.absolute_layout_bounds.get(&id).cloned() {\n            return layout;\n        }\n\n        let layout = self.taffy.layout(id.into()).expect(EXPECT_MESSAGE);\n        let layout_location = layout.location;\n        let layout_size = layout.size;\n        let parent = self.taffy.parent(id.0);\n\n        let absolute_outer_origin = match parent {\n            Some(parent_id) => {\n                let parent_id = LayoutId::from(parent_id);\n                self.layout_bounds(parent_id, scale_factor);\n                let parent_origin = *self\n                    .absolute_outer_origins\n                    .get(&parent_id)\n                    .expect(\"parent absolute outer origin should be cached\");\n                parent_origin + Point::from(layout_location)\n            }\n            None => Point::from(layout_location),\n        };\n        self.absolute_outer_origins\n            .insert(id, absolute_outer_origin);\n\n        let absolute_far = absolute_outer_origin + Point::from(Size::from(layout_size));\n        let snapped_bounds = Bounds::from_corners(\n            absolute_outer_origin.map(round_half_toward_zero),\n            absolute_far.map(round_half_toward_zero),\n        );\n\n        let bounds = (snapped_bounds / scale_factor).map(Pixels);\n        self.absolute_layout_bounds.insert(id, bounds);\n        bounds\n    }\n}","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui/src/taffy.rs#L349-L385","documentation":"TaffyLayoutEngine::layout_bounds computes a child's absolute bounds from its parent's cached bounds; the expect asserts the parent's absolute outer origin is already in the cache. Firing means layout ran with a parent whose cached bounds were not computed first — a taffy layout ordering/traversal bug.","triggerScenarios":"Thrown at crates/gpui/src/taffy.rs:367 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure parents are processed before children when computing absolute layout bounds","Check that compute_layout ran on the full tree before layout_bounds queries","Reproduce with a minimal nested-layout case and inspect cache population order"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}