Expand description
Engine-neutral signal-graph game logic for Wyrd.
Author an immutable Weave, bind it to dense ids with Runtime, then
sample host senses and settle it once per frame. Use core, graph,
and runtime when an explicit layer namespace is clearer.
The crate root re-exports the common authoring and runtime vocabulary. The layer modules provide the same contracts grouped by intent. Implementation modules stay private so downstream code cannot depend on bind tables or runtime storage details:
ⓘ
use wyrd::runtime_impl::Runtime;ⓘ
use wyrd::authoring::WeaveBuilder;Start with the ordered, executable examples, beginning at
examples::tier_a::a01_hello_invert.
Modules§
- core
- Shared signal, id, port, and knot-catalog vocabulary.
- examples
- Learn Wyrd through small, ordered, executable examples.
- graph
- Weave authoring, validation, patterns, and serialization codecs.
- runtime
- Runtime binding, host integration, and output collection.
- signal_
ops - Path-local arithmetic on
Signal(preferCalcknots inside Weaves).
Macros§
- pattern
- Builds and validates a reusable
Pattern. - schema_
for - JSON Schema traits and macros for serializable graph and recipe types.
Enable the opt-in
schemafeature before importing these exports. Generates aRootSchemafor the given type using default settings. - weave
- Builds and validates a
Weavewith the typed graph API.
Structs§
- Bind
Opts - Bind-time options (sandbox / host policy).
- Bool
- Marker for boolean graph wires.
- Budget
- Hard and soft resource limits applied after structural validation.
- CmdId
- An interned EmitCommand handle owned by one Runtime.
- Composer
- Dynamic graph composer scoped to one generated
Weave. - Count
- Marker for whole-count graph wires.
- Emit
- One
EmitCommandentry written since the lastRuntime::begin_frame(subject to the per-frame emit cap). - Emit
Command Manifest - A named host-applied
EmitCommandendpoint in aRecipeManifest. - Host
Path Id - An interned SignalOut path handle owned by one Runtime.
- Host
Time - Core time: discrete tick only (
dtstays host-side). - Input
Port - Catalog-checked input endpoint for connecting a thread.
- KnotDef
- Serializable knot definition.
- KnotId
- Dense knot index after validate/bind.
- Level
- Marker for continuous level graph wires.
- Null
Host - No-op host (benches, placeholder worlds).
- Outbox
- Borrowed view of this frame’s acts and dropped-emit telemetry after loom.
- Output
Port - Catalog-checked output endpoint for connecting a thread.
- Pattern
- Immutable, validated reusable graph fragment.
- Pattern
Def - Editable pattern definition; convert with
Pattern::try_from. - Pattern
Export Def - Named export of an inner knot port for parent-weave wiring.
- Pattern
Instance - Expanded pattern include: export names map to parent-builder ports.
- Port
Info - One entry in a kind’s fixed port table.
- Port
RefDef - Serializable author reference to a named knot port.
- Port
Slot - Port within a knot’s closed catalog table (D-port-schema).
- Port
Writer - Mutable host handle for writing dense sense values before loom.
- Recipe
Instance - One bound
Recipewith its runtime and typed resolved ports. - Recipe
Manifest - Deterministic, tooling-facing summary of a validated recipe topology.
- Runtime
- Bound runtime: dense buffers, topo order, intern tables, stateful rune storage.
- Runtime
Preset - Authorable initial values addressed by stable knot names.
- Runtime
State - Opaque cloneable continuation state produced by
Runtime::snapshot. - Runtime
State Report - Read-only semantic checkpoint report.
- Scenario
- A deterministic, closure-scoped runner for one bound
Recipe. - Scripted
Host - Scripted senses + recorded apply commands for deterministic replay tests.
- Seed
- Host-owned PRNG seed for
Randomknots (mixed with weave id at bind). - SenseId
- A host-writable SignalIn handle owned by one Runtime.
- Signal
InManifest - A named host-writable
SignalInendpoint in aRecipeManifest. - Signal
OutManifest - A named host-applied
SignalOutendpoint in aRecipeManifest. - Signal
OutSample - One
SignalOutlevel written during the last loom. - Thread
Def - Serializable directed connection.
- Thread
Id - Optional diagnostics / tooling id (not used on the settle hot path).
- Threshold
Wires - Boolean outputs of a threshold knot.
- Validate
Report - Soft budget warnings from a successful hard-limit pass.
- Weave
- Immutable, structurally validated graph ready for runtime bind.
- Weave
Builder - Incremental weave construction;
Self::buildvalidates into aWeave. - Weave
Def - Editable and serializable graph definition. Convert it to
Weavebefore execution. - Wire
- A typed output wire owned by the active
Composer.
Enums§
- Bind
Error - Failure while turning an authored
crate::authoring::Weaveinto a runtime. - Bind
Restore Error - Failure while binding a fresh runtime from a durable checkpoint.
- Budget
Warning - Soft-limit warning; graph remains valid for bind.
- Build
Error - An authoring operation failed before final graph validation.
- CalcOp
- Binary arithmetic for
KnotKind::Calc(prefer over path-localsignal_ops). - Compare
Op - Comparison operator for
KnotKind::Compare. - Compose
Error - Error produced while composing a generated weave.
- Flag
Priority - Simultaneous set/reset priority for
KnotKind::Flag. - Handle
Error - Failure caused by using a dense handle with the wrong runtime or port.
- Host
Command - Dense command emitted for host apply (from SignalOut / EmitCommand).
- Json
Codec Error - JSON parse, serialize, or post-parse validation failure.
- Knot
Kind - Author / asset knot kind. Host path and emit names stay open strings until bind.
- Numeric
Path - Which numeric wire path this weave was authored for.
- PortDir
- Direction of a catalog port relative to its knot.
- Port
Domain - Graph-time domain constraint for one structural port.
- Preset
Error - Failure while applying a named authored runtime preset.
- Recipe
Endpoint - The kind of named endpoint a
crate::Reciperequires from a bound runtime. - Recipe
Error - Failure while constructing, binding, or resolving a
crate::Recipe. - Recipe
Resolve Error - Failure while resolving one of a recipe’s required named endpoints.
- Restore
Error - Failure while restoring an opaque
RuntimeState. - RonCodec
Error - RON parse, serialize, or post-parse validation failure.
- Runtime
Preset Entry - One named semantic initial-state value in a
RuntimePreset. - Runtime
State Entry - Owned, authored-name state entry for checkpoint auditing.
- Runtime
State Json Codec Error - JSON checkpoint codec error.
- Runtime
State RonCodec Error - RON checkpoint codec error.
- Scenario
Error - Failure while driving or asserting a typed
crate::Scenario. - Signal
Domain - Semantic domain carried by a monomorphic
Signalwire. - Timer
Mode - Timer behavior for
KnotKind::Timer. - Validation
Error - A graph definition is structurally invalid and cannot become a
crate::Weave.
Constants§
- ONE
- Canonical true / on level for the active signal path.
- RUNTIME_
STATE_ FORMAT_ VERSION - Current in-memory snapshot format version.
- ZERO
- Canonical false / off level for the active signal path.
Traits§
- Host
- Engine-neutral host: sample senses into a
PortWriter, apply outbox after loom. - Json
Schema - JSON Schema traits and macros for serializable graph and recipe types.
Enable the opt-in
schemafeature before importing these exports. A type which can be described as a JSON Schema document. - Numeric
Wire Domain - A typed wire domain accepted by numeric catalog operations.
- Recipe
- A reusable graph with statically named, runtime-resolved ports.
- Wire
Domain - A signal domain that may be represented by a typed
Wire.
Functions§
- append_
commands - Append outbox contents as dense host commands (signals then emits).
- from_
count - Whole count into Signal bits (not Q-scaled on i32).
- from_
json - Parse JSON text as a
WeaveDefand validate into aWeave. - from_
level - Author level ~0..=1 into Signal.
- from_
ron - Parse RON text as a
WeaveDefand validate into aWeave. - is_
truthy - Truthy when not equal to
ZERO(level and count domains share this rule). - outbox_
to_ commands - Map a loom outbox into a new command vec (allocates). See
append_commands. - port_
domain - Domain constraint for a structural port, or
Nonewhenslotis invalid. - port_
slot - Resolve a catalog port name to its dense slot for the given kind.
- ports_
of - Static port table for a kind. Empty for unsupported And/Or arity.
- runtime_
state_ from_ json - Deserialize a checkpoint from JSON. Bind it with
Runtime::bind_restoredto validate topology and state. - runtime_
state_ from_ ron - Deserialize a checkpoint from RON. Bind it with
Runtime::bind_restoredto validate topology and state. - runtime_
state_ to_ json - Serialize a checkpoint as JSON.
- runtime_
state_ to_ ron - Serialize a checkpoint as pretty RON.
- slot_of
- Resolve a catalog port name to its compact slot.
- tick_
once - One host tick: begin_frame → sample → loom → apply.
- to_json
- Pretty-print a weave definition as JSON.
- to_ron
- Pretty-print a weave definition as RON.
- validate
- Hard budget check only; discards soft warnings.
- validate_
report - Hard budget check plus soft-limit warnings for tooling.
Type Aliases§
- Bool
Wire - Boolean wire alias used by composition examples and helpers.
- Count
Wire - Count wire alias used by composition examples and helpers.
- Level
Wire - Level wire alias used by composition examples and helpers.
- Signal
- Wire value type for the
signal-f32compile-time path.
Derive Macros§
- Json
Schema - JSON Schema traits and macros for serializable graph and recipe types.
Enable the opt-in
schemafeature before importing these exports.