Commit Graph
308 Commits
Author SHA1 Message Date
Stefan a137fbe6a7 docs: agent batch API; test variadic host functions feeding aggregates
Also ungates serde_json::json in compiled_policy tests, used outside the driver feature.
2026-10-20 22:40:54 +02:00
Stefan a7446057c9 feat: batch evaluation APIs for decisions and standalone expressions
DecisionEngine::evaluate_many wraps evaluate_batch (compiled columnar plan with row
fallback) and returns results only; evaluate_batch now resolves keys with or without
.json like evaluate. BatchExpression compiles one expression for the lane VM (stack VM
fallback when the lane refuses it) and evaluates rows or Columns. batch_rows example
benchmarks 100k rows.
2026-10-20 22:01:23 +02:00
Ivan Miletic 8eb9d0f971 feat(engine): columnar graphs and policies end to end: prepared inputs, reasons, fallbacks, impact diffs 2026-10-15 15:41:30 +02:00
Ivan Miletic fa520af6de feat(engine): prepare policy input as columns (dates, defaults, references) 2026-10-13 15:46:58 +02:00
Stefan Miljakovic 08bc977727 perf: wider typed lowering coverage with census tooling
Typed lowering now covers contains/some/all/none over literal lists,
ordering compares against an absent input (lenient tables fold the cell
to no-match and drop the rule; constant one-input tables stay native),
text tests on absent operands, list-valued table inputs, lists of
scalars from static list slots, input slots of unknown shape (resolved
per batch like Dyn) and literal tables with composite output cells.
A unit using new coverage is lowered as its own typed group. The typed
date-to-text and generic host paths reuse the result while consecutive
rows pass identical arguments. ZEN_CENSUS records why a unit stays on
the lane and times lane fallbacks (cold paths, off by default).
2026-10-12 18:02:58 +02:00
Stefan Miljakovic 8d41eab863 perf: learned row dedup for typed groups
Typed groups without list inputs (graph: 16+ local rows, not already on
the long-program dedup; policy: root groups) learn per group whether to
run the program on distinct input rows only: warm-up, a deferred probe
of the coded run, then a measured trial against the plain run, repeated
every 64 calls. Rows are keyed by exact value codes (table hints, Dict
keys, numbers by mantissa and scale, text through Coder::keys, cached
per call in the graph store). Graph outputs stay dict-coded (reps plus
ids through widen/expand); policy spreads rep outputs back to rows
(Outputs::spread) because its sinks take row-shaped outputs.
2026-10-12 16:07:51 +02:00
Stefan Miljakovic 5097194f94 perf: one QuickJS context per batch for V1 function nodes
Columnar batches of a V1 function node run in one prepared runtime and
context when the source is proven isolated (Purity::layout, the script
dialect of the shared allow-list analysis). Each row is evaluated on a
layout that keeps line/column positions, inputs go through JSON.parse
unless a literal is needed (__proto__ keys, deep nesting), the 500 ms
limit restarts per row, and any error or pending job drops the context.
Single-row evaluation is unchanged.
2026-10-12 15:23:39 +02:00
Stefan Miljakovic be644af5fb fix: allow-list isolation analysis for batched V2 function nodes
Isolation::shareable treated member writes rooted at a local as local,
so state shared through a call result, an object field or a function
parameter (e.g. const f = () => Math; f().seen = ...) leaked across the
rows of a columnar batch. Shared runtimes now need a closed-world proof
(Purity::module): globals, imports and top-level functions never appear
as values, only whitelisted calls/statics/methods; everything else runs
on a fresh runtime per row.
2026-10-12 14:02:55 +02:00
Stefan Miljakovic c634da7a74 perf: chunked column-wise shredding with in-place typed runs 2026-10-12 13:03:18 +02:00
Stefan Miljakovic 9996606021 perf: column-wise shredding of uniform object lists with inline string coding 2026-10-11 19:25:00 +02:00
Stefan Miljakovic 98de53454c refactor: one row-node dispatch in the old runner 2026-10-11 14:27:32 +02:00
Stefan Miljakovic c979f978e5 refactor: plan refusals fall back to the row runner 2026-10-11 13:51:02 +02:00
Stefan Miljakovic 3a86b14876 fix: absent vs null cells in generic table matching 2026-10-11 12:49:12 +02:00
Stefan Miljakovic a65ff37cf2 fix: path-independent policy columnar column order 2026-10-11 11:52:03 +02:00
Stefan Miljakovic a12ea151f9 refactor: revert policy entities on Records (placement regression on a graph fixture) 2026-10-11 10:09:00 +02:00
Stefan Miljakovic 0b7026795d refactor: drop the frozen static table slot cache 2026-10-11 10:03:28 +02:00
Stefan Miljakovic 81398d4538 refactor: measured typed/lane switch for policies 2026-10-11 08:13:47 +02:00
Stefan Miljakovic fe8ec914f0 refactor: policy entities on Records 2026-10-11 07:33:57 +02:00
Stefan Miljakovic 55c55bbaa9 refactor: policy tables on the shared Table 2026-10-11 06:12:20 +02:00
Stefan Miljakovic f76524646b refactor: core Specialized program cache for policy plans and graph bound lanes 2026-10-11 04:55:41 +02:00
Stefan Miljakovic 4eaae887a8 refactor: exact index Candidates narrowing shared by policy and graph row tables 2026-10-11 04:22:46 +02:00
Stefan Miljakovic e79f3fc484 refactor: core Fused lane programs and learned Runs out of policy fuse 2026-10-11 03:50:20 +02:00
Stefan Miljakovic c405249635 refactor: core Take fault set for graph merged reruns and policy faulted rows 2026-10-11 03:17:45 +02:00
Stefan Miljakovic ae09f2623f refactor: core Prefix lowering with shared Attempt for policy and graph typed groups 2026-10-11 02:44:52 +02:00
Stefan Miljakovic 2936a5fd53 refactor: core TypedCall, Select and Dedup for policy and graph typed program runs 2026-10-11 01:40:18 +02:00
Stefan Miljakovic 81054de087 refactor: core Frame and Kin for struct-list spans, parent mapping and list views 2026-10-11 01:07:52 +02:00
Stefan Miljakovic 457a1e958f refactor: core Children cache for graph schedule, policy schedule and segment plan switches 2026-10-11 00:35:40 +02:00
Stefan Miljakovic 7726a24b72 refactor: core Variants cache for policy typed groups and graph deferred pieces 2026-10-11 00:02:47 +02:00
Stefan Miljakovic 71eb05aa64 refactor: core switch with Cost, Path, Density and Switch shared by policy and graph typed groups 2026-10-10 23:21:04 +02:00
Stefan Miljakovic e74bdec75b fix: deterministic policy columnar output column order 2026-10-10 22:43:36 +02:00
Stefan Miljakovic 5eb27e8a2a refactor: allow clippy::arc_with_non_send_sync on sub_extensions 2026-10-10 22:05:16 +02:00
Stefan Miljakovic 62d4d531d8 refactor: Host parameter struct for clippy::too_many_arguments 2026-10-10 21:34:23 +02:00
Stefan Miljakovic 641755507f refactor: Option::map for clippy::manual_map 2026-10-10 21:02:36 +02:00
Stefan Miljakovic 571f7a216a refactor: iterate instead of indexing for clippy::needless_range_loop 2026-10-10 20:30:43 +02:00
Stefan Miljakovic 4551ba7b08 refactor: type aliases for clippy::type_complexity 2026-10-10 19:59:20 +02:00
Stefan Miljakovic adfa3e9107 refactor: move graph-only compiled modules under compiled/graph 2026-10-10 19:26:10 +02:00
Stefan Miljakovic daeb63035d refactor: move row-exact executors under compiled/exact 2026-10-10 18:52:23 +02:00
Stefan Miljakovic d2cc39e264 refactor: split compiled/mod.rs into step and state modules 2026-10-10 18:20:40 +02:00
Stefan Miljakovic 35015c1a79 refactor: split compiled/table.rs into compiled/table modules 2026-10-10 17:47:52 +02:00
Stefan Miljakovic eaa4f2eae2 refactor: split policy/columnar.rs into policy/columnar modules 2026-10-10 17:14:09 +02:00
Stefan Miljakovic e732aa3803 refactor: split plan/run.rs into plan/run modules 2026-10-10 16:40:46 +02:00
Stefan Miljakovic dfbdec031c refactor: split compiled/typed.rs into compiled/leaf modules 2026-10-10 16:07:04 +02:00
Stefan Miljakovic 2da0696345 test: consolidation_snapshot counters probe 2026-10-10 15:27:27 +02:00
Stefan Miljakovic 07e5b70586 perf: lane lowering of $ reads in closures, indexed reads and computed loop input fields in graph expression nodes, row-wise census 2026-10-10 12:37:29 +02:00
Stefan Miljakovic 41a8da721a perf: non-materializing object checks, lazy masked validity and typed text spread 2026-10-10 11:10:00 +02:00
Stefan Miljakovic e6e4544411 perf: allocation-light switch fan-out and pre-sized distinct ids 2026-10-10 10:33:32 +02:00
Stefan Miljakovic 7e875cae16 perf: batched sub-decision resolution and shared resolve faults, direct custom-node adapter calls 2026-10-10 09:38:36 +02:00
Stefan Miljakovic 1132829506 perf: let the measured typed/lane cost decide for failure-heavy typed groups 2026-10-10 08:56:12 +02:00
Stefan Miljakovic a577adbc2a perf: widened columnar schema verdicts and per-batch reuse of required-only validation errors 2026-10-10 08:08:05 +02:00
Stefan Miljakovic 40498c9c85 perf: struct-list collect tables, lazy templated outputs and columnar record consumers 2026-10-10 05:38:53 +02:00