@elaraai/east 1.0.79 → 1.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/builtins.d.ts +1 -1
- package/dist/src/builtins.d.ts.map +1 -1
- package/dist/src/builtins.js +19 -0
- package/dist/src/builtins.js.map +1 -1
- package/dist/src/codegen/spellings.d.ts.map +1 -1
- package/dist/src/codegen/spellings.js +3 -0
- package/dist/src/codegen/spellings.js.map +1 -1
- package/dist/src/comparison.d.ts +54 -0
- package/dist/src/comparison.d.ts.map +1 -1
- package/dist/src/comparison.equivalent.spec.d.ts +6 -0
- package/dist/src/comparison.equivalent.spec.d.ts.map +1 -0
- package/dist/src/comparison.equivalent.spec.js +130 -0
- package/dist/src/comparison.equivalent.spec.js.map +1 -0
- package/dist/src/comparison.js +97 -25
- package/dist/src/comparison.js.map +1 -1
- package/dist/src/compile/builtins/array.d.ts +60 -0
- package/dist/src/compile/builtins/array.d.ts.map +1 -0
- package/dist/src/compile/builtins/array.js +691 -0
- package/dist/src/compile/builtins/array.js.map +1 -0
- package/dist/src/compile/builtins/blob.d.ts +18 -0
- package/dist/src/compile/builtins/blob.d.ts.map +1 -0
- package/dist/src/compile/builtins/blob.js +150 -0
- package/dist/src/compile/builtins/blob.js.map +1 -0
- package/dist/src/compile/builtins/compare.d.ts +18 -0
- package/dist/src/compile/builtins/compare.d.ts.map +1 -0
- package/dist/src/compile/builtins/compare.js +52 -0
- package/dist/src/compile/builtins/compare.js.map +1 -0
- package/dist/src/compile/builtins/datetime.d.ts +21 -0
- package/dist/src/compile/builtins/datetime.d.ts.map +1 -0
- package/dist/src/compile/builtins/datetime.js +46 -0
- package/dist/src/compile/builtins/datetime.js.map +1 -0
- package/dist/src/compile/builtins/dict.d.ts +47 -0
- package/dist/src/compile/builtins/dict.d.ts.map +1 -0
- package/dist/src/compile/builtins/dict.js +576 -0
- package/dist/src/compile/builtins/dict.js.map +1 -0
- package/dist/src/compile/builtins/index.d.ts +9 -0
- package/dist/src/compile/builtins/index.d.ts.map +1 -0
- package/dist/src/compile/builtins/index.js +28 -0
- package/dist/src/compile/builtins/index.js.map +1 -0
- package/dist/src/compile/builtins/matrix.d.ts +31 -0
- package/dist/src/compile/builtins/matrix.d.ts.map +1 -0
- package/dist/src/compile/builtins/matrix.js +310 -0
- package/dist/src/compile/builtins/matrix.js.map +1 -0
- package/dist/src/compile/builtins/primitives.d.ts +36 -0
- package/dist/src/compile/builtins/primitives.d.ts.map +1 -0
- package/dist/src/compile/builtins/primitives.js +67 -0
- package/dist/src/compile/builtins/primitives.js.map +1 -0
- package/dist/src/compile/builtins/ref.d.ts +11 -0
- package/dist/src/compile/builtins/ref.d.ts.map +1 -0
- package/dist/src/compile/builtins/ref.js +30 -0
- package/dist/src/compile/builtins/ref.js.map +1 -0
- package/dist/src/compile/builtins/set.d.ts +42 -0
- package/dist/src/compile/builtins/set.d.ts.map +1 -0
- package/dist/src/compile/builtins/set.js +410 -0
- package/dist/src/compile/builtins/set.js.map +1 -0
- package/dist/src/compile/builtins/sparse.d.ts +19 -0
- package/dist/src/compile/builtins/sparse.d.ts.map +1 -0
- package/dist/src/compile/builtins/sparse.js +143 -0
- package/dist/src/compile/builtins/sparse.js.map +1 -0
- package/dist/src/compile/builtins/string.d.ts +34 -0
- package/dist/src/compile/builtins/string.d.ts.map +1 -0
- package/dist/src/compile/builtins/string.js +238 -0
- package/dist/src/compile/builtins/string.js.map +1 -0
- package/dist/src/compile/builtins/tree.d.ts +32 -0
- package/dist/src/compile/builtins/tree.d.ts.map +1 -0
- package/dist/src/compile/builtins/tree.js +108 -0
- package/dist/src/compile/builtins/tree.js.map +1 -0
- package/dist/src/compile/builtins/vector.d.ts +44 -0
- package/dist/src/compile/builtins/vector.d.ts.map +1 -0
- package/dist/src/compile/builtins/vector.js +463 -0
- package/dist/src/compile/builtins/vector.js.map +1 -0
- package/dist/src/compile/constructors.d.ts +13 -0
- package/dist/src/compile/constructors.d.ts.map +1 -0
- package/dist/src/compile/constructors.js +179 -0
- package/dist/src/compile/constructors.js.map +1 -0
- package/dist/src/compile/control.d.ts +13 -0
- package/dist/src/compile/control.d.ts.map +1 -0
- package/dist/src/compile/control.js +513 -0
- package/dist/src/compile/control.js.map +1 -0
- package/dist/src/compile/functions.d.ts +13 -0
- package/dist/src/compile/functions.d.ts.map +1 -0
- package/dist/src/compile/functions.js +492 -0
- package/dist/src/compile/functions.js.map +1 -0
- package/dist/src/compile/ir.d.ts +19 -0
- package/dist/src/compile/ir.d.ts.map +1 -0
- package/dist/src/compile/ir.js +193 -0
- package/dist/src/compile/ir.js.map +1 -0
- package/dist/src/compile/runtime.d.ts +75 -0
- package/dist/src/compile/runtime.d.ts.map +1 -0
- package/dist/src/compile/runtime.js +114 -0
- package/dist/src/compile/runtime.js.map +1 -0
- package/dist/src/compile/type_parameters.d.ts +4 -0
- package/dist/src/compile/type_parameters.d.ts.map +1 -0
- package/dist/src/compile/type_parameters.js +55 -0
- package/dist/src/compile/type_parameters.js.map +1 -0
- package/dist/src/compile/typed_arrays.d.ts +28 -0
- package/dist/src/compile/typed_arrays.d.ts.map +1 -0
- package/dist/src/compile/typed_arrays.js +77 -0
- package/dist/src/compile/typed_arrays.js.map +1 -0
- package/dist/src/compile.d.ts +6 -41
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +8 -4415
- package/dist/src/compile.js.map +1 -1
- package/dist/src/compile.open_beast.spec.js +5 -4
- package/dist/src/compile.open_beast.spec.js.map +1 -1
- package/dist/src/compile.signature.spec.d.ts +6 -0
- package/dist/src/compile.signature.spec.d.ts.map +1 -0
- package/dist/src/compile.signature.spec.js +53 -0
- package/dist/src/compile.signature.spec.js.map +1 -0
- package/dist/src/containers/sortedmap.d.ts +2 -1
- package/dist/src/containers/sortedmap.d.ts.map +1 -1
- package/dist/src/containers/sortedmap.js +4 -2
- package/dist/src/containers/sortedmap.js.map +1 -1
- package/dist/src/containers/sortedset.d.ts +2 -1
- package/dist/src/containers/sortedset.d.ts.map +1 -1
- package/dist/src/containers/sortedset.js +4 -2
- package/dist/src/containers/sortedset.js.map +1 -1
- package/dist/src/error.d.ts +15 -0
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +16 -0
- package/dist/src/error.js.map +1 -1
- package/dist/src/expr/array.d.ts +158 -81
- package/dist/src/expr/array.d.ts.map +1 -1
- package/dist/src/expr/array.js +68 -51
- package/dist/src/expr/array.js.map +1 -1
- package/dist/src/expr/ast.d.ts.map +1 -1
- package/dist/src/expr/ast.js +13 -0
- package/dist/src/expr/ast.js.map +1 -1
- package/dist/src/expr/blob.d.ts +8 -8
- package/dist/src/expr/blob.js +8 -8
- package/dist/src/expr/block.d.ts +18 -5
- package/dist/src/expr/block.d.ts.map +1 -1
- package/dist/src/expr/block.js +19 -0
- package/dist/src/expr/block.js.map +1 -1
- package/dist/src/expr/boolean.d.ts +10 -10
- package/dist/src/expr/boolean.js +10 -10
- package/dist/src/expr/datetime.d.ts +28 -28
- package/dist/src/expr/datetime.js +28 -28
- package/dist/src/expr/dict.d.ts +101 -51
- package/dist/src/expr/dict.d.ts.map +1 -1
- package/dist/src/expr/dict.js +97 -36
- package/dist/src/expr/dict.js.map +1 -1
- package/dist/src/expr/float.d.ts +23 -23
- package/dist/src/expr/float.js +23 -23
- package/dist/src/expr/integer.d.ts +17 -17
- package/dist/src/expr/integer.js +11 -11
- package/dist/src/expr/libs/array.d.ts +6 -6
- package/dist/src/expr/libs/array.js +6 -6
- package/dist/src/expr/libs/blob.d.ts +2 -2
- package/dist/src/expr/libs/blob.js +2 -2
- package/dist/src/expr/libs/datetime.d.ts +25 -25
- package/dist/src/expr/libs/datetime.js +25 -25
- package/dist/src/expr/libs/dict.d.ts +2 -2
- package/dist/src/expr/libs/dict.js +2 -2
- package/dist/src/expr/libs/float.d.ts +15 -15
- package/dist/src/expr/libs/float.js +15 -15
- package/dist/src/expr/libs/integer.d.ts +12 -12
- package/dist/src/expr/libs/integer.js +12 -12
- package/dist/src/expr/libs/set.d.ts +2 -2
- package/dist/src/expr/libs/set.js +2 -2
- package/dist/src/expr/libs/string.d.ts +4 -4
- package/dist/src/expr/libs/string.js +4 -4
- package/dist/src/expr/recursive.d.ts +22 -5
- package/dist/src/expr/recursive.d.ts.map +1 -1
- package/dist/src/expr/recursive.js +22 -5
- package/dist/src/expr/recursive.js.map +1 -1
- package/dist/src/expr/ref.d.ts +5 -5
- package/dist/src/expr/ref.js +5 -5
- package/dist/src/expr/set.d.ts +96 -51
- package/dist/src/expr/set.d.ts.map +1 -1
- package/dist/src/expr/set.js +85 -29
- package/dist/src/expr/set.js.map +1 -1
- package/dist/src/expr/string.d.ts +28 -28
- package/dist/src/expr/string.js +28 -28
- package/dist/src/expr/struct.d.ts.map +1 -1
- package/dist/src/expr/struct.js +2 -2
- package/dist/src/expr/variant.d.ts +12 -12
- package/dist/src/expr/variant.js +7 -7
- package/dist/src/function_symbols.d.ts +28 -0
- package/dist/src/function_symbols.d.ts.map +1 -0
- package/dist/src/function_symbols.js +28 -0
- package/dist/src/function_symbols.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/location.d.ts +32 -0
- package/dist/src/location.d.ts.map +1 -1
- package/dist/src/location.js +38 -0
- package/dist/src/location.js.map +1 -1
- package/dist/src/location.spec.js +89 -1
- package/dist/src/location.spec.js.map +1 -1
- package/dist/src/patch/index.d.ts +1 -1
- package/dist/src/patch/index.d.ts.map +1 -1
- package/dist/src/patch/index.js +1 -1
- package/dist/src/patch/index.js.map +1 -1
- package/dist/src/patch/type_of_patch.d.ts +25 -1
- package/dist/src/patch/type_of_patch.d.ts.map +1 -1
- package/dist/src/patch/type_of_patch.js +33 -10
- package/dist/src/patch/type_of_patch.js.map +1 -1
- package/dist/src/platform.spec.js +19 -1
- package/dist/src/platform.spec.js.map +1 -1
- package/dist/src/runner_protocol.d.ts +357 -0
- package/dist/src/runner_protocol.d.ts.map +1 -0
- package/dist/src/runner_protocol.js +154 -0
- package/dist/src/runner_protocol.js.map +1 -0
- package/dist/src/serialization/beast2/index.d.ts +22 -5
- package/dist/src/serialization/beast2/index.d.ts.map +1 -1
- package/dist/src/serialization/beast2/index.js +13 -2
- package/dist/src/serialization/beast2/index.js.map +1 -1
- package/dist/src/serialization/beast2/index.spec.js +84 -3
- package/dist/src/serialization/beast2/index.spec.js.map +1 -1
- package/dist/src/serialization/beast2/shared.d.ts +32 -3
- package/dist/src/serialization/beast2/shared.d.ts.map +1 -1
- package/dist/src/serialization/beast2/shared.js +135 -10
- package/dist/src/serialization/beast2/shared.js.map +1 -1
- package/dist/src/serialization/beast2/v4/container.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v4/container.js +5 -3
- package/dist/src/serialization/beast2/v4/container.js.map +1 -1
- package/dist/src/serialization/beast2/v5/aliasing.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/aliasing.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/aliasing.spec.js +75 -0
- package/dist/src/serialization/beast2/v5/aliasing.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/boundary.d.ts +176 -0
- package/dist/src/serialization/beast2/v5/boundary.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/boundary.js +297 -0
- package/dist/src/serialization/beast2/v5/boundary.js.map +1 -0
- package/dist/src/serialization/beast2/v5/boundary.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/boundary.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/boundary.spec.js +479 -0
- package/dist/src/serialization/beast2/v5/boundary.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/canonical.d.ts +101 -0
- package/dist/src/serialization/beast2/v5/canonical.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/canonical.js +436 -0
- package/dist/src/serialization/beast2/v5/canonical.js.map +1 -0
- package/dist/src/serialization/beast2/v5/canonical.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/canonical.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/canonical.spec.js +124 -0
- package/dist/src/serialization/beast2/v5/canonical.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/codec.d.ts +6 -5
- package/dist/src/serialization/beast2/v5/codec.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v5/codec.js +18 -3
- package/dist/src/serialization/beast2/v5/codec.js.map +1 -1
- package/dist/src/serialization/beast2/v5/deflate.d.ts +24 -2
- package/dist/src/serialization/beast2/v5/deflate.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v5/deflate.js +47 -12
- package/dist/src/serialization/beast2/v5/deflate.js.map +1 -1
- package/dist/src/serialization/beast2/v5/deflate.spec.js +15 -1
- package/dist/src/serialization/beast2/v5/deflate.spec.js.map +1 -1
- package/dist/src/serialization/beast2/v5/elements.d.ts +66 -0
- package/dist/src/serialization/beast2/v5/elements.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/elements.js +325 -0
- package/dist/src/serialization/beast2/v5/elements.js.map +1 -0
- package/dist/src/serialization/beast2/v5/elements.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/elements.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/elements.spec.js +161 -0
- package/dist/src/serialization/beast2/v5/elements.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/frame-pool.d.ts +62 -21
- package/dist/src/serialization/beast2/v5/frame-pool.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v5/frame-pool.js +138 -27
- package/dist/src/serialization/beast2/v5/frame-pool.js.map +1 -1
- package/dist/src/serialization/beast2/v5/frame-pool.spec.js +198 -71
- package/dist/src/serialization/beast2/v5/frame-pool.spec.js.map +1 -1
- package/dist/src/serialization/beast2/v5/frame-worker.js +25 -15
- package/dist/src/serialization/beast2/v5/frame-worker.js.map +1 -1
- package/dist/src/serialization/beast2/v5/frames.d.ts +22 -12
- package/dist/src/serialization/beast2/v5/frames.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v5/frames.js +52 -27
- package/dist/src/serialization/beast2/v5/frames.js.map +1 -1
- package/dist/src/serialization/beast2/v5/geometry.d.ts +38 -1
- package/dist/src/serialization/beast2/v5/geometry.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v5/geometry.js +73 -1
- package/dist/src/serialization/beast2/v5/geometry.js.map +1 -1
- package/dist/src/serialization/beast2/v5/geometry.spec.js +34 -23
- package/dist/src/serialization/beast2/v5/geometry.spec.js.map +1 -1
- package/dist/src/serialization/beast2/v5/index.spec.js +32 -28
- package/dist/src/serialization/beast2/v5/index.spec.js.map +1 -1
- package/dist/src/serialization/beast2/v5/intake.d.ts +98 -0
- package/dist/src/serialization/beast2/v5/intake.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/intake.js +462 -0
- package/dist/src/serialization/beast2/v5/intake.js.map +1 -0
- package/dist/src/serialization/beast2/v5/intake.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/intake.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/intake.spec.js +202 -0
- package/dist/src/serialization/beast2/v5/intake.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/lazy.d.ts +42 -1
- package/dist/src/serialization/beast2/v5/lazy.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v5/lazy.js +143 -28
- package/dist/src/serialization/beast2/v5/lazy.js.map +1 -1
- package/dist/src/serialization/beast2/v5/lazy.spec.js +102 -24
- package/dist/src/serialization/beast2/v5/lazy.spec.js.map +1 -1
- package/dist/src/serialization/beast2/v5/manifest-writer.d.ts +110 -0
- package/dist/src/serialization/beast2/v5/manifest-writer.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/manifest-writer.js +118 -0
- package/dist/src/serialization/beast2/v5/manifest-writer.js.map +1 -0
- package/dist/src/serialization/beast2/v5/manifest-writer.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/manifest-writer.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/manifest-writer.spec.js +207 -0
- package/dist/src/serialization/beast2/v5/manifest-writer.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/manifest.d.ts +241 -0
- package/dist/src/serialization/beast2/v5/manifest.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/manifest.js +233 -0
- package/dist/src/serialization/beast2/v5/manifest.js.map +1 -0
- package/dist/src/serialization/beast2/v5/merge.d.ts +93 -0
- package/dist/src/serialization/beast2/v5/merge.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/merge.js +202 -0
- package/dist/src/serialization/beast2/v5/merge.js.map +1 -0
- package/dist/src/serialization/beast2/v5/merge.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/merge.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/merge.spec.js +118 -0
- package/dist/src/serialization/beast2/v5/merge.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/recut.d.ts +143 -0
- package/dist/src/serialization/beast2/v5/recut.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/recut.js +365 -0
- package/dist/src/serialization/beast2/v5/recut.js.map +1 -0
- package/dist/src/serialization/beast2/v5/recut.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/recut.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/recut.spec.js +215 -0
- package/dist/src/serialization/beast2/v5/recut.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/runs.d.ts +148 -0
- package/dist/src/serialization/beast2/v5/runs.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/runs.js +260 -0
- package/dist/src/serialization/beast2/v5/runs.js.map +1 -0
- package/dist/src/serialization/beast2/v5/runs.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/runs.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/runs.spec.js +182 -0
- package/dist/src/serialization/beast2/v5/runs.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/sha256.d.ts +19 -0
- package/dist/src/serialization/beast2/v5/sha256.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/sha256.js +103 -0
- package/dist/src/serialization/beast2/v5/sha256.js.map +1 -0
- package/dist/src/serialization/beast2/v5/sha256.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/v5/sha256.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/v5/sha256.spec.js +42 -0
- package/dist/src/serialization/beast2/v5/sha256.spec.js.map +1 -0
- package/dist/src/serialization/beast2/v5/stream.d.ts +273 -86
- package/dist/src/serialization/beast2/v5/stream.d.ts.map +1 -1
- package/dist/src/serialization/beast2/v5/stream.js +576 -244
- package/dist/src/serialization/beast2/v5/stream.js.map +1 -1
- package/dist/src/serialization/beast2/v5/sync-reader.spec.js +24 -10
- package/dist/src/serialization/beast2/v5/sync-reader.spec.js.map +1 -1
- package/dist/src/serialization/index.d.ts +1 -1
- package/dist/src/serialization/index.d.ts.map +1 -1
- package/dist/src/serialization/index.js +1 -1
- package/dist/src/serialization/index.js.map +1 -1
- package/dist/src/serialization/json.d.ts +28 -0
- package/dist/src/serialization/json.d.ts.map +1 -1
- package/dist/src/serialization/json.js +141 -30
- package/dist/src/serialization/json.js.map +1 -1
- package/dist/src/serialization/json.spec.js +47 -2
- package/dist/src/serialization/json.spec.js.map +1 -1
- package/dist/src/serialization/json_schema.d.ts +15 -11
- package/dist/src/serialization/json_schema.d.ts.map +1 -1
- package/dist/src/serialization/json_schema.js +21 -36
- package/dist/src/serialization/json_schema.js.map +1 -1
- package/dist/src/serialization/json_schema.spec.js +26 -32
- package/dist/src/serialization/json_schema.spec.js.map +1 -1
- package/dist/src/serialization/json_schema_to_type.d.ts +10 -5
- package/dist/src/serialization/json_schema_to_type.d.ts.map +1 -1
- package/dist/src/serialization/json_schema_to_type.js +13 -6
- package/dist/src/serialization/json_schema_to_type.js.map +1 -1
- package/dist/src/serialization/json_schema_to_type.spec.js +19 -0
- package/dist/src/serialization/json_schema_to_type.spec.js.map +1 -1
- package/dist/src/string_order.d.ts +36 -0
- package/dist/src/string_order.d.ts.map +1 -0
- package/dist/src/string_order.js +64 -0
- package/dist/src/string_order.js.map +1 -0
- package/dist/src/string_order.spec.d.ts +6 -0
- package/dist/src/string_order.spec.d.ts.map +1 -0
- package/dist/src/string_order.spec.js +79 -0
- package/dist/src/string_order.spec.js.map +1 -0
- package/dist/src/type_of_type.d.ts +17 -0
- package/dist/src/type_of_type.d.ts.map +1 -1
- package/dist/src/type_of_type.js +66 -0
- package/dist/src/type_of_type.js.map +1 -1
- package/dist/src/type_of_type.to_etv.spec.js +69 -1
- package/dist/src/type_of_type.to_etv.spec.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sorted runs — a Set's or Dict's elements in any order in, sorted canonical
|
|
7
|
+
* collections out.
|
|
8
|
+
*
|
|
9
|
+
* A producer that cannot hand its keys over in order — a re-key, an index built
|
|
10
|
+
* in another order than its source's — gives them to a
|
|
11
|
+
* {@link Beast2RunSorter}. It holds them encoded, with aliasing scoped to each
|
|
12
|
+
* element as every writer scopes it, and once it holds {@link RUN_MAX_COUNT} of
|
|
13
|
+
* them or {@link RUN_MAX_BYTES} of their bytes it sorts them, folds the keys
|
|
14
|
+
* that repeat, and writes them out as one run: the canonical blob of the run's
|
|
15
|
+
* value, cut by the content-defined rule like every other, or that value as a
|
|
16
|
+
* manifest directory. The runs are merged afterwards (`mergeBeast2For`), a key
|
|
17
|
+
* range at a time if need be, and a key that repeats across runs folds there,
|
|
18
|
+
* in run order.
|
|
19
|
+
*
|
|
20
|
+
* The caps are platform constants, not settings. Where a run closes decides how
|
|
21
|
+
* a repeated key's values group before they fold, which for a fold over floats
|
|
22
|
+
* decides the output's bytes; and both caps count what every runtime measures
|
|
23
|
+
* alike — elements, and the bytes of their canonical encoding — so every
|
|
24
|
+
* runtime closes a run at the same element.
|
|
25
|
+
*/
|
|
26
|
+
import {} from "../../../type_of_type.js";
|
|
27
|
+
import { printFor } from "../../east.js";
|
|
28
|
+
import { compareFor } from "../../../comparison.js";
|
|
29
|
+
import { BufferWriter } from "../../binary-utils.js";
|
|
30
|
+
import { asTypeValue } from "./type-section.js";
|
|
31
|
+
import { buildV5Encoder, createV5EncodeContext } from "./codec.js";
|
|
32
|
+
import { Beast2ElementWriter } from "./stream.js";
|
|
33
|
+
import { Beast2ManifestWriter } from "./manifest-writer.js";
|
|
34
|
+
import { decodeBeast2FenceFor } from "./boundary.js";
|
|
35
|
+
/** Elements a run holds before it closes (pairs, for a Dict). */
|
|
36
|
+
export const RUN_MAX_COUNT = 131_072;
|
|
37
|
+
/** Bytes of canonical element encoding — keys and values both — a run holds
|
|
38
|
+
* before it closes. */
|
|
39
|
+
export const RUN_MAX_BYTES = 64 * 1024 * 1024;
|
|
40
|
+
/**
|
|
41
|
+
* Sorts a Set's or Dict's elements, given in any order, into sorted canonical
|
|
42
|
+
* runs.
|
|
43
|
+
*
|
|
44
|
+
* Each element is encoded as it is added, so what the sorter holds is bounded
|
|
45
|
+
* by bytes rather than by what the elements decode to. When a run closes its
|
|
46
|
+
* elements sort by key, stably — so a key's values stay in the order they were
|
|
47
|
+
* added — and each run is written through {@link Beast2ElementWriter}, as the
|
|
48
|
+
* bytes a writer of the run's value writes, or through
|
|
49
|
+
* {@link Beast2ManifestWriter} as the manifest directory of that value, when
|
|
50
|
+
* the sink a run opens is a {@link Beast2ManifestSink}. Runs are numbered from
|
|
51
|
+
* zero in the order they close; a key that repeats across runs is the merge's
|
|
52
|
+
* to fold.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const type = DictType(StringType, IntegerType);
|
|
57
|
+
* const runs: Uint8Array[][] = [];
|
|
58
|
+
* const sorter = new Beast2RunSorter(type, () => {
|
|
59
|
+
* const chunks: Uint8Array[] = [];
|
|
60
|
+
* runs.push(chunks);
|
|
61
|
+
* return { write: (bytes) => chunks.push(bytes), close: () => {} };
|
|
62
|
+
* }, { merge: (_key, acc, value) => acc + value });
|
|
63
|
+
* sorter.add(["b", 1n]);
|
|
64
|
+
* sorter.add(["a", 2n]);
|
|
65
|
+
* sorter.add(["b", 3n]);
|
|
66
|
+
* sorter.finish();
|
|
67
|
+
* decodeBeast2For(type)(Buffer.concat(runs[0]!)); // Map { "a" => 2n, "b" => 4n }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export class Beast2RunSorter {
|
|
71
|
+
typeValue;
|
|
72
|
+
kind;
|
|
73
|
+
openRun;
|
|
74
|
+
writerOptions;
|
|
75
|
+
merge;
|
|
76
|
+
union;
|
|
77
|
+
cmp;
|
|
78
|
+
printKey;
|
|
79
|
+
ctx;
|
|
80
|
+
/** Encodes one element at the end of the writer and returns the length of
|
|
81
|
+
* its key: a Set element's whole length, a Dict pair's key. */
|
|
82
|
+
encodeElement;
|
|
83
|
+
encodeValue;
|
|
84
|
+
decodeValue;
|
|
85
|
+
/** The open run's elements, back to back. */
|
|
86
|
+
buffer = new BufferWriter();
|
|
87
|
+
/** A folded element, while it is assembled. */
|
|
88
|
+
folded = new BufferWriter();
|
|
89
|
+
starts = [];
|
|
90
|
+
keyLengths = [];
|
|
91
|
+
keys = [];
|
|
92
|
+
written = 0;
|
|
93
|
+
finished = false;
|
|
94
|
+
/**
|
|
95
|
+
* @param type - the collection type the runs hold (Set or Dict)
|
|
96
|
+
* @param openRun - opens the sink for run `run`: a blob's bytes, or a
|
|
97
|
+
* manifest directory's objects and manifest
|
|
98
|
+
* @param options - the fold, and the runs' codec, source map and parallel
|
|
99
|
+
* framing
|
|
100
|
+
* @throws {TypeError} When `type` is not a Set or Dict type, or the fold does
|
|
101
|
+
* not fit it: a merge function folds a Dict, union a Set.
|
|
102
|
+
*/
|
|
103
|
+
constructor(type, openRun, options) {
|
|
104
|
+
const typeValue = asTypeValue(type);
|
|
105
|
+
if (typeValue.type !== "Set" && typeValue.type !== "Dict") {
|
|
106
|
+
throw new TypeError(`beast2 v5: sorted runs hold Set or Dict values, not ${typeValue.type} — an Array keeps the order it is written in`);
|
|
107
|
+
}
|
|
108
|
+
const { merge, union, ...writerOptions } = options ?? {};
|
|
109
|
+
if (merge !== undefined && typeValue.type !== "Dict") {
|
|
110
|
+
throw new TypeError(`beast2 v5: a merge function folds a Dict's values; a Set's equal elements collapse under union`);
|
|
111
|
+
}
|
|
112
|
+
if (union && typeValue.type !== "Set") {
|
|
113
|
+
throw new TypeError(`beast2 v5: union collapses a Set's equal elements; a Dict's values fold with a merge function`);
|
|
114
|
+
}
|
|
115
|
+
this.typeValue = typeValue;
|
|
116
|
+
this.kind = typeValue.type;
|
|
117
|
+
this.openRun = openRun;
|
|
118
|
+
this.writerOptions = writerOptions;
|
|
119
|
+
this.merge = merge ?? null;
|
|
120
|
+
this.union = union ?? false;
|
|
121
|
+
this.ctx = createV5EncodeContext(writerOptions.sourceMap ?? null, true);
|
|
122
|
+
this.ctx.containerCount = 1;
|
|
123
|
+
const typeCtx = new Map();
|
|
124
|
+
if (typeValue.type === "Dict") {
|
|
125
|
+
const dict = typeValue.value;
|
|
126
|
+
const key = buildV5Encoder(dict.key, typeCtx);
|
|
127
|
+
const value = buildV5Encoder(dict.value, typeCtx);
|
|
128
|
+
this.encodeElement = (element, writer) => {
|
|
129
|
+
const start = writer.size;
|
|
130
|
+
key(element[0], writer, this.ctx);
|
|
131
|
+
const keyLength = writer.size - start;
|
|
132
|
+
value(element[1], writer, this.ctx);
|
|
133
|
+
return keyLength;
|
|
134
|
+
};
|
|
135
|
+
this.encodeValue = value;
|
|
136
|
+
this.decodeValue = merge !== undefined ? decodeBeast2FenceFor(dict.value) : null;
|
|
137
|
+
this.cmp = compareFor(dict.key);
|
|
138
|
+
this.printKey = printFor(dict.key);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
const elementType = typeValue.value;
|
|
142
|
+
const elem = buildV5Encoder(elementType, typeCtx);
|
|
143
|
+
this.encodeElement = (element, writer) => {
|
|
144
|
+
const start = writer.size;
|
|
145
|
+
elem(element, writer, this.ctx);
|
|
146
|
+
return writer.size - start;
|
|
147
|
+
};
|
|
148
|
+
this.encodeValue = null;
|
|
149
|
+
this.decodeValue = null;
|
|
150
|
+
this.cmp = compareFor(elementType);
|
|
151
|
+
this.printKey = printFor(elementType);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Runs written so far. The open run is not among them until a cap or
|
|
155
|
+
* {@link finish} closes it. */
|
|
156
|
+
get runs() {
|
|
157
|
+
return this.written;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Encodes one element and adds it to the open run, which is written out once
|
|
161
|
+
* it reaches {@link RUN_MAX_COUNT} elements or {@link RUN_MAX_BYTES}.
|
|
162
|
+
*
|
|
163
|
+
* @param element - a Set element, or a Dict's `[key, value]` pair
|
|
164
|
+
* @throws {Error} When called after {@link finish}; when the element cannot
|
|
165
|
+
* be encoded, which leaves the sorter as it was; or, as the run it closes is
|
|
166
|
+
* written, when a key repeats without a fold or the merge function throws.
|
|
167
|
+
*/
|
|
168
|
+
add(element) {
|
|
169
|
+
if (this.finished)
|
|
170
|
+
throw new Error("add() after finish()");
|
|
171
|
+
const start = this.buffer.size;
|
|
172
|
+
// Aliasing is scoped to the element, so its bytes depend on it alone and
|
|
173
|
+
// it can be written into whichever run it lands in by byte copy.
|
|
174
|
+
this.ctx.containerIndex.clear();
|
|
175
|
+
this.ctx.segmentBaseDef = this.ctx.containerCount;
|
|
176
|
+
let keyLength;
|
|
177
|
+
try {
|
|
178
|
+
keyLength = this.encodeElement(element, this.buffer);
|
|
179
|
+
}
|
|
180
|
+
catch (err) {
|
|
181
|
+
const kept = this.buffer.toUint8Array().slice(0, start);
|
|
182
|
+
this.buffer.pop();
|
|
183
|
+
this.buffer.writeBytes(kept);
|
|
184
|
+
throw err;
|
|
185
|
+
}
|
|
186
|
+
this.starts.push(start);
|
|
187
|
+
this.keyLengths.push(keyLength);
|
|
188
|
+
this.keys.push(this.kind === "Dict" ? element[0] : element);
|
|
189
|
+
if (this.keys.length >= RUN_MAX_COUNT || this.buffer.size >= RUN_MAX_BYTES)
|
|
190
|
+
this.writeRun();
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Writes the open run, if it holds anything. Idempotent.
|
|
194
|
+
*
|
|
195
|
+
* @throws {Error} When a key of the open run repeats without a fold, or the
|
|
196
|
+
* merge function throws.
|
|
197
|
+
*/
|
|
198
|
+
finish() {
|
|
199
|
+
if (this.finished)
|
|
200
|
+
return;
|
|
201
|
+
this.finished = true;
|
|
202
|
+
if (this.keys.length > 0)
|
|
203
|
+
this.writeRun();
|
|
204
|
+
}
|
|
205
|
+
/** Sorts the open run, folds its repeated keys, and writes it. A failure
|
|
206
|
+
* leaves the run incomplete: a blob sink without its `close`, a manifest
|
|
207
|
+
* directory without its manifest. */
|
|
208
|
+
writeRun() {
|
|
209
|
+
const n = this.keys.length;
|
|
210
|
+
const bytes = this.buffer.toUint8Array();
|
|
211
|
+
const { starts, keyLengths, keys } = this;
|
|
212
|
+
const end = (e) => (e + 1 < n ? starts[e + 1] : bytes.length);
|
|
213
|
+
// Stable by construction: equal keys order by when they were added, which
|
|
214
|
+
// is the order their values fold in.
|
|
215
|
+
const order = Array.from({ length: n }, (_, i) => i);
|
|
216
|
+
order.sort((a, b) => this.cmp(keys[a], keys[b]) || a - b);
|
|
217
|
+
const sink = this.openRun(this.written);
|
|
218
|
+
const writer = "manifest" in sink
|
|
219
|
+
? new Beast2ManifestWriter(this.typeValue, sink, this.writerOptions)
|
|
220
|
+
: new Beast2ElementWriter(this.typeValue, (chunk) => sink.write(chunk), this.writerOptions);
|
|
221
|
+
for (let i = 0; i < n;) {
|
|
222
|
+
const first = order[i];
|
|
223
|
+
let j = i + 1;
|
|
224
|
+
while (j < n && this.cmp(keys[first], keys[order[j]]) === 0)
|
|
225
|
+
j++;
|
|
226
|
+
if (j - i > 1 && this.merge === null && !this.union) {
|
|
227
|
+
const noun = this.kind === "Dict" ? "Dict" : "Set";
|
|
228
|
+
const part = this.kind === "Dict" ? "key" : "element";
|
|
229
|
+
throw new Error(`beast2 v5: duplicate ${noun} ${part} emitted: ${this.printKey(keys[first])} — ${noun} ${part}s must be unique`);
|
|
230
|
+
}
|
|
231
|
+
if (j - i === 1 || this.merge === null) {
|
|
232
|
+
writer.addEncoded(bytes.subarray(starts[first], end(first)), keyLengths[first]);
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
const keyLength = keyLengths[first];
|
|
236
|
+
let acc = this.decodeValue(bytes.subarray(starts[first] + keyLength, end(first)));
|
|
237
|
+
for (let k = i + 1; k < j; k++) {
|
|
238
|
+
const e = order[k];
|
|
239
|
+
acc = this.merge(keys[first], acc, this.decodeValue(bytes.subarray(starts[e] + keyLengths[e], end(e))));
|
|
240
|
+
}
|
|
241
|
+
this.folded.writeBytes(bytes.subarray(starts[first], starts[first] + keyLength));
|
|
242
|
+
this.ctx.containerIndex.clear();
|
|
243
|
+
this.ctx.segmentBaseDef = this.ctx.containerCount;
|
|
244
|
+
this.encodeValue(acc, this.folded, this.ctx);
|
|
245
|
+
writer.addEncoded(this.folded.toUint8Array(), keyLength);
|
|
246
|
+
this.folded.pop();
|
|
247
|
+
}
|
|
248
|
+
i = j;
|
|
249
|
+
}
|
|
250
|
+
writer.finish();
|
|
251
|
+
if (!("manifest" in sink))
|
|
252
|
+
sink.close();
|
|
253
|
+
this.written++;
|
|
254
|
+
this.buffer.pop();
|
|
255
|
+
this.starts = [];
|
|
256
|
+
this.keyLengths = [];
|
|
257
|
+
this.keys = [];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRo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AAC,KAAK,CAAE,GAAG,SAAS,CAAC,CAAC,CAAC;gBACnF,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;gBAChC,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC;gBAClD,IAAI,CAAC,WAAY,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC9C,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,SAAS,CAAC,CAAC;gBACzD,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;YACpB,CAAC;YACD,CAAC,GAAG,CAAC,CAAC;QACR,CAAC;QACD,MAAM,CAAC,MAAM,EAAE,CAAC;QAChB,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC;YAAE,IAAI,CAAC,KAAK,EAAE,CAAC;QACxC,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.spec.d.ts","sourceRoot":"","sources":["../../../../../src/serialization/beast2/v5/runs.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Sorted runs: each run is the canonical blob of its sorted, folded value, or
|
|
7
|
+
* that value's manifest directory; a key's values fold in the order they were
|
|
8
|
+
* added; a run closes at the element cap or the byte cap; and the runs a
|
|
9
|
+
* pinned sequence of elements closes are the runs east-c closes for it.
|
|
10
|
+
*/
|
|
11
|
+
import { describe, test } from "node:test";
|
|
12
|
+
import assert from "node:assert/strict";
|
|
13
|
+
import { ArrayType, BlobType, DictType, IntegerType, SetType, StringType } from "../../../types.js";
|
|
14
|
+
import { compareFor } from "../../../comparison.js";
|
|
15
|
+
import { SortedMap, SortedSet } from "../../../index.js";
|
|
16
|
+
import { Beast2RunSorter, RUN_MAX_BYTES, RUN_MAX_COUNT, decodeBeast2For, decodeCollectionManifest, encodeBeast2PagedFor, fnv1a64, mergeBeast2For, openBeast2PagesFor, spliceBeast2, } from "../index.js";
|
|
17
|
+
/** Sorts `elements` through a run sorter and returns each run's bytes. */
|
|
18
|
+
function sortInto(type, elements, options) {
|
|
19
|
+
const runs = [];
|
|
20
|
+
const closed = [];
|
|
21
|
+
const sorter = new Beast2RunSorter(type, (run) => {
|
|
22
|
+
assert.equal(run, runs.length, "runs are numbered in the order they open");
|
|
23
|
+
const chunks = [];
|
|
24
|
+
runs.push(chunks);
|
|
25
|
+
closed.push(false);
|
|
26
|
+
return { write: (bytes) => chunks.push(bytes), close: () => { closed[run] = true; } };
|
|
27
|
+
}, options);
|
|
28
|
+
for (const element of elements)
|
|
29
|
+
sorter.add(element);
|
|
30
|
+
sorter.finish();
|
|
31
|
+
assert.equal(sorter.runs, runs.length);
|
|
32
|
+
assert.ok(closed.every((c) => c), "every run is closed");
|
|
33
|
+
return runs.map((chunks) => new Uint8Array(Buffer.concat(chunks)));
|
|
34
|
+
}
|
|
35
|
+
/** `k0000042`-style keys, which order the way their numbers do. */
|
|
36
|
+
const key = (i) => `k${String(i).padStart(7, "0")}`;
|
|
37
|
+
describe("beast2 v5 sorted runs", () => {
|
|
38
|
+
const DictSI = DictType(StringType, IntegerType);
|
|
39
|
+
const sum = { merge: (_key, acc, value) => acc + value };
|
|
40
|
+
test("writes a run as the canonical blob of its sorted, folded value", () => {
|
|
41
|
+
const added = [["c", 1n], ["a", 2n], ["c", 3n], ["b", 4n], ["a", 5n]];
|
|
42
|
+
const [run, ...rest] = sortInto(DictSI, added, sum);
|
|
43
|
+
assert.equal(rest.length, 0);
|
|
44
|
+
const expected = new SortedMap([["a", 7n], ["b", 4n], ["c", 4n]], compareFor(StringType));
|
|
45
|
+
assert.deepEqual(run, encodeBeast2PagedFor(DictSI)(expected));
|
|
46
|
+
});
|
|
47
|
+
test("folds a key's values in the order they were added", () => {
|
|
48
|
+
const type = DictType(StringType, StringType);
|
|
49
|
+
const [run] = sortInto(type, [["k", "a"], ["j", "x"], ["k", "b"], ["k", "c"]], {
|
|
50
|
+
merge: (_key, acc, value) => acc + value,
|
|
51
|
+
});
|
|
52
|
+
assert.deepEqual([...decodeBeast2For(type)(run)], [["j", "x"], ["k", "abc"]]);
|
|
53
|
+
});
|
|
54
|
+
test("keeps a Set's repeated element once under union, and refuses it without", () => {
|
|
55
|
+
const type = SetType(StringType);
|
|
56
|
+
const [run] = sortInto(type, ["b", "a", "b", "c", "a"], { union: true });
|
|
57
|
+
assert.deepEqual([...decodeBeast2For(type)(run)], ["a", "b", "c"]);
|
|
58
|
+
assert.throws(() => sortInto(type, ["b", "a", "b"]), { message: `beast2 v5: duplicate Set element emitted: "b" — Set elements must be unique` });
|
|
59
|
+
});
|
|
60
|
+
test("refuses a Dict key added twice without a merge function", () => {
|
|
61
|
+
assert.throws(() => sortInto(DictSI, [["k", 1n], ["j", 2n], ["k", 3n]]), { message: `beast2 v5: duplicate Dict key emitted: "k" — Dict keys must be unique` });
|
|
62
|
+
});
|
|
63
|
+
test("closes a run at the element cap", () => {
|
|
64
|
+
const type = SetType(IntegerType);
|
|
65
|
+
const elements = Array.from({ length: RUN_MAX_COUNT + 10 }, (_, i) => BigInt(RUN_MAX_COUNT + 10 - i));
|
|
66
|
+
const runs = sortInto(type, elements);
|
|
67
|
+
assert.deepEqual(runs.map((run) => openBeast2PagesFor(type)(run).elementCount), [RUN_MAX_COUNT, 10]);
|
|
68
|
+
// The first run holds the elements added first, whatever their keys.
|
|
69
|
+
assert.equal([...decodeBeast2For(type)(runs[1])].at(-1), 10n);
|
|
70
|
+
});
|
|
71
|
+
test("closes a run at the byte cap", () => {
|
|
72
|
+
// Elements of 2 MiB: the run that reaches the cap is written with the
|
|
73
|
+
// element that reached it.
|
|
74
|
+
const type = DictType(StringType, BlobType);
|
|
75
|
+
const payload = new Uint8Array(2 * 1024 * 1024).fill(7);
|
|
76
|
+
const elements = Array.from({ length: 40 }, (_, i) => [key(i), payload]);
|
|
77
|
+
const perElement = key(0).length + 1 + 4 + payload.length;
|
|
78
|
+
const first = Math.ceil(RUN_MAX_BYTES / perElement);
|
|
79
|
+
const runs = sortInto(type, elements, { codec: "none" });
|
|
80
|
+
assert.deepEqual(runs.map((run) => openBeast2PagesFor(type)(run).elementCount), [first, 40 - first]);
|
|
81
|
+
});
|
|
82
|
+
test("is left as it was by an element that fails to encode", () => {
|
|
83
|
+
const runs = [];
|
|
84
|
+
const sorter = new Beast2RunSorter(DictSI, () => {
|
|
85
|
+
const chunks = [];
|
|
86
|
+
runs.push(chunks);
|
|
87
|
+
return { write: (bytes) => chunks.push(bytes), close: () => { } };
|
|
88
|
+
});
|
|
89
|
+
sorter.add(["b", 1n]);
|
|
90
|
+
assert.throws(() => sorter.add(["a", "not an integer"]));
|
|
91
|
+
sorter.add(["a", 2n]);
|
|
92
|
+
sorter.finish();
|
|
93
|
+
assert.deepEqual([...decodeBeast2For(DictSI)(Buffer.concat(runs[0]))], [["a", 2n], ["b", 1n]]);
|
|
94
|
+
assert.throws(() => sorter.add(["c", 3n]), /after finish/);
|
|
95
|
+
});
|
|
96
|
+
test("writes no run when nothing was added", () => {
|
|
97
|
+
assert.deepEqual(sortInto(DictSI, []), []);
|
|
98
|
+
});
|
|
99
|
+
test("writes each run as a manifest directory when its sink takes one", () => {
|
|
100
|
+
// 7919 is prime to 136,072: every key once, in a permuted order, over two
|
|
101
|
+
// runs.
|
|
102
|
+
const n = RUN_MAX_COUNT + 5_000;
|
|
103
|
+
const elements = Array.from({ length: n }, (_, i) => [key((i * 7919) % n), BigInt(i)]);
|
|
104
|
+
const blobs = sortInto(DictSI, elements);
|
|
105
|
+
const dirs = [];
|
|
106
|
+
const sorter = new Beast2RunSorter(DictSI, (run) => {
|
|
107
|
+
assert.equal(run, dirs.length, "runs are numbered in the order they open");
|
|
108
|
+
const dir = { objects: new Map(), manifest: null };
|
|
109
|
+
dirs.push(dir);
|
|
110
|
+
return { object: (hash, bytes) => { dir.objects.set(hash, bytes); }, manifest: (bytes) => { dir.manifest = bytes; } };
|
|
111
|
+
});
|
|
112
|
+
for (const element of elements)
|
|
113
|
+
sorter.add(element);
|
|
114
|
+
sorter.finish();
|
|
115
|
+
assert.equal(dirs.length, 2);
|
|
116
|
+
dirs.forEach((dir, i) => {
|
|
117
|
+
const entries = decodeCollectionManifest(dir.manifest).entries;
|
|
118
|
+
assert.deepEqual(spliceBeast2(entries.map((entry) => dir.objects.get(entry.hash))), blobs[i], `run ${i}'s segments are its blob's`);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
test("refuses a root it cannot sort, and a fold that does not fit the root", () => {
|
|
122
|
+
const open = () => ({ write: () => { }, close: () => { } });
|
|
123
|
+
assert.throws(() => new Beast2RunSorter(ArrayType(IntegerType), open), /Set or Dict values, not Array/);
|
|
124
|
+
assert.throws(() => new Beast2RunSorter(SetType(IntegerType), open, { merge: (_k, a) => a }), /folds a Dict/);
|
|
125
|
+
assert.throws(() => new Beast2RunSorter(DictSI, open, { union: true }), /collapses a Set/);
|
|
126
|
+
});
|
|
127
|
+
describe("two-runtime parity", () => {
|
|
128
|
+
// Where a run closes decides how a repeated key's values group before they
|
|
129
|
+
// fold, so east and east-c must close runs at the same elements and write
|
|
130
|
+
// each as the same bytes. The same sequences and digests are pinned in
|
|
131
|
+
// east-c's `tests/test_beast2_runs.c`.
|
|
132
|
+
const digestOf = (runs) => fnv1a64(new TextEncoder().encode(runs.map((run) => fnv1a64(run).toString(16).padStart(16, "0")).join(",")))
|
|
133
|
+
.toString(16).padStart(16, "0");
|
|
134
|
+
test("closes and writes the runs east-c writes for a permuted Dict", () => {
|
|
135
|
+
// 300,000 distinct keys in a permuted order: 7919 is prime to 300,000.
|
|
136
|
+
const n = 300_000;
|
|
137
|
+
const elements = Array.from({ length: n }, (_, i) => [key((i * 7919) % n), BigInt(i)]);
|
|
138
|
+
const runs = sortInto(DictSI, elements);
|
|
139
|
+
assert.deepEqual(runs.map((run) => openBeast2PagesFor(DictSI)(run).elementCount), [RUN_MAX_COUNT, RUN_MAX_COUNT, n - 2 * RUN_MAX_COUNT]);
|
|
140
|
+
assert.equal(digestOf(runs), "d90d3818c52e31bb");
|
|
141
|
+
});
|
|
142
|
+
test("closes and writes the runs east-c writes for a Set under union", () => {
|
|
143
|
+
// 300,000 elements over 200,000 values: each repeats, within a run and
|
|
144
|
+
// across runs.
|
|
145
|
+
const type = SetType(StringType);
|
|
146
|
+
const elements = Array.from({ length: 300_000 }, (_, i) => `e${String((i * 7919) % 200_000).padStart(6, "0")}`);
|
|
147
|
+
const runs = sortInto(type, elements, { union: true });
|
|
148
|
+
assert.equal(runs.length, 3);
|
|
149
|
+
assert.equal(digestOf(runs), "a4a7379f0468c2be");
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
describe("beast2 v5 sorted runs, merged", () => {
|
|
154
|
+
// The runs and the merge together are the any-order write: whatever order
|
|
155
|
+
// the elements came in and wherever the runs closed, merging the runs is the
|
|
156
|
+
// canonical blob of the value.
|
|
157
|
+
test("merge back into the canonical blob of the whole value", () => {
|
|
158
|
+
const type = DictType(StringType, IntegerType);
|
|
159
|
+
const n = 300_000;
|
|
160
|
+
const expected = new SortedMap(undefined, compareFor(StringType));
|
|
161
|
+
const elements = [];
|
|
162
|
+
for (let i = 0; i < n; i++) {
|
|
163
|
+
const k = key((i * 7919) % 200_000);
|
|
164
|
+
elements.push([k, BigInt(i)]);
|
|
165
|
+
expected.set(k, (expected.get(k) ?? 0n) + BigInt(i));
|
|
166
|
+
}
|
|
167
|
+
const merge = (_key, acc, value) => acc + value;
|
|
168
|
+
const runs = sortInto(type, elements, { merge });
|
|
169
|
+
assert.ok(runs.length > 1);
|
|
170
|
+
const chunks = [];
|
|
171
|
+
const stats = mergeBeast2For(type, { merge })(runs, (bytes) => chunks.push(bytes));
|
|
172
|
+
assert.deepEqual(new Uint8Array(Buffer.concat(chunks)), encodeBeast2PagedFor(type)(expected));
|
|
173
|
+
assert.equal(stats.entries, expected.size);
|
|
174
|
+
const setType = SetType(StringType);
|
|
175
|
+
const set = new SortedSet(elements.map(([k]) => k), compareFor(StringType));
|
|
176
|
+
const setRuns = sortInto(setType, elements.map(([k]) => k), { union: true });
|
|
177
|
+
const setChunks = [];
|
|
178
|
+
mergeBeast2For(setType, { union: true })(setRuns, (bytes) => setChunks.push(bytes));
|
|
179
|
+
assert.deepEqual(new Uint8Array(Buffer.concat(setChunks)), encodeBeast2PagedFor(setType)(set));
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
//# sourceMappingURL=runs.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.spec.js","sourceRoot":"","sources":["../../../../../src/serialization/beast2/v5/runs.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,eAAe,EAEf,aAAa,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AS,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The SHA-256 digest of `bytes`, in lowercase hex — the name a store gives an
|
|
7
|
+
* object, and a manifest gives each object it names.
|
|
8
|
+
*
|
|
9
|
+
* @param bytes - the bytes to hash
|
|
10
|
+
* @returns the digest as 64 lowercase hex digits
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* sha256Hex(new TextEncoder().encode("abc"));
|
|
15
|
+
* // "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function sha256Hex(bytes: Uint8Array): string;
|
|
19
|
+
//# sourceMappingURL=sha256.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../../../../../src/serialization/beast2/v5/sha256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAgCnD"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* SHA-256 (FIPS 180-4), the name of every object a manifest directory holds.
|
|
7
|
+
*
|
|
8
|
+
* A store names an object by the SHA-256 of its bytes, and a manifest names
|
|
9
|
+
* its segments and its header the same way. A runtime that writes a manifest
|
|
10
|
+
* directory therefore writes the names the store would give its files, and the
|
|
11
|
+
* store takes each one in under its name without hashing it again. `east` runs
|
|
12
|
+
* in the browser as well as on Node, so the hash is written here rather than
|
|
13
|
+
* borrowed from a platform; east-c carries the same function, which east-py
|
|
14
|
+
* binds.
|
|
15
|
+
*/
|
|
16
|
+
/** The round constants: the first 32 bits of the fractional parts of the cube
|
|
17
|
+
* roots of the first 64 primes. */
|
|
18
|
+
const K = Int32Array.of(0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2);
|
|
19
|
+
/** Folds the 64-byte block at `offset` into `state`. Words are int32: every
|
|
20
|
+
* sum is taken mod 2^32 by `| 0`, and `>>>` reads a word as unsigned. */
|
|
21
|
+
function compress(state, w, data, offset) {
|
|
22
|
+
for (let t = 0; t < 16; t++) {
|
|
23
|
+
const i = offset + t * 4;
|
|
24
|
+
w[t] = (data[i] << 24) | (data[i + 1] << 16) | (data[i + 2] << 8) | data[i + 3];
|
|
25
|
+
}
|
|
26
|
+
for (let t = 16; t < 64; t++) {
|
|
27
|
+
const x = w[t - 15];
|
|
28
|
+
const y = w[t - 2];
|
|
29
|
+
const s0 = ((x >>> 7) | (x << 25)) ^ ((x >>> 18) | (x << 14)) ^ (x >>> 3);
|
|
30
|
+
const s1 = ((y >>> 17) | (y << 15)) ^ ((y >>> 19) | (y << 13)) ^ (y >>> 10);
|
|
31
|
+
w[t] = (w[t - 16] + s0 + w[t - 7] + s1) | 0;
|
|
32
|
+
}
|
|
33
|
+
let a = state[0], b = state[1], c = state[2], d = state[3];
|
|
34
|
+
let e = state[4], f = state[5], g = state[6], h = state[7];
|
|
35
|
+
for (let t = 0; t < 64; t++) {
|
|
36
|
+
const s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
|
|
37
|
+
const t1 = (h + s1 + ((e & f) ^ (~e & g)) + K[t] + w[t]) | 0;
|
|
38
|
+
const s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
|
|
39
|
+
const t2 = (s0 + ((a & b) ^ (a & c) ^ (b & c))) | 0;
|
|
40
|
+
h = g;
|
|
41
|
+
g = f;
|
|
42
|
+
f = e;
|
|
43
|
+
e = (d + t1) | 0;
|
|
44
|
+
d = c;
|
|
45
|
+
c = b;
|
|
46
|
+
b = a;
|
|
47
|
+
a = (t1 + t2) | 0;
|
|
48
|
+
}
|
|
49
|
+
state[0] = (state[0] + a) | 0;
|
|
50
|
+
state[1] = (state[1] + b) | 0;
|
|
51
|
+
state[2] = (state[2] + c) | 0;
|
|
52
|
+
state[3] = (state[3] + d) | 0;
|
|
53
|
+
state[4] = (state[4] + e) | 0;
|
|
54
|
+
state[5] = (state[5] + f) | 0;
|
|
55
|
+
state[6] = (state[6] + g) | 0;
|
|
56
|
+
state[7] = (state[7] + h) | 0;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The SHA-256 digest of `bytes`, in lowercase hex — the name a store gives an
|
|
60
|
+
* object, and a manifest gives each object it names.
|
|
61
|
+
*
|
|
62
|
+
* @param bytes - the bytes to hash
|
|
63
|
+
* @returns the digest as 64 lowercase hex digits
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* sha256Hex(new TextEncoder().encode("abc"));
|
|
68
|
+
* // "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export function sha256Hex(bytes) {
|
|
72
|
+
const state = Int32Array.of(0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19);
|
|
73
|
+
const w = new Int32Array(64);
|
|
74
|
+
const whole = bytes.length - (bytes.length % 64);
|
|
75
|
+
for (let offset = 0; offset < whole; offset += 64)
|
|
76
|
+
compress(state, w, bytes, offset);
|
|
77
|
+
// The rest, a 1 bit, zeros, and the message's length in bits as a
|
|
78
|
+
// big-endian u64 — one block, or two when the length does not fit after
|
|
79
|
+
// the rest.
|
|
80
|
+
const rest = bytes.length - whole;
|
|
81
|
+
const tail = new Uint8Array(rest < 56 ? 64 : 128);
|
|
82
|
+
tail.set(bytes.subarray(whole));
|
|
83
|
+
tail[rest] = 0x80;
|
|
84
|
+
const bits = bytes.length * 8;
|
|
85
|
+
const high = Math.floor(bits / 0x100000000);
|
|
86
|
+
const low = bits >>> 0;
|
|
87
|
+
const at = tail.length - 8;
|
|
88
|
+
tail[at] = high >>> 24;
|
|
89
|
+
tail[at + 1] = high >>> 16;
|
|
90
|
+
tail[at + 2] = high >>> 8;
|
|
91
|
+
tail[at + 3] = high;
|
|
92
|
+
tail[at + 4] = low >>> 24;
|
|
93
|
+
tail[at + 5] = low >>> 16;
|
|
94
|
+
tail[at + 6] = low >>> 8;
|
|
95
|
+
tail[at + 7] = low;
|
|
96
|
+
for (let offset = 0; offset < tail.length; offset += 64)
|
|
97
|
+
compress(state, w, tail, offset);
|
|
98
|
+
let hex = "";
|
|
99
|
+
for (let i = 0; i < 8; i++)
|
|
100
|
+
hex += (state[i] >>> 0).toString(16).padStart(8, "0");
|
|
101
|
+
return hex;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=sha256.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../../../../src/serialization/beast2/v5/sha256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH;oCACoC;AACpC,MAAM,CAAC,GAAG,UAAU,CAAC,EAAE,CACrB,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,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