Skip to content

Reduce transform allocations and native model memory - #171

Merged
capz merged 1 commit into
mainfrom
perf/sdk-memory-reduction
Nov 12, 2026
Merged

capz merged 1 commit into
mainfrom
perf/sdk-memory-reduction

Conversation

@capz

@capz capz commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Transforms eagerly allocated local matrices and child collections even for root objects, while native model batching reserved two full tables for a combined 4,096-mesh limit and skinning reserved 256 joints per instance. Reserve hierarchy storage during attachment, share one bounded submission table, and size skinning palettes from validated model joints when workspace is allocated. Public APIs and steady-state allocation behavior are preserved.

Measured savings:

  • 128 root transforms: 47,128 → 28,696 B of warmed host CLR allocations (18,432 B saved); PPC layout accounting is documented separately.
  • Model batching: 65,536 B less native static storage when that path is linked, with unchanged opaque/alpha ordering and capacity.
  • Two-joint skinning: 32,800 → 288 B workspace charge; net PPC instance saving is 32,508 B after the cached-stride field. Maximum-size skins retain their workspace size.

The audit includes reproducible measurements, conditional-linkage/heap-reservation caveats, and deferred opportunities in materials, streaming textures, native buffers, draw scratch and animation poses. Engine-side work is in capz/hypercube-engine#19.

Validation: focused CLR Debug/Release and zero-allocation checks; full native model/import/animation, production GX recording (4,096 opaque/alpha/mixed and 4,097 rejection), AOT and GC-stress acceptance; palette ASan/UBSan checks; CI selection/coverage invariants; Hypercube managed integration and PPC native build. The combined engine/SDK build passed all eleven Dolphin streaming scenarios, with an exact 199,680-pixel occlusion comparison and 140.8 seconds of continuous DSP audio. All GitHub checks on this SDK PR are green.

@capz
capz merged commit bac008e into main Nov 12, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant