pub struct SessionLimits {
pub max_depth: usize,
pub max_aggregate_elements: usize,
}Expand description
Recursion budget for chained IFC references.
IFC places no normative limit on placement or mapped-item nesting, so a budget is the only way to terminate on malformed input that is deep rather than strictly cyclic.
Fields§
§max_depth: usizeMaximum simultaneously active entities in one chain.
max_aggregate_elements: usizeMaximum elements one file-declared aggregate may materialize.
Implementations§
Source§impl SessionLimits
impl SessionLimits
Sourcepub const DEFAULT_MAX_DEPTH: usize = 64
pub const DEFAULT_MAX_DEPTH: usize = 64
Depth budget used when a caller states no preference.
Real exporter output nests placements a few levels deep; 64 is far above observed depth while still terminating quickly on bad input.
Sourcepub const DEFAULT_MAX_AGGREGATE_ELEMENTS: usize = 16_777_216
pub const DEFAULT_MAX_AGGREGATE_ELEMENTS: usize = 16_777_216
Aggregate-element budget used when a caller states no preference.
Sized against the largest thing a legitimate file plausibly declares:
a dense triangulated face set of ~5.5M triangles expands to 16M
indices, and the largest observed knot vectors are four orders of
magnitude smaller. 16M f64 is ~128 MiB, which bounds a single
aggregate to something a workstation survives while still refusing the
billion-element declarations that motivate this budget.
This is a refusal threshold, never a truncation point: an aggregate
over the limit produces crate::GeometryError::AggregateTooLarge
naming the entity, and no geometry is emitted for it.