GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jscott3201/open-control-engine: Embeddable, deterministic Rust control engine that natively executes OBC/LBL CDL for smart-building control sequences.

BranchesTags
Open more actions menu

Latest commit

 

History

592 Commits
592 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents
.agents
 
 
.cargo
.cargo
 
 
.config
.config
 
 
.githooks
.githooks
 
 
.github
.github
 
 
crates
crates
 
 
docs
docs
 
 
firmware/link
firmware/link
 
 
scripts
scripts
 
 
site
site
 
 
third_party/modelica-buildings-cdl
third_party/modelica-buildings-cdl
 
 
tools
tools
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE-APACHE
LICENSE-APACHE
 
 
LICENSE-MIT
LICENSE-MIT
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
TESTING.md
TESTING.md
 
 
clippy.toml
clippy.toml
 
 
deny.toml
deny.toml
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

Open Control Engine

Open Control Engine runs building control sequences written in the OBC / LBL Control Description Language (CDL), published as ANSI/ASHRAE Standard 231-2026, as a Rust library you embed in your own application.

License: Apache-2.0 OR MIT Rust 1.97.0 MSRV · edition 2024 database-free documentation site

You hand it a control sequence as a CXF document (CDL's JSON-LD exchange format). It parses, validates, and compiles that sequence into a frozen topological schedule, then ticks the schedule deterministically — the same document, parameters and input sequence produce bit-identical outputs, run to run and across x86_64 and arm64, checked against committed goldens on both architectures on every pull request.

It is a library and nothing else: no main, no daemon, no network listener, no async runtime, and no database. Everything non-computational — points, trends, tags, durability — sits behind a storage port your application implements. That split is not a design preference. The OpenBuildingControl (OBC) specification's metadata section (OBC §7.17; clause 5.13 in the table of contents of ANSI/ASHRAE Standard 231-2026) says of that metadata that none of it affects the computation of a control signal, and the engine applies that rule to everything non-computational.

Its four execution-core crates build #![no_std] on core and alloc alone, and the work in progress lets a verified sequence leave a std host as a compiled-schedule blob that a bare-metal or WASM target executes without the CXF importer. See Status and roadmap.

Today it loads and simulates 46 ASHRAE Guideline 36 sequence fixtures against a registry of 133 CDL block classes*. It is pre-1.0 and not published to crates.io.

* One of the 133, TrueHoldWithReset, uses a local two-input interface that is not in the CDL catalog, so a conforming single-input document is refused. See the note in CDL coverage.

Read the product contract for the versioned executable-CXF/HostTick boundary, current limitations, host obligations and future acceptance outcomes.


Who this is for

  • BAS and OEM product teams who need a sequence runtime inside a controller or supervisory product, without adopting a database or a runtime framework along with it.
  • Commissioning and FDD tool authors who need the same sequence to produce the same numbers today that it produced last quarter, as evidence rather than as a hope.
  • CDL researchers and toolchain authors who want an independent executable implementation to compare against.

If you are looking for a finished building-automation product, this is not that. It is the engine such a product would be built on.


Quickstart

The facade package is oce-api. open-control-engine is a reserved umbrella name for a future release, not a current alias — nothing is on crates.io yet, so depend on it via git. Pin a revision appropriate to your release process rather than following a moving branch:

[dependencies]
oce-api = { git = "https://github.com/jscott3201/open-control-engine", rev = "<commit-sha>" }

Load a CDL sequence from CXF and execute complete typed frames:

Every point is named by an authored @id from the CXF document, expanded against the document's @context to canonical absolute form at ingest — the declared boundary input's @id for a boundary-driven point, the connector's own otherwise — so the same key names the same point across loads of the same document, including a document re-serialized between compact and expanded spellings. The document's declared boundary-output names (root S231:hasOutput) read as aliases for their driving connectors on get_output and watch. These are latest-state, non-receipt inspection surfaces. CompletedFrame retains the committed executable boundary outputs in lexical identity order, independently of later engine changes.

use oce_api::{Engine, Value};

const ECONOMIZER: &str = "http://example.org#g36.ahu_economizer";

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut engine = Engine::new(); // A pure engine: no storage backend, no database.
    let cxf_bytes = std::fs::read("crates/oce-cxf/tests/fixtures/g36/ahu_economizer.jsonld")?;
    engine.load_cxf(&cxf_bytes)?;

    // The host owns cadence and supplies every required observation on each frame.
    for index in 0..=4 {
        let time = f64::from(index);
        let observations = [
            (format!("{ECONOMIZER}.return_air_temp"), Value::Real(24.0)),
            (
                format!("{ECONOMIZER}.outdoor_air_temp"),
                Value::Real(18.0 + time),
            ),
            (format!("{ECONOMIZER}.operating_mode"), Value::Integer(1)),
        ];
        let entries: Vec<_> = observations
            .iter()
            .map(|(p, v)| (p.as_str(), v.clone()))
            .collect();
        let prepared = engine.prepare_frame(time, &entries)?;
        let completed = engine.execute_frame(prepared)?;
        println!(
            "frame {} at {}: {:?}",
            completed.sequence(),
            completed.time(),
            completed.outputs()
        );
    }
    Ok(())
}

