Repository navigation
Enforce StorageMode is fixed per (component, revision); fixes parallel-fixture data-loss - #547
Conversation
…reasing Component type revision.
|
📝 Doc-accuracy review (advisory · scoped · Layer 2) Reviewed:
Findings:
Map maintenance: The following page is not in the scoped list but has significant drift from this PR and should be added to the map:
Advisory & scoped to the pages the change touches — recall for cross-cutting or unmapped drift is covered by the weekly Layer 3 audit. |
…sion); drop storageModeOverride from 04-schema + storage-modes docs; map 04-schema.md [no-ut] Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0166rY7C3gqgTJe1GbE9tA9P
|
📝 Doc-accuracy review (advisory · scoped · Layer 2) Reviewed:
Findings:
Advisory & scoped to the pages the change touches — recall for cross-cutting or unmapped drift is covered by the weekly Layer 3 audit. |
…gistration (key-concepts/storage-mode.md) [no-ut] Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0166rY7C3gqgTJe1GbE9tA9P
|
📝 Doc-accuracy review (advisory · scoped · Layer 2) Reviewed: Deep scrutiny (hand-written narrative):
Skim for gross contradictions (feature-set catalog):
No contradictions found in the reviewed pages. The three pages edited by this PR ( Advisory & scoped to the pages the change touches — recall for cross-cutting or unmapped drift is covered by the weekly Layer 3 audit. |
…eqlock stall (PR #550) Fix page-cache seqlock stall: memory slots were reused without resetting the ModificationCounter, so the checkpoint spin-waited its 100ms skip timeout on a phantom writer (~650ms per engine close). Reset on reuse + guard CopyPageWithSeqlock against a stale odd counter on an unlatched page. Adds a regression test. Parallelize the suite: strip [NonParallelizable] from fixtures whose only reason was the archetype-registry race (fixed upstream by #547). Isolate the 7 Durability fixtures' DBs into per-fixture temp dirs to remove parallel file-lock contention. Raise the default test page-cache 2→8 MiB. Keep NonParallelizable on the timing-sensitive Runtime fixtures.
Problem
Enabling parallel test fixtures in
Typhon.Engine.Tests(removing the bare[NonParallelizable]markers) surfaced one deterministic, silent-wrong-data failure:EntitySpawnTests.ReadAll_InheritedArchetype_IncludesParentComponentsread backHealth = 0for an inherited archetype's own component (~1×/run).Root cause: the cluster-layout fields (
IsClusterEligible,ClusterLayout, entity-record size, slot masks) live on the process-sharedArchetypeMetadata, but they are derived from each engine's componentStorageMode. A peer fixture that registered the same components asSingleVersion(via the test-onlystorageModeOverride) made the archetype cluster-eligible and stomped the shared metadata for a concurrent pure-Versioned engine — truncating the entity record so the child's own top slot read back as default (0). Inherited slots below it survived.Fix — enforce the schema invariant instead of tolerating divergence
StorageModeis part of a component's schema identity: it is fixed per(component name, revision). The only thing that let two engines disagree for the same archetype wasstorageModeOverride, a test-only knob with no production caller. Rather than make the engine robust to an incoherent input, this PR makes the incoherent input impossible:storageModeOverridefromRegisterComponentFromAccessor/RegisterComponentByType—StorageModenow comes solely from the[Component]attribute.StorageModenow throws (definition.Revision == persisted.Comp.SchemaRevision && declared != persisted). Changing the mode requires a[Component]revision bump.SingleVersionvia the override now use declared-SV twin types (SvEcsTestSchema):ChangeFilterTests,ViewDeltaTests,SubscriptionStressTests,OutputPhaseTests. Removed the now-obsoleteStorageModeInfrastructureTests.Register_StorageModeOverride_OverridesAttribute.StorageModeRevisionLockTestsverifies the guard via a two-session reopen (same name + revision, different mode ⇒ throws).With this, an archetype's components resolve to the same
StorageModein every engine, so the shared cluster-layout fields are globally consistent — the stomp is impossible by construction, and the fields legitimately stay on the sharedArchetypeMetadata.Testing
Typhon.Engine.Testssuite green: 4029 passed, 0 failed, 38 skipped.StorageModeRevisionLockTestscovers the reopen enforcement.Follow-ups (not in this PR)
StorageModechange across a revision bump (the sanctioned escape hatch is not yet wired end-to-end).[NonParallelizable]marker strip (the original motivation) is now unblocked but intentionally out of scope here.rules/ecs.mdSCHEMA-01) lands in the separate typhon-claude repo (its own PR).🤖 Generated with Claude Code
https://claude.ai/code/session_0166rY7C3gqgTJe1GbE9tA9P