Repository navigation
Description
Summary
TyphonEvent.EmitSchedulerSystemArchetype — the per-(system, archetype) entity-touch rollup that feeds the Workbench Data Flow module (#327) — appears to be unreachable for the only systems that can pass its archetype gate. Every capture produced so far carries zero SystemArchetypeTouchSummary rows, which leaves the Data Flow panel permanently empty.
Found while verifying #618 (F5) and #619 (F6) against a live database: both features join a trace bar to database storage, and neither could be exercised end-to-end because there are no bars to click.
Observed
Harness: scratch/mkcapture.cs — SWG schema, cluster-native Character archetype with a populated cluster (the same database whose File Map shows Cluster Character at 72 pages), a MovementSystem declared .Parallel(), 123 ticks captured with the full trace gate on.
SystemArchetypeTouchSummaryrows in the capture: 0entitiesProcessedreported by every system on every one of the 123 ticks: 0
The zero entity count is the more interesting half. A parallel query system over a populated cluster archetype processing nothing for 123 consecutive ticks is either the harness misusing the API or the runtime under-reporting.
The two gates
TyphonRuntime.EmitSchedulerSystemArchetypeIfActive (src/Typhon.Engine/Runtime/public/TyphonRuntime.cs:2270-2299) requires both:
| Gate | Line | Passes only when |
|---|---|---|
_systemArchetypeIds[sysIdx] != ushort.MaxValue |
:2277 |
the system is IsParallelQuery and bound to an ArchetypeClusterState with ActiveClusterCount > 0 (:503-521) |
metrics.EntitiesProcessed > 0 |
:2285 |
the system's view materialized a non-empty EntityId list (:2197) |
Hypothesis (not yet proven — needs a repro before anyone changes code)
The two gates may be structurally antagonistic:
EntitiesProcessedcomes only fromentities is PooledEntityList pel ? pel.Count : 0(:2197), fed byBuildFullViewEntitySet(:948), which returnsPooledEntityList.Emptythe momentview.Count == 0(:951).ViewBase.Countis_entityIds.Count(src/Typhon.Engine/Querying/public/ViewBase.cs:117) — the materialized entity-id map.- Binding a cluster state switches the system to cluster-RANGE dispatch, which is precisely the path that avoids materializing a per-entity id list — that is the point of cluster-native storage.
If that holds, gate 1 selects exactly the systems for which gate 2 is structurally 0, and the emission is dead code as written. This is a hypothesis built from reading the two paths, not a confirmed root cause — the alternative (the harness fails to populate the view, or ActiveClusterCount is 0 and gate 1 is what actually fails) has not been ruled out, and the fix differs completely between them.
Why it matters
- The Data Flow panel (Workbench Data Flow module — Marey-style timeline + Access Matrix #327) has no data source in any cluster-native schema — the common case for the workloads it exists to profile.
- Two shipped bridges cannot be verified end-to-end: F5 — Structural correlation bridges #618 §4.3 (component → systems that touch it) and F6 — Physical lens: performance → storage #619 §4.2 AC1/AC7 (bar → archetype name → storage rollup). Both have unit-tested rendering and live-verified inputs, but no path exercises them in a browser.
- If confirmed, the caveat cuts deeper than telemetry:
EntitiesProcessedis also read by the tier-budget rollup (:2144-2149,Tier{N}EntityCount) and byInspectorChunkEnd(DagScheduler.cs:1852), so the same zero would silently flatten those too.
Suggested first step
Write an engine test that ticks a cluster-native archetype through a .Parallel() QuerySystem and asserts GetCurrentSystemMetrics(sysIdx).EntitiesProcessed > 0. That single assertion separates the two hypotheses without touching the Workbench at all: green ⇒ the harness is wrong and wants documenting; red ⇒ the runtime under-reports and gate 2 needs to source its count from the dispatched cluster range rather than the view.
Acceptance criteria
- An engine test pins the expected
EntitiesProcessedfor a.Parallel()system over a populated cluster-native archetype - Root cause identified with evidence (runtime under-report vs. harness misuse) — not assumed
- If a runtime bug: fixed, with the touch summary emitted for cluster-native parallel systems
- If harness misuse: the required system/view shape documented where a user would look for it
- A capture from
scratch/mkcapture.cscarries a non-zeroSystemArchetypeTouchSummaryrow count - F5 — Structural correlation bridges #618 §4.3 and F6 — Physical lens: performance → storage #619 AC1/AC7 verified in the browser against that capture
References
- Emission site:
src/Typhon.Engine/Runtime/public/TyphonRuntime.cs:2266-2299 - Cluster-state binding:
src/Typhon.Engine/Runtime/public/TyphonRuntime.cs:498-525 - Entity-count source:
src/Typhon.Engine/Runtime/public/TyphonRuntime.cs:2195-2202,:948-986 - Design:
claude/design/Apps/Workbench/10-database-and-profiles.md§1.6, §4.2, §4.3
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Estimate
Area
Start date
Target date
Bug status
Product
Projects
- StatusShow more project fieldsDone
Activity
nockawa commentedon Aug 8, 2026
Fixed in PR #719. The hypothesis in this issue is refuted, and the real cause was somewhere else entirely.
The hypothesis, tested
The suggested first step was exactly right, so I built it:
SystemArchetypeTouchTeststicks a.Parallel()QuerySystem over a populated cluster-native archetype and asserts on both gates.Both gates pass, together, at 1 and 4 workers.
EntitiesProcessedis not merely non-zero — it equals the entity count the walk actually visited, which is what the test asserts (an over-reporting gate would fill the Data Flow panel with numbers nobody did). So gate 1 does not select systems for which gate 2 is structurally 0.The two system-end hook fixes that would have explained it both landed in the #327 PR itself (
7741eef3, 2026-05-10), long before this was filed. Neither was ever the cause.What was actually broken
The binding is resolved once, in the TyphonRuntime constructor, and was gated on
ActiveClusterCount > 0. That reads a transient condition to make a permanent decision: build the runtime before loading data — the order every sample, andscratch/mkcapture.cs, uses — and_systemArchetypeIds[i]staysushort.MaxValuefor the rest of the session.Gate 1 being shut is the smaller half. The same resolution sets
_systemClusterStates, which is what switches a parallel system to cluster-RANGE dispatch. Left null, the system silently falls back to materializing a per-entity id list from its view — a permanent, silent regression on precisely the storage mode cluster dispatch exists for.Dropping the count is safe: a bound state whose count is zero was always reachable (nothing un-binds a drained archetype), and both dispatch paths read the count live per tick.
A second copy of the same defect turned up next door and is fixed in the same PR —
BuildTierIndexesAtTickStart's late-spawn recovery took the first cluster-eligible archetype rather than the system's own, which is the pre-#662 binding bug left behind in the recovery path.What made the capture empty
Neither gate: #718. An unfiltered
Query<T>().ToView()is frozen at construction, so a system fed one processes only the entities that existed when its view was built. A harness that builds views before loading data getsentitiesProcessed = 0on every system on every tick — exactly what was reported — and gate 2 is then honestly reporting zero work.That is a P0 in its own right, filed separately with two quarantined regression tests.
Acceptance criteria
EntitiesProcessedfor a.Parallel()system over a populated cluster-native archetypescratch/mkcapture.cscarries a non-zeroSystemArchetypeTouchSummaryrow count — blocked on A system's input View built from Query<T>().ToView() is frozen at creation — no system ever processes an entity spawned later #718: the harness's views are built before its data, so its systems keep reporting zero work until that is resolvedThe last two are deliberately left open; closing them needs a browser session and a capture this fix alone cannot make non-empty.
#631 #582 #710 #672 #688 Bug bash round two: seven fixes (PR #719)