To run the engine's own tests from a clone:

git clone https://github.com/jscott3201/open-control-engine
cd open-control-engine
cargo nextest run -p oce-api -p oce-blocks -p oce-expr # the state-determinism subset
bash .agents/gate.sh                            # the gate script CI runs; see its closing report
                                                # for the per-PR checks it cannot cover locally

What it does today

  • Imports CXF through the oce-cxf resolver, and exports back to CXF under a round-trip contract where re-importing the emitted bytes renders bit-identically — Reals compared by IEEE-754 bits, not by epsilon. See CXF round trip. Both directions use one vocabulary namespace, http://data.ashrae.org/S231#: a document bound to another is refused with a typed diagnostic, and every exported document names the software and version that wrote it.
  • Executes a registry of 133 CDL elementary block classes plus 3 reserved internal lowering classes, enumerable at runtime via oce_api::catalog() with per-class ports, parameter rules, and honest parameter defaults. See CDL coverage.
  • Runs 46 G36 conformance fixtures end to end through the frozen facade, each with a committed whole-sequence golden trace.
  • Executes exclusively through prepare_frame followed by consuming execute_frame, or by slot: frame_slots resolves the boundary once and execute_slots(&slots, t, &values) then submits each complete frame through the same core driver, with the same refusals, borrowing its outputs and allocating nothing per frame once the map exists, beyond warning-record growth. The engine is pure: it has no storage dependency, and load_cxf returns the resolved model and IO inventory as a plain-data LoadedModel. Hosts own cadence, persistence and equipment delivery; for persistence, oce_store::host::persist_loaded_model runs the post-load recover → save → validate-inputs sequence against any adapter behind the storage port (or the in-memory oce_store::MemStore).
  • Builds its execution core — oce-model, oce-expr, oce-blocks and oce-graph — no_std + alloc behind a default std feature, checked for thumbv7em-none-eabihf, riscv32imac-unknown-none-elf and wasm32-unknown-unknown on every pull request that changes the engine, and linked into a bare-metal firmware image for both bare-metal targets that is held to a size budget per PR and run under QEMU nightly, where its per-frame results must equal the host's. Every f64 operation core lacks goes through libm, bit-identical to the std methods, and clippy refuses std float methods and hash collections inside those four crates. See the core four.
  • Proves determinism on every engine-changing pull request rather than asserting it: goldens on x86_64 and arm64 natively, a populated portable state snapshot compared byte for byte across the two, a per-frame allocation census, and a hash-order-independence test that loads every fixture under twenty independently seeded hashers and requires identical outputs, receipts and snapshot bytes.
  • Compiles a loaded executable to an OCEB compiled-schedule blob — Engine::compile_blob in oce-api encodes it, oce_graph::blob::decode in oce-graph (built no_std) decodes it into a ready-to-tick schedule and run state, checking each class against a per-class signature hash. The 46 blob goldens are byte-identical across x86_64 and arm64, the decoded executable matches the facade bit for bit after every tick, and hostile bytes are refused with typed errors. oce_api::inspect_blob reads what a blob records about itself (content id, class table, per-instance initial-state CRCs, I/O paths) without running it, so two blobs can be compared, and its summary says whether this build's decoder accepts the blob (decode_refusal: None, or the decoder's own error). A decoded blob executes through the same HostTick frame driver as the facade (oce_graph::blob::Executable, inputs and outputs by slot, zero allocations per frame), and every pull request that changes the engine runs the blob round trip: blobs encoded on x86_64 are decoded and run natively on arm64 and under wasmtime on wasm32-wasip1, with every output, warning and raw state word after every frame of the 46 fixtures bit-identical to the recorded host run. See compiled-schedule blob.
  • Lets a person or an agent write a sequence without touching JSON-LD: oce-author holds one typed model in a strict-JSON wire form and a terse text form, validates it before an engine sees it, emits it deterministically to flat CXF and imports the library's in-subset CXF back. The oce command-line tool validates, emits and formats a sequence, serves the catalog and the vocabulary and replays a vector set (emit, validate, fmt, catalog, vocab, verify), prints a file's canonical content id (id) and turns a flat CXF document back into the authoring form (import), with a JSON report and exit codes 0 / 1 / 2. See the authoring layer and oce.

