Repository navigation
engine/update: compose a child of a destroyed parent as a root - #5082
Merged
Merged
Conversation
…PAGATE_TRANSFORM destroyEntity never cascades, so a child outlives its parent and still names it. buildSignature and the level pass read the parent through the asserting getEntityRecord, so the first tick after the destroy failed the assert in Debug and dereferenced a null record in Release. Both sites now resolve the parent node through a non-asserting findRecord probe; a dead parent counts as a root, and the orphan keeps its CHILD_OF link. Two tests cover eager and deferred parent destroy, with a grandchild under the orphan. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jakildev
commented
Nov 12, 2026
jakildev
left a comment
Owner
Author
There was a problem hiding this comment.
Review — engine/update: compose a child of a destroyed parent as a root
Verdict: approve
Praise
findLiveParentNodecentralizes the non-asserting lookup for both topology paths, preserving the existing null-node-as-root contract without altering the orphan's relation.- The eager and deferred cases both cover an orphaned grandchild, so the re-partitioning path and subsequent child composition are exercised together.
Acceptance (issue #5080)
| Criterion | Status | Evidence |
|---|---|---|
| Eager parent destruction leaves the child composing as a root without throwing | Met | OrphanAfterEagerParentDestroyComposesAsRoot destroys through EntityManager::destroyEntity, checks tick() does not throw, and verifies the child world translation is its local (0, 3, 0). |
| Deferred destruction and an orphaned grandchild compose correctly | Met | OrphanAfterDeferredParentDestroyComposesAsRoot drains the deferred destruction and verifies child (0, 3, 0) and grandchild (0, 3, 2). |
The orphan retains its CHILD_OF link |
Met | Both new tests compare the masked result of getParent(child) with the destroyed parent id after propagation. |
| No transform-propagation regression | Met | Local fleet-build --detach --target IrredenEngineTest completed successfully, and fleet-run IrredenEngineTest --gtest_filter='PropagateTransformTest.*' passed 15/15. |
Checks
- The current GitHub
linux-buildand aggregateall-checkschecks are still pending; all completed checks are passing. They were not treated as green for this review.
🤖 Reviewed by Codex GPT-5 (review-pr skill)
Opus recheck not required.
10 of 11 tasks
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PROPAGATE_TRANSFORM'sbuildSignatureand level pass read a child's parent throughIREntity::getEntityRecord, which asserts on a dead id. A child whose parent was destroyed (destroyEntitynever cascades) failed that assert on the first tick after the destroy (Debug), or dereferenced a null record (Release).findLiveParentNodehelper built on the non-assertingEntityManager::findRecord. A dead or unplaced parent yields null, which both sites already treat as "compose as a root". The orphan keeps itsCHILD_OFlink; no semantics change.PropagateTransformTestcases: eagerEntityManager::destroyEntity(parent)and deferredIREntity::destroyEntity(parent)drained withdestroyMarkedEntities(), each with a grandchild under the orphan.Test plan
fleet-build --target IrredenEngineTestbuilds clean.build/IrredenEngineTest --gtest_filter='PropagateTransformTest.*': 15 of 15 pass.Orphan*tests fail (FAILED 2 tests); with it restored they pass.Acceptance evidence
EntityManager::destroyEntitycomposes as a root on the next tick;tick()does not throw and the child'sC_WorldTransformequals its local transformbuild/IrredenEngineTest --gtest_filter='PropagateTransformTest.OrphanAfterEagerParentDestroyComposesAsRoot'OK;EXPECT_NO_THROW(tick())holds and the child's world translation is(0, 3, 0)IREntity::destroyEntity(parent)drained at a flush, and for a grandchild under the orphan, whose world transform composes under the orphanbuild/IrredenEngineTest --gtest_filter='PropagateTransformTest.OrphanAfterDeferredParentDestroyComposesAsRoot'OK; grandchild world translation is(0, 3, 2)(the eager test checks the same)getParent(child)still returns the destroyed parent's id after the tickEXPECT_EQ(getParent(child) & IR_ENTITY_ID_BITS, parent & IR_ENTITY_ID_BITS)holds in bothbuild/IrredenEngineTest --gtest_filter='PropagateTransformTest.*'[ PASSED ] 15 tests.Notes for reviewer
fleet-pr-overlapreportsVERDICT: overlapwith #5073 onsystem_propagate_transform.hpp; the trial merge is clean. #5073 is the static-resident stack and depends on orphans deriving as roots (the design in #5062), so this fix is a prerequisite rather than a competitor.Closes #5080
🤖 Generated with Claude Code