Counts SolverStatistics in one
pass per collection, from §113's DebugBodyAccess — which every
PhysicsSolverAdapter satisfies structurally, so world.adapter is what you
pass.
out follows §7b's out-parameter convention: pass a record to reuse and this
allocates nothing; omit it and one plain object is allocated (a record, not a
math type — the constructionCount() allocation tests do not see it).
Why it lives here and not in debug-draw.ts, where it shipped until
2026-08-08 (A-6): that module allocates module-level scratch math objects and
freezes its staged-feature list, so a bundler keeps the whole file the moment
anything in it is named — 939 B gzip, measured on examples/ui-demo, for a
frame loop that wanted one integer. four's Application reports §84's
activeBodies from here every frame that asks for statistics; a debug overlay
is a different and much rarer thing to be paying for. The seam types stay in
debug-draw.ts — a type costs nothing to import.
Counts SolverStatistics in one pass per collection, from §113's
DebugBodyAccess— which everyPhysicsSolverAdaptersatisfies structurally, soworld.adapteris what you pass.outfollows §7b's out-parameter convention: pass a record to reuse and this allocates nothing; omit it and one plain object is allocated (a record, not a math type — theconstructionCount()allocation tests do not see it).Why it lives here and not in
debug-draw.ts, where it shipped until 2026-08-08 (A-6): that module allocates module-level scratch math objects and freezes its staged-feature list, so a bundler keeps the whole file the moment anything in it is named — 939 B gzip, measured onexamples/ui-demo, for a frame loop that wanted one integer.four'sApplicationreports §84'sactiveBodiesfrom here every frame that asks for statistics; a debug overlay is a different and much rarer thing to be paying for. The seam types stay indebug-draw.ts— a type costs nothing to import.