Repository navigation
docs: design static residents that stop costing per-update work - #5062
Conversation
A resident entity that cannot change is still walked by the transform, voxel-position, fog and modifier systems every update. This document fixes the semantics for stopping that: the owner declares an entity static with a tag, which removes it from every system that writes its pose inputs; the ordinary systems then derive from the frozen inputs once more, and the engine adds a second tag that removes it from them. No second code path computes derived state. It states what each system and reader may assume about a settled entity, what happens to each kind of forbidden write, the rule text the design needs changed, the bytes, the public contract changes, and the nine gates and three fixtures the implementation is held to. The evidence file records the component sizes on this tree and the measured cost of an archetype move (0.20 to 0.28 us per entity), from a throwaway Release probe whose source is reproduced in the file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: approve, pending final Opus recheck.
Praise
docs/design/static-residents.md:44makes the two-tag transition explicit: writers stop before the final pipeline derivation, thenC_Settledremoves steady-state work. That preserves the ordinary derivation path instead of introducing a duplicate settle path.docs/design/static-residents.md:290enumerates fog inputs and makes an armed pass cover the full stagger period, so a settled subject remains correct when world-scoped fog state changes.docs/design/static-residents.md:629turns the implementation ticket into measurable gates, including an always-dynamic twin and the regressions most likely to hide an invalid static-state transition.
Acceptance (issue #5008)
All six planned criteria are met: the change is confined to the design document and its committed measurement evidence; it covers each requested system and reader contract, identifies the governing ECS rules and requested replacement text, defines measurable gates and fixtures, classifies evidence with provenance, and keeps the owner-merge notice as the PR body's first line.
Validation reviewed
git diff --check origin/master...HEAD— clean.python3 scripts/lint_instruction_refs.py— 0 dead references; only three pre-existing stale-baseline entries reported.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; 10 inherited offenders reported.- Head checks are complete and successful; the docs-only fleet test is intentionally skipped.
Next step
Repository owner review and an Opus-class architectural pass should confirm the proposed matching and scheduler contracts before merge.
🤖 Reviewed by Codex (runtime codex; GPT-5; review-pr skill)
Opus recheck required: this design defines new ECS matching and scheduler contracts across pose writers, fog, and LOD.
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: needs-fix
Sonnet flagged the new ECS matching and scheduler contracts; on closer read I agree the escalation was required. The archetype-routing direction is sound, but the document does not yet close three contracts that #5009 needs in order to preserve the stated invariants.
Needs-fix
-
docs/design/static-residents.md:151— promotion is keyed to entering the settling archetype and completing the deriving systems, but the round is not invalidated when an input changes after its deriving system has already run.resettleonly removesC_Settled, so it is tag-wise a no-op for an entity that is already settling; similarly,MODIFIER_RESOLVE_GLOBALcan run and then a global modifier can be pushed before the promotion flush. Either path can promote staleC_WorldTransform/C_ResolvedFieldseven though the document promises the value current when the entity settled. Define the cutover explicitly: every resettle-worthy mutation while settling must restart the entity's settle epoch, and the global-modifier value frozen by the last resolver pass needs a revision/cutoff rule. Add positive tests that mutate after the relevant deriving dispatch but before promotion, including a global push in that window. -
docs/design/static-residents.md:217— the promise that existingC_VoxelSetNewmutators automatically resettle their target has no entity-aware ownership path.C_VoxelSetNew::editVoxels,carve,resyncAfterRawEdits,resyncAfterAuthoredEdits, andattachToCanvasreceive only the component, not its owningEntityId; the component-method contract also forbids a component from reaching back into the ECS. The direct LualodMin/lodMaxsetters have the same shape. That cannot satisfy “the caller never has to remember it” without either breaking/migrating these APIs, adding accounted owner identity, or introducing a feature-owned entity-keyed mutation queue. Lock one route in the design, include its migration and byte cost, and make the direct C++ and Lua paths part of gate 5. -
docs/design/static-residents.md:429— universal implicit exclusion is assigned to registration, whileC_Staticis owned by the higher-level prefab module. The document does not define how the generic system layer learns that component without reversing the module dependency, nor how one policy stays identical acrossregisterSystem,createSystem,executeQuery, runtime Lua EVAL, and generated Lua systems. Specify the generic hook/access-policy boundary and its initialization order (or relocate the marker to an appropriate lower layer), then require coverage for each registration/query lane. Otherwise creation-defined writers can bypass the “never matches a static entity” contract.
Acceptance (issue #5008)
The scope, evidence, rule-replacement text, gates, and owner-merge notice are present. Criterion 2 is not yet substantively met because the transition and forbidden-write answers above do not define an implementable, race-free contract for all named mutation and registration paths.
Validation reviewed
- Head
6f0ef526118e6730b7ad33e53c89e01be9aa6174is mergeable and all required GitHub checks are complete and successful; the docs-only fleet test is intentionally skipped. git diff --check origin/master...HEAD— pass.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— pass with 10 inherited offenders.- Full-tree
python3 scripts/lint_instruction_refs.pyexits 1 on two unchangedattach-screenshotspaths plus three stale baseline entries; none is introduced by this two-file docs diff, and the head's changed-scope instruction-refs check is green.
Praise
- The two-tag ordering avoids a duplicate derivation path and correctly separates owner declaration from engine-confirmed settlement.
- The fog trigger table and the explicit “armed for the full stagger period” rule are the right shape for preserving world-scoped inputs without a per-row dirty flag.
Test plan the author should run before merge
- Add contract examples/tests for mid-round resettle, pre-promotion global-modifier change, entity-aware voxel/LOD mutation, and every C++/Lua registration lane.
- Re-run the docs validators after revising the design.
🤖 Reviewed by Codex (runtime codex; GPT-6.1 Sol; review-pr skill)
Address the three needs-fix contracts on the static-residents design: - Cutover: rounds are counted with roundsOpened_/roundsCompleted_ and an ordered cursor; each settling entity carries a settle stamp that every resettle-worthy mutation and hold restarts, and a world-scoped global floor restarts every settling entity on a global-modifier change. The drain applies its own structural changes, so no mutation lands between a promotion decision and the move. - Mutator route: C_VoxelSetNew methods reach their entity through the existing ownerEntityId_ (adopted by the drain for every static set) and a padding-byte ownerStatic_ routing bit; Lua lodMin/lodMax setters route through a new setLodBand; any other archetype move drops C_Settled. - Policy boundary: a per-component guard trait at the entity layer, recorded per ComponentId at registration, the tags moved to the system layer, and one exclusion function on every C++ and Lua registration and query lane, with no initialization order. Gates 4, 5 and 6 gain the matching tests and a recolored dynamic fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (head
— worker |
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: approve, pending final Opus recheck.
The revised design closes the three prior implementation-contract gaps. The round stamp and global floor now make a mid-round input or global-modifier change restart settlement before promotion; the voxel/LOD mutation route is entity-aware without changing callers; and the entity-layer guard plus the listed C++/Lua lanes gives the static exclusion one defined policy boundary.
Praise
docs/design/static-residents.md:151defines a cutover that excludes a round already in progress and requires a complete later round before promotion. The new Gate 4 cases make the ordering observable for both entity-local and global inputs.docs/design/static-residents.md:350makesownerEntityId_adoption and theownerStatic_routing hint precise, including the pre-adoption and stale-hint cases, while keeping ECS lookup out of the component method.docs/design/static-residents.md:587assigns the component guard, runtime guard table, tag ownership, and one exclusion function to layers that have the needed information, then requires coverage for every registration and query lane.
Acceptance (issue #5008)
All six planned criteria are met: this is a docs-only design plus committed measurement evidence; it defines the requested system and reader contracts; it cites the governing rules and exact replacement text; it specifies measurable gates and fixtures; it classifies evidence with provenance; and the PR preserves repository-owner merge authority.
Validation reviewed
git diff --check origin/master...HEAD— clean.- GitHub checks on
b80b18562d9508384f886eb040b1e58cd2445ab0are complete and successful; the docs-only fleet test is intentionally skipped. - No inline-review comments are outstanding.
Next step
An Opus-class pass should confirm the core matching, round-tracking, and gated fog/LOD scheduler contracts before the repository owner decides whether to merge.
🤖 Reviewed by Codex (runtime codex; GPT-5; review-pr skill)
Opus recheck required: this design changes ECS matching and scheduler contracts across pose writers, fog, and LOD.
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: needs-fix
Sonnet flagged the revised ECS matching and scheduler contracts; on closer read I agree that the prior three gaps are substantially closed, but I disagree with approval because the written round algorithm still has three correctness holes at the scheduler boundary.
Needs-fix
-
docs/design/static-residents.md:259— the drain collects rows that can be promoted before step 3 observes a new global-modifier revision and raisesglobalFloor_. A global push afterMODIFIER_RESOLVE_GLOBALbut before this drain can therefore enter the candidate set under the old floor—the exact stale-promotion window the revision is meant to close. Move the revision comparison/floor update before eligibility collection, or state that step 4 revalidates every candidate against the updated floor; the existing Gate 4 “global push after round close” case should pin that order. -
docs/design/static-residents.md:168— the single declaration-order cursor does not define a race-free round forregisterPipelineGroups.SystemManager::executePipelinedispatches members of a multi-system group concurrently on workers; declaration order is only the no-worker fallback. A creation system becomes a deriving system simply by addingExclude<C_Settled>, so two non-conflicting deriving systems can share a group and complete out of order. Advancing one shared cursor from those dispatches is either racy or leaves a valid group unable to complete a round. Either reject deriving systems in multi-system groups, or define group-aware completion on the main thread after the group joins, and add a positive test with two grouped deriving systems. -
docs/design/static-residents.md:86—settleStamp_is fixed atstd::uint32_t, while promotion uses ordinary ordering andmax(settleStamp_, globalFloor_)over monotonically advancing round numbers. At 60 completed rounds per second it wraps in about 2.3 years; after wrap an old high floor/stamp can hold new residents indefinitely, and a wider manager counter would instead truncate when stored. Lock the counter widths and wrap-safe comparison/reset contract (or use a non-wrapping width), reconcile the five-byte memory claim if needed, and test the rollover boundary.
Acceptance (issue #5008)
All seven issue criteria are structurally met: the PR is limited to the design and its measurement evidence; every requested system/reader contract has a section; four exact rule replacements are supplied; the four fixtures and nine measurable gates are present; numeric evidence is classified with provenance; the owner-merge notice is first; and no CLAUDE.md pointer was added. The needs-fix items above are internal correctness defects in the chosen scheduler contract, not missing acceptance sections.
Validation reviewed
- Head
b80b18562d9508384f886eb040b1e58cd2445ab0is mergeable and all current required GitHub checks are complete and successful; the docs-only fleet test is intentionally skipped. git diff --check origin/master...HEAD— pass.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— pass with 10 inherited offenders and none introduced.- No inline review comments are outstanding.
Praise
- The revised stamp/floor concept correctly separates entity-local and world-scoped invalidation, and the positive cutover matrix is strong.
- Moving the tags to the system layer and centralizing the guard policy gives every typed and runtime registration lane an implementable dependency direction.
- The owner-adoption route keeps ECS lookup out of
C_VoxelSetNewmutators and accounts for both pre-adoption edits and stale routing hints.
Test plan the author should run before merge
- Pin global-floor observation before candidate promotion.
- Exercise a round containing two non-conflicting deriving systems in one parallel group.
- Exercise round/stamp behavior immediately across the chosen rollover boundary.
- Re-run the docs validators after reconciling the algorithm and byte table.
🤖 Reviewed by Codex (runtime codex; GPT-6.1 Sol; review-pr skill)
jakildev
left a comment
There was a problem hiding this comment.
Third round
Review — docs: design static residents that stop costing per-update work
Verdict: needs-fix
Sonnet flagged the implementation-facing scheduler, entity-layer trait, and matching-policy contracts. On closer read I confirm the orphan-parent transition, declared/effective exclusion split, and cross-pipeline round accounting are coherent, but I disagree with approval because the document applies registered-system round semantics to one-shot query lanes that have no round membership.
Needs-fix
docs/design/static-residents.md:836-887, 1382-1392— the policy definesExclude<C_Settled>as the declaration that makes a derived-pose writer a deriving system, and Gate 5 applies the resulting “visits settling rows … and counts in the round” requirement to every lane, explicitly includingexecuteQuery<Cs...>andexecuteQueryDynamic. Those query APIs deliberately register nothing:IRSystem::executeQueryDynamichas noSystemIdor pipeline slot, and its documented contract is a serial run-now traversal with no persistent scheduler state. It therefore cannot join a deriving group, enter that group's pending set, or count towardroundsCompleted_. The same gate also requires a const/readsreader to visit static rows on every lane, but the runtime query surface accepts only include/exclude archetypes and a node body; unlike the proposedcreateSystemDynamicchange, it has noreadOnlydescriptor. Separate the one-shot-query policy from registered-system round membership. Only persistent pipeline systems can be deriving round members; for each query lane, specify whether a derived-pose write is rejected or conservatively excludesC_Static, and either add a read-only descriptor toexecuteQueryDynamicor document its all-write behavior and adjust Gate 5 and the migration contract. As written, #5009 cannot implement the stated lane matrix or its positive test.
Acceptance (issue #5008)
All six planned criteria are structurally present: the PR is limited to the design and permitted measurement evidence; it covers the requested systems and readers; it supplies the governing rule map and four replacement passages; it defines fixtures and nine measurable gates; it classifies evidence with conditions; and the PR body preserves repository-owner merge authority. The finding above is an internal contradiction in the chosen matching/round contract and makes part of Gate 5 unimplementable, rather than a missing acceptance section.
Validation reviewed
- Checked out
035c1c1151334a7fbd776bab74624d04c4dc1766, matching the live PR head. - Read the complete issue #5008 and PR #5062 threads, all twelve submitted reviews, all seven author responses, both changed files, issue #5080, and the cited hierarchy/query scheduler paths; there are no inline review comments.
- Live GitHub checks are complete and successful; the docs-only
fleet-testsjob is intentionally skipped. git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; ten inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; three inherited.
Praise
- The orphan-parent rule now preserves the entity layer's non-cascading destruction semantics while making the surviving subtree's re-derivation and #5080 dependency explicit.
- The settle stamp, global floor, main-thread group cursor, and declared/effective exclusion split close the previously identified stale-promotion and filter-provenance windows.
Test plan the author should run before merge
- Reconcile one-shot query matching with the rule that only registered pipeline systems participate in deriving rounds.
- Make the runtime-query read/write contract expressible and update Gate 5 so every listed lane has an implementable positive test.
- Re-run the documentation validators after revising the matching-policy and gate text.
🤖 Reviewed by Codex (runtime codex; GPT-5; opus-reviewer, review-pr skill)
A one-shot query registers nothing, so it cannot join a deriving group, enter a pending set, or move the round cursor. The matching policy now limits deriving membership to registered pipeline systems and treats every query as non-deriving: a derived-pose writer query excludes C_Static even with Exclude<C_Settled>, GatesSettled in an executeQuery pack is a static_assert, and executeQueryDynamic gains a defaulted readOnly archetype so a runtime reader can still see static rows. Gate 5 splits into system-lane and query-lane matrices with an implementable test each, and the migration and public contract lists follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (eighth needs-fix review, head
— worker (pool-1) |
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: approve
The latest revision resolves the prior one-shot-query contradiction. It now confines deriving-round membership to registered pipeline systems, while queries apply the static exclusion solely from their declared access and never affect round state. The parent-destruction, settled-note, global-floor, and declared-versus-effective-filter contracts remain coherent on this head.
Praise
docs/design/static-residents.md:836makes query lanes explicitly non-deriving and preserves their ability to read static rows only throughconst/readOnlydeclarations.docs/design/static-residents.md:1465splits the system-lane and query-lane Gate 5 coverage, so the implementation has an executable positive test for both policy shapes.docs/design/static-residents.md:483preserves existing non-cascading parent-destruction semantics while requiring the resulting orphan to derive as a root, with the required #5080 dependency stated.
Acceptance (issue #5008)
All six criteria are met: the diff is limited to the design and committed probe evidence; it specifies the required static-resident and reader contracts; maps each mechanism to governing rules and exact requested text; defines measurable fixtures and gates; classifies quantitative evidence with reproducible conditions; and reserves merge authority to the repository owner.
Validation reviewed
- Checked out
7ded02267217190973360dd968effe23894f65b2, matching the live PR head. - Read the complete issue and PR discussion, including the eight author responses, prior reviews, and the absence of inline review comments.
git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; 10 inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; 3 inherited.- Current GitHub checks are successful; the docs-only
fleet-testsjob is skipped.
🤖 Reviewed by Codex (runtime codex; GPT-5; sonnet-reviewer, review-pr skill)
Opus recheck required: this design defines core ECS matching, entity-layer mutation, and cross-pipeline scheduler contracts.
jakildev
left a comment
There was a problem hiding this comment.
Third round
Review — docs: design static residents that stop costing per-update work
Verdict: needs-fix
Sonnet flagged the core ECS matching, entity-layer mutation, and cross-pipeline scheduler contracts. On closer read I confirm the latest one-shot-query split, settled-note stamping, orphan-parent handling, declared/effective exclusion split, and round accounting are coherent, but I disagree with approval because the design's engine-owned settled-state invariant is still only a convention at the public component boundary.
Needs-fix
docs/design/static-residents.md:96-97, 1043, 1155— the design says only the engine adds or removesC_Settledand that it never exists withoutC_Static, then publishes both as ordinary new components. Nothing specifies how that invariant is enforced. The current genericIREntity::createEntity,setComponent, andsetComponentDeferredtemplates accept any constructible component, so C++ can create an entity withC_Settledalone, attach it to a dynamic entity, or attach it to a settling entity before the required round completes. The first two cases leave pose writers matching while every deriving system withExclude<C_Settled>skips the row; the third bypasses the settle stamp, global floor, pending groups, and promotion budget. Specify an unbypassable construction/mutation boundary for the tag (for example, an entity-layer attach rule or an actually internal capability rather than a public aggregate), including the runtime/Lua component lanes if the type is exposed there. Gate 5 should prove that direct creation and direct attachment cannot produceC_SettledwithoutC_Staticor promote a settling row before a qualifying complete round.
Acceptance (issue #5008)
All seven criteria are met structurally: the diff contains only the design and its cited probe evidence; every requested transition, system/reader, forbidden-write, bytes, contract, and gate section is present; the rule map and four exact replacements are supplied; all defaults are adopted or measurably replaced; numeric evidence is classified with conditions; the PR reserves merge authority to the repository owner; and the instruction-size check has no introduced offender. The finding above is an internal correctness gap in the chosen two-tag contract, not a missing acceptance section.
Validation reviewed
- Checked out
7ded02267217190973360dd968effe23894f65b2, matching the live PR head. - Read the complete issue #5008 and PR #5062 threads, all eight author responses, all fourteen submitted reviews, both changed files, and issue #5080; there are no inline review comments.
git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; ten inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; three inherited.- Live GitHub checks are complete and successful; the docs-only
fleet-testsjob is intentionally skipped.
Praise
- The system/query distinction now keeps one-shot queries out of deriving rounds and gives each query lane an implementable access contract.
- The settle stamp, global floor, group cursor, and declared/effective exclusion split close the previously identified stale-promotion and filter-provenance windows.
- The orphan-parent contract preserves existing entity semantics while making the required #5080 dependency explicit.
Test plan the author should run before merge
- Make
C_Settledattachment engine-only by construction or enforce the companion/transition rule at every generic attach path. - Add positive tests for direct create/attach attempts on dynamic and settling entities, including every exposed runtime/Lua lane.
- Re-run the documentation validators after specifying that boundary and its gate coverage.
🤖 Reviewed by Codex (runtime codex; GPT-5; opus-reviewer, review-pr skill)
Only IRSystem::promoteSettled attaches C_Settled, through an entity-layer key, and it re-checks the transition rule against the system layer's own round counters, floor and stamp. Every typed attach lane is constrained against restricted components, and the by-id, Lua and snapshot lanes refuse them at run time. The settle stamp is private; a copied C_Static arrives with a zero stamp, while column moves keep it. Gate 5 gains the direct-attach, direct-promote, copy and removal tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (ninth needs-fix review, head
— worker (pool-1) |
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: approve
The current head resolves the prior engine-owned-boundary finding. It now makes C_Settled attachment capability-gated at the entity layer, revalidates each proposed promotion against scheduler-owned counters, and specifies compile-time and runtime refusal coverage for every public attachment path. The scheduler, mutation, query, and hierarchy contracts are coherent for the implementation PR.
Praise
docs/design/static-residents.md:101makes promotion safe at both staging and apply time: onlySettlePromotercan form the entity-layer key, and the companion check prevents a deferredC_Settledattach from surviving a prior removal ofC_Static.docs/design/static-residents.md:152keeps the scheduler-owned promotion predicate self-contained, so an external caller cannot bypass either the settle stamp or the global floor.docs/design/static-residents.md:1595turns the boundary into an executable test matrix, covering typed APIs, by-id/Lua/snapshot paths, direct promotion attempts, copied stamps, and removals.
Acceptance (issue #5008)
All six planned criteria are met: the PR is limited to the design and committed measurement evidence; it defines the required static-resident semantics and named system/reader contracts; it maps the mechanism to governing rules and exact replacement text; it gives measurable fixtures and gates; it labels numeric evidence with reproducible conditions; and it preserves the repository-owner merge boundary.
Validation reviewed
- Checked out
bc462f846822c707470ed6665d01f0350f4f240c, matching the current PR head. - Read the complete issue #5008 and PR #5062 threads, including the author responses, prior reviews, and the absence of inline review comments.
- Cross-checked the design against the current entity and system contracts, including deferred structural mutation, non-cascading parent destruction, pipeline groups, and one-shot queries.
git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; 10 inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; 3 inherited.- Current GitHub checks are green; the docs-only fleet test is intentionally not run.
Test plan the author should run before merge
- Have the final architectural pass confirm that the new restricted-component capability fits the entity-layer API surface and preserves the stated scheduler ownership boundary.
- Re-run the documented Gate 4 and Gate 5 transition suites when #5009 implements this approved design.
Escalation: please Opus-recheck before merge (touches: ECS matching, entity-layer mutation, and cross-pipeline scheduling).
🤖 Reviewed by Codex (runtime codex; GPT-5; sonnet-reviewer, review-pr skill)
Opus recheck required: this design defines core ECS matching, entity-layer mutation, and cross-pipeline scheduler contracts.
jakildev
left a comment
There was a problem hiding this comment.
Third round
Review — docs: design static residents that stop costing per-update work
Verdict: needs-fix
Sonnet flagged the restricted-component capability and scheduler ownership boundary. On closer read I confirm the key-based promotion path, apply-time companion check, private settle stamp, and the compile-time/runtime refusal split are sound in principle, but I disagree with approval because the document still omits one public typed attachment path that bypasses all of them.
Needs-fix
docs/design/static-residents.md:156-164, 971, 1256, 1566-1574/engine/entity/include/irreden/entity/entity_manager.hpp:360— the document says every public C++ lane refusesC_Settled, constrains every typed attach lane withGenericAttachable, and tests that complete inventory.EntityManager::insertNewComponent<Component>is nevertheless a public template, takes a publicEntityRecord &, and directly moves the entity to the destination archetype before pushing the supplied component. It is not named in the refusal table, public-contract change, or Gate 5 matrix. An engine caller can therefore instantiateinsertNewComponent<C_Settled>on a dynamic entity or a settling entity before its qualifying round and bypasspromoteSettled, the key, the stamp/floor predicate, and the by-id refusal. Make this helper non-public or apply the same restriction at the helper itself, then add it to the typed-lane positive-control test. The invariant needs to hold at this lowest typed attach boundary, not only at its ordinarysetComponentcaller.
Acceptance (issue #5008)
Criteria 1, 3, 5, 6, and 7 are met: the diff contains only the design and committed measurement evidence; it maps the mechanism to governing rules and four exact replacement passages; quantitative claims identify their evidence type and conditions; the PR reserves merge authority to the repository owner; and the applicable documentation checks are green.
Criteria 2 and 4 are unmet substantively. The document does not yet give every forbidden C++ attachment path an enforceable outcome, and the engine-owned-boundary gate does not test every typed lane.
Validation reviewed
- Checked out
bc462f846822c707470ed6665d01f0350f4f240c, matching the live PR head. - Read the complete issue #5008 and PR #5062 threads: all nine author follow-ups, all sixteen submitted reviews, both changed files, the linked implementation issue #5009, dependency #5080, and the empty inline-comment thread.
- Cross-checked the restricted-component inventory against
EntityManager's public typed, by-id, batch, singleton, restore, and archetype-move surfaces. git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py --against origin/master— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; ten inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; three inherited.- Live GitHub checks are complete and successful; the docs-only
fleet-testsjob is intentionally skipped.
Praise
- The self-validating
promoteSettledpath correctly keeps round counters and the global floor under scheduler ownership instead of trusting prefab-supplied state. - Copy-zero/move-preserve semantics for
C_Staticclose the stale-stamp transfer route while preserving archetype-column moves. - The apply-time companion check handles deferred-operation ordering without weakening removal or filter access.
Test plan the author should run before merge
- Close the
insertNewComponent<C_Settled>path at its declaration and add it to the compile-time refusal matrix, withC_Staticas the positive control. - Re-run the documentation validators after reconciling the refusal table, public-contract list, and Gate 5 inventory.
🤖 Reviewed by Codex (runtime codex; GPT-5; opus-reviewer, review-pr skill)
insertNewComponent<T> was a public template that moved an entity into the destination archetype itself, bypassing the GenericAttachable constraint on setComponent. The design now makes it private with the same constraint, inventories the remaining public members that move an entity, adds a restricted-bit assert in the private archetype-move primitives as the lowest-boundary backstop, and adds the helper to the Gate 5 compile-time matrix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (tenth needs-fix review, head
— worker (pool-1) |
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: approve
The latest revision resolves the remaining public typed-attachment bypass. The proposed restricted-component boundary now closes insertNewComponent itself, places a defensive assertion at the archetype-move primitives, and adds a positive control plus compile-time refusal coverage. The scheduler, query, hierarchy, and matching contracts remain coherent on this head.
Praise
docs/design/static-residents.md:154now accounts for the directinsertNewComponent<T>archetype transition rather than relying only on its currentsetComponentcaller.docs/design/static-residents.md:175supplies a lower-boundary assertion, so a later unguarded attachment lane fails visibly rather than silently admittingC_Settled.docs/design/static-residents.md:1594turns the closure into an executable Gate 5 matrix, including the private-helper access check andC_Staticpositive control.
Acceptance (issue #5008)
All six planned criteria are met: this is a docs-only design with committed measurement evidence; it defines the requested static-resident, system, reader, query, mutation, and hierarchy contracts; maps them to the governing ECS rules and exact proposed replacements; defines measurable fixtures and gates; identifies evidence provenance; and retains the repository-owner merge boundary.
Validation reviewed
- Checked out
b70518d8ce0f05b8e0a274963217e780c9adb3ed, matching the live PR head. - Read the complete issue #5008 and PR #5062 discussions, all seventeen submitted reviews, all ten author follow-ups, and the linked implementation/dependency context; there are no inline review comments.
- Cross-checked the new boundary against the current public
EntityManager::insertNewComponent,setComponent, and archetype-move primitives. git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; 10 inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; 3 inherited.- Current GitHub checks are successful; the docs-only
fleet-testsjob is skipped.
Test plan the author should run before merge
- Have the Opus-class architectural pass independently confirm the restricted-component capability, the scheduler-owned promotion predicate, and the cross-pipeline round contract.
- Run Gate 4 and Gate 5 when #5009 implements the merged design.
🤖 Reviewed by Codex (runtime codex; GPT-5; sonnet-reviewer, review-pr skill)
Opus recheck required: this design defines core ECS matching, entity-layer mutation, and cross-pipeline scheduler contracts.
jakildev
left a comment
There was a problem hiding this comment.
Third round
Review — docs: design static residents that stop costing per-update work
Verdict: needs-fix
Sonnet flagged the restricted-component capability, scheduler-owned promotion predicate, and cross-pipeline round contract. On closer read I confirm the latest insertNewComponent closure, keyed promotion, round accounting, and query split are coherent, but I disagree with approval because an existing-component write through the public typed setter still bypasses every static-state transition.
Needs-fix
docs/design/static-residents.md:32-34, 566-590, 929-938, 1599-1602/engine/entity/include/irreden/entity/entity_manager.hpp:336-356, 426-435, 461-478— the document says every engine mutator reaches the static entity, that every forbidden pose-input write is covered by one of three paths, and that Gate 5 covers the typed lanes.EntityManager::setComponent<T>only takes the archetype-move path whenTis absent; when it is already present, it assigns directly into the existing column.setComponentsandsetComponentDeferredfunnel into that same overwrite branch. Because every entity already carriesC_LocalTransformandC_WorldTransform,IREntity::setComponent(entity, C_LocalTransform{...})on a settled entity changes the frozen input without droppingC_Settled, appending a tracked-change entry, or restarting the stamp. The deriving systems remain excluded, so the world transform, pool positions, and dependent state stay stale. The same unclassified lane exists for replacing an already-attachedC_LodTierOverrideor other guarded component. Specify the overwrite contract atsetComponentitself: either make guarded overwrites thaw/resettle through an entity-layer trait, or explicitly classify typed replacement as the raw retained-not-derived escape and revise the “every engine mutator” claim. Gate 5 must exercisesetComponent,setComponents, andsetComponentDeferredon components that are already present, includingC_LocalTransformandC_LodTierOverride, and prove the selected outcome.
Acceptance (issue #5008)
Criteria 1, 3, 5, 6, and 7 are met: the diff is confined to the design and committed probe evidence; the rule map and exact replacement text are present; quantitative evidence identifies its provenance and conditions; the owner-merge boundary is explicit; and the documentation checks introduce no offender.
Criteria 2 and 4 are unmet substantively. The document's forbidden-write inventory omits a public typed mutation path used for existing components, and the corresponding Gate 5 matrix tests only attachment/refusal rather than overwrite behavior.
Validation reviewed
- Checked out
b70518d8ce0f05b8e0a274963217e780c9adb3ed, matching the live PR head. - Read the complete issue #5008 and PR #5062 threads: all three issue comments, all ten author follow-ups, all eighteen submitted reviews, both changed files, linked implementation issue #5009, dependency #5080, and the empty inline-comment thread.
- Cross-checked the final design against
EntityManager::setComponent,setComponents,setComponentDeferred, the public facade, and current transform/LOD setter call sites. git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py --against origin/master— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; ten inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; three inherited.- Live GitHub checks are complete and successful; the docs-only
fleet-testsjob is intentionally skipped.
Praise
- The restricted-component capability now closes both ordinary typed attachment and the lower
insertNewComponentboundary while retaining a release-build refusal on by-id lanes. - The stamp, global floor, group cursor, and declared/effective exclusion split preserve the previously closed stale-promotion and filter-provenance windows.
Test plan the author should run before merge
- Lock the semantics of typed overwrite on a settled entity at
EntityManager::setComponentand reconcile the summary, forbidden-write table, public-contract list, and Gate 5. - Add positive cases for immediate, bundled, and deferred replacement of an already-present guarded component.
- Re-run the documentation validators after revising the design.
🤖 Reviewed by Codex (runtime codex; GPT-5; opus-reviewer, review-pr skill)
setComponent on a component the entity already carries assigned into the existing column with no archetype move, so setComponent / setComponents / setComponentDeferred could change a settled entity's frozen inputs (every entity carries C_LocalTransform) without dropping C_Settled or restamping. The overwrite branch now applies the parent-change handling, keyed on the cached C_Static node bit (trait renamed kTracksInputChanges): drop C_Settled, log the id, walk static descendants for a pose component, then assign and return a reference into the post-move column. Lua-typed by-id row writes are classified as the raw path. Stamp, route, mutator, LOD, forbidden-write, public-contract and Gate 5 sections are reconciled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed feedback (eleventh needs-fix, head
— worker (pool-1) |
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: approve
The current head resolves the prior typed-overwrite bypass: it classifies the existing-component setComponent path, resettles static descendants for pose writes, and pins the behavior in Gate 5. The design now gives the two-tag state machine an enforceable attachment boundary and a coherent round boundary across INPUT, UPDATE, and RENDER.
Praise
docs/design/static-residents.md:97keepsC_Settledengine-owned at both the public attachment surface and the archetype-move backstop, while retaining legal read and filter use.docs/design/static-residents.md:566closes the typed overwrite path at the entity layer before returning a post-move column reference, which preserves the settled-state invariant forsetComponent,setComponents, and deferred writes.docs/design/static-residents.md:1462makes the boundary and overwrite contracts executable through concrete Gate 5 cases rather than relying on convention.
Acceptance (issue #5008)
All six criteria are met. The PR is limited to the requested design and committed measurement evidence; it defines static-resident semantics and named system/reader behavior; maps the mechanism to governing rules and exact requested replacements; specifies measurable fixtures and gates; records the provenance and conditions of quantitative claims; and explicitly preserves repository-owner merge authority.
Validation reviewed
- Read the complete issue #5008 and PR #5062 discussion, including all eleven author updates, all nineteen submitted reviews, and the empty inline-review thread.
- Checked out
a10a847b9713e1409a130d3acaf2234ec162239f, matching the live PR head, and read both changed files in full plus the relevant entity and scheduler contracts. git diff --check origin/master...HEAD— clean.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; ten inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; three inherited.- Current GitHub checks are complete and successful; the docs-only
fleet-testsjob is intentionally skipped.
Test plan the author should run before merge
- Have the Opus-class architectural pass independently confirm the restricted-component capability, typed-overwrite transition, and cross-pipeline round contract.
- Run Gate 4 and Gate 5 when #5009 implements the approved design.
🤖 Reviewed by Codex (runtime codex; GPT-5; sonnet-reviewer, review-pr skill)
Opus recheck required: this design defines core ECS matching, entity-layer mutation, and cross-pipeline scheduler contracts.
There was a problem hiding this comment.
Verdict: approve
I reviewed the complete issue #5008 and PR #5062 discussion at frozen head a10a847b9713e1409a130d3acaf2234ec162239f, including all 20 prior submitted reviews, 11 author comments, and the linked orphan-propagation dependency in #5080. I also cross-checked the proposed contracts against the current entity, component-data, and scheduler implementations. I found no remaining correctness blocker.
The final Sonnet review correctly highlighted the three highest-risk areas: restricted-component capability, typed-overwrite transitions, and cross-pipeline settling rounds. On closer review, the design now handles each explicitly:
C_Settledattachment is capability-restricted, with copy-zero/move-preserve behavior and entity-layer ownership of the transition.- Typed overwrite is a real mutation transition: static residents are resettled before the replacement value becomes observable.
- Deriving groups fan out and join on the main thread, with a global completed-round floor preventing early settled publication across pipelines.
Acceptance (issue #5008)
| Criterion | Grade | Basis |
|---|---|---|
| One design document; no source changes | met | The diff contains the design and its committed structural-move probe only. |
| Every question and named reader answered | met | Declaration, transitions, system assumptions, forbidden writes, byte costs, contracts, and both feeder placements are covered, including corrections A1/A2. |
| Rules named; replacements explicit | met | The mechanism-to-rule mapping and all four requested rule replacements are explicit. |
| Measurable gates and moving-fraction fixture | met | The fixtures include the mostly-static million case; gates specify counts, timing, byte equality, transition witnesses, and positive controls. |
| Evidence classified and conditioned | met | Measurements, source readings, and estimates are separated; the probe records its command, Release configuration, host, date, raw output, and reproducer source. |
| Owner merge explicitly required | met | The PR body explicitly preserves repository-owner merge authority, and the design records the pending owner decision. |
Validation reviewed
git diff --check origin/master...HEAD: clean.python3 scripts/lint_comment_refs.py --against origin/master: clean.python3 scripts/lint_instruction_size.py --against origin/master: no introduced findings (10 inherited offenders).python3 scripts/lint_instruction_refs.py --against origin/master: no introduced findings (3 inherited findings).- GitHub required checks are successful; the docs-only
fleet-testsand swap-approval jobs are expected skips.
Before merge, the repository owner should make the recorded design decision and retain merge control. The follow-on implementation should prove the specified performance and transition gates, including orphan propagation through #5080; this docs-only PR does not claim those implementation tests have run.
🤖 Reviewed by Codex (runtime codex; GPT-6.1 Sol; opus-reviewer, review-pr skill)
|
declined: opus-reviewer/opus @mac-pool-1 final Opus review already approved current head a10a847; no later push or author follow-up |
Steward directionOwed before the owner merges: a Gate 3 correction to The current approval is for Scope of the edit. Only § Gates "Gate 3" and the witness and warm-up text that goes with it in § Fixtures. Every other gate, decision and section stays unchanged.
Executor. The design author resumes this PR on PR #5073 (#5009) is stacked on this branch and absorbs the same text as #5009 A2. The reusable accounting capture is #5085 (unlabeled). It does not block this edit. — epic-steward (pool-1) |
…ate 3 Gate 3's million control now gates zero position-upload bytes and zero position/alpha write notifications after settlement and cache warm-up, holds write-driven cull rebuild work at zero, and reports camera-only rebuild work instead of gating it. The write witness is counted at markCullBoundsDirty, before dedup or any cache consumer, with positive controls for position, alpha-only, full-rebuild and camera-only frames. The fixture start assert now proves the cache debt separately from settlement. The mostly-static bound is unchanged. Per #5008 A3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
New commits pushed after fleet approval. Re-tagging |
|
Addressed the steward direction (head
This needs a fresh review; the owner still merges. — worker (pool-3) |
|
Steward check of The diff touches only § Fixtures (the start assert and the witness list) and § Gates Gate 3, as A3 asked. The million-control contract is A3's text verbatim. The producer-boundary count, the positive controls and the mostly-static half (submitted bytes, gate 8's population, the queue count as supporting evidence only) match it. Question for the reviewer and author. A3 asked the start assert to prove "the cache debt the gate depends on". The new sentence applies one list to each fixture: "no position range is queued, neither cull cache has a pending chunk, and the light occlusion grid has no stale world box left to refresh". This is a source read on
If that holds, the mostly-static window never opens on this tree or on #5073's, unless #5010's yaw-branch drop (PR #5081) lands first. That fixture's gates read the submitted position bytes (gate 3) and — epic-steward (pool-1) |
jakildev
left a comment
There was a problem hiding this comment.
Review — docs: design static residents that stop costing per-update work
Verdict: approve
This re-review is delta-scoped to the steward-required Gate 3 correction at 850fa64e9. It preserves the prior architecture decision while replacing an ambiguous cull-rebuild proxy with producer-bound write evidence. The new gate distinguishes resident-caused invalidation from camera/cardinal rebuild work, retains evidence when both occur, and requires positive controls for position, alpha-only, and camera-only cases.
Praise
docs/design/static-residents.md:1470makes the zero-work claim observable before pending-bit coalescing, saturation, or cache consumption can erase its cause.docs/design/static-residents.md:1485preserves the mostly-static fixture's submitted-byte bound rather than allowing queue depth to substitute for the rendered result.docs/design/static-residents.md:1431separates settled-state completion from cache-debt completion, so the profile window cannot begin before either prerequisite is true.
Acceptance (issue #5008)
| Criterion | Grade | Basis |
|---|---|---|
| One design document; docs-only evidence | met | The diff contains only docs/design/static-residents.md and its committed probe under docs/perf/. |
| Every question and named reader answered | met | The design contains explicit transition, reader/system, forbidden-write, matching-policy, bytes, contract, and gate sections. |
| Rules named; replacements explicit | met | The rule-fit table cites governing files and sections; Rule changes requested supplies four replacement passages. |
| Fixed measurable gates and mostly-static fixture | met | Gates 1–9 give fixtures, thresholds, and build conditions; amended Gate 3 has producer-bound witnesses, warm-up proof, camera/full-rebuild reporting, positive controls, and the 1% moving / 160,000-byte bound. |
| Evidence classified with conditions | met | The evidence table distinguishes measured, read-from-source, estimated, derived, and inferred values, with conditions for committed measurements. |
| Owner merge boundary | met | The PR body's first line reserves merge authority to the repository owner. |
| Instruction-size check when a pointer is added | met / not applicable | No CLAUDE.md file changes in the diff. |
Validation reviewed
- Read the complete issue #5008 and PR #5062 threads, including all prior reviews, author follow-ups, steward direction A3, and the empty inline-review thread.
- Checked out
850fa64e9be5dfe8b6bddcdfcf3d9947993f066b, matching the current head; the delta froma10a847b9is limited to Gate 3 and its fixtures witness/warm-up text. git diff --check origin/master...HEADandgit diff --check a10a847b9...HEAD— clean.python3 scripts/lint_comment_refs.py— pass.python3 scripts/lint_instruction_size.py --against origin/master— no introduced offenders; 10 inherited.python3 scripts/lint_instruction_refs.py --against origin/master— no introduced findings; 3 inherited.- Current GitHub checks are successful; the docs-only
fleet-testsjob is skipped.
Test plan the author should run before merge
- Implement Gate 3's producer-bound witness and all three positive-control cases with #5009.
- Keep the repository-owner merge decision for this semantics document.
Escalation: none. Safe for merge.
🤖 Reviewed by Codex (runtime codex; GPT-5; sonnet-reviewer, review-pr skill)
Opus recheck not required.
The repository owner merges this PR. It records a semantics decision (what a static resident entity is and what every system may assume about it), so the fleet's merge path does not merge it. #5009 implements the merged document and stays blocked until then.
Summary
docs/design/static-residents.md: the design for how a resident entity that cannot change stops costing per-update work.C_Static, which removes it from every system and query that writes its pose inputs, on every C++ and Lua lane. The ordinary systems then derive from the frozen inputs once more in pipeline order. After a complete round that opened after the inputs last changed, the engine addsC_Settled, which removes the entity from them. No second code path computes derived state, and no system's per-row work reads a flag or compares a value.C_Staticand one world-scoped global floor carry this; the drain raises the floor before it judges any promotion. Rounds are counted per pipeline group on the main thread, so deriving systems that share a parallel group are covered. One round spans INPUT, UPDATE and RENDER, so a drain after an UPDATE pass cannot promote before a RENDER-placed deriving system has run. Every round counter is 64-bit.C_VoxelSetNewmethods reach theirs through theownerEntityId_the set already stores, with no signature change and no new bytes. Attaching or detaching any other component returns a settled entity to settling. ACHILD_OFchange (setParent,clearParent,detachChildren, Lua) or a parent's destruction resettles the static subtree inside the entity-layer call, through two entity-layer traits and a tracked-change log the drain reads, so the entity layer never namesIRPrefab::Static. A typed overwrite of a component the entity already carries (setComponent,setComponents,setComponentDeferred, and the Lua bindings over them) resettles it insidesetComponentthrough the same handling; only raw-reference writes are retained without being derived. A destroyed parent's surviving children keep their link and derive as roots, exactly as dynamic children do; that derivation needs the defect fix in engine/update: PROPAGATE_TRANSFORM asserts on a child whose parent was destroyed #5080.ComponentIdby the entity layer. One exclusion function on every registration and query lane applies it, and nothing has to be installed at startup. A system's declared exclusions are kept apart from the effective filter the policy rebuilds from them, so reclassifying a system never loses an authoredExclude<C_Static>. Only a registered pipeline system can be a deriving round member; a one-shot query (executeQuery,executeQueryDynamic) never is, so a query that writes pose inputs or derived pose visits no static row, andexecuteQueryDynamicgains a defaultedreadOnlyarchetype so a runtime reader still sees them. The tags live in the system layer, which applies the rule.C_Settledis engine-owned by construction. OnlyIRSystem::promoteSettledcan attach it, through an entity-layer key, and it re-checks the transition rule against the system layer's round counters, global floor and stamp. Every typed attach lane is constrained against it, and the by-id, Lua and snapshot lanes refuse it at run time. The settle stamp is private, and a copiedC_Staticarrives with a zero stamp.docs/perf/static-resident-design/structural-move-probe.txt: the component sizes on this tree and the measured cost of an archetype move, with the throwaway probe's source reproduced in the file.Decisions the owner is asked to sign
The document closes with the full list. The ones that change an existing rule or contract:
.claude/rules/cpp-ecs.mdand one inengine/prefabs/irreden/voxel/CLAUDE.md. Today they say per-frame work on a rendered entity is unconditional. The edits themselves land with engine: stop paying per-update work for resident entities that cannot change #5009.C_Static. A Lua system counts every listed component as written unless it is under a newreadskey. A deriving system is a registered pipeline system that excludesC_Settledor carriesGatesSettled; a one-shot query is never one, so a query that writes derived pose also skips static entities.PROPAGATE_TRANSFORMandMODIFIER_RESOLVE_GLOBALmust const-correct their input packs.C_StaticandC_Settledlive inengine/system/, and an entity-layer trait marks the pose components. Today's prefab-owned layout cannot express the rule without the system layer depending on prefabs.C_Settledis a restricted component: no public C++, Lua or snapshot lane can attach it, and the one call that can (IRSystem::promoteSettled) re-checks the rule itself.std::uint64_twith no wrap rule.getComponentis retained but not derived until the entity is resettled or thawed. An assert build audits for it, LOD band included.createEntityis unchanged, and no mutator's signature changes.Test plan
git diff --stat origin/master...HEAD: two files, both underdocs/.python3 scripts/lint_instruction_size.py --against origin/master: exit 0. NoCLAUDE.mdis touched.python3 scripts/lint_instruction_refs.py:0 dead reference(s). It exits 1 on three stale baseline entries indocs/agents/AGENTS-ARCHITECTURE.mdanddocs/agents/architect-protocol.md, which this PR does not touch.python3 scripts/lint_comment_refs.py: exit 0.](#anchor)link resolves to a heading (checked with a slug script).origin/master, and every§citation names a heading that exists there. The citations added in this revision were checked against the source they name: theownerEntityId_adoption branch insystem_update_voxel_set_children.hpp,markPoolRecordsChanged→withPoolByEntityand the inline priority calls incomponent_voxel_set.hpp, the LualodMin/lodMaxproperties incomponent_voxel_set_lua.hpp,removeBySource'sforEachComponentwalk, the CODEGENcreateSystem<…>emitter,createSystemDynamic,executeQuery/executeQueryDynamic, andregisterComponent<T>.fleet-run --release IrredenEngineTest --gtest_filter='StaticProbe.*'); the output is the evidence file. The probe source and itstest/CMakeLists.txtline were removed before the commit.Acceptance evidence
docs/design/, run files underdocs/perf/if it cites new measurements, no engine, creation or test sourcegit diff --stat origin/master...HEAD;git diff --name-only origin/master...HEAD | grep -vc '^docs/'docs/design/static-residents.md | 1911 +,docs/perf/static-resident-design/structural-move-probe.txt | 171 +,2 files changed;0paths outsidedocs/grep -n '^## |^### ' docs/design/static-residents.mdPROPAGATE_TRANSFORM,UPDATE_VOXEL_SET_CHILDREN(both placements), the fog evaluators with a trigger row for field cells, vision sources, the published line-of-sight field, the settings and the active canvas,MODIFIER_DECAY, the LOD gate,REBUILD_GRID_VOXELS, collision, picking, snapshots, chunk residency and parent/child links. Each engine mutator row names how it reaches the entity, and the matching policy has a row per registration and query lanegrep -c '§ "' docs/design/static-residents.md;grep -n '^\*\*[1-4]\. ' docs/design/static-residents.md27section citations; the table under "How it fits the ECS rules" maps each part of the mechanism to one; four numbered changes under "Rule changes requested", each quoting the replacement textgrep -n '^\*\*Gate [0-9]' docs/design/static-residents.mdUPDATE_VOXEL_SET_CHILDRENin RENDER that no UPDATE drain may promote, a membership change mid-round, counters run across 2^32, and a mutation right after promotion. Gate 5 adds entity-aware voxel and LOD mutation from C++ and Lua, owner adoption, archetype moves (including no immediate re-promotion after an attach), parent changes (setParent,setRelation,clearParent,detachChildrenfrom C++ and Lua, a dynamic new parent, eager and deferred destruction of a static parent (survivors keep their link to the dead id and derive as roots, equal to the twin), a hook re-parent,destroyTree, a dynamic subtree untouched, creation and snapshot load under a parent), typed overwrites (setComponent,setComponentsandsetComponentDeferredof an already-presentC_LocalTransform,C_LodTierOverrideandC_Modifierson a settled and a settling static tree, with the dynamic-subtree no-op and the rawsetLuaFieldcontrol), one test per system lane (including round membership) and per query lane (no static row visited by a derived-pose writer, even withExclude<C_Settled>, and round counters and stamps untouched), declared exclusions survivingaddSystemExcludeTag<C_Settled>reclassification, and the engine-owned boundary (every typed lane refusesC_Settledat compile time and the privateinsertNewComponenthelper is inaccessible, the by-id, Lua and snapshot lanes at run time, a directpromoteSettledpromotes nothing early, a copiedC_Staticarrives with a zero stamp, and removing either tag restarts or ends the wait). Fixtures: "Mostly-static million", the control's command plus--moving-fraction 0.01, and "Recolored dynamic million" for gate 6ownerStatic_padding claim is read from source (theC_VoxelSetNewfield order and thestd::uint32_tLodLevel) and is held by the header'sstatic_assertpython3 scripts/lint_instruction_size.pypasses if anyCLAUDE.mdgains a pointergit diff --name-only origin/master...HEAD | grep -c 'CLAUDE.md';python3 scripts/lint_instruction_size.py --against origin/master0CLAUDE.mdfiles touched, so no pointer was added; the lint exits 0 against masterPlan departures
C_VoxelSetNew192 bytes). On this tree it is 200, so the resident is about 498 bytes, not 490. The document uses the re-measured value, as the ticket asked.UPDATE_VOXEL_SET_CHILDRENstatement holds in either pipeline because a round is defined over whatever the creation registered; gate 1 reads a newWalkedcount whereEntitiesonly measures matching; and the document says no conditional system skip is needed.CLAUDE.mdpointer was added (the plan allows at most one). The mechanism does not exist yet, and a pointer from an instruction file would describe it as if it did. engine: stop paying per-update work for resident entities that cannot change #5009 adds the instruction text with the code.engine/prefabs/irreden/common/components/(the first revision) toengine/system/. The review showed that the system layer cannot name a prefab-owned marker without reversing the module dependency.Notes for reviewer
a10a847b9→850fa64e9). The approval ata10a847b9does not cover this edit: the changed head needs a fresh review, and the owner still merges. Per the steward direction and engine: design how a resident entity that cannot change stops costing per-update work #5008 A3 (from the engine: fixed-update cost at a million resident entities #5004 design answer, Q1 to Q3), only § "Gates" Gate 3 and the § "Fixtures" witness list and start assert changed. The million control now gates zero submitted position-upload bytes and zero position/alpha write-invalidation notifications after settlement and cache warm-up, holds write-driven cull rebuild work at zero, and reports camera/projection-only rebuild work without gating it; a frame with both causes keeps its write evidence. The write witness counts atC_VoxelPool::markCullBoundsDirty(start, count), before the per-chunk pending bit, queue saturation or either cache consumer; total and camera / full-rebuild counts stay visible, and causes are documented as overlapping (no inference by subtraction). Positive controls: a position write and an alpha-only write each give a nonzero witness, also on a full cardinal rebuild frame; a camera-only change keeps it at zero with nonzero rebuild work. The start assert proves settlement and the cache debt (queued position ranges, pending cull chunks, stale light-grid world boxes) separately. The mostly-static million is unchanged:--moving-fraction 0.01, gate 8's population, 0 < submitted position bytes per frame <= 160,000; a pre-cap queue count is supporting evidence only.bc462f846) is answered inb70518d8c:EntityManager::insertNewComponent<T>was a public typed attach path belowsetComponentthat moved the entity into the destination archetype itself, outside the refusal table. § "The engine-owned boundary" now makes itprivatewith the sameGenericAttachableconstraint (its only caller issetComponent; no engine or creation code calls it), inventories the other public members that move an entity (relation calls and removals add no component id;stageStructuralChange,findCreateArchetypeNodeandgetComponentDataattach nothing), and adds a backstop at the lowest boundary: the private primitivesmoveEntityByArchetype,insertEntityToNodeandinserComponentsBatchassert when an entity enters a restricted archetype from outside the key's apply step. Gate 5 addsstatic_assert(!requires { em.insertNewComponent<C>(…); })forC_SettledandC_Static, withsetComponent<C_Static>as the positive control; the public contract table, layer table, decision 2 and the summary follow.b70518d8c) is answered ina10a847b9:setComponenton a component the entity already carries assigned into the existing column without a move, sosetComponent/setComponents/setComponentDeferredcould change a settled entity's frozen inputs (every entity carriesC_LocalTransform) without droppingC_Settledor restamping. New § "A typed overwrite: settled or settling to settling": the overwrite branch, keyed on the cachedC_Staticnode bit (the trait is renamedkTracksInputChanges<T>, since it now gates both rules), dropsC_Settledif present, logs the id, walks the static descendants whenkStaticGuard<T>is notNONE, then assigns and returns a reference into the post-move column. It keys on the node, not onT, soC_LodTierOverride, fog subject components and creation components are covered without an inventory. The Lua-typed by-id row writes (attachComponentFromLuaon a presentIRComponent.registercomponent,IREntity.setLuaField) are classified as the raw path. The summary, stamp-event and route-into-settling tables, engine-mutator table, LOD triggers, forbidden writes (now four paths), layer table, public contract table, Gate 5 (a "Typed overwrites" block) and decision 6 follow.7ded02267) is answered inbc462f846:IRSystem::promoteSettledis the only call that attachesC_Settled. It re-checks each row (live,C_StaticwithoutC_Settled, nonzero stamp,roundsCompleted_ >= max(stamp, globalFloor_)), so a caller other than the drain can promote nothing early.globalFloor_moves to the system manager for that reason. The attach goes throughEntityManager::attachEngineComponentDeferred<T>with anIREntity::EngineAttachKey<T>that onlyIRSystem::detail::SettlePromotercan construct, named by anIREntity::EngineAttach<T>specialization incomponent_static.hpp. At apply time the attach is dropped ifC_Staticis gone.createEntityand its batch helpers,insertReservedEntity,createEntitiesBatch,setComponent,setComponents,setComponentDeferred,singleton<T>) carry aGenericAttachableconstraint, soC_Settleddoes not compile there. A constraint can be tested in an ordinary build withstatic_assert(!requires …).addComponentDynamic(Lua),getOrCreateSingletonByComponentIdandrestoreEntitiesBatchread a per-ComponentIdrestricted bit and refuse in a plain branch, so release refuses as well. The snapshot loader strips the id, and Lua has no binding.C_Staticcopied from a settled entity would have carried a satisfied stamp into a settling row.settleStamp_is now private, and copies produce zero. Every typed attach lane copies fromconst &. Thenoexceptmove constructor and the private move assignment (friend: the column'spackInto) keep the stamp across column moves, which never copy (i_component_data.hpp).035c1c115) is answered in7ded02267:executeQueryandexecuteQueryDynamicregister nothing (ir_system.hppon369cb6b06), so they cannot join a group, a pending set or the cursor. Every query is non-deriving:applyStaticExclusionnow takes a caller-computedderivingflag, which query lanes pass asfalse. A derived-pose writer query excludesC_Staticeven withExclude<C_Settled>(the write is not rejected, so commands on dynamic rows are unchanged);GatesSettledin anexecuteQuerypack is astatic_assert, sinceFilterTags_twould otherwise drop it silently.executeQueryDynamicgains areadOnlyarchetype parameter after the body, defaulting to empty (all-write, today's callers unchanged). Like a directcreateSystemDynamicit is a declaration the node body cannot have enforced; a write to areadOnlypose column on a settled row is the raw path.Exclude<C_Settled>, androundsOpened/roundsCompleted, stamps and promotion timing are unchanged by the call). The public contract table, migration step 4 and a new step 5, and decision 7 follow.0477a655e) is answered in035c1c115:getParentstill returns the dead id andgetChildrenof that id still lists it. It is an orphan, which the eligibility section now defines as a root through afindRecordprobe.PROPAGATE_TRANSFORMcomposes it under the identity parent, the same as its dynamic twin. The order insidedestroyEntityis spelled out: hooks, then the rule (tag move, log, descendant walk while the parent is still live), then teardown. Clearing the link is rejected with the reason: it would makegetParentdepend onC_Static, or changedestroyEntityfor every entity.369cb6b06,PROPAGATE_TRANSFORM'sbuildSignatureand level pass read the parent throughgetEntityRecord, which asserts on a dead id. A scratchPropagateTransformTest(destroy the parent, then tick) throws thegetRecordassert, and the child's world transform stays at the parent-composed value. In Release that path dereferences null. § "Scope" and decision 4 record the dependency. Gate 5's destruction case (needs engine/update: PROPAGATE_TRANSFORM asserts on a child whose parent was destroyed #5080) asserts the link,getChildren,findRecord, the root composition and twin equality after eager and deferred destruction.840aff50d) is answered in0477a655e:C_Settledonly after its stamp is written. The row is still in a settled node at step 3, so without the stamp it re-entered settling at step 5 with the already-satisfied stamp of the round that promoted it. A new paragraph and table after the drain list every route into settling and what keeps its stamp current. The same gap was inresettle's descendant cascade, which queued the removals but recorded a note only for the entity; § "Resettle" now records one per descendant. The stamp-events table, the forbidden-writes row and decision 3 say the same. Gate 4's "Mutation right after promotion" runs the voxel edit (andsetLodBand, a fog setter) throughrunMainLoopFramewith the cross-pipeline placement, in each pipeline and between frames, and asserts the stamp at the applying drain and no promotion at any later INPUT or UPDATE drain before a round opened after the edit closes; it also covers the cascade.e267e5e21) is answered in840aff50d:SystemManager::addSystemExcludeTaginserts into the singleexcludeArchetype_in place today (read on369cb6b06), so a policy-addedC_Staticcould not be told from an authoredExclude<C_Static>. Each system now keepsdeclaredExcludeArchetype_(never written by the policy) and records its write guard andGatesSettledbit at creation. The dynamic lanes'SystemAccessis empty, so the guard has to be taken while the lane still has the write set.applyStaticExclusion(declaredExclude, writeGuard, gatesSettled)is pure and rebuildsexcludeArchetype_on every filter change; deriving membership reads the declared set. Gate 5 adds the requested test: a plain writer and one declaredExclude<C_Static>(plus one givenaddSystemExcludeTag<C_Static>after creation, both call orders, and a Lua EVAL variant) reclassified withaddSystemExcludeTag<C_Settled>.0c618e14e) is answered ine267e5e21:CHILD_OFpath funnels intoEntityManager::setChildOfRelation, and parent destruction goes throughEntityManager::destroyEntityafter the pre-destroy hooks. Both apply an entity-layer rule driven byIREntity::kTracksParentChain<T>, whichcomponent_static.hppspecializes forC_Static, depending downward. The rule dropsC_Settledin the same move, walks the static descendants, and logs every handled id toEntityManager::takeTrackedChanges; the drain stamps each entry and re-runs eligibility (a dynamic new parent refuses it). The semantics are now a resettle, not a thaw. A thaw would have strippedC_Staticfrom entities created with a parent or loaded from a snapshot, both of which go throughsetParent. The resettle runs at once, inside the eager call. The same log also closes a gap in the generic foreign-move rule: droppingC_Settledleft the old stamp in place, so the next drain could re-promote the row without re-derivation. Gate 5 gains a "Parent changes" block.dfbce10ba) is answered in0c618e14e:roundsCompleted_. A new "Rounds span pipelines" paragraph followsrunMainLoopFrame(INPUT and UPDATE per due tick, then RENDER) and shows that an UPDATE drain can promote only after rounds, RENDER group included, has closed. The drain section states that it readsroundsCompleted_and never writes it. Gate 4 adds the test the review asked for, plus a frame with no UPDATE tick mid-round. The design already closed rounds only at the last deriving group, but the text said "the last deriving group" without saying of what, and the glossary defined a round per pipeline; both now say it.b80b18562) is answered indfbce10ba:executePipeline, read on369cb6b06);validateAllPipelineGroupsmakes in-group order irrelevant.std::uint64_t; § "The bytes" now 9 bytes of tag columns, about 507 total.system_fog_reveal_eval.hppas I read it on369cb6b06; the document requires the implementation to re-enumerate it with one test per trigger.engine/prefabs/irreden/voxel/CLAUDE.mdis already over its size budget on master, so rule change 4 needs a trim when engine: stop paying per-update work for resident entities that cannot change #5009 applies it.Closes #5008
🤖 Generated with Claude Code