Repository navigation
perf(scene): index root positions inside the hierarchy owner #42
Description
Verified on branch / awaiting merge
Production implementation: dd5979c613b0fe8ebd9f7026f25001ceee9f8cee. Delivered head: dbae93e8f211d45a69cdffdb6afa3a33a0af0fa5; the subsequent diff contains documentation/acceptance evidence only. Exact-head CI: Engine CI and NuGet dependency graph passed; all six checks on this exact head are successful. All applicable acceptance conditions for this issue are verified; unavailable physical/manual device checks are explicitly scoped, not reported passed.
Owner: Scene-owned root placement indices. Implementation commits: 63d4f7dc.
Evidence: complete report, exact-head delivery attachment, portable test-case/raw-measurement/requirement indexes linked by the report. Specific proof: Scene: creation/reorder/parent/transfer/failure indices; Quantitative: five paired 10k Hierarchy producers; Original profile retains repeated IndexOf evidence.
Commands: official tests/Invoke-EditorUiAcceptance.ps1 Contracts/Workflows/Visual/Lifecycle/Products with SDK-selected independent outputs; complete source/entry preparation; formal InnoEngine.Build scripts --ide for the three companions; tests/Invoke-WikiChecks.ps1; controlled public performance fixtures where applicable. The report records original command owners, TRX/binlogs, negative tests, failures, skips, input hashes and device limits.
Profiles overlap; do not sum their pass counts into a distinct-test claim. Windows-only sharing fixtures and Unix-only filesystem fixtures are scoped to the executing host. Real native contexts/simulated display metrics and hidden product feature journeys are not a claim of physical display, OS IME or manual Mac testing. No BGCS/vendor/package/generated-binding modification, parallel Core system, test hook, IVT or private reflection was used.
Keep this issue Open. PR #26 includes an individual Fixes #42 and will close it only when the user merges to master. No automatic merge or premature master-resolution claim.
Original defect, ownership and accepted work
The following baseline observations describe the issue as opened. The verification above supersedes intermediate pending checkpoints; original failed/negative logs remain preserved. Acceptance checkboxes are checked only after the exact delivery-head verification completes.
Approved-plan mapping
E07 / #34 (large hierarchy work), E11 / #38 (repeatable performance acceptance).
Confirmed finding
A real 10,000-root hierarchy workload still spends about 3.4–4.0 seconds per measured frame after presentation clipping. A captured managed stack identifies HierarchySelection.GetRootObjects sorting roots by Transform.siblingIndex; each comparison calls HierarchyService.GetSiblingIndex and scans the root list with List.IndexOf. This is repeated linear lookup inside sorting. The issue is independent of BGCS.
Owner and boundaries
The authoritative root ordering belongs to Inno.Scene.HierarchyService. The UI must not introduce another hierarchy authority, public API, or live-object cache across generation boundaries.
Implementation
Maintain a derived root-position index inside the existing hierarchy owner. Register, unregister, reparent, sibling reorder and Clear must update or invalidate it atomically with the existing ordered list. Remove retired references immediately. Preserve all public signatures and observable root/sibling ordering. Do not change child identity, serialization or History protocols.
Failure and lifecycle
Invalid reparent operations must leave ordering unchanged. Cross-scene transfer, destroy and scene disposal must not retain old roots. No global cache, Events replacement, BGCS changes or compatibility branch.
Acceptance
- Public scene tests cover root creation, sibling reorder, parent/unparent, destroy and cross-scene transfer.
- Invalid hierarchy requests preserve existing indices.
- Large hierarchy sampling no longer shows repeated List.IndexOf inside sorting.
- Five repeated comparable measurements and allocation counts are recorded; a reproducible >10% regression remains blocking.
- Architecture, API documentation and affected UI regressions pass.
Dependencies and evidence
Refs #34 and #38. Evidence owner: editor-ui-closure-2026-10-27/e07. Record implementation commit and final commands before marking Verified on branch / awaiting merge. Keep this issue open until PR #26 merges.
Activity
FLwolfy commentedon Oct 27, 2026
The root-position fix passes 22 public Scene/Transform regressions and reduces the 10,000-root median from approximately 3.7 seconds to 156 ms. E07 still requires visible-row submission and unchanged-view reuse. The next necessary boundary is a read-only GameScene.hierarchyRevision, supplied by the existing hierarchy owner, so presentation can invalidate neutral ID/depth snapshots without polling or duplicating hierarchy state. It introduces no mutation API or live-object registry. Creation, deletion, reparent, sibling order and Clear must invalidate it; tests will verify those changes before acceptance.