pub struct ContextBudget {
pub total: usize,
pub atlas: usize,
pub surface: usize,
pub task_delta: usize,
pub structural_source: usize,
}Expand description
The startup/task context budget split (Wave 14 dynamic budgets).
Fields§
§total: usize§atlas: usize§surface: usize§task_delta: usize§structural_source: usizeImplementations§
Source§impl ContextBudget
impl ContextBudget
Sourcepub fn adaptive(
total: usize,
entity_count: usize,
component_count: usize,
flow_count: usize,
surface_candidates: usize,
) -> ContextBudget
pub fn adaptive( total: usize, entity_count: usize, component_count: usize, flow_count: usize, surface_candidates: usize, ) -> ContextBudget
Adaptive startup split: scale the Atlas/Surface allocation by repo
complexity instead of the fixed 13:7 default. Tiers by entity count
(component count escalates to large; flow count escalates to
architecture-heavy):
- tiny (
entity_count < 200): 55/45 — a small atlas leaves room for a proportionally larger surface; - ordinary: 60/40;
- architecture-heavy (
flow_count > 40): 65/35 — flows, routes and contracts are Atlas content, so a flow-dense repo needs the Atlas slice even when its entity count is ordinary; - large (
entity_count > 5000orcomponent_count > 30): 65/35 — the atlas dominates; - massive (
entity_count > 20_000): 70/30 with the surface slice capped absolutely ([MASSIVE_SURFACE_CAP]) and no candidate boost.
Within a tier, the actual candidate pool feeds the surface share:
every 2,000 surface candidates earns up to +5 percentage points
(surface never over 50% of the total), so a repo whose surface map
is genuinely large gets a proportionally larger surface slice.
total is caller-supplied — adaptive scales the SPLIT, never the
total. Deterministic and no-panic. Defaults stay for callers that
do not adapt.
Trait Implementations§
Source§impl Clone for ContextBudget
impl Clone for ContextBudget
Source§impl Debug for ContextBudget
impl Debug for ContextBudget
Source§impl Default for ContextBudget
impl Default for ContextBudget
Source§impl<'de> Deserialize<'de> for ContextBudget
impl<'de> Deserialize<'de> for ContextBudget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContextBudget
impl PartialEq for ContextBudget
Source§impl Serialize for ContextBudget
impl Serialize for ContextBudget
impl StructuralPartialEq for ContextBudget
Auto Trait Implementations§
impl Freeze for ContextBudget
impl RefUnwindSafe for ContextBudget
impl Send for ContextBudget
impl Sync for ContextBudget
impl Unpin for ContextBudget
impl UnsafeUnpin for ContextBudget
impl UnwindSafe for ContextBudget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more