feat: configurable arbitrary precision#433
Merged
stefan-gorules merged 10 commits intomasterfrom Mar 3, 2026
Merged
Conversation
ivanmiletic
approved these changes
Feb 19, 2026
…gs for compilation when arbitrary precision not enabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
arbitrary_precisionan optional feature flagThis PR refactors
serde_json'sarbitrary_precisionfrom being always-on to an opt-in Cargo feature flag across the core crates (zen-types,zen-expression,zen-engine). All bindings (Node.js, Python, C, UniFFI) explicitly enable the flag, preserving current behavior.What changed:
The
arbitrary_precisionfeature onserde_jsonwas previously hardcoded inzen-types,zen-expression, andzen-engine. Now each crate declares its ownarbitrary_precisionfeature that propagates through the dependency chain (zen-engine→zen-expression→zen-types→serde_json). Core crates default toarbitrary_precisionoff, while all binding crates opt in explicitly.When the feature is enabled (current default for all bindings), number handling is unchanged — numbers round-trip through
serde_jsonas strings and are parsed viaDecimal::from_str_exact/from_scientific.When disabled, serialization and deserialization fall back to native
i64/u64/f64conversions, and theNUMBER_TOKEN-based struct hack used byarbitrary_precisionis compiled out via#[cfg]guards in theVariableandRcValueser/de impls.Additional changes:
addnab/docker-run-action@v3withstefan-gorules/docker-run-action@v1