Skip to content

feat: Phase 5 — Holographic Core (payload system, rules, HUD, worker, spring drag, tests)#1

Open
akaradje wants to merge 7 commits into
mainfrom
feat/phase5-holographic-core
Open

feat: Phase 5 — Holographic Core (payload system, rules, HUD, worker, spring drag, tests)#1
akaradje wants to merge 7 commits into
mainfrom
feat/phase5-holographic-core

Conversation

@akaradje

Copy link
Copy Markdown
Owner

Summary

Implements the remaining blueprint features for the Liquid-State Engine:

  • Data Payload System — Opaque payloads (text/number/json/array) attached to each physics node via a JS-side registry. Wasm emits a packed u32 event queue for spawn/despawn/merge/fracture.
  • Generic Rule Engine — Pure JS functions for per-type merge and fracture semantics. Configurable numeric reducer (sum/avg/product). Auto-detect payload type from raw input.
  • Draw Mode & Drag-and-Drop — Mouse-drag path tracing creates new nodes; file/text drop onto canvas creates payload nodes; payload dialog for labeling.
  • Glassmorphism HUD — Preact+htm via CDN (no build step). Mode switcher, floating inspector, physics config toolbar, translucent blurred panels.
  • Web Worker — Wasm engine runs in background thread. SharedArrayBuffer + Atomics path with COOP/COEP headers; transfer-based postMessage fallback.
  • Spring-Damped Drag — Hooke's law spring + velocity damping replaces brute-force drag. pin_node/unpin_node/update_pin_target API.
  • Tests & Examples — 12 Rust unit tests (ECS round-trip, quadtree query, bitwise merge/fracture). Example page for JSON/number/text data workflows.

Files Changed

18 files, +2617 / -309 lines

Verification Checklist

  • cargo check --target wasm32-unknown-unknown — clean, no warnings
  • cargo test — 12/12 tests pass
  • All existing Wasm APIs preserved
  • HUD renders above canvas, pointer-events selectively enabled
  • No DOM inside canvas — all node visuals remain pixel-rendered by Rust
  • SoA memory layout maintained
  • Dirty rectangle strategy unchanged
  • Worker path degrades gracefully: SAB → transfer → single-threaded

How to Test

npm run build:wasm
npm run serve
# Open http://localhost:8080/web/
# Open http://localhost:8080/examples/data-workflow.html

🤖 Generated with Claude Code

akaradje and others added 7 commits May 12, 2026 15:28
Add packed u32 event queue (merge/fracture/spawn/despawn) to Rust.
JS PayloadRegistry decodes events and maintains Map<entityId, payload>.
Relations emit merge/fracture events; spawn/despawn tracked in lib.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pure JS functions for per-type merge/fracture semantics.
Configurable numeric reducer (sum/avg/product).
Auto-detect payload type from raw input.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Preact+htm via CDN (zero build step). Translucent panels with
backdrop-filter blur. Mode switcher (Select/Draw), floating
inspector panel, bottom toolbar for physics config, payload
input dialog. All positioned above canvas with pointer-events
selectively enabled.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Worker owns the Wasm engine; main thread handles input + canvas blit.
SharedArrayBuffer path with Atomics.wait/notify for frame sync.
Transfer-based postMessage fallback when SAB unavailable.
Node/Express serve script sets COOP/COEP headers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Damped spring (Hooke's law + velocity damping) pulls pinned
nodes toward cursor. Exposed pin_node/unpin_node/update_pin_target
API. Configurable stiffness and damping coefficients.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
12 Rust tests covering spawn/despawn round trip, quadtree
query correctness, bitwise merge & fracture producing
expected masks, color derivation, capacity bounds.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ASCII architecture diagram with worker, payload system docs,
rule engine table, COOP/COEP instructions, roadmap table,
package.json test scripts. Example page demonstrating
JSON/numeric/text data workflows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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