v0.1.2 Conformance, sequence-scan fusion #4
vlad-public-code
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Conformance work, the sequence-scan fusion performance pass, and a docs
trim, brought together onto
main.Changelog
Performance
translator/scan_fusion.py, new): groups a block'soperations per bound sequence and emits one helper that reads each distinct
field once, feeding every accumulator from that read. On the analytical
benchmark: 551 field reads per evaluation down to 320, 1 955 function calls
down to 1 253, evaluation 1.33x faster. It plans rather than rewrites —
operations are collected only from unconditionally evaluated positions — and
falls back to the original helper for anything but a plain
int/floatfield.
$seq[field = <literal>]compiles to a monomorphizedfilter_field_eqcallinstead of a per-element callback (hoisted lambdas on the benchmark: 18 → 3).
object_of's per-key duplicate check.deliberate cost of the above; it repays after ~100 evaluations.
jsonatapy285 µs,jsonata-rs517 µs,
jsonata-python5 797 µs.Conformance
$fn()as a path step, and direct callswith fewer arguments than the signature, now route through a port of the
reference
parseSignature/validatelogic; the evaluation context issubstituted into focus (
-) parameters by argument type at runtime. Covers45+ previously diverging cases (
$power(3)crash,$uppercase()wrong errorcode, …).
direct_call_is_safe()exempts fully-determined fast paths from thevalidation cost.
runtime/tuples.py,translator/tuple_path_codegen.py,both new): tuple-stream path evaluation and its codegen.
("ab").foois a value navigation (undefined),not a field lookup.
evaluateWildcard/evaluateDescendants; leading-step outer-wrapper case separated from theper-element case via
wildcard_contextandat_input_root.PathExprcontaining a wildcard or descendant step into the outer path,preserving the re-split semantics of a nested
evaluatePath.$spread: singleton-collapses the single-object result and preserves thearray result, fixing the previous inversion.
number words, regex operations and string built-ins reworked against the
reference.
_leaks_evaluator_scopeuses a whole-token regex, socall_builtin_ctxinhoisted closure bodies no longer false-fires.
Tests
New suites for scan fusion, tuple-path bindings, signature validation, callback
hoisting, object construction, array-constructor path heads, constructor step
flattening and value wrappers, path-stage/null conformance, reference
conformance, cache bounds, memory (generated modules stay collectible) and
concurrency.
Docs
README.mdanddocs/index.mdcut by ~40% — everytable, figure and caveat kept; the per-session measurement diary that had
accumulated around them removed.
to the figure that project reports for itself (~53x-60x vs jsonata).
docs/llms.txtrefreshed.🤖 Generated with Claude Code
https://claude.ai/code/session_015XC8GqzZHFbZzTw8pEjwVs
This discussion was created from the release v0.1.2 Conformance, sequence-scan fusion.
All reactions