SporeLanguage referenceAbout the solverHow it solves
Configurator demo
For readers who know SAP LO-VC / IPC

Uses SAP LO-VC's vocabulary, without the ERP it usually runs inside

Characteristic, class, object, restriction, procedure, variant table - anyone who has written $SET into an IPC dependency net, or sat through CU50, will recognize an .ssc file within minutes. What differs is not the vocabulary but where the engine runs: the same code runs in a browser, on a PC, and on a microcontroller that configures a live machine, reading a sensor and driving an actuator directly.

SAP configures an order; Spore configures a board, and does not attempt to cover the rest of what SAP provides - BOM, routing, pricing, or a support contract. Anyone who needs those will not find them here.


Vocabulary

The same names, mapped onto a different runtime

If you can read an SAP dependency net, you can read .ssc - the naming is deliberate, chosen to map onto one static heap and a total recompute rather than a session on an application server. How to write the language itself is in the language reference; this table is only the mapping - what the SAP word means here, and where it does not.

SAP LO-VC / IPCSporeNote
CharacteristiccharacteristicThree types: SINGLE, MULTI, RANGE. No date type, no table type, no multi-interval RANGE.
Class, Objectclass, objectSame idea. No BOM and no configurable product structure behind it.
Constraint / Restrictionrestrictions:Narrows a domain. Never writes a value. Re-derived from committed state on every solve_config().
Procedure ($SET, $SET_DEFAULT, $DEL_DEFAULT)procedureOne-to-one, including default provenance (revocable vs. an explicit pick). unset is host-only, not a procedure.
Precondition / invisible / required / no-inputproperty restrictionsDerived flags, not memory. A precondition is OR across rows: the target is visible if any one holds.
Variant tabletable / .vtableRows inline or in an attached file. Bidirectional propagation, with the gaps called out below.
GUI dependency-net editor.ssc DSLLangium grammar, kb-emit → .kb.img plus a UI manifest. No visual canvas.
Session on an application serverone heap[]No malloc. PC default 8000 ints; AVR 400 ints = 800 bytes. Multi-tenant isolation is the host’s job, not the engine’s.

New territory

Requirements a live device introduces that SAP's design never had to meet

01

Why an observed value skips the admission gate

A characteristic marked observed is written from a sensor through set_cstic_observed rather than by a user, so the engine applies no admission gate and no domain narrowing to it - a low reading is not rejected as CONFIG_BAD just because it is cold outside. Reporting a conflict on a thermometer reading would misrepresent a fact as a configuration error, so the engine does not; the UI instead treats the value as read-only. SAP has no equivalent, since it configures an order, not a live physical state.

02

How applied differs from observed

A value marked applied is one the settled configuration is meant to leave toward the host - a relay, an LED, a PWM output - with the solver deciding the value and the host driving the actual hardware. It is manifest metadata rather than a bit stored in the .kb.img, so pin binding stays entirely on the host side, addressed by object.characteristic name.

03

One source file, compiled for four different hosts

The same engine.c (~1560 lines of portable C11, no struct pointers) compiles with gcc for a PC, emcc for WASM in the browser, avr-gcc for an ATtiny1614 with 2 KB of RAM, and the ESP-IDF / PlatformIO toolchain for an ESP32-C3. No JVM, no application server, no per-platform engine binary. The knowledge base lives in flash as a .kb.img.

04

Derived state is recomputed fresh, so it cannot go stale

Every solve_config() call recomputes all derived state - domains, properties, completeness - from committed state, which rules out any bug class where derived state could drift from its source; the tradeoff is that every change pays for a full recompute. Defaults are cleared and re-derived at the start of each call, while an explicit pick remains untouched.


Semantic differences from SAP

Points where a direct port of SAP semantics breaks

Both sides detect the same infeasibility, but they disagree on what stays “assigned” once there is a conflict.

A MULTI restriction is an admission gate

In Spore, set_cstic rejects a value that is no longer in the domain. In real SAP, RESTRICTION: FALSE accepts the pick, leaves it assigned, and flags the whole configuration as conflicting. This is a deliberate design choice rather than a missing second, non-gating mode.

A table, closer to a full SAP lookup now

Forward and reverse both work: a pick on a dependent column can narrow a primary. A reverse key must not be RANGE, must not be MULTI, and a SINGLE must be an explicit pick, not an inferred default. The one thing those per-value rules structurally could not do - narrow a dependent while the primary is still ambiguous, as long as every remaining row agrees on it - engine.c now does too, reading the table's own rows at solve time instead of a precompiled per-value rule. A MULTI primary is still out of scope.

No two-role binding onto one MULTI

SAP writes two roles bound to one characteristic with a joint condition; Spore’s object model has no direct equivalent, so includes / not includes reads the current chosen set instead - the same intent expressed differently, and only in one direction.


Costs that come with that footprint

No completeness guarantee - on the board

The solver on the board is pure propagation, not search. It can report a conflict where a different pick order would still have a legal solution - the classical gap of any propagation-only CSP, not unique to Spore. search_complete() exists to close that gap: real depth-first backtracking, with a full heap snapshot taken at every choice point so it can prove outright that no solution exists, rather than only detecting that propagation got stuck. It is deliberately not shipped on AVR. It was tried live on ESP32-C3 (~60 KB RAM for a usable depth) and taken back out: the KBs a board actually runs are hand-authored and checked before deployment, so this gap almost never fires there. It stays a PC / WASM tool while writing a KB, where the memory is free.

No precompiled table of the whole space

Another school of configurators precomputes the legal space into a compressed table and gets completeness without runtime search. Industrial engines do that; Spore deliberately does not, because that table would not fit on an ATtiny. The data model looks this way because of that footprint constraint, not because completeness was overlooked.

No ERP integration, no scoring

There is a browser editor for writing a KB (live preview, diagnostics, WASM or a WebSocket to a PC / a bridge to a board), but there is no drag-and-drop canvas like SAP GUI, and no BOM, routing, or pricing. It only ever answers boolean legality - allowed or not - never a notion of “cheapest”, since there is no coefficient or weight equivalent.

A young project

No years of production on thousands of daily transactions, no certification, no support contract. Exercised on a handful of demo knowledge bases and real hardware (ATtiny1614, ESP32-C3) - not on an industrial catalogue with tens of thousands of combinations.


Verdict

When this project is, and isn't, the right choice

Yes
  • A physical product whose configurator has to run on the board, not a server - sensor in, actuator out
  • A team that wants to read the whole engine (~1560 lines), not trust a black box
  • A prototype or small deployment where an SAP licence and stack do not make sense
  • A KB author who needs the same solver in the editor and on the target chip
No
  • An industrial catalogue with thousands of characteristics and variant tables
  • A deployment that needs an SLA, a certification, or a support contract
  • Anything that must integrate BOM, routing, or pricing into an ERP
  • A 1:1 port of an LO-VC profile with no appetite to rewrite MULTI and table edges