{"record":{"id":"10de468738f50db8","repo":"bevyengine/bevy","slug":"hierarchyredundancy","errorCode":"HierarchyRedundancy","errorMessage":"The hierarchy of system sets contains redundant edges: {0:?}","messagePattern":"The hierarchy of system sets contains redundant edges: (.+?)","errorType":"error_code","errorClass":"ScheduleBuildWarning","httpStatus":null,"severity":"warning","filePath":"crates/bevy_ecs/src/schedule/error.rs","lineNumber":62,"sourceCode":"    /// A warning that was elevated to an error.\n    #[error(transparent)]\n    Elevated(#[from] ScheduleBuildWarning),\n}\n\n/// Category of warnings encountered during [`Schedule::initialize`](crate::schedule::Schedule::initialize).\n#[non_exhaustive]\n#[derive(Error, Debug)]\npub enum ScheduleBuildWarning {\n    /// The hierarchy of system sets contains redundant edges.\n    ///\n    /// This warning is **enabled** by default, but can be disabled by setting\n    /// [`ScheduleBuildSettings::hierarchy_detection`] to [`LogLevel::Ignore`]\n    /// or upgraded to a [`ScheduleBuildError`] by setting it to [`LogLevel::Error`].\n    ///\n    /// [`ScheduleBuildSettings::hierarchy_detection`]: crate::schedule::ScheduleBuildSettings::hierarchy_detection\n    /// [`LogLevel::Ignore`]: crate::schedule::LogLevel::Ignore\n    /// [`LogLevel::Error`]: crate::schedule::LogLevel::Error\n    #[error(\"The hierarchy of system sets contains redundant edges: {0:?}\")]\n    HierarchyRedundancy(#[from] DagRedundancyError<NodeId>),\n    /// Systems with conflicting access have indeterminate run order.\n    ///\n    /// This warning is **disabled** by default, but can be enabled by setting\n    /// [`ScheduleBuildSettings::ambiguity_detection`] to [`LogLevel::Warn`]\n    /// or upgraded to a [`ScheduleBuildError`] by setting it to [`LogLevel::Error`].\n    ///\n    /// [`ScheduleBuildSettings::ambiguity_detection`]: crate::schedule::ScheduleBuildSettings::ambiguity_detection\n    /// [`LogLevel::Warn`]: crate::schedule::LogLevel::Warn\n    /// [`LogLevel::Error`]: crate::schedule::LogLevel::Error\n    #[error(transparent)]\n    Ambiguity(#[from] AmbiguousSystemConflictsWarning),\n}\n\nimpl ScheduleBuildError {\n    /// Renders the error as a human-readable string with node identifiers\n    /// replaced with their names.\n    ///","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/schedule/error.rs#L44-L80","documentation":"`HierarchyRedundancy` is a build warning (enabled by default) that the set-hierarchy graph contains edges already implied by transitive containment — e.g. C in B, B in A, plus an explicit C in A. The extra edge is not wrong, just redundant; it is reported because redundant edges usually indicate unintended hierarchy structure. It can be silenced via `ScheduleBuildSettings::hierarchy_detection = LogLevel::Ignore` or escalated to an error with `LogLevel::Error`.","triggerScenarios":"`.configure_sets(Update, (A, B.in_set(A), C.in_set(B).in_set(A)))` — the C→A edge is redundant; two plugins both nesting a shared set into the same ancestor.","commonSituations":"Plugin ecosystems where several plugins configure nesting into a common base set; refactors that add a direct `in_set` shortcut while the transitive path remains; merging example code that re-declares existing hierarchy edges.","solutions":["Delete the implied edge (keep only `C.in_set(B)` in the example) so each nesting is declared once","Centralize set-hierarchy declaration in the plugin that owns the sets instead of repeating edges across plugins","If the redundancy is intentional, set `hierarchy_detection: LogLevel::Ignore` in that schedule's build settings to silence the warning"],"exampleFix":"// before\napp.configure_sets(Update, (A, B.in_set(A), C.in_set(B).in_set(A))); // warning: C->A redundant\n\n// after\napp.configure_sets(Update, (A, B.in_set(A), C.in_set(B)));","handlingStrategy":"fallback","validationCode":"// Before running, configure tolerance for known-redundant hierarchies\nlet mut schedule = schedules.get_mut(Update).unwrap();\nlet mut settings = schedule.get_build_settings().clone();\nsettings.hierarchy_detection = LogLevel::Ignore;\nschedule.set_build_settings(settings);","typeGuard":null,"tryCatchPattern":"// Warnings are logged during initialize; to fail closed instead, escalate:\nsettings.hierarchy_detection = LogLevel::Error; // HierarchyRedundancy becomes ScheduleBuildError\nmatch schedule.initialize(&mut world) {\n    Err(ScheduleBuildError::Elevated(w)) => { /* inspect warning, fix edges */ }\n    _ => {}\n}","preventionTips":["Declare each containment edge once, in the owning plugin","Treat the warning as a design smell: flatten the shortcut edge rather than silencing","Use LogLevel::Error in CI to keep the hierarchy minimal, Ignore only for legacy schedules you cannot fix yet"],"tags":["bevy","ecs","schedule","system-sets","warning"],"backgroundTag":"redundant-dependency-declaration","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}