mirror of
https://github.com/gorules/zen.git
synced 2026-11-28 16:06:26 +00:00
- zen_expression::clock: Clock is now plain per-evaluation state (now, timezone, seed, per-row and per-item random streams in a RefCell arena), and EvalContext pairs an Rc<Clock> with the row mapping of the current call (direct, one stream, picked rows, loop items). The thread-local current clock, Origin/Origins, set_row/at_row and the stream map lookups are gone. - the compiled engine builds the context once per evaluation (pinning::single / pinning::batch) and carries it in NodeHandlerExtensions; graph states, bounds, loops, sub-decisions, tables and policies derive row/item contexts with rows()/at()/items() and pass them down. - lane runs (LaneRunner, Session, kernels, cells), builtins (At), date helpers and typed programs take the context or its clock explicitly; rand draws from the stream of the lane's row. - function hosts install Date/Math.random once per runtime and point them at the call's context with a scoped JsClock slot (v1 scripts, v1 batch sessions, v2 handlers, rows and zen.evaluate). - Workspace gains evaluate_pinned / evaluate_batch_pinned / evaluate_columns_pinned that read now/timezone/seed from EvaluationOptions. - d(...) with a zone-dependent argument is no longer folded at compile time; typed lowering folds only zone-independent date texts and checks the rest at run time with the evaluation's zone. - the interpreted engine and the stack VM use the host clock and unseeded fastrand as on release/2.2; functions/internal.rs is back to release/2.2. - tests: interleaved evaluations on one thread and on two threads see only their own clock and stream.