Repository navigation
v5.8.0
Added
Engine::operators()describes every built-in operator compiled
into the build: canonical name and aliases, family and gating feature,
the argument counts it reads (declared on every row whose body does not
take any count, so==reports 2 or more andmapexactly 2), whether
it reads the data context, its effect
(pure,clock,throws,catches), its cost class, and which
argument (if any) runs under a pushed frame (ScopedArg). It is read
from the same table that drives compilation and dispatch, so it cannot
drift from what the engine does. New public types:OperatorInfo,
ScopedArg(both#[non_exhaustive]).Logic::facts()reports what a compiled rule reads, which
operators it uses, and whether its result is a function of its data,
from one walk over the compiled tree.reads()lists the data paths
read from the root asDataPathsegment lists (sorted, with any path a
shorter one covers dropped); reads inside iterator bodies andtry
catch arms resolve against the element or the error and are left out,
while a level marker that climbs back to the root is kept.
has_computed_reads()flags a path only known at runtime, and
reads_complete()says whetherreads()is everything the rule can
read (no computed path, no custom operator).operators()lists
canonical built-in names, matchingEngine::operators();
custom_operators()the custom ones;is_deterministic()is false for
nowand any custom operator. The facts describe the rule after the
optimizer, so a folded branch is neither read nor listed. A generated
test checks every suite case: evaluating against data pruned to the
reported reads gives the same outcome. New public types:Facts,
DataPath.Rootsevaluates several values as the fields of one top-level
object without building it:Roots::from([("data", &payload), ("metadata", &metadata)])reads as{"data": .., "metadata": ..}.
Each root is borrowed and viewed in place like a single input of its
type (&serde_json::Value,&OwnedDataValue,&ParsedData,
&DataValue, mixed freely), so a host no longer copies its parts into
a combined value per evaluation. Accepted by every entry point that
takes input, by reference or by value. Against a per-evaluation
json!merge it measured 7 to 10 times faster for payloads of 4 to
1,024 fields. A generated test splits every suite case's data into
roots and checks the outcome is unchanged. New public types:Roots,
RootValue.Engine::truthy_ofapplies the engine's configured truthiness to
a value the host already holds:&serde_json::Value,
&OwnedDataValue,&ParsedDataor&DataValue(sealed
TruthyInput). Hand-written checks on an evaluated result tend to
differ from the engine: under the default rules an empty object is
falsy, like an empty array, and a configuredTruthyEvaluatorapplies.
Tested against the engine's own!!for every representation and
evaluator.Engine::checkreports every problem the engine can see in a rule
before it runs, in one pass, asDiagnostics (aDiagnosticCode, a
Severity, a message and an RFC 6901 JSON Pointer into the rule). Errors
are what will fail: an object with several keys outside templating
mode, an unknown operator (with a "did you mean" suggestion one edit
away),and/or/ifwithout an argument array, an argument count
the operator rejects (read from the operator table, or from a custom
operator's declaredCustomOperatorInfo), and a literal timezone that
does not exist. Warnings run but are probably mistakes: arguments an
operator never evaluates, and in a template an output key one edit away
from an operator name.CheckModechecks in the engine's mode, strictly
or as a template.Engine::compile_checkedcompiles only a rule with
no error diagnostic and otherwise returns aCompileErrorlisting them
all. A generated test checks thatcompilefails exactly whencheck
reports a compile-level problem. Run over the 525 rules stored in Orion
and dataflow-rs, it reports nothing in the mode they are compiled in. New
public types:CheckMode,Diagnostic,DiagnosticCode,Severity,
CompileError.EvaluationConfig::missing_varchooses what avar/valread that
finds nothing evaluates to:MissingVar::Null(the default, JSONLogic's
rule) orMissingVar::Error, which raisesVariableNotFoundnaming the
path, so a typo in a path fails instead of flowing on asnull. A
default ({"var": ["x", 0]}), a presentnull,missing,
missing_some,existsand iteration metadata are not misses, and
trycatches the error. The iterator fast paths that read fields
inline step aside in error mode so every read raises the same way. Also
settable from the bindings' JSON config as"missing_var": "error". New
public type:MissingVar.SharedSession, aSessionthat holds its engine byArc, so it
is'static + Send: it can be a struct field, move to another thread or
live across an.awaitwithout borrowing the engine
(SharedSession::new(Arc<Engine>)orFrom<Arc<Engine>>). It is
Session<'static, Arc<Engine>>:Sessiongained a defaulted type
parameter for how it holds the engine, soSession<'_>still names the
borrowed form and both have the same methods.Session::engine()returns
the engine either way. A host that kept a thread-local arena because a
session borrowed the engine can keep a session per worker instead.Error::code()returns anErrorCode, the error's kind without its
payload: one variant perErrorKindvariant,Copy,Eq,Hash,
present in every build.ErrorCode::as_str()is the nameError::tag()
has always returned (tag()is now defined through it), it parses back
withFromStr, andErrorCode::ALLlists every code, so a host can
switch on the kind instead of comparing tag strings.ErrorKind::code()
gives the same for a bare kind. New public types:ErrorCode,
UnknownErrorCode.EngineBuilder::try_add_operatorrefuses a name that a built-in
operator of the build answers to (aliases included), where the custom
operator would never run, with aConfigurationErrornaming the
built-in.add_operatoris unchanged.EngineBuilder::check_operator_name
gives the same refusal without consuming the builder, which the C ABI's
strict-names registration uses, so it follows the builder's families too.
EngineBuilder::try_buildchecks every nametry_add_operator
took against the builder's final families (Engine::to_builder()
carries them over), and refuses amax_recursion_depthof 0, as
EvaluationConfig::from_json_strdoes;build()is unchanged.Engine::compile_templateandEngine::compile_strictchoose
the templating mode for one compile instead of for the engine. The
engine's custom operators, template key escape and folding setting
still apply, so one engine can check a condition strictly and compile
an output template, where a host used to build an engine per mode and
keep their operator registrations in step. A generated test checks
every suite case: each mode gives the same compiled rule and outcome as
an engine built in that mode.CustomOperator::checklets a custom operator validate a call's
arguments as written, before anything runs.Engine::checkand
compile_checkedcall it for each call whose argument count fits the
operator's declaration;compiledoes not. It returns
Diagnostic::errororDiagnostic::warning, optionally narrowed with
at_argument(i), and the checker fills in the JSON Pointer and the
operator name, under the new codeDiagnosticCode::OperatorCheck. The
default accepts every call.Box<dyn CustomOperator>andArc<T>
forward it.- Operator families at runtime.
EngineBuilder::with_families(..)
keeps an engine to the JSONLogic core plus the families it names
(Family::ExtString,Family::DateTime, ...), whatever this build
compiled in; by default an engine has every compiled family, as before.
A family left out is not there for that engine: its names compile as
unknown operators (an error at evaluation, or fromcompile_checked
andcheck), as output fields in templating mode, or as a custom
operator registered under that name.Engine::operators(),
builtin_operator_names(),check's suggestions and
try_add_operatorfollow the engine's families. The set applies at
compile time: a rule compiled on another engine keeps its operators.
New public type:Family(#[non_exhaustive], every family named in
every build, withFamily::ALL,name()andis_compiled()). This is
the 5.x step towards turning theext-*features into runtime
families in 6.0. - Trace node pointers.
TracedSession::compile(rule)compiles a rule
the way the one-shot trace does (no folding) and records, for every node
id, the RFC 6901 JSON Pointer of the rule value that node was compiled
from.Logic::pointer(id)andLogic::pointers()read them back, so a
debugger places eachExpressionNodeandExecutionStepin the rule as
written ("/if/1","/!"for a lone argument, the key as written for an
alias such as?:) instead of re-deriving the compiler's canonical forms.
An ordinary compile records none. Logic::compiled_on(&engine)tells whether that engine instance
compiled the rule (not one built alike or rebuilt from it). Any engine
can still evaluate any rule; in 6.0 a rule evaluates only on its own
engine, so a host can use this to find the places that rely on the
name lookup now.Engine::to_builder()starts a builder from a running engine: the
same custom operators, config, templating mode, template key escape and
folding setting. Both engines share each operator instance, so a host
that rebuilds on every reload changes only what differs instead of
registering every operator again. The engine now stores its operators
asArc<dyn CustomOperator>.CustomOperator::infolets a custom operator declare what the
engine may assume about it, as aCustomOperatorInfo: whether it is
deterministic, whether it reads the data context, and how many arguments
it takes. The default method returnsCustomOperatorInfo::opaque()
(nondeterministic, may read the context, any count), so existing
operators are unchanged. A deterministic operator that does not read the
context, called with constant arguments, is evaluated once at compile
time and folded like a built-in.Logic::facts()trusts the declaration
(is_deterministic(),reads_complete()), and a declared argument count
is checked before any argument runs.Engine::custom_operator_info(name)
reads it back.Box<dyn CustomOperator>andArc<T>forward it.Arc<T>implementsCustomOperator(for any
T: CustomOperator + ?Sized,Arc<dyn CustomOperator>included), so
one operator instance and its state can be registered on several
engines, for example on every engine a host builds on hot reload,
without a wrapper type.all-operatorsfeature enables every operator family. The
bindings and the benchmark now depend on it instead of listing the
families one by one.docs/src/operators/operators.json, a machine-readable operator
catalogue rendered from the table and checked by a snapshot test. The
feature table in the operators overview is generated from the same
table, and the React editor's registry test checks its picker entries
and argument counts against the catalogue.
Added (bindings)
-
The 5.8 API in every binding. WASM, Node, Python, Go, JVM, .NET and
PHP gain the per-compile templating mode (compileTemplate/
compileStrict),compileChecked(failing with error type
CompileErrorand its diagnostics),checkwith a mode, the operator
catalogue (operators, the schema ofdocs/src/operators/operators.json),
rule facts (Rule.facts), the engine'struthy, and an option that
refuses a custom operator named like a built-in (strictOperatorNames
and its per-language spellings). Errors also carry their node-id
breadcrumb. Python gainstemplate_key_escape, which the other bindings
already had.truthyreads a string as JSON text in every binding
(truthy("[]")isfalse), and no binding reads a metered budget of
0as a budget nothing fits in: it is the engine's own budget across
the C ABI and refused where the budget can be left out (Python,
JavaScript). .NET takes an escape outside the BMP (Runeorstring). -
C ABI v2, minor 1. New entry points:
datalogic_engine_compile_mode,
datalogic_engine_compile_checked,datalogic_engine_check,
datalogic_engine_operators,datalogic_engine_truthy,
datalogic_rule_facts,datalogic_session_evaluate_metered,
datalogic_engine_builder_set_template_key_escape,
datalogic_engine_builder_set_strict_operator_names,
datalogic_error_diagnostics_json,datalogic_error_node_ids_json,
datalogic_traced_session_evaluate_modeanddatalogic_abi_minor(). Existing symbols are unchanged, so v2 wrappers
keep working; a wrapper that calls the new ones checks
datalogic_abi_minor() >= 1at load. The mode enum is exported as
datalogic_mode. -
evaluateInt/evaluateFloatin Node and WASM, the typed-result
names the other bindings use.evaluateNumberis deprecated. -
One JSON wire format per document. The bindings share
crates/datalogic-bind(not published), which defines the traced-run,
catalogue, facts and diagnostics JSON and the custom-operator bridge,
replacing four copies of the trace serialiser and the type-name helper. -
Operator families in every binding:
families(Node, WASM,
Python),Families(Go),withFamilies(JVM, PHP),WithFamilies
(.NET), over the new C entry point
datalogic_engine_builder_set_families(a JSON array of family names).
An unknown family name is aConfigurationError; five scenarios check
the option in all eight bindings. -
Traced runs carry
pointers. Every binding'sevaluateWithTrace
envelope (datalogic_bind::traced_json) addspointers, mapping each
node id to the JSON Pointer of the rule value it was compiled from; the
JVM, .NET and PHPTracedRunmodels expose it (pointers(),
Pointers,$pointers). It is absent when the rule does not compile.
schemas/trace.v1.jsonlists it, and two scenarios check it in all eight
bindings. Each binding's traced evaluation also takes a compile mode
("template"/"strict", or itsCompileMode), as
TracedSession::with_modedoes in Rust, so a rule compiled with
compileTemplatecan be traced; a scenario checks it in all eight. -
A scenario suite every binding runs (
bindings/scenarios/api.json),
and a test that keeps PHP's FFI header and the JVM and .NET native
declarations in step with the generateddatalogic.h. -
Versioned wire schemas (
schemas/*.v1.json, JSON Schema 2020-12)
for the traced-run envelope, serialised errors, the operator catalogue,
rule facts and check diagnostics.datalogic-bind's tests validate real
output against them and reject unlisted properties, so a format change
is a reviewed schema change.
Fixed (UI)
- The debugger places trace steps by the engine's pointers. It matched
each trace node to the rule by re-implementing the compiler's canonical
forms (alias folding,var/valnormalisation, single-argument
unwrapping) and fell back to loose and positional guesses, so a compiler
change could silently attach steps to the wrong node. It now resolves each
node's pointer against the rule it shows and pairs operands by identity;
child-matching.tsand its heuristics are gone, and a step no node
claims goes to the nearest placed node whose pointer strictly encloses it.
A trace without pointers, or converted without the rule as written, pairs
operands with children by their expression text, then by position. - Adding a case to a
switchin the editor works again. The editor
compared the operator's argument limit (3) against the node's cells (a
switchwith one case has four), so "add case" did nothing once the
catalogue gaveswitchits real limit, and the context menu and
properties panel hid it. Every add action now asks one check
(canAddArgument), which lets the case, else-if and path-segment editors
grow a node past the limit, since they grow one argument rather than
adding one. - The UI no longer carries a stale
@goplasmatic/datalogic-wasm5.4.0
devDependency; every build already resolved the package to the WASM built
from this tree. A build-time type check keeps the editor's hand-written
WASM interface in step with the generated typings. - The CommonJS build (
require) starts the WASM engine again; Jest,
CJS SSR and older-bundler consumers got an editor without evaluation.
The editor shows a banner when the engine fails to load. - Keyboard shortcuts apply only while focus is inside that editor,
instead of taking keys from the host page and driving every editor on
it. - The selection, open properties panel, pan and zoom survive the
onChangeround trip in a controlled editor; they reset ~300 ms after
each edit. Two editors on a page keep their properties-panel labels and
focus to themselves. - The bundled React Flow styles and the editor's handle and edge
overrides no longer restyle other React Flow canvases on the page, and
touch panning gets upstream'stouch-action: noneback. - Debugger stepping re-renders only the nodes that change, and long
traces no longer slow playback quadratically. Inlineconfig/
customOperatorsobjects no longer make the editor re-check its inputs
every render. uuid,lucide-reactand@dagrejs/dagreare no longer installed as
dependencies (they were always bundled), anddistno longer carries
danglingsourceMappingURLcomments.
Deprecated
- The WASM
CompiledRuleclass and the freeevaluate(logic, data, templating)andevaluateWithTrace(logic, data, templating)functions:
build anEngineand use itscompile,evalStrand
evaluateWithTrace.evaluateNumberin Node and WASM: use
evaluateFloat. All are removed in 6.0.
Changed
- A custom operator call no longer looks its operator up by name. The
compiler records the operator's slot on the engine that compiled the
rule, and dispatch indexes it directly; a rule evaluated on another
engine still finds that engine's operator by name, as before. A rule
calling eight custom operators measured 181 ns per evaluation before and
75 ns after. ErrorKind::BudgetExceededexists in every build. The variant
was compiled in only with thebudgetfeature, so code outside
datalogic had to match onError::tag() == "BudgetExceeded". It is now
always present (ErrorKindis#[non_exhaustive], so this is
additive); only thebudgetfeature raises it.- One declarative operator table. Every built-in operator is now one
row inoperators/table.rsplus one function. TheOpCodeenum, name
lookup, dispatch arms,builtin_operator_names(), and the constant
folding, CSE and scope classifications are generated from the row or
derived from the facts it declares, replacing six hand-maintained
classifier lists. Fixed-arity operators (the string, object, datetime,
math, tensor and flagdsem_verfamilies, plus!,!!,in,
substr,type,length) are plain typed functions whose argument counting, evaluation
and result conversion are generated. EveryInvalidArgumentsmessage
is unchanged, all suites pass on every compile path, and the canonical
benchmark is within noise. - Editor argument counts for
!=,!==,switchandmatch. The
React editor offered!=and!==as chainable, but the engine
compares only the first two operands and ignores the rest; they are now
two-operand nodes.switch/matchaccept at most a value, the case
list and a default, as the engine reads. Found by the registry test
against the catalogue's new argument counts. - Nested
!/!!always collapse to one operator. The optimizer
already rewrote!(!x)to!!xand!!(!!x)to!!x; it now also
rewrites!(!!x)and!!(!x)to!x, except under a custom truthy
evaluator (see Fixed). Results are unchanged; a rule with that shape
shows the shorter form inLogic::to_json()and in traces. - Tensor error precedence. When a tensor operator call has two
problems, a different one may now be reported: a missing argument is
reported before any argument is evaluated, and an error raised while
evaluating a later argument now wins over a coercion error on an
earlier one. Calls that succeed are unaffected. sortwith a literal key expression is no longer constant-folded.
Its key runs per element, like every other iterator body, and is now
classified that way. Results are unchanged; the rule is simply
evaluated at run time.
Fixed
- Constant folding no longer changes what a rule means. A few
operators read whether an argument is written as a literal: a single
literal array is an error for+,*,maxandminbut a computed
one is summed or scanned;sortrejects a literalnullsource but
returnsnullfor a computed one; a literalvar/valpath is split
differently from a computed one;switchreads only a literal case
table. Folding turned an expression with no data reads into a literal
first, so{"+": [{"if": [true, [1, 2], 0]}]}wasNaNon the default
engine and3with folding off or in a trace, and
{"var": {"cat": ["a", ".b"]}}readathenbinstead of the key
"a.b". Those positions are now declared in the operator table
(literal_args) and an expression there keeps its own node; everything
inside it still folds.Logic::facts()follows: a path computed from
literals is reported as computed. sortby a field reads a missing field asnull. With a plain
{"var": ..}key, an element without the field sorted before one whose
field isnull; with any other key expression they tied and kept their
input order. They now tie on both paths.- A fractional
slicebound is an error whether written or computed.
A literal1.5was silently ignored while a computed one raisedNaN;
both raiseNaNnow. Whole floats (2.0) are still indices. - A fractional
missing_someminimum rounds up.2.5means at least 3
present, as JSONLogic'spresent >= needreads it. A literal minimum was
truncated and a computed one fell back to 1.
These were found by a new reference interpreter in the test suite
(tests/oracle/), which evaluates rules without any optimization and is
compared with the engine on every suite case and on generated rules.
-
filterwith a strict comparison againstnullnow sees missing
fields.{"filter": [list, {"===": [{"var": "v"}, null]}]}dropped the
items that have novfield (and!==kept them), although a missing
field reads asnulleverywhere else. Onlyfilter's
field-against-literal fast path was affected;all/some/none
and traced evaluation were already right. -
maparithmetic stays exact next to an overflowing element. A
mapwhose body is+,-or*on a field and a literal, or on two
fields, computed the whole array inf64as soon as one element
overflowedi64, rounding exact neighbours past 2^53:
{"map": [list, {"+": [{"var": "x"}, {"var": "y"}]}]}turned
i64::MIN + 3intoi64::MIN, and{"-": [{"var": ""}, i64::MAX]}
returnedi64::MINfor every element. Each element is now computed
exactly as the arithmetic operators compute it. This also affected
reduceover such amapwhen the fold could not be fused (for
example with a non-number initial value). -
Partial constant folding of
+and*gives what evaluation gives.
The static arguments of a call with dynamic ones were regrouped and
folded together, but integer overflow intof64,f64rounding and
numeric-string coercion do not regroup:
{"*": [0.1, {"var": "x"}, 10]}was3folded and
3.0000000000000004with folding off. Only a leading run of integer
literals that folds exactly is folded now, and only while three or more
arguments remain, since the two-argument forms coerce differently. -
Iterator predicates compare as
==,===andindo. The
filter/all/some/nonefast paths compared integers exactly
under===(the operator compares numbers asf64) and compared two
strings byte for byte, without thedatetimefeature's check for two
spellings of one instant.{"filter": [xs, {"===": [{"var": "k"}, 9007199254740992]}]}overk = 9007199254740993returned[]though
the bare===is true, and"2024-01-01T00:00:00Z"did not match
"2024-01-01T00:00:00+00:00"inside an iterator. A comparison that
needs the datetime check now runs on the general path. -
Nested
!/!!keep their meaning under a custom truthy
evaluator. Folding collapsed{"!": [{"!": [x]}]}into{"!!": [x]}
(and, new in this release, the other nested forms), which assumes a
boolean's truthiness is itself; aTruthyEvaluator::Customneed not
agree. The collapse is skipped under a custom evaluator, as the CSE
pass already was. -
A computed timezone fails the same way folded or not. Folding
turned{"cat": ["Nowhere/", "Zone"]}informat_date/parse_date
into a literal, which the compile-time zone check rejected with a bare
InvalidArguments; unfolded it wasUnknown timezone: Nowhere/Zone.
The zone position is declaredliteral_args. -
Traced
sortby a field records each key. The keys were read on a
fast path, so the trace showed no step for them. -
Error-path pointers escape like trace pointers.
PathStep's
json_pointerdid not escape/and~in an operator name (/~1/0
under/), and for a rule compiled for tracing it is now that rule's
recorded pointer. -
A huge
missing_someminimum stays huge on 32-bit targets. On
wasm32 a minimum pastu32::MAXwrapped to a small one. -
Logic::to_json()reads back as the rule. A call with one argument
was written with the argument in place, so an argument that is an
array read back as the argument list ({"max": [[1, 2]]}became
{"max": [1, 2]}), andand/or/if, which take only an array,
read back as an error ({"or": [0]}became{"or": 0}). Both now keep
the array. Literal-shape arguments staying unfolded in this release made
the shapes reachable on the default engine. -
A
reducecan no longer build a value deep enough to abort the
process. A fold that wraps its accumulator each step
({"reduce": [xs, [{"var": "accumulator"}], null]}) nested one level per
item, and serialising, comparing or copying the result recursed once per
level: 100,000 items overflowed an 8 MiB stack and aborted with
fatal runtime error: stack overflow, which nocatch_unwindcan stop.
The accumulator may now nest at most 1,024 levels (four times what the
parser accepts as input), and passing that is anInvalidArguments
error. Accumulators are measured against the previous step's parts and,
for bodies of built-ins, only every few steps, so folds to numbers and
folds that rebuild flat lists cost what they did. -
format_datewith an unknown chrono specifier is an error, not a
panic. A raw specifier chrono does not know ("%Q") or a trailing%
panicked inside chrono's formatter. It is now
InvalidArguments("Invalid date format"). -
A rule compiled on one engine follows the evaluating engine's
settings. Constant folding evaluates under the compiling engine's
number coercion, NaN and division handling, loose equality and
truthiness, so{"/": [1.5, 0]}compiled on a default engine kept
1.797e308on an engine set to returnnullon division by zero, while
the same division computed at runtime returnednull; a deadifbranch
was dropped by the compiling engine's truthiness. A rule whose compile
folded something under those settings now keeps its source and is
compiled again on an engine whose settings differ (once per distinct
setting, cached on the rule). Rules evaluated on the engine that
compiled them, or on one with the same settings, are unchanged. -
A record with a
datetimeortimestampfield is ordinary data.
Any object carrying such a key was taken for the boundary form of a
datetime, so===and==judged two different records equal by that
field alone,inmatched them,distinctdropped all but one, and
typereported"datetime"or"duration". Only the single-key form
({"datetime": "..."},{"timestamp": "..."}) is a datetime now. -
Logic::to_jsonwrites valid JSON and keeps dottedvalkeys.
Paths,missing/existspaths, template keys, custom operator names
andthrowtypes holding quotes, backslashes or control characters
came out unescaped (so the trace tree'sexpressionstrings broke
too), and{"val": "a.b"}came back as{"var": "a.b"}, which reads
athenb. Such reads are now written in thevalform; other output
is unchanged. -
Error::resolve_pathnames avardefault and template fields
right on a rule not compiled for tracing:/var/1(was/var/0) and
/b(was/1), as a traced compile records them. -
Error::operatornames the innermost failing operator, custom
operators included, and plain and traced runs agree. It was the root
operator unless a deeper site set one, and the traced run always
reported the root. Behaviour change in that field and in the
serialized error's"operator". -
fractionalweights past 32 bits no longer overflow.[i64::MAX, 1]returned null and[2^40, 2^40]split differently from[1, 1]in
release builds (a debug build panicked). Weights clamp toi32::MAX, as
flagd's are 32-bit; weights within 32 bits pick exactly as before. -
Tensor constructors refuse more than 2^28 elements.
zeros,full,
scatter,rle_expand,one_hotandpadsized a buffer from the
rule's dimensions with only ausizeoverflow check, so
{"zeros": [[1000000, 1000000], "f64"]}asked for 8 TB and hung or
aborted the process. Past 2^28 elements (2 GiB off64) they are now
InvalidArguments. -
Metered counts no longer depend on data types, tracing or
MissingVar. Iterator fast paths now charge what the general path
charges for the same data, and the double charge when a fused
reduce(map(...))gave up is gone. Behaviour change: counts for
fast-path shapes rise to match the general path. -
The
reducefast path no longer treatsaccumulator.xas the whole
accumulator ({"+": [{"var": "current"}, {"var": "accumulator.x"}]}
summed the accumulator itself). -
Datetime arithmetic takes any number of operands, in either order:
{"+": [dt, "1d", "1d"]},{"+": ["1d", dt]}and{"-": [dt, "1d", "1d"]}raised NaN. -
Integers above 2^53 compare, divide and sort exactly in
==(with
integer strings),===,<and friends,/,%andsort, and
variadic+/*coerce numeric strings as the binary forms do.
Behaviour change: such values are no longer rounded or judged equal. -
NanHandling::CoerceToZerosubstitutes 0 as documented instead of
skipping the value:{"*": [2, "x", 3]}is0, not6. -
The strings
"NaN","inf","infinity"and overflowing literals no
longer coerce to non-finite numbers. Arithmetic applies NaN handling
to them (it producednull),==and<raise NaN, andabs,ceil
andfloorraiseInvalidArguments. -
ceil/floorkeep results outside thei64range as floats
instead of saturating toi64::MAX/i64::MIN. -
lower/upperapply context-sensitive Unicode case rules
("ΟΔΟΣ"→"οδος"). -
typeclassifies strings with the datetime and duration parsers:
"password1"is"string"(it was"duration"), and an offset or
naive ISO datetime is"datetime".
Fixed (bindings)
- Node:
@goplasmatic/datalogic-nodeships itsindex.jsloader and
index.d.tstypings again. 5.1.1 through 5.7.1 published the
package with onlypackage.json, the README and the LICENSE, so
require('@goplasmatic/datalogic-node')failed with
MODULE_NOT_FOUND(the per-platform packages were complete). The
release now hands the generated loader to the publish job, and refuses
to publish the package without it. - Node: a panic in the engine throws instead of aborting Node. No
export was guarded, so any panic killed the process (and a panic in
evaluateStrAsyncran unguarded on the libuv pool). Every export now
carries#[napi(catch_unwind)], and every call into the engine turns a
panic into a thrown error (or a rejected promise) with
name/errorType"InternalError". - Go: custom operators keep working after the Engine is closed or
collected.Engine.Close()(also its finalizer) deleted the callback
handles that Rules and Sessions from that engine still call, so a later
evaluation crashed the process withmisuse of an invalid Handle. The
handles now belong to a registry that the Engine, every Rule, Session
and TracedSession keep alive, and the callback state passes through C as
a C-allocated box rather than a Go pointer, as cgo's pointer rules
require. - .NET: custom operators keep working after the Engine is disposed or
finalized.Engine.Dispose()freed the delegates'GCHandles while
Rules and Sessions still called them, failing with
operator handle had wrong type. The handles now belong to an object
that the Engine, every Rule, Session and TracedSession hold. - C ABI: a custom-operator callback that re-enters the session running
it getsDATALOGIC_STATUS_INVALID_ARGinstead of undefined behaviour
(memory corruption in Go, JVM, .NET and PHP);reset/freeon that
session do nothing, andallocated_bytesreturns 0. - C ABI: builder setters called after
datalogic_engine_builder_build
fail withDATALOGIC_STATUS_INVALID_ARG(set_config_json,
set_families,set_template_key_escape,add_operator); they
returned OK and did nothing. - Traced evaluation keeps the result's object key order in every
binding; keys came back sorted. - Node:
allocatedBytesno longer wraps above 4 GiB. Python releases
the GIL while compiling and checking. A typed-result mismatch on a
datetime or duration reportsgot string, notgot object. - Go, .NET, PHP, JVM: an engine builder dropped before
Buildno longer
leaks its native builder, and Go, .NET and JVMClose/Dispose/
close()free a handle exactly once under concurrent calls. JVM handles
never closed are freed by a sharedCleaner. - PHP: Rules, Sessions and TracedSessions keep their Engine (and its
custom operators) alive, wrapping a native handle a second time throws
InvalidArgumentExceptioninstead of double-freeing it later
(behaviour change), and the native library is found on Windows (the
machine name was matched case-sensitively againstAMD64/ARM64). - Go, .NET (and JVM for non-string fields): a malformed batch item
decodes like the other hosts, as tag"InternalError"with the raw
JSON as the message. - JVM: the native library is extracted once to a per-user cache named by
its SHA-256 (~/.cache/datalogic/native/or the platform
equivalent, falling back to a temp directory) instead of a fresh temp
directory per start, which piled up on Windows. The jar declares
Automatic-Module-Name: com.goplasmatic.datalogic. - Go: the module tag's static libraries are about 6x smaller
(darwin/arm64 81.6 → 13.5 MB): a debuginfo-free, LTO'dgo-release
profile. .NET shipsnet8.0andnet10.0builds. - WASM: the npm package declares
engines.node >=18, matching the
Node package. Python wheels list Python 3.14.
Performance
- Evaluating against an owned, serde or
Rootsinput brings in only
what the rule reads. A compiled rule whose reads are all known
(Logic::facts(),reads_complete()) and that does not read the whole
input now views just those paths: on the way down each path only the
object keys it names, and the whole value at its end. Reading one field
of an 8 MB context throughEngine::evaluateor aSessiontakes 36 ns
owned and 41 ns serde, where viewing the whole input took 2.96 ms and
15.7 ms; a 1 KB context is 3 to 12 times faster.Rootskeeps only the
roots a rule reads. Results are unchanged: every suite case gives the
same outcome projected and whole, under default, unfolded and
MissingVar::Errorengines. A rule with a computed path, a custom
operator that reads the context, or a read of the whole input is viewed
whole as before, as is a rule evaluated on an engine other than the one
that compiled it, and traced runs. JSON text andParsedDatainputs
are unaffected.tools/benchmarkgains aprojectionbinary for these
numbers. filter,all,someandnoneover a comparison predicate are
faster and no longer layout-sensitive. The recognised predicate shape
is now dispatched once per call instead of once per item. Over 1,000
items:{">": [{"var": ""}, 500]}filters in 1.17 µs (was 3.2 µs, or
6.0 µs in some builds of the same code), fullall/somescans are
3.7 to 3.9 times faster, and comparisons on a field are 26 to 31% faster.mapandreducearithmetic fast paths fix their operation outside
the loop. Over 1,000 items:reducewith{"+": [{"var": "current.score"}, {"var": "accumulator"}]}is 21% faster, a fused
reduceovermap9 to 16%,mapwith two fields 13% and with a
fractional literal 38%; the remaining shapes are flat to 5% faster. The
timings are now the same across builds of the same code.- One-shot
Engine::eval*and the top-leveleval*functions project
owned,serde_jsonandRootsinput the same way. - The CSE compile pass is one post-order walk instead of re-walking
subtrees at every node; a projection binary-searches wide read sets;
template keys are borrowed instead of copied per evaluation; compiling
a borrowed&OwnedDataValueno longer deep-clones it;split, stepped
stringslice,format_date,parse_date,nowandmissingcopy
less. - The second round of fixes in this release, measured against the tree
before it, moves the canonical bench geomean +1.0% on the suites whose
cases did not change; macro suites stay within +3% (checkout-40
+1.4%).
Changed (tooling)
- The
Cargo.lockof every shipping workspace is committed and releases
build--lockedwith a pinned toolchain; CI gains cargo-semver-checks,
cargo-deny, a docs check, a WASM size gate, fuzzing and weekly macOS /
Windows runs, and the release runs all of CI on the tag before
publishing. Integration tests declare theirrequired-features. - Dependency updates. Every Rust lockfile refreshed (
napi3.14.2
in the Node binding). UI:@xyflow/react12.12.0 (its bundled base
CSS regenerated),vite8.3.3,vitest5.0.3,eslint10.12.0,
typescript-eslint8.71.1,lucide-react1.52.0 and smaller bumps;
source-map-js1.2.2 (#82, an event-loop DoS advisory). TypeScript stays on
6.x untiltypescript-eslintadmits 7. Node:@napi-rs/cli3.10.8.
JVM:maven-jar-plugin3.5.1. .NET, Python, PHP and Go were already
current. - The GitHub release attaches the
@goplasmatic/datalogic-uitarball
again; the asset step looked for the package one directory too deep.
Every binding passes the same conformance battery: 66 suites / 2,128 cases.
Try rules live in the playground.
Running datalogic-rs in production? Add your project.