{"record":{"id":"4b71eb2528ec5ed3","repo":"zed-industries/zed","slug":"frame-instance-data-exceeds-the-byte-maximum","errorCode":null,"errorMessage":"frame instance data exceeds the {}-byte maximum","messagePattern":"frame instance data exceeds the (.+?)-byte maximum","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_wgpu/src/wgpu_renderer.rs","lineNumber":1939,"sourceCode":"                    width: 1,\n                    height: 1,\n                    depth_or_array_layers: 1,\n                },\n            );\n            break;\n        }\n    }\n\n    fn grow_instance_data(&mut self, required: u64) -> Result<()> {\n        let capacity = (self.instance_data_capacity * 2)\n            .max(required.next_power_of_two())\n            .min(self.max_instance_data_size);\n        anyhow::ensure!(\n            capacity >= required,\n            \"instance data needs {required} bytes, above the maximum of {}\",\n            self.max_instance_data_size\n        );\n        anyhow::ensure!(\n            capacity > self.instance_data_capacity,\n            \"frame instance data exceeds the {}-byte maximum\",\n            self.max_instance_data_size\n        );\n        log::debug!(\n            \"instance data grown from {} to {capacity}\",\n            self.instance_data_capacity\n        );\n        // Bind groups created earlier in the frame keep the previous buffer or\n        // texture alive, so allocations written before the grow remain valid;\n        // only subsequent writes land in the new allocation.\n        let uses_webgl_instance_data = self.uses_webgl_instance_data;\n        let resources = self.resources_mut();\n        if uses_webgl_instance_data {\n            let max_texture_dimension = resources.device.limits().max_texture_dimension_2d;\n            let (instance_data, actual_capacity) =\n                Self::create_instance_texture(&resources.device, capacity, max_texture_dimension);\n            resources.instance_data = instance_data;","sourceCodeStart":1921,"sourceCodeEnd":1957,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_wgpu/src/wgpu_renderer.rs#L1921-L1957","documentation":"Second guard in `grow_instance_data` after capacity computation: even at the clamped maximum capacity the buffer cannot satisfy `required` bytes, so the frame's instance data exceeds the renderer's hard cap. Same root cause as the companion error — an oversized instance batch.","triggerScenarios":"Thrown at crates/gpui_wgpu/src/wgpu_renderer.rs:1939 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Batch the draw calls so each frame stays under the maximum instance data size.","Increase the configured maximum if workload requirements are legitimate.","Profile scene content producing the oversized batch (large path sets, huge text runs).","Return the error to the caller instead of allocating past the cap."],"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"}