an.engines.conformance#
Conformance of a TIME-driven engine against the timing kernel’s golden vectors.
A time-driven engine evaluates the compiled channels itself (core study §2.7):
runtime.js does, in a browser. Its pictures are only comparable with any
other engine’s if the STATE it evaluated at t is the kernel’s, so a
time-driven session exposes state(t) – the read-back – and this module
holds it to an/data/timing/timing_vectors.json, the contract an.timing
and previz both assert (ADR 0001 decision 10): numbers within the file’s
tolerance, everything else exact, every sample of every case of the session’s
property space.
The engine supplies how to load a vector’s document; the check is the core’s.
>>> cases = vector_cases(space="stage.node")
>>> len(cases) >= 10 and all(c["space"] == "stage.node" for c in cases)
True
>>> readback_mismatches(lambda t: {}, {"name": "n", "samples": [{"t": 0.0, "state": {}}]})
[]
Module Attributes
|
Functions
|
A state in the vectors' spelling: |
|
The case's document, carrying its property space the way a compiled document does (an#287): |
|
Every mismatch over |
|
|
|
The golden cases, optionally only those of one property space. |
- an.engines.conformance.VECTORS_RESOURCE: tuple[str, str] = ('an.data', 'timing/timing_vectors.json')#
(package, path inside it)forimportlib.resources.- Type:
Where the vectors ship
- an.engines.conformance.as_contract_state(state)[source]#
A state in the vectors’ spelling:
"target:property"keys.Accepts the kernel’s pose keys (
(target, property)tuples) and the runtime’s ("target::property").>>> as_contract_state({("a", "x"): 1.0, "b::y": 2}) {'a:x': 1.0, 'b:y': 2}
- an.engines.conformance.case_document(case)[source]#
The case’s document, carrying its property space the way a compiled document does (an#287):
meta.entity_spacesnames the space for every entity the case animates andmeta.spacesdefines it, so an engine that reads only the DOCUMENT (runtime.jshas no registry) evaluates the case in the case’s space. A case in the default space is returned as it is.>>> case = {"space": {"name": "inline", "fields": []}, "document": { ... "timeline": {"duration": 1.0, "tracks": []}, "animations": {"m": { ... "duration": 1.0, "channels": [{"target": "view/a", "property": "x", ... "keyframes": [{"time": 0.0, "value": 0}]}]}}}} >>> meta = case_document(case)["meta"] >>> meta["entity_spaces"], meta["spaces"]["inline"]["fields"] ({'view': 'inline'}, []) >>> "meta" in case_document({"space": "stage.node", "document": case["document"]}) False
- an.engines.conformance.conformance_report(open_case, cases)[source]#
Every mismatch over
cases;open_case(case)is a context manager yielding a session loaded with the case’s document.
- an.engines.conformance.readback_mismatches(state_at, case)[source]#
(case, t, expected, got)for every sample whose read-back differs.state_atis a loaded session’sstate(or anything with its shape). Compared with the contract’s own rule (an.timing.contract.values_close()).