typesea 0.1.0 → 0.2.0
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/CHANGELOG.md +67 -6
- package/README.md +98 -17
- package/dist/adapters/index.d.ts +50 -8
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +169 -48
- package/dist/aot/index.d.ts +18 -2
- package/dist/aot/index.d.ts.map +1 -1
- package/dist/aot/index.js +93 -14
- package/dist/async/index.d.ts +28 -56
- package/dist/async/index.d.ts.map +1 -1
- package/dist/async/index.js +94 -37
- package/dist/builders/composite.d.ts +37 -6
- package/dist/builders/composite.d.ts.map +1 -1
- package/dist/builders/composite.js +84 -10
- package/dist/builders/index.d.ts +2 -0
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +2 -0
- package/dist/builders/modifier.d.ts +30 -5
- package/dist/builders/modifier.d.ts.map +1 -1
- package/dist/builders/modifier.js +38 -5
- package/dist/builders/object/guard.d.ts +18 -22
- package/dist/builders/object/guard.d.ts.map +1 -1
- package/dist/builders/object/guard.js +26 -26
- package/dist/builders/object/index.d.ts +2 -0
- package/dist/builders/object/index.d.ts.map +1 -1
- package/dist/builders/object/index.js +2 -0
- package/dist/builders/object/schema.d.ts +55 -9
- package/dist/builders/object/schema.d.ts.map +1 -1
- package/dist/builders/object/schema.js +92 -15
- package/dist/builders/object/types.d.ts +5 -31
- package/dist/builders/object/types.d.ts.map +1 -1
- package/dist/builders/object/types.js +2 -0
- package/dist/builders/scalar.d.ts +29 -8
- package/dist/builders/scalar.d.ts.map +1 -1
- package/dist/builders/scalar.js +33 -8
- package/dist/builders/table.d.ts +4 -0
- package/dist/builders/table.d.ts.map +1 -1
- package/dist/builders/table.js +4 -0
- package/dist/builders/types.d.ts +14 -4
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/builders/types.js +2 -0
- package/dist/compile/check-composite.d.ts +22 -1
- package/dist/compile/check-composite.d.ts.map +1 -1
- package/dist/compile/check-composite.js +564 -24
- package/dist/compile/check-scalar.d.ts +78 -0
- package/dist/compile/check-scalar.d.ts.map +1 -1
- package/dist/compile/check-scalar.js +432 -1
- package/dist/compile/check.d.ts +12 -0
- package/dist/compile/check.d.ts.map +1 -1
- package/dist/compile/check.js +37 -0
- package/dist/compile/context.d.ts +47 -9
- package/dist/compile/context.d.ts.map +1 -1
- package/dist/compile/context.js +51 -8
- package/dist/compile/graph-predicate.d.ts +4 -2
- package/dist/compile/graph-predicate.d.ts.map +1 -1
- package/dist/compile/graph-predicate.js +1907 -171
- package/dist/compile/guard.d.ts +15 -24
- package/dist/compile/guard.d.ts.map +1 -1
- package/dist/compile/guard.js +158 -74
- package/dist/compile/index.d.ts +3 -1
- package/dist/compile/index.d.ts.map +1 -1
- package/dist/compile/index.js +2 -0
- package/dist/compile/issue.d.ts +110 -0
- package/dist/compile/issue.d.ts.map +1 -1
- package/dist/compile/issue.js +184 -1
- package/dist/compile/names.d.ts +12 -2
- package/dist/compile/names.d.ts.map +1 -1
- package/dist/compile/names.js +19 -3
- package/dist/compile/predicate.d.ts +24 -0
- package/dist/compile/predicate.d.ts.map +1 -1
- package/dist/compile/predicate.js +131 -5
- package/dist/compile/runtime.d.ts +80 -12
- package/dist/compile/runtime.d.ts.map +1 -1
- package/dist/compile/runtime.js +25 -6
- package/dist/compile/source.d.ts +10 -2
- package/dist/compile/source.d.ts.map +1 -1
- package/dist/compile/source.js +361 -26
- package/dist/compile/types.d.ts +20 -0
- package/dist/compile/types.d.ts.map +1 -1
- package/dist/compile/types.js +2 -0
- package/dist/decoder/index.d.ts +32 -46
- package/dist/decoder/index.d.ts.map +1 -1
- package/dist/decoder/index.js +102 -38
- package/dist/evaluate/check-composite.d.ts +59 -0
- package/dist/evaluate/check-composite.d.ts.map +1 -1
- package/dist/evaluate/check-composite.js +151 -3
- package/dist/evaluate/check-scalar.d.ts +16 -0
- package/dist/evaluate/check-scalar.d.ts.map +1 -1
- package/dist/evaluate/check-scalar.js +32 -0
- package/dist/evaluate/check.d.ts +7 -0
- package/dist/evaluate/check.d.ts.map +1 -1
- package/dist/evaluate/check.js +43 -0
- package/dist/evaluate/index.d.ts +2 -0
- package/dist/evaluate/index.d.ts.map +1 -1
- package/dist/evaluate/index.js +2 -0
- package/dist/evaluate/issue.d.ts +11 -1
- package/dist/evaluate/issue.d.ts.map +1 -1
- package/dist/evaluate/issue.js +15 -1
- package/dist/evaluate/predicate.d.ts +16 -5
- package/dist/evaluate/predicate.d.ts.map +1 -1
- package/dist/evaluate/predicate.js +20 -5
- package/dist/evaluate/shared.d.ts +59 -13
- package/dist/evaluate/shared.d.ts.map +1 -1
- package/dist/evaluate/shared.js +66 -8
- package/dist/evaluate/state.d.ts +35 -13
- package/dist/evaluate/state.d.ts.map +1 -1
- package/dist/evaluate/state.js +35 -2
- package/dist/guard/base.d.ts +79 -29
- package/dist/guard/base.d.ts.map +1 -1
- package/dist/guard/base.js +91 -29
- package/dist/guard/error.d.ts +10 -5
- package/dist/guard/error.d.ts.map +1 -1
- package/dist/guard/error.js +10 -5
- package/dist/guard/index.d.ts +2 -0
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -0
- package/dist/guard/number.d.ts +26 -11
- package/dist/guard/number.d.ts.map +1 -1
- package/dist/guard/number.js +30 -11
- package/dist/guard/props.d.ts +27 -3
- package/dist/guard/props.d.ts.map +1 -1
- package/dist/guard/props.js +27 -3
- package/dist/guard/read.d.ts +62 -9
- package/dist/guard/read.d.ts.map +1 -1
- package/dist/guard/read.js +83 -10
- package/dist/guard/registry.d.ts +12 -2
- package/dist/guard/registry.d.ts.map +1 -1
- package/dist/guard/registry.js +15 -3
- package/dist/guard/string.d.ts +33 -13
- package/dist/guard/string.d.ts.map +1 -1
- package/dist/guard/string.js +37 -13
- package/dist/guard/types.d.ts +92 -40
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/guard/types.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/index.d.ts +42 -6
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +51 -8
- package/dist/ir/builder.d.ts +16 -126
- package/dist/ir/builder.d.ts.map +1 -1
- package/dist/ir/builder.js +77 -137
- package/dist/ir/freeze.d.ts +4 -0
- package/dist/ir/freeze.d.ts.map +1 -1
- package/dist/ir/freeze.js +59 -0
- package/dist/ir/index.d.ts +3 -1
- package/dist/ir/index.d.ts.map +1 -1
- package/dist/ir/index.js +2 -0
- package/dist/ir/regexp.d.ts +2 -0
- package/dist/ir/regexp.d.ts.map +1 -1
- package/dist/ir/regexp.js +2 -0
- package/dist/ir/types.d.ts +90 -55
- package/dist/ir/types.d.ts.map +1 -1
- package/dist/ir/types.js +2 -0
- package/dist/ir/validate.d.ts +8 -1
- package/dist/ir/validate.d.ts.map +1 -1
- package/dist/ir/validate.js +477 -61
- package/dist/issue/index.d.ts +41 -9
- package/dist/issue/index.d.ts.map +1 -1
- package/dist/issue/index.js +61 -11
- package/dist/json-schema/emit-combinator.d.ts +44 -4
- package/dist/json-schema/emit-combinator.d.ts.map +1 -1
- package/dist/json-schema/emit-combinator.js +44 -4
- package/dist/json-schema/emit-composite.d.ts +10 -0
- package/dist/json-schema/emit-composite.d.ts.map +1 -1
- package/dist/json-schema/emit-composite.js +15 -1
- package/dist/json-schema/emit-scalar.d.ts +26 -3
- package/dist/json-schema/emit-scalar.d.ts.map +1 -1
- package/dist/json-schema/emit-scalar.js +70 -9
- package/dist/json-schema/emit-types.d.ts +11 -1
- package/dist/json-schema/emit-types.d.ts.map +1 -1
- package/dist/json-schema/emit-types.js +2 -0
- package/dist/json-schema/emit.d.ts +12 -1
- package/dist/json-schema/emit.d.ts.map +1 -1
- package/dist/json-schema/emit.js +12 -1
- package/dist/json-schema/freeze.d.ts +13 -2
- package/dist/json-schema/freeze.d.ts.map +1 -1
- package/dist/json-schema/freeze.js +41 -8
- package/dist/json-schema/index.d.ts +16 -2
- package/dist/json-schema/index.d.ts.map +1 -1
- package/dist/json-schema/index.js +23 -3
- package/dist/json-schema/issue.d.ts +4 -1
- package/dist/json-schema/issue.d.ts.map +1 -1
- package/dist/json-schema/issue.js +4 -1
- package/dist/json-schema/read.d.ts +24 -3
- package/dist/json-schema/read.d.ts.map +1 -1
- package/dist/json-schema/read.js +59 -12
- package/dist/json-schema/types.d.ts +38 -15
- package/dist/json-schema/types.d.ts.map +1 -1
- package/dist/json-schema/types.js +2 -0
- package/dist/kind/index.d.ts +15 -28
- package/dist/kind/index.d.ts.map +1 -1
- package/dist/kind/index.js +15 -10
- package/dist/lower/index.d.ts +6 -1
- package/dist/lower/index.d.ts.map +1 -1
- package/dist/lower/index.js +411 -44
- package/dist/message/index.d.ts +46 -10
- package/dist/message/index.d.ts.map +1 -1
- package/dist/message/index.js +88 -17
- package/dist/optimize/algebraic.d.ts +54 -0
- package/dist/optimize/algebraic.d.ts.map +1 -0
- package/dist/optimize/algebraic.js +314 -0
- package/dist/optimize/compact.d.ts +8 -1
- package/dist/optimize/compact.d.ts.map +1 -1
- package/dist/optimize/compact.js +13 -2
- package/dist/optimize/domain.d.ts +16 -0
- package/dist/optimize/domain.d.ts.map +1 -0
- package/dist/optimize/domain.js +615 -0
- package/dist/optimize/fold-boolean.d.ts +17 -2
- package/dist/optimize/fold-boolean.d.ts.map +1 -1
- package/dist/optimize/fold-boolean.js +59 -14
- package/dist/optimize/fold-common.d.ts +43 -8
- package/dist/optimize/fold-common.d.ts.map +1 -1
- package/dist/optimize/fold-common.js +37 -6
- package/dist/optimize/fold-constraints.d.ts +33 -0
- package/dist/optimize/fold-constraints.d.ts.map +1 -0
- package/dist/optimize/fold-constraints.js +484 -0
- package/dist/optimize/fold-scalar.d.ts +98 -13
- package/dist/optimize/fold-scalar.d.ts.map +1 -1
- package/dist/optimize/fold-scalar.js +98 -13
- package/dist/optimize/fold.d.ts +8 -1
- package/dist/optimize/fold.d.ts.map +1 -1
- package/dist/optimize/fold.js +22 -2
- package/dist/optimize/index.d.ts +9 -1
- package/dist/optimize/index.d.ts.map +1 -1
- package/dist/optimize/index.js +18 -3
- package/dist/optimize/map-node.d.ts +3 -1
- package/dist/optimize/map-node.d.ts.map +1 -1
- package/dist/optimize/map-node.js +45 -3
- package/dist/optimize/peephole.d.ts +16 -0
- package/dist/optimize/peephole.d.ts.map +1 -0
- package/dist/optimize/peephole.js +254 -0
- package/dist/optimize/remap.d.ts +2 -0
- package/dist/optimize/remap.d.ts.map +1 -1
- package/dist/optimize/remap.js +2 -0
- package/dist/optimize/rewrite.d.ts +13 -8
- package/dist/optimize/rewrite.d.ts.map +1 -1
- package/dist/optimize/rewrite.js +13 -8
- package/dist/plan/cache.d.ts +9 -3
- package/dist/plan/cache.d.ts.map +1 -1
- package/dist/plan/cache.js +21 -5
- package/dist/plan/index.d.ts +2 -0
- package/dist/plan/index.d.ts.map +1 -1
- package/dist/plan/index.js +2 -0
- package/dist/plan/predicate.d.ts +2 -0
- package/dist/plan/predicate.d.ts.map +1 -1
- package/dist/plan/predicate.js +268 -29
- package/dist/plan/schema-predicate.d.ts +6 -0
- package/dist/plan/schema-predicate.d.ts.map +1 -1
- package/dist/plan/schema-predicate.js +117 -13
- package/dist/plan/types.d.ts +2 -0
- package/dist/plan/types.d.ts.map +1 -1
- package/dist/plan/types.js +2 -0
- package/dist/result/index.d.ts +19 -5
- package/dist/result/index.d.ts.map +1 -1
- package/dist/result/index.js +10 -2
- package/dist/schema/common.d.ts +69 -6
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +104 -10
- package/dist/schema/freeze.d.ts +4 -0
- package/dist/schema/freeze.d.ts.map +1 -1
- package/dist/schema/freeze.js +18 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +3 -0
- package/dist/schema/lazy.d.ts +4 -0
- package/dist/schema/lazy.d.ts.map +1 -1
- package/dist/schema/lazy.js +4 -0
- package/dist/schema/literal.d.ts +7 -1
- package/dist/schema/literal.d.ts.map +1 -1
- package/dist/schema/literal.js +7 -1
- package/dist/schema/types.d.ts +20 -96
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +5 -1
- package/dist/schema/undefined.d.ts +17 -0
- package/dist/schema/undefined.d.ts.map +1 -0
- package/dist/schema/undefined.js +72 -0
- package/dist/schema/validate.d.ts +8 -1
- package/dist/schema/validate.d.ts.map +1 -1
- package/dist/schema/validate.js +146 -55
- package/docs/api.md +57 -0
- package/docs/assets/benchmark-headline.svg +163 -0
- package/docs/engine-notes.md +58 -15
- package/docs/index.html +130 -110
- package/package.json +65 -65
package/dist/ir/types.d.ts
CHANGED
|
@@ -1,54 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file types.ts
|
|
3
3
|
* @brief Sea-of-Nodes graph value model.
|
|
4
|
+
* @details IR helpers preserve Sea-of-Nodes invariants before graphs cross optimizer,
|
|
5
|
+
* compiler, or public introspection boundaries.
|
|
4
6
|
*/
|
|
5
|
-
import { NodeTag } from "../kind/index.js";
|
|
7
|
+
import { NodeTag, type ObjectModeTag, type PresenceTag } from "../kind/index.js";
|
|
6
8
|
import type { LiteralValue, Schema } from "../schema/index.js";
|
|
7
9
|
/**
|
|
8
|
-
* @brief
|
|
10
|
+
* @brief Dense index into Graph.nodes.
|
|
11
|
+
* @details Node ids are arena-local and may change after graph rewrites.
|
|
9
12
|
*/
|
|
10
13
|
export type NodeId = number;
|
|
14
|
+
export type GraphNode = StartNode | ParamNode | ConstNode | GetPropNode | UnaryPredicateNode | EqualsNode | NumericCompareNode | StringBoundNode | RegexNode | HasOwnNode | HasOwnDataNode | StrictKeysNode | ArrayEveryNode | TupleItemsNode | RecordEveryNode | DiscriminantDispatchNode | ObjectShapeNode | UnionDispatchNode | PrimitiveUnionNode | SchemaCheckNode | BooleanFoldNode | ReturnNode;
|
|
11
15
|
/**
|
|
12
|
-
* @brief graph
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @brief graph.
|
|
16
|
+
* @brief Immutable validation graph.
|
|
17
|
+
* @details entry is the control anchor, result is the boolean value consumed by
|
|
18
|
+
* compiled predicates and introspection tools.
|
|
17
19
|
*/
|
|
18
20
|
export interface Graph {
|
|
19
21
|
readonly nodes: readonly GraphNode[];
|
|
20
22
|
readonly entry: NodeId;
|
|
21
23
|
readonly result: NodeId;
|
|
22
24
|
}
|
|
23
|
-
/**
|
|
24
|
-
* @brief start node.
|
|
25
|
-
*/
|
|
26
25
|
export interface StartNode {
|
|
27
26
|
readonly id: NodeId;
|
|
28
27
|
readonly tag: typeof NodeTag.Start;
|
|
29
28
|
readonly deps: readonly [];
|
|
30
29
|
}
|
|
31
|
-
/**
|
|
32
|
-
* @brief param node.
|
|
33
|
-
*/
|
|
34
30
|
export interface ParamNode {
|
|
35
31
|
readonly id: NodeId;
|
|
36
32
|
readonly tag: typeof NodeTag.Param;
|
|
37
33
|
readonly deps: readonly [];
|
|
38
34
|
readonly name: string;
|
|
39
35
|
}
|
|
40
|
-
/**
|
|
41
|
-
* @brief const node.
|
|
42
|
-
*/
|
|
43
36
|
export interface ConstNode {
|
|
44
37
|
readonly id: NodeId;
|
|
45
38
|
readonly tag: typeof NodeTag.Const;
|
|
46
39
|
readonly deps: readonly [];
|
|
47
40
|
readonly value: LiteralValue;
|
|
48
41
|
}
|
|
49
|
-
/**
|
|
50
|
-
* @brief get prop node.
|
|
51
|
-
*/
|
|
52
42
|
export interface GetPropNode {
|
|
53
43
|
readonly id: NodeId;
|
|
54
44
|
readonly tag: typeof NodeTag.GetProp;
|
|
@@ -56,18 +46,12 @@ export interface GetPropNode {
|
|
|
56
46
|
readonly object: NodeId;
|
|
57
47
|
readonly key: string;
|
|
58
48
|
}
|
|
59
|
-
/**
|
|
60
|
-
* @brief unary predicate node.
|
|
61
|
-
*/
|
|
62
49
|
export interface UnaryPredicateNode {
|
|
63
50
|
readonly id: NodeId;
|
|
64
51
|
readonly tag: typeof NodeTag.IsString | typeof NodeTag.IsNumber | typeof NodeTag.IsBoolean | typeof NodeTag.IsBigInt | typeof NodeTag.IsSymbol | typeof NodeTag.IsObject | typeof NodeTag.IsArray | typeof NodeTag.IsUndefined | typeof NodeTag.IsNull | typeof NodeTag.IsInteger | typeof NodeTag.Not;
|
|
65
52
|
readonly deps: readonly [NodeId];
|
|
66
53
|
readonly value: NodeId;
|
|
67
54
|
}
|
|
68
|
-
/**
|
|
69
|
-
* @brief equals node.
|
|
70
|
-
*/
|
|
71
55
|
export interface EqualsNode {
|
|
72
56
|
readonly id: NodeId;
|
|
73
57
|
readonly tag: typeof NodeTag.Equals;
|
|
@@ -75,9 +59,6 @@ export interface EqualsNode {
|
|
|
75
59
|
readonly left: NodeId;
|
|
76
60
|
readonly right: NodeId;
|
|
77
61
|
}
|
|
78
|
-
/**
|
|
79
|
-
* @brief numeric compare node.
|
|
80
|
-
*/
|
|
81
62
|
export interface NumericCompareNode {
|
|
82
63
|
readonly id: NodeId;
|
|
83
64
|
readonly tag: typeof NodeTag.Gte | typeof NodeTag.Lte;
|
|
@@ -85,9 +66,6 @@ export interface NumericCompareNode {
|
|
|
85
66
|
readonly left: NodeId;
|
|
86
67
|
readonly right: NodeId;
|
|
87
68
|
}
|
|
88
|
-
/**
|
|
89
|
-
* @brief string bound node.
|
|
90
|
-
*/
|
|
91
69
|
export interface StringBoundNode {
|
|
92
70
|
readonly id: NodeId;
|
|
93
71
|
readonly tag: typeof NodeTag.StringMin | typeof NodeTag.StringMax;
|
|
@@ -95,9 +73,6 @@ export interface StringBoundNode {
|
|
|
95
73
|
readonly value: NodeId;
|
|
96
74
|
readonly bound: number;
|
|
97
75
|
}
|
|
98
|
-
/**
|
|
99
|
-
* @brief regex node.
|
|
100
|
-
*/
|
|
101
76
|
export interface RegexNode {
|
|
102
77
|
readonly id: NodeId;
|
|
103
78
|
readonly tag: typeof NodeTag.Regex;
|
|
@@ -106,9 +81,6 @@ export interface RegexNode {
|
|
|
106
81
|
readonly regex: RegExp;
|
|
107
82
|
readonly name: string;
|
|
108
83
|
}
|
|
109
|
-
/**
|
|
110
|
-
* @brief has own node.
|
|
111
|
-
*/
|
|
112
84
|
export interface HasOwnNode {
|
|
113
85
|
readonly id: NodeId;
|
|
114
86
|
readonly tag: typeof NodeTag.HasOwn;
|
|
@@ -116,9 +88,6 @@ export interface HasOwnNode {
|
|
|
116
88
|
readonly object: NodeId;
|
|
117
89
|
readonly key: string;
|
|
118
90
|
}
|
|
119
|
-
/**
|
|
120
|
-
* @brief has own data node.
|
|
121
|
-
*/
|
|
122
91
|
export interface HasOwnDataNode {
|
|
123
92
|
readonly id: NodeId;
|
|
124
93
|
readonly tag: typeof NodeTag.HasOwnData;
|
|
@@ -126,9 +95,6 @@ export interface HasOwnDataNode {
|
|
|
126
95
|
readonly object: NodeId;
|
|
127
96
|
readonly key: string;
|
|
128
97
|
}
|
|
129
|
-
/**
|
|
130
|
-
* @brief strict keys node.
|
|
131
|
-
*/
|
|
132
98
|
export interface StrictKeysNode {
|
|
133
99
|
readonly id: NodeId;
|
|
134
100
|
readonly tag: typeof NodeTag.StrictKeys;
|
|
@@ -137,7 +103,9 @@ export interface StrictKeysNode {
|
|
|
137
103
|
readonly keys: readonly string[];
|
|
138
104
|
}
|
|
139
105
|
/**
|
|
140
|
-
* @brief array
|
|
106
|
+
* @brief Homogeneous array loop with a lowered child graph for each item.
|
|
107
|
+
* @details The original schema is retained for diagnostics and opaque fallback;
|
|
108
|
+
* boolean compilation consumes itemGraph first.
|
|
141
109
|
*/
|
|
142
110
|
export interface ArrayEveryNode {
|
|
143
111
|
readonly id: NodeId;
|
|
@@ -145,9 +113,12 @@ export interface ArrayEveryNode {
|
|
|
145
113
|
readonly deps: readonly [NodeId];
|
|
146
114
|
readonly value: NodeId;
|
|
147
115
|
readonly item: Schema;
|
|
116
|
+
readonly itemGraph: Graph;
|
|
148
117
|
}
|
|
149
118
|
/**
|
|
150
|
-
* @brief tuple
|
|
119
|
+
* @brief Fixed-index tuple check with one child graph per item.
|
|
120
|
+
* @details Codegen can emit straight-line descriptor reads because the item
|
|
121
|
+
* count is known at lowering time.
|
|
151
122
|
*/
|
|
152
123
|
export interface TupleItemsNode {
|
|
153
124
|
readonly id: NodeId;
|
|
@@ -155,9 +126,12 @@ export interface TupleItemsNode {
|
|
|
155
126
|
readonly deps: readonly [NodeId];
|
|
156
127
|
readonly value: NodeId;
|
|
157
128
|
readonly items: readonly Schema[];
|
|
129
|
+
readonly itemGraphs: readonly Graph[];
|
|
158
130
|
}
|
|
159
131
|
/**
|
|
160
|
-
* @brief record
|
|
132
|
+
* @brief Own-key record loop with a lowered graph for each value.
|
|
133
|
+
* @details The loop must skip inherited enumerable properties even when user
|
|
134
|
+
* input has a hostile prototype.
|
|
161
135
|
*/
|
|
162
136
|
export interface RecordEveryNode {
|
|
163
137
|
readonly id: NodeId;
|
|
@@ -165,13 +139,13 @@ export interface RecordEveryNode {
|
|
|
165
139
|
readonly deps: readonly [NodeId];
|
|
166
140
|
readonly value: NodeId;
|
|
167
141
|
readonly item: Schema;
|
|
142
|
+
readonly itemGraph: Graph;
|
|
168
143
|
}
|
|
169
|
-
/**
|
|
170
|
-
* @brief discriminant dispatch lookup.
|
|
171
|
-
*/
|
|
172
144
|
export type DiscriminantDispatchLookup = Readonly<Record<string, number>>;
|
|
173
145
|
/**
|
|
174
|
-
* @brief
|
|
146
|
+
* @brief Object union dispatch keyed by one literal property.
|
|
147
|
+
* @details The lookup table lets codegen choose a branch before validating the
|
|
148
|
+
* whole object, avoiding linear scans on tagged unions.
|
|
175
149
|
*/
|
|
176
150
|
export interface DiscriminantDispatchNode {
|
|
177
151
|
readonly id: NodeId;
|
|
@@ -181,10 +155,72 @@ export interface DiscriminantDispatchNode {
|
|
|
181
155
|
readonly key: string;
|
|
182
156
|
readonly literals: readonly string[];
|
|
183
157
|
readonly schemas: readonly Schema[];
|
|
158
|
+
readonly graphs: readonly Graph[];
|
|
184
159
|
readonly lookup: DiscriminantDispatchLookup;
|
|
185
160
|
}
|
|
186
161
|
/**
|
|
187
|
-
* @brief schema
|
|
162
|
+
* @brief Object field schema paired with its lowered validation graph.
|
|
163
|
+
* @details Presence is stored beside the graph so object compilation can choose
|
|
164
|
+
* between required fast paths and optional descriptor checks.
|
|
165
|
+
*/
|
|
166
|
+
export interface ObjectShapeEntry {
|
|
167
|
+
readonly key: string;
|
|
168
|
+
readonly schema: Schema;
|
|
169
|
+
readonly graph: Graph;
|
|
170
|
+
readonly presence: PresenceTag;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* @brief Structured object check after lowering a declared shape.
|
|
174
|
+
* @details allRequired enables strict object fast paths that avoid optional
|
|
175
|
+
* property branching when every field must exist.
|
|
176
|
+
*/
|
|
177
|
+
export interface ObjectShapeNode {
|
|
178
|
+
readonly id: NodeId;
|
|
179
|
+
readonly tag: typeof NodeTag.ObjectShape;
|
|
180
|
+
readonly deps: readonly [NodeId];
|
|
181
|
+
readonly value: NodeId;
|
|
182
|
+
readonly entries: readonly ObjectShapeEntry[];
|
|
183
|
+
readonly keys: readonly string[];
|
|
184
|
+
readonly mode: ObjectModeTag;
|
|
185
|
+
readonly allRequired: boolean;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* @brief Bit mask of possible root JavaScript kinds for a union arm.
|
|
189
|
+
* @details IR helpers preserve Sea-of-Nodes invariants before graphs cross optimizer,
|
|
190
|
+
* compiler, or public introspection boundaries.
|
|
191
|
+
*/
|
|
192
|
+
export type UnionDispatchMask = number;
|
|
193
|
+
/**
|
|
194
|
+
* @brief General union dispatch with coarse root-kind partitioning.
|
|
195
|
+
* @details Masks let codegen skip arms whose root type cannot match before
|
|
196
|
+
* entering their child graphs.
|
|
197
|
+
*/
|
|
198
|
+
export interface UnionDispatchNode {
|
|
199
|
+
readonly id: NodeId;
|
|
200
|
+
readonly tag: typeof NodeTag.UnionDispatch;
|
|
201
|
+
readonly deps: readonly [NodeId];
|
|
202
|
+
readonly value: NodeId;
|
|
203
|
+
readonly options: readonly Schema[];
|
|
204
|
+
readonly graphs: readonly Graph[];
|
|
205
|
+
readonly masks: readonly UnionDispatchMask[];
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @brief Union specialized to primitive arms only.
|
|
209
|
+
* @details This node avoids object/array bookkeeping and emits a compact
|
|
210
|
+
* typeof/switch style predicate.
|
|
211
|
+
*/
|
|
212
|
+
export interface PrimitiveUnionNode {
|
|
213
|
+
readonly id: NodeId;
|
|
214
|
+
readonly tag: typeof NodeTag.PrimitiveUnion;
|
|
215
|
+
readonly deps: readonly [NodeId];
|
|
216
|
+
readonly value: NodeId;
|
|
217
|
+
readonly graphs: readonly Graph[];
|
|
218
|
+
readonly masks: readonly UnionDispatchMask[];
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* @brief Opaque schema fallback retained when lowering cannot express a rule.
|
|
222
|
+
* @details New optimizations should reduce the number of SchemaCheck nodes on
|
|
223
|
+
* hot paths, not teach consumers to reinterpret arbitrary schema trees.
|
|
188
224
|
*/
|
|
189
225
|
export interface SchemaCheckNode {
|
|
190
226
|
readonly id: NodeId;
|
|
@@ -194,7 +230,9 @@ export interface SchemaCheckNode {
|
|
|
194
230
|
readonly schema: Schema;
|
|
195
231
|
}
|
|
196
232
|
/**
|
|
197
|
-
* @brief boolean
|
|
233
|
+
* @brief Variadic boolean combiner.
|
|
234
|
+
* @details Optimization passes flatten nested folds so codegen can emit one
|
|
235
|
+
* predictable branch chain.
|
|
198
236
|
*/
|
|
199
237
|
export interface BooleanFoldNode {
|
|
200
238
|
readonly id: NodeId;
|
|
@@ -202,9 +240,6 @@ export interface BooleanFoldNode {
|
|
|
202
240
|
readonly deps: readonly NodeId[];
|
|
203
241
|
readonly values: readonly NodeId[];
|
|
204
242
|
}
|
|
205
|
-
/**
|
|
206
|
-
* @brief return node.
|
|
207
|
-
*/
|
|
208
243
|
export interface ReturnNode {
|
|
209
244
|
readonly id: NodeId;
|
|
210
245
|
readonly tag: typeof NodeTag.Return;
|
package/dist/ir/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ir/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ir/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,SAAS,GACf,SAAS,GACT,SAAS,GACT,SAAS,GACT,WAAW,GACX,kBAAkB,GAClB,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,SAAS,GACT,UAAU,GACV,cAAc,GACd,cAAc,GACd,cAAc,GACd,cAAc,GACd,eAAe,GACf,wBAAwB,GACxB,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,eAAe,GACf,UAAU,CAAC;AAEjB;;;;GAIG;AACH,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC;IACnC,QAAQ,CAAC,I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 -1,10 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file validate.ts
|
|
3
3
|
* @brief Runtime validation for graph objects.
|
|
4
|
+
* @details Graph validation protects optimizer and compiler passes before they assume dense
|
|
5
|
+
* node ids and valid dependency edges.
|
|
4
6
|
*/
|
|
5
7
|
import type { Graph } from "./types.js";
|
|
6
8
|
/**
|
|
7
|
-
* @brief
|
|
9
|
+
* @brief Validate an unknown value as a frozen-style Sea-of-Nodes graph.
|
|
10
|
+
* @param value Candidate graph object supplied to graph consumers.
|
|
11
|
+
* @returns True when the full graph has a dense arena and well-formed nodes.
|
|
12
|
+
* @details Graph objects can cross public introspection boundaries. Validation
|
|
13
|
+
* therefore rejects accessors, sparse arrays, and prototype-backed fields before
|
|
14
|
+
* optimization or freezing reads graph metadata.
|
|
8
15
|
*/
|
|
9
16
|
export declare function isGraphValue(value: unknown): value is Graph;
|
|
10
17
|
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/ir/validate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/ir/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,KAAK,EAAqB,MAAM,YAAY,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAE3D"}
|