Skip to content

Architecture maps: plugin.ts per layer, compiled systems, faster routing, quieter hover - #294

Merged
krisnye merged 35 commits into
mainfrom
krisnye/architecture-polish
Nov 30, 2026
Merged

krisnye merged 35 commits into
mainfrom
krisnye/architecture-polish

Conversation

@krisnye

@krisnye krisnye commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Architecture maps: one plugin per layer as plugin.ts, compiled systems, faster routing, and quieter hover.

Plugins: plugin.ts, reached through a namespace

  • A layer's one plugin is plugin.ts exporting plugin; its parts live in plugin/. A layer has at most one plugin, so plugin is both its kind and its name.
  • Other modules reach it through a PascalCase namespace import of the layer, named for its feature and layer, like a typespace: import * as TodosView from "…/todos/view/index.js" → TodosView.plugin, ...FilterView.plugin.systems.
  • Checker: plugin-import (new) reports a named import of plugin from another layer, or a namespace whose .plugin is used under another name; plugin-name accepts only plugin.ts; plugin-name-clash is removed. The standard, rules, agent rules and README (with an upgrade note) describe it.
  • Every app following the standard is renamed; the map labels plugins by place ("todos view plugin").

Compiled systems

  • The document records each system's compiled forms from the build's own description (as the guide gets them): compiled: { runsOn, js?, wasm?, wgsl? }, each compiled, eligible (with why) or made at registration.
  • The map badges systems that compile (JS, WASM, GPU), and a system's pinned note shows its JavaScript, WAT and WGSL after its TypeScript.

Routing

  • About 3.5× faster on the voxel editor (fold 2.4 s → 0.6 s; todo 152 → 48 ms), routes as good: a typed-array queue in the router, routes kept as corners, crossing counts kept in a table and recounted only near moved runs, faster track placement, and widenings that don't separate what bounds their gap taken back (no wasted pass or blank space). pnpm run bench times each phase; the README's "Routing performance" note records what helped and what didn't.
  • Crowded corridors at the top and bottom of the map: tracks fit around a run that can't move, and its lost space widens the gap.

Hover

  • Related rows are tinted magenta instead of outlined; a layer hiding a related node gets a fainter tint.
  • Hovering a line heats and describes only the line nearest the pointer.

Versions

@adobe/ecs-architecture 0.7.2, @adobe/ecs-architecture-viewer 0.1.3.

Tests

From a clean build of ecs/: check:workspace, typecheck, lint, build and every package's tests with CI=true pass; ecs-architecture check is clean in all seven apps; the root installs frozen. The viewer's routing tests (directions, clearances, tracks, crossings — thresholds only lowered — zoom exactness) pass locally and in CI mode.

Left in FOLLOWUPS.md: the voxel editor routes in ~0.6 s, not under 0.5 s (the router's search needs a cheaper strong length estimate); render systems have no compiled form in the build's description.

krisnye and others added 30 commits November 30, 2026 02:10
A layer has at most one plugin, so it is `plugin` in `plugin.ts`, its parts in
`plugin/`. Other modules import it through a PascalCase namespace of the layer's
index named for its feature and layer (`TodosView.plugin`; `App<Layer>` at the
root). The checker enforces the file name and the import form, follows
`Namespace.plugin` members in plugin systems and connects, and the map viewer
labels plugins by feature and layer. The sample apps and the viewer follow it.

Co-Authored-By: OpenCode <noreply@opencode.ai>
…ng one fainter

Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
… gap widens for the room it breaks up

The top corridor's tracks were squeezed past a row's leg running along it, 2px off other nets. Corridors now fill the
pieces between pins and widen for the tracks lost there; the browser check covers runs along the top and bottom.

Co-Authored-By: OpenCode <noreply@opencode.ai>
…n bench

Co-Authored-By: OpenCode <noreply@opencode.ai>
…, runs found in one pass and once per link

The routes drawn are unchanged.

Co-Authored-By: OpenCode <noreply@opencode.ai>
The routes drawn are unchanged.

Co-Authored-By: OpenCode <noreply@opencode.ai>
… as its shape changes

The routes drawn are unchanged.

Co-Authored-By: OpenCode <noreply@opencode.ai>
The routes drawn are unchanged.

Co-Authored-By: OpenCode <noreply@opencode.ai>
…each move weighed by its own crossings, orders tried in place

The routes drawn are unchanged.

Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
…eap empties

The routes drawn are unchanged.

Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
A path through every grid node it passed made each later step walk hundreds of points, and the crossing pass, matching
a run by where it starts among them, lost runs to the nodes a moved run dragged along, so it reordered fewer corridors
than it could. With only its corners, a link has the same shape, tracking and lessening crossings are about twice as
fast, and the crossing pass reorders those corridors, crossing a few fewer.

Co-Authored-By: OpenCode <noreply@opencode.ai>
The voxel editor's 'view' module's margin below it doesn't move the heading below the gap its links' tracks need, so
each pass widened it again, to no avail, and routed every link again for it.

Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
…e runs it changed

Co-Authored-By: OpenCode <noreply@opencode.ai>
… as they are now, and what's left in the follow-ups

Co-Authored-By: OpenCode <noreply@opencode.ai>
…ld describes them

Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
Each gap's widening is measured once all are made: where what bounds it on one side didn't move off what bounds it on
the other, as below the voxel editor's 'view' module, last in its column, whose margin below moved nothing, the
widening is taken back, adding no space that holds no tracks, and the links aren't routed again for it.

Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
…ery order

The first cheapest in lexicographic order, as before, from what's left to place at best for each set placed.

Co-Authored-By: OpenCode <noreply@opencode.ai>
Co-Authored-By: OpenCode <noreply@opencode.ai>
krisnye and others added 5 commits November 30, 2026 13:10
The pinned note docks in the window's bottom right corner for every kind,
translucent over a light blur, with a close button; scrolling keeps it.
related derives from the pinned and hovered nodes (relate, in
RelatedModel.plugin) and heatLinks heats both nodes' links, so the
pinned node's places stay tinted and its links stay in front and flowing
as the pointer moves on.

Co-Authored-By: OpenCode <noreply@opencode.ai>
…ter are left as they are

Co-Authored-By: OpenCode <noreply@opencode.ai>
…ery name still show their tips

Co-Authored-By: OpenCode <noreply@opencode.ai>
…spread

Systems' components, lookups, Index.create, System.render, System.entered/exited,
commands.despawnWhere and readonly systems' tables declare with, not and where
directly, typed from the declaration. Query.create and Query.and stay for named,
reusable queries, which a site spreads ({ ...visible, changed: [done] }); a
query's kind is non-enumerable at runtime and a private member in types, so it
never spreads. despawnWhere takes a query as it is too. Query.and takes query
declarations as well as queries.

The build follows inline declarations and spreads of query constants through
consts, imports, re-exports and namespaces, and hoists despawnWhere literals of
module keys and literal values so they're read once.

ecs-persistence 0.4.0: snapshot's selection is { entities?: { with, not, where }, resources? }.
ecs-gpu 0.0.6. ecs-architecture: query-in-place rule; map reads the flattened
form and spreads. Rules and agent files regenerated; samples, guides, benchmark migrated.

Co-Authored-By: OpenCode <noreply@opencode.ai>
@krisnye
krisnye merged commit 9869f23 into main Nov 30, 2026
4 checks passed
@krisnye
krisnye deleted the krisnye/architecture-polish branch November 30, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant