RenderLimits

constructor(maxInstances: Int, maxDepth: Int = 24, templateFanout: Int = 2)

Parameters

maxInstances

how many component instances one surface may draw. The adjacency list is a graph rather than a tree, so this is not bounded by the number of components an agent sends: n layers that each name the same two children expand to 2^n instances from 2n components, and neither a depth bound nor a cycle check stops that -- no path repeats an id and none of them is deep. The default is the largest breadth measured to compose to completion (about 500ms on Chrome, 212ms on the JVM at 5,000 plain widgets). A surface that must show more than this wants the host's lazy layout, which a library cannot impose on a renderer it did not write.

maxDepth

how deeply a surface may nest before drawing stops. The default is derived from two measurements: the official example corpus needs 7 levels at most (median 5), and the point where composition breaks moves with how many frames a widget nests per level -- 216 for a plain container, about 36 for a widget stacking six. 24 is 3.4x what real content needs and two thirds of the break for a heavy widget. Both sides have room because the break is neither catchable nor recoverable.

templateFanout

how many instances a ChildReference.Template counts as when the cost of a surface is being estimated from its components alone. Counting a template as one is unsound: nested templates and templates reached along many structural paths multiply, and a count that summed them would report a surface as cheap and then draw the product. The default is the smallest value that still multiplies -- how many items a template actually yields is the agent's data model talking rather than its component graph, and that is bounded where it arises, when the reference is expanded.