What it does not do

Stating this plainly is more useful than a feature list.

  • It does not parse or flatten Modelica .mo sources. It executes the block graph a CXF document hands it; the oce-cxf resolver lowers that document and nothing elaborates it further.
  • It does not execute CDL extension blocks. It executes elementary and composite blocks. An extension block is implemented by a Functional Mockup Unit, and FMI is out of scope before 1.0, so a document that contains one is refused at load with extension-block-unsupported (GitHub #582). What the engine does not execute.
  • It is not general ASHRAE G36 support. The supported set is explicitly selected-explicit-cxf-variants-supported: pre-flattened CXF at specific parameterizations, not other G36 composites. What "supported" means.
  • Its external-reference evidence is four cases, not broad engine coverage. CDL.Logical.Nand has one exhaustive Boolean case, CDL.Logical.Toggle has one stateful Boolean event schedule, and CDL.Reals.Line has one finite matrix covering four limit modes and five input regions. One composed G36 Reliefs leaf has a seven-state exact-bit case at its declared outputs. Beside them, single OpenModelica runs check the event timing of five event-triggered classes exactly (a trigger true at the start, and a later rising edge) and the resets of the Building 33 valve sequence on synthetic frames, and seven pilots check how an event input treats a pulse (Change, SampleTrigger, logic over them, the first frame included; issue #800), with ten registered, documented differences. No complete G36 sequence or general numeric tolerance has been checked that way, and the global Tier-3 report remains skipped — read the full accounting.
  • CDL.Logical.Pre is a host-tick delay, not Modelica event iteration. Under the fixed HostTick v1 profile, every successful Engine::execute_frame call advances Pre once, including repeated calls at the same timestamp. Exact Modelica/OpenModelica Pre equivalence is outside the conformance claim.
  • It has no Python bindings, no daemon, no scheduler, and no database.
  • halt() does not stop execution. It only opens the tune-at-rest window in which set_param is accepted; complete-frame execution can continue while halted with no pending edits.
  • Deferred loader signatures have been removed. load_from_semantic and load_modelica are no longer callable; prepare supported CXF externally and use load_cxf.
  • Assertion events and AssertLevel are Warning-only. AssertLevel::default() is now Warning; the never-emitted AssertLevel::Error variant was removed. This adds no escalation or safety policy.

Status and roadmap

The current release is v0.5.0 (milestone M2, November 2026): the authoring layer. A person or an agent writes a sequence without touching JSON-LD. oce-author holds one typed authoring model and builder with two forms that carry exactly it: a strict-JSON wire form with a pinned JSON Schema, and a terse text form with a hand-written parser that gives one typed refusal per malformed construct, a canonical printer and an idempotent fmt that keeps every comment (an end-of-line comment moves above its statement; a comment after the last item of a list or block is refused). A two-stage validator reports every catalog-level defect before an engine sees the sequence, then loads the emitted bytes in a throwaway engine and maps every diagnostic back onto the model; the deterministic emitter writes flat CXF; and the importer reads the in-subset library CXF (31 of the 34 in-subset library fixtures round-trip to their committed content id) and the frozen prototype's v0 graph JSON (it imports to the content id of the CXF the prototype wrote). The engine side it needed is in the facade: oce_api::class_ports names every port of a configured block, oce_api::class_metadata gives each class a description and each parameter a settable flag, and oce_api::enumerations lists every CDL and G36 enumeration and G36 Integer constant package. The milestone's last gate row, agent usability measured by a benchmark, moves to the milestone that lands the benchmark harness (owner decision, 2026-11-09). v0.5.0 also ships M3's work so far (below), and it is the first release in which every format and schema stays at revision 1 until 1.0.0 and changes in place: the engine version is what separates one layout from another, and a compiled blob and a state snapshot each carry it and are accepted only by the version that wrote them. v0.4.0 (M1b) made the execution core build no_std + alloc with its math through libm and no hash collections, compiled a loaded executable to an OCEB blob that runs on a bare-metal target through the facade's own frame driver, and replays one recorded run of the 46 fixtures' blobs bit for bit on x86_64, arm64 and wasm32-wasip1 on every engine PR; v0.3.0 (M1a) made the engine pure and moved the per-PR gate to native x86_64 and arm64 cells under one required CI OK status. development carries 0.6.0. The first change after the v0.5.0 tag that moved a format's meaning bumped it (issue #683): a Real parameter written as an Integer is held as a Real from load on, so the parameter table, the blob and the canonical content id are those of the document that writes it as a Real, and an Integer above 2^53 in magnitude on a Real parameter is refused (parameter-out-of-range). A blob or a snapshot release 0.5.0 wrote is refused with EngineVersionMismatch. Every reader of such a parameter sees that Real too (issue #735), and a parameter holding a value of another kind than its catalog type, which a block used to replace with its default, is refused (parameter-kind-mismatch, issue #734).

M2's oce command-line tool (crates/leverage/oce-cli, the first binary above the facade) puts the authoring loop at a shell prompt: emit, validate, fmt, catalog and vocab (M3 adds verify, id, import and diff, below), each with a documented JSON report on stdout for agents and the exit rule 0 yes / 1 no / 2 error (report contract):

# econ_enable.oce is crates/leverage/oce-author/tests/fixtures/text/econ_enable.oce; copy it here first
cargo run -p oce-cli -- validate econ_enable.oce        # findings as JSON; exit 0, 1 or 2
cargo run -p oce-cli -- emit econ_enable.oce -o out.cxf.json # validate, then write flat CXF
cargo run -p oce-cli -- fmt --check econ_enable.oce     # exit 1 when not canonical
cargo run -p oce-cli -- catalog CDL.Reals.MultiSum --param nin=3
cargo run -p oce-cli -- catalog CDL.Reals.PID           # what each port and parameter means

The importer's verb is oce import (M3, #514): it reads a flat CXF document into canonical text or the wire form over oce_author::import_cxf. The frozen prototype's v0 graph JSON stays the library API oce_author::import_graph_v0.

Vocabulary v1 is the reference text behind oce catalog: oce-vocab (crates/leverage/oce-vocab, README) carries, for each of the 133 authorable classes, a description of every connector and parameter with the unit and quantity the CDL source declares, generated from modelica-json's CXF-Core output (vendored under third_party/ and regenerated and compared byte for byte by a test), plus hand-written notes an agent needs and the catalog cannot say: which input is the minuend, which classes break an algebraic loop, the library's delayOnInit convention. class_vocab() joins it with the catalog, and oce catalog CLASS prints the result as text or JSON: for every parameter and port its meaning and declared unit, for every parameter its range (rendered from the catalog's own rules, such as Ti >= 1e-13 and uLow <= uHigh, never stored), then the notes and the upstream links. oce vocab lists the unit scale factors (min, h and d, exact multiples of s), and the text form reads them: delayTime = 1 h is 3600.0 s, exactly, fmt keeps 1 h, and a suffix that is not the parameter's declared unit is refused (unit-suffix-mismatch).

Next is M3 (the verification product), in progress in parallel with M2 since v0.4.0: the facade's slot-indexed execute entry is in, and so is the first leverage crate built on it, oce-replay, which drives the engine frame by frame from recorded or scripted inputs (columnar arrays, a bounded CSV reader, step lists) under an explicit missing-sample policy and records a columnar, bit-exact trace. M3's canonical content id is in as well: Engine::content_id names a loaded sequence by the SHA-256 of a canonical encoding of its flat graph, the same whatever its authored order, JSON spelling or instance namespace, and the blob header carries it.

M3's vector format and its replayer are in as well: oce-verify (crates/leverage/oce-verify, README) reads a vector set, the strict-JSON file of scenarios a sequence is checked against (oce/vectors/v1: one clock, constant and step inputs, expectations over windows of ticks or a diagnostic at one tick). It refuses everything the format does not define with a typed code, never ignoring a key, decides what a tick is by multiplication so that { step_s: 0.1, horizon_s: 4.3 } is a clock, and writes a canonical form with a spec_id over it; its JSON Schema is derived from the reader and pinned. run_vectors binds a set to a CXF subject (every name by one rule, every value typed by the port it lands on), replays each scenario on a fresh engine through oce-replay, compares exactly, a Real by its bits, and issues a receipt (oce/receipt/v1) whose receipt_id is the same for every run of the same inputs. The two in-repo library rules pass and their receipts are goldens. Mutant mode scores how well a set's vectors catch deliberate defects: a set lists mutants, deliberately broken copies of the subject; each is validated at bind and, when the subject passes, run until a scenario fails on it. The receipt records the catch score as two integers, caught of total. AHU-0016 ships three hand-written mutants: two caught, and one deliberate survivor that shows a real gap in its vectors. Every run is held to four work budgets, checked at bind before any load but the subject's first: frames, compared instants, bytes loaded, and frames weighted by the bytes of the document that runs them (work-budget note). The worst a set can ask for is then about a minute in release, not hours. oce verify <VECTORS> --subject <FILE> runs it all from the command line: the receipt on stdout, exit 0 when every scenario passed, 1 when one failed, 2 when no verdict could be reached. Mutant paths are resolved and kept inside the vector file's directory. The in-repo replay gate runs that binary over both library rules on every PR, against their golden receipts. oce verify --commission <SPEC> runs one reference of an OBC §12 commissioning spec against its trend files the same way: the files resolved inside the spec's directory and bounded before they are read, the commissioning receipt on stdout (exit 0 pass, 1 fail or no_data, 2 refused), and with --out each output's exceedance curve as a pyfunnel-shaped CSV file beside the receipt.

oce id <FILE> prints the canonical content id of a CXF document, or of the CXF a text or wire file emits, alone on stdout: the id a library card is stamped with.

oce import <FILE> [-o <OUT>] [--wire] reads a flat CXF document into canonical text, or the wire form, and reports what the importer read and did not carry; a document outside the authoring subset is refused under the importer's own code. It validates nothing: oce validate or oce emit judges the result. Import then emit keeps the content id wherever emit accepts the sequence, except for a name prefix on the root (every imported G36 fixture, re-stamped); the per-fixture table records what every CXF fixture under crates/ does. Neither import -o nor emit -o will replace the input file named on the command line, nor, on Unix, a regular file redirected as stdin (< doc); a pipe (cat doc | oce emit - -o doc) and, on Windows, stdin are not checked. Each refuses a name oce would read as another form. No verb writes through a symbolic link at its target: the path emit -o, import -o, fmt --write or verify --out writes must be absent or a regular file, or the run is refused before it reads anything (output-not-a-file; owner ruling of 2026-11-22, #758), and a file a commissioning spec or a vector set names is opened component by component without following a link (on Unix). On Unix every read and write below a directory goes through a handle opened once (#771): a document and the files it names come through one handle on its directory, the curve files verify --commission --out writes go through handles on DIR and the directories it makes, and fmt --write rewrites only the file it read.

Open follow-ups from M2 include the benchmark data the agent-usable row needs (#457) and checking a sequence parameter's unit suffix against the block parameter it feeds (#590); oce check (#574) is on M3.

See CHANGELOG.md.

Work is planned as GitHub milestones and cut into issues. Each milestone has a tracking issue that lists the order, the hard dependencies and the gate that closes it. The engine milestones, in order:

Milestone Goal State
M1a Portable core: cleanup Pure Engine, dead crates and ledgers removed, two CI lanes, native determinism and strict-bit matrices Released as v0.3.0
M1b Portable core: no_std Core four build no_std + alloc; math through libm; hash-free core; the OCEB compiled-schedule blob (encoder in oce-api, decoder in oce-graph, byte-stable across architectures); a no_std execution entry that never links oce-cxf or oce-api; a bare-metal gate cell with a size budget over thumbv7em, riscv32imac and wasm32; QEMU execution nightly Released as v0.4.0
M2 Authoring layer oce-author: one typed authoring model with strict-JSON and text forms, a validator that runs before the engine sees anything, and a deterministic emitter to CXF Released as v0.5.0: oce-author's model, builder, wire form and pinned schema, two-stage validator, emitter, text form and importer; the oce CLI (emit, validate, fmt, catalog, vocab); vocabulary v1 (oce-vocab), served through oce catalog and read by the text form for time-unit suffixes. The agent-usable gate row moves to the milestone that lands the benchmark harness (owner decision, 2026-11-09)
M3 Verification product Canonical content id, the vector format, an oce-verify replayer with receipts and a mutant score, a funnel-style tolerance mode, on the oce-replay historical replay crate In progress: oce-replay, the canonical content id (Engine::content_id, oce:canon1: over the loaded graph), output types in slot order before the first frame (FrameSlots::output_types()), the vector format (oce-verify: oce/vectors/v1 with a strict bounded reader, a canonical form with a spec_id, and a pinned JSON Schema), the replayer with its receipts (run_vectors, oce/receipt/v1), mutant mode with its catch score, the four work budgets on a run, and the oce verify verb with the in-repo replay gate are in, shipped in v0.5.0; the oce id verb, which prints the content id of a file, the oce import verb, which turns a flat CXF document into the authoring form, and the structural diff in all four parts (oce-diff: the authoring diff, the rename pass and the renderers, then the CXF adapter over two loaded documents, then the blob comparison; and the oce diff verb over them) are in since. Of the tolerance mode, the envelope arithmetic is in on development: oce_verify::funnel, a port of LBNL funnel whose curves print as the pinned pyfunnel==2.1.1's do, byte for byte, on funnel's own test set and a hostile set, and the aligned-grid envelope beside it. Of the commissioning verifier (OBC §12), the first of seven parts is in on development: oce-verify reads the test spec (oce/commissioning-spec/v1: OBC §12.7 Listing 12.1 as published, comments removed before the strict reader) and the point mapping, as typed values or typed refusals. The second part is in too: the closed unit table units/v1 (oce_verify::convert_unit, device unit to CDL unit, absolute temperatures and temperature differences kept apart, every unlisted pair refused). So is the third: the trend sources (oce_verify::TrendSources), which read a reference's csv (OBC §12.7.3's padded examples as printed, a Boolean as true/false, active/inactive or 1/0) and combiTimeTable trend files, convert every cell to its CDL unit and type, and merge the inputs on the union of their times for replay. The vector keys that ask for a tolerance are in on development too: a window's within and of, a when mask and the set's envelope, judged under either envelope after a self-enclosure check, with a tolerance receipt. So are the commissioning verifier's fifth and sixth parts: oce_verify::run_commissioning binds a reference to its sequence, replays its trends, masks each output by its indicators, compares it at its sampling grid under the funnel envelope (or aligned-grid, or exactly for a Boolean or Integer) and issues a commissioning receipt; on a synthetic trend perturbed by 0.1 K, zero tolerances fail and the stated band passes, the M3 gate row "Tolerance mode checked". The oce verify --commission verb is in on development too: one reference of a spec run against its trend files from the command line, the commissioning receipt on stdout, byte for byte the library's, and with --out each output's exceedance curve (and, with --bounds, its envelope) as pyfunnel-shaped CSV files. The OBC §12.6 Building 33 trends and their CoolingCoilValve sequence are vendored verbatim (#661); the sequence's modelica-json translation does not load (#760), so the Building 33 worked example runs from a CoolingCoilValve authored from the vendored model, not vendored (#755): one day of the trends through oce verify --commission, its receipt a golden, and the verdict fail, about that transcription: the recorded valve leaves the 1 s / 1 % funnel from 61,770 to 67,755 s, worst by 0.0209 at 65,965 s, where OpenModelica's run of upstream's own model leaves it too and OBC's Fig. 12.12, as we read its published SVG, shows the same afternoon. The engine stays within 0.0034 of OpenModelica over the day, and the day's five funnel curves print as the pinned pyfunnel's
M4 WASM oce-wasm over oce-api, a TypeScript package, a browser demo that replays vectors without a server, a tracked .wasm size budget Planned, in parallel with M5
M5 Python oce-py wheels (PyO3, abi3) over the same surface; replay and receipts from a notebook Planned, in parallel with M4
M6 Reference host oce-host: cadence, staleness limits, the non-finite policy, degraded mode and safe-state outputs as tested code; BOPTEST client and a Docker runtime Planned, in parallel with M7
M7 Composite lowering Composites first-class on import, with canonical lowering order and leaf names chosen so a composite has the canonical content id of its flattened form (the id already ignores order), so the library ships reusable routines Planned, in parallel with M6
M8 Semantics SemanticPoint records (Brick, 223P, QUDT, Haystack) carried through import and export without the tick ever reading them; oce-bind matches a building graph to a sequence Planned
M9 BACnet device image One no_std image that is a BACnet device: compiled sequence inside, boundary points as objects, MS/TP or B/IP outside, over rusty-bacnet Planned

M3's structural diff is in, all four parts: oce-diff (crates/leverage/oce-diff, README) compares two authoring models and returns what changed as sorted data (oce-diff/1), with authored block names as identity and a bounded rename pass for the blocks a revision renamed. Sequence parameters have a section of their own, so a site retune reads as "same structure, different tuning"; a Real is carried as its spelling and its bits; and two pure renderers write the text form's syntax and a Markdown table. It never validates or loads an engine, so a draft can be diffed against the reference it is repairing. The CXF adapter, diff_topology, gives the same data for two loaded CXF documents through the facade's Topology views, block names taken under the document's root and ports by index; equal content ids and equal sequence names never coexist with a graph or interface entry, and for documents emitted from two authoring models it agrees with the authoring diff of the models as loaded. The blob comparison, compare_blobs, says same or different for two compiled-schedule blobs read through oce_api::inspect_blob, by content id, class table and per-instance initial-state CRCs, and carries each side's verdict from this build, so "same" is never read as "runs here". The oce diff verb puts it at the shell: oce diff base.oce head.oce compares two authoring files (text or wire, never validated) or two CXF documents and prints the report with the diff, or its Markdown table with --format markdown, exiting 0 only when nothing differs, 1 for any difference and 2 when a side cannot be read, parsed or loaded (oce README).

The three one-page design passes M3 waits on are written: the historical replay API (built as crates/leverage/oce-replay), the commissioning verifier (it follows OBC §12, Verification; the standard's table of contents lists no verification clause) and oce-diff, beside the M2 authoring layer. M2's engine prerequisite is in: oce_api::class_ports names every port of a configured block, and oce_api::class_metadata gives each class a description and each parameter a settable flag (issue #440; port naming contract), and oce_api::enumerations lists every CDL and G36 enumeration and G36 Integer constant package with its members (issue #468; enumerations). Design notes for thinly specified work land in docs/design/ before code; the OCEB blob format is the first. Sequences, routines and their test vectors live in the separate open-control-library; this repository keeps only the minimal conformance corpus.


Before you drive equipment

The engine deliberately implements no fail-safe policy of its own, and that is a decision your host layer has to answer for:

  • Every boundary input is required exactly once. Missing values refuse before mutation; there is no sparse staging, implicit zero, or hold-last execution profile.
  • Typed values are not sensor-quality evidence. Frame preparation checks types and declared domains, not host freshness, plausibility or permission to command. Stored samples are not consulted.

Staleness limits, fault reactions, and safe-state fallback belong in the host above the engine. Host responsibilities is the checklist; read it before wiring anything to a physical output.


Architecture

OBC §7.17 (clause 5.13 in the table of contents of ANSI/ASHRAE Standard 231-2026) says of CDL's metadata that none of it affects the computation of a control signal. The engine applies that rule to point lists, trends, display units, tags, and Brick / Haystack / ASHRAE 223P semantics. That one rule is the seam the whole system is built around: an execution core that sees only blocks, typed connections, and values, and a storage port for everything else, which the host reaches and the engine never does.

The execution core sees only blocks, connections, and values and has no database; everything non-computational sits behind the oce-store port, which only the host reaches

Full layer-by-layer detail, the crate map, and the platform and MSRV policy are in Architecture.


How it is verified

Six evidence layers in this repository are called "tests", and they prove different things. One of them proves nothing about correctness at all — the 46 fixture goldens are engine self-output, a determinism snapshot that catches drift, not wrongness.

Correctness is bounded separately by 422 provenance records generated by a tool held off the workspace and forbidden from depending on the block library, with CI enforcing that code-dependency firewall. Of the 420 signal goldens, 398 check CDL / Buildings source semantics and 22 check the HostTick v1 profile instead: 20 G36 signals across three Pre-dependent fixtures and the two standalone CDL.Logical.Pre goldens. 399 retain their existing exact comparisons, including all 135 G36 sequence goldens. The other 21 transcendental, psychrometric, and solar Real goldens compare exactly on qualified Linux x86_64/aarch64 debug/release and retain the unchanged 1e-12 aligned band on unqualified targets. That Linux result is re-established per-PR: the scoped strict-bit subset and its four suite binaries run in four native Linux cells (x86_64 and aarch64, debug and release) with repeat captures and a cross-cell comparison, and no source file is bound to a stored receipt any more (strict-bit evidence). It bounds the claim to the pinned corpus, rustc and libm; it is not mathematical correctness or arbitrary-input proof. The state-determinism subset runs per-PR on both architectures in debug and release codegen, with the debug-against-release comparison (CI and the gate). The blob round trip in oce-conformance also runs per-PR, from one recorded x86_64 artifact replayed natively on arm64 and under wasmtime on wasm32-wasip1 (blob round trip). The remainder of oce-conformance still needs the release/full gate.

Two global report tiers are not wired, and no complete G36 sequence here has been executed against an external Modelica / Buildings toolchain. The separate OpenModelica evidence covers exhaustive Boolean Nand, one stateful Boolean Toggle schedule, one finite exact-bit Line matrix, and one seven-state exact-bit case for a composed G36 Reliefs leaf.

Verification and evidence sets out what each layer proves, what it cannot, and which checks are not running.


Documentation

The docs/ pages below are also published as a site: jscott3201.github.io/open-control-engine. TESTING.md and SECURITY.md are not on it; they are repository-only. The site is built from main, so it trails development by a release — where the two differ, the Markdown in this repository is the newer copy.

Page For
Architecture Layers, the metadata seam (OBC §7.17; ANSI/ASHRAE 231-2026 §5.13), the crate map, platform and MSRV
Execution profile HostTick semantics and the CDL.Logical.Pre conformance boundary
Verification and evidence What has been proven, and what has not
CDL coverage Which classes and sequences run, and what "supported" means
CXF round trip Export guarantees, and where it silently drops things
CXF composite subset Normative contract for external CXF emitters
Host responsibilities What you must implement before driving equipment
Product contract The versioned executable-CXF / HostTick boundary and its evidence map
State compatibility Snapshot and checkpoint bytes: what is portable, what is target-bound
Strict-bit evidence What the per-PR native matrix proves about exact Real results
Compiled-schedule blob What travels in an OCEB blob, what does not, versioning and the trust model
Design notes One-page decisions written before thinly specified work; currently the OCEB blob format
CI and the gate What runs when, and what a green check proves
Benchmarks Measured tick throughput, per run
Testing standard The bar every change is held to
Security Reporting, threat model, and known limits

Contributing

Changes land via pull requests into development. Install the shared git hooks once after cloning with bash scripts/install-hooks.sh, and run the bash .agents/gate.sh mode that matches your change before opening a PR (CONTRIBUTING.md has the table) — that script is the single source of truth for what CI runs.

Read CONTRIBUTING.md first, and TESTING.md before writing a test. Notable changes are in CHANGELOG.md. Coding agents start from AGENTS.md, the issue-driven milestone workflow this repository runs on.

One thing worth knowing up front: the per-PR gate runs the oce-api, oce-blocks, and oce-expr state-determinism subset plus the scoped oce-conformance strict-bit subset. Changes outside those and the named input-hygiene audits can show every check green without running their own tests. The gate also has three lanes under the one CI OK: a documentation-only change compiles nothing, a change to this README.md runs the checks that read it (a test byte-pins the Quickstart above to the example that compiles, and the gate executes that example), a change under crates/leverage/ runs the lighter leverage lane, and anything else runs the full determinism lane. CI and the gate explains the split.


License

Dual-licensed under either of:

  • Apache License, Version 2.0 (LICENSE-APACHE)
  • MIT license (LICENSE-MIT)

at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual-licensed as above, without any additional terms or conditions.

third_party/ vendors upstream Modelica Buildings CDL sources, modelica-json CXF translations and its CXF-Core document verbatim, under their own license — see third_party/modelica-buildings-cdl/README.md. That tree sits outside every crate root, so cargo package never ships it.

crates/leverage/oce-verify/src/funnel/ is a Rust port of LBNL funnel's C sources (commit a12fa96), a derived work under funnel's own licence: a 3-clause BSD licence with one added clause on enhancements, Copyright (c) 2020 The Regents of the University of California through Lawrence Berkeley National Laboratory. Its licence and copyright notice are reproduced verbatim in LICENSE-funnel at that crate's root, so the notice ships with the port wherever the crate does. oce-verify's license field says so, (MIT OR Apache-2.0) AND BSD-3-Clause-LBNL: it is the one crate here that is not under the dual licence alone, and deny.toml allows that identifier for it and for no other crate. funnel's own test inputs, vendored as test data under crates/leverage/oce-verify/tests/fixtures/funnel/upstream/, carry the same two files beside them.

crates/oce-cxf/tests/fixtures/unicode/ holds a verbatim excerpt of the Unicode Character Database (DerivedGeneralCategory.txt 17.0.0), test data read by one oce-cxf unit test, under the Unicode License v3. Its full text is the LICENSE beside it, so the notice ships with the excerpt wherever the crate does.

About

Embeddable, deterministic Rust control engine that natively executes OBC/LBL CDL for smart-building control sequences.

Topics

ashraebuilding-automationcdlcontrol-enginecontrol-systemsembeddablehvacmodelicarustsmart-buildings

Resources

Readme

Contributing

Contributing

Security policy

Security policy
Activity

Stars

8 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.