@eagleoutice/flowr 2.8.14 → 2.9.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/README.md +25 -26
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +4 -3
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -3
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +2 -1
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +4 -3
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +13 -10
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +7 -6
- package/abstract-interpretation/data-frame/resolve-args.js +2 -1
- package/benchmark/slicer.d.ts +0 -16
- package/benchmark/slicer.js +0 -47
- package/benchmark/stats/print.js +0 -6
- package/benchmark/stats/stats.d.ts +0 -3
- package/benchmark/summarizer/second-phase/process.js +0 -6
- package/cli/benchmark-app.d.ts +0 -1
- package/cli/benchmark-app.js +0 -1
- package/cli/benchmark-helper-app.d.ts +0 -1
- package/cli/benchmark-helper-app.js +1 -5
- package/cli/common/options.d.ts +0 -10
- package/cli/common/options.js +0 -2
- package/cli/common/scripts-info.d.ts +0 -10
- package/cli/repl/server/connection.js +1 -1
- package/config.d.ts +0 -15
- package/config.js +0 -21
- package/control-flow/cfg-dead-code.js +0 -3
- package/control-flow/extract-cfg.js +5 -1
- package/control-flow/semantic-cfg-guided-visitor.d.ts +7 -0
- package/control-flow/semantic-cfg-guided-visitor.js +11 -4
- package/dataflow/cluster.js +2 -2
- package/dataflow/environments/built-in-config.d.ts +1 -0
- package/dataflow/environments/built-in.d.ts +9 -3
- package/dataflow/environments/built-in.js +15 -7
- package/dataflow/environments/default-builtin-config.d.ts +10 -1
- package/dataflow/environments/default-builtin-config.js +6 -4
- package/dataflow/environments/define.d.ts +4 -11
- package/dataflow/environments/define.js +16 -96
- package/dataflow/environments/diff.js +3 -2
- package/dataflow/environments/environment.d.ts +17 -6
- package/dataflow/environments/environment.js +69 -18
- package/dataflow/environments/identifier.d.ts +92 -6
- package/dataflow/environments/identifier.js +159 -1
- package/dataflow/environments/reference-to-maybe.js +1 -1
- package/dataflow/environments/resolve-by-name.d.ts +4 -4
- package/dataflow/environments/resolve-by-name.js +24 -8
- package/dataflow/eval/resolve/resolve.d.ts +10 -6
- package/dataflow/eval/resolve/resolve.js +12 -7
- package/dataflow/extractor.js +6 -3
- package/dataflow/fn/exceptions-of-function.d.ts +3 -1
- package/dataflow/fn/exceptions-of-function.js +23 -6
- package/dataflow/fn/higher-order-function.js +7 -7
- package/dataflow/graph/call-graph.d.ts +13 -0
- package/dataflow/graph/call-graph.js +46 -20
- package/dataflow/graph/diff-dataflow-graph.js +6 -4
- package/dataflow/graph/edge.d.ts +48 -31
- package/dataflow/graph/edge.js +66 -60
- package/dataflow/graph/graph.d.ts +18 -9
- package/dataflow/graph/graph.js +29 -13
- package/dataflow/graph/quads.js +1 -1
- package/dataflow/graph/resolve-graph.js +1 -1
- package/dataflow/graph/unknown-replacement.d.ts +2 -1
- package/dataflow/graph/vertex.d.ts +2 -103
- package/dataflow/graph/vertex.js +0 -44
- package/dataflow/internal/linker.d.ts +2 -2
- package/dataflow/internal/linker.js +27 -19
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -65
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +4 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +13 -47
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +8 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +1 -69
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +11 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +46 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +0 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +11 -72
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +1 -60
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +3 -1
- package/dataflow/internal/process/functions/call/common.js +4 -16
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +6 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -3
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/process/process-named-call.d.ts +2 -1
- package/dataflow/internal/process/process-named-call.js +0 -1
- package/dataflow/internal/process/process-symbol.d.ts +3 -1
- package/dataflow/internal/process/process-symbol.js +8 -5
- package/dataflow/origin/dfg-get-origin.d.ts +2 -2
- package/dataflow/origin/dfg-get-origin.js +4 -4
- package/dataflow/origin/dfg-get-symbol-refs.js +2 -2
- package/documentation/data/interface/doc-writing-code.d.ts +6 -0
- package/documentation/data/interface/doc-writing-code.js +176 -0
- package/documentation/doc-util/doc-types.d.ts +3 -1
- package/documentation/doc-util/doc-types.js +4 -2
- package/documentation/wiki-absint.js +2 -1
- package/documentation/wiki-analyzer.js +17 -2
- package/documentation/wiki-cfg.js +2 -2
- package/documentation/wiki-dataflow-graph.js +9 -8
- package/documentation/wiki-interface.js +8 -164
- package/documentation/wiki-mk/doc-context.d.ts +12 -1
- package/documentation/wiki-mk/doc-context.js +21 -4
- package/documentation/wiki-normalized-ast.js +5 -0
- package/linter/linter-rules.d.ts +6 -6
- package/linter/rules/absolute-path.js +23 -23
- package/linter/rules/dataframe-access-validation.js +2 -1
- package/linter/rules/deprecated-functions.d.ts +2 -2
- package/linter/rules/deprecated-functions.js +1 -1
- package/linter/rules/function-finder-util.d.ts +3 -3
- package/linter/rules/function-finder-util.js +1 -1
- package/linter/rules/network-functions.d.ts +2 -2
- package/linter/rules/seeded-randomness.d.ts +3 -3
- package/linter/rules/seeded-randomness.js +7 -5
- package/linter/rules/unused-definition.js +4 -4
- package/package.json +5 -5
- package/project/context/flowr-analyzer-context.d.ts +17 -1
- package/project/context/flowr-analyzer-context.js +17 -1
- package/project/context/flowr-analyzer-meta-context.d.ts +51 -0
- package/project/context/flowr-analyzer-meta-context.js +47 -0
- package/project/flowr-analyzer.d.ts +17 -1
- package/project/flowr-analyzer.js +18 -0
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +15 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +26 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +17 -3
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +292 -10
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -2
- package/project/plugins/flowr-analyzer-plugin-defaults.js +2 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +12 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +42 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +2 -2
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +2 -2
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +6 -4
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +4 -4
- package/queries/catalog/dependencies-query/dependencies-query-format.js +5 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +14 -4
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +1 -1
- package/r-bridge/data/data.d.ts +8 -3
- package/r-bridge/data/data.js +9 -3
- package/r-bridge/lang-4.x/ast/model/model.d.ts +0 -11
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +7 -3
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +2 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.d.ts +1 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +12 -13
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +4 -11
- package/reconstruct/reconstruct.js +6 -5
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-filters.js +37 -6
- package/search/search-executor/search-enrichers.d.ts +1 -2
- package/search/search-executor/search-enrichers.js +9 -7
- package/slicing/static/slice-call.js +5 -5
- package/slicing/static/static-slicer.js +2 -2
- package/statistics/features/common-syntax-probability.js +3 -2
- package/statistics/features/supported/defined-functions/defined-functions.js +3 -3
- package/statistics/features/supported/used-functions/used-functions.js +3 -2
- package/util/mermaid/dfg.js +3 -3
- package/util/simple-df/dfg-ascii.js +5 -5
- package/util/version.js +1 -1
- package/util/containers.d.ts +0 -66
- package/util/containers.js +0 -143
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ It offers a wide variety of features, for example:
|
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
27
|
-
flowR repl using flowR v2.8.
|
|
27
|
+
flowR repl using flowR v2.8.15, R grammar v14 (tree-sitter engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -33,13 +33,13 @@ It offers a wide variety of features, for example:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
```text
|
|
36
|
-
Query: linter (
|
|
36
|
+
Query: linter (3 ms)
|
|
37
37
|
╰ Deprecated Functions (deprecated-functions):
|
|
38
|
-
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs:
|
|
38
|
+
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0
|
|
39
39
|
╰ File Path Validity (file-path-validity):
|
|
40
40
|
╰ certain:
|
|
41
41
|
╰ Path `/root/x.txt` at 1.1-23
|
|
42
|
-
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
42
|
+
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 0
|
|
43
43
|
╰ Seeded Randomness (seeded-randomness):
|
|
44
44
|
╰ Metadata: consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 0, processTimeMs: 0
|
|
45
45
|
╰ Absolute Paths (absolute-file-paths):
|
|
@@ -53,12 +53,12 @@ It offers a wide variety of features, for example:
|
|
|
53
53
|
╰ Network Functions (network-functions):
|
|
54
54
|
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
|
|
55
55
|
╰ Dataframe Access Validation (dataframe-access-validation):
|
|
56
|
-
╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs:
|
|
56
|
+
╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 1
|
|
57
57
|
╰ Dead Code (dead-code):
|
|
58
58
|
╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
|
|
59
59
|
╰ Useless Loops (useless-loop):
|
|
60
60
|
╰ Metadata: numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0
|
|
61
|
-
All queries together required ≈
|
|
61
|
+
All queries together required ≈3 ms (1ms accuracy, total 3 ms)
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
|
|
@@ -80,19 +80,19 @@ It offers a wide variety of features, for example:
|
|
|
80
80
|
|
|
81
81
|
_Results (prettified and summarized):_
|
|
82
82
|
|
|
83
|
-
Query: **linter** (
|
|
83
|
+
Query: **linter** (3 ms)\
|
|
84
84
|
╰ **Deprecated Functions** (deprecated-functions):\
|
|
85
85
|
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
86
86
|
╰ **File Path Validity** (file-path-validity):\
|
|
87
87
|
╰ certain:\
|
|
88
88
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
89
|
-
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
89
|
+
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
90
90
|
╰ **Seeded Randomness** (seeded-randomness):\
|
|
91
91
|
╰ _Metadata_: <code>consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
92
92
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
93
93
|
╰ certain:\
|
|
94
94
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
95
|
-
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
95
|
+
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
96
96
|
╰ **Unused Definitions** (unused-definitions):\
|
|
97
97
|
╰ _Metadata_: <code>totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
98
98
|
╰ **Naming Convention** (naming-convention):\
|
|
@@ -102,14 +102,14 @@ It offers a wide variety of features, for example:
|
|
|
102
102
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
103
103
|
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
104
104
|
╰ **Dead Code** (dead-code):\
|
|
105
|
-
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs:
|
|
105
|
+
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
106
106
|
╰ **Useless Loops** (useless-loop):\
|
|
107
107
|
╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
108
|
-
_All queries together required ≈
|
|
108
|
+
_All queries together required ≈3 ms (1ms accuracy, total 3 ms)_
|
|
109
109
|
|
|
110
110
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
111
111
|
|
|
112
|
-
The analysis required
|
|
112
|
+
The analysis required _2.8 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
113
113
|
|
|
114
114
|
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
|
|
115
115
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -149,8 +149,8 @@ It offers a wide variety of features, for example:
|
|
|
149
149
|
"totalUnknown": 0,
|
|
150
150
|
"totalWritesBeforeAlways": 0,
|
|
151
151
|
"totalValid": 0,
|
|
152
|
-
"searchTimeMs":
|
|
153
|
-
"processTimeMs":
|
|
152
|
+
"searchTimeMs": 1,
|
|
153
|
+
"processTimeMs": 0
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
156
|
"seeded-randomness": {
|
|
@@ -181,7 +181,7 @@ It offers a wide variety of features, for example:
|
|
|
181
181
|
".meta": {
|
|
182
182
|
"totalConsidered": 1,
|
|
183
183
|
"totalUnknown": 0,
|
|
184
|
-
"searchTimeMs":
|
|
184
|
+
"searchTimeMs": 1,
|
|
185
185
|
"processTimeMs": 0
|
|
186
186
|
}
|
|
187
187
|
},
|
|
@@ -225,7 +225,7 @@ It offers a wide variety of features, for example:
|
|
|
225
225
|
"results": [],
|
|
226
226
|
".meta": {
|
|
227
227
|
"consideredNodes": 5,
|
|
228
|
-
"searchTimeMs":
|
|
228
|
+
"searchTimeMs": 1,
|
|
229
229
|
"processTimeMs": 0
|
|
230
230
|
}
|
|
231
231
|
},
|
|
@@ -239,11 +239,11 @@ It offers a wide variety of features, for example:
|
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
241
|
".meta": {
|
|
242
|
-
"timing":
|
|
242
|
+
"timing": 3
|
|
243
243
|
}
|
|
244
244
|
},
|
|
245
245
|
".meta": {
|
|
246
|
-
"timing":
|
|
246
|
+
"timing": 3
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
```
|
|
@@ -308,7 +308,7 @@ It offers a wide variety of features, for example:
|
|
|
308
308
|
|
|
309
309
|
```shell
|
|
310
310
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
311
|
-
flowR repl using flowR v2.8.
|
|
311
|
+
flowR repl using flowR v2.8.15, R grammar v14 (tree-sitter engine)
|
|
312
312
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
313
313
|
```
|
|
314
314
|
|
|
@@ -322,7 +322,7 @@ It offers a wide variety of features, for example:
|
|
|
322
322
|
N <- 10
|
|
323
323
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
324
324
|
sum
|
|
325
|
-
All queries together required ≈
|
|
325
|
+
All queries together required ≈3 ms (1ms accuracy, total 4 ms)
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
|
|
@@ -338,7 +338,7 @@ It offers a wide variety of features, for example:
|
|
|
338
338
|
|
|
339
339
|
|
|
340
340
|
* 📚 **dependency analysis**\
|
|
341
|
-
Given your analysis project, flowR offers a plethora of so-called [queries](https://github.com/flowr-analysis/flowr/wiki/query-api) to get more information about your code.
|
|
341
|
+
Given your analysis project, flowR offers a plethora of so-called [queries](https://github.com/flowr-analysis/flowr/wiki/wiki/query-api) to get more information about your code.
|
|
342
342
|
An important query is the [dependencies query](https://github.com/flowr-analysis/flowr/wiki/Query-API#dependencies-query), which shows you the library your project needs,
|
|
343
343
|
the data files it reads, the scripts it sources, and the data it outputs.
|
|
344
344
|
|
|
@@ -356,9 +356,9 @@ It offers a wide variety of features, for example:
|
|
|
356
356
|
|
|
357
357
|
|
|
358
358
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
359
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
359
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">118.7 ms</span></i> (as of Jan 30, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
360
360
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
361
|
-
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) for more details on the dataflow graphs as well as call graphs.
|
|
361
|
+
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/wiki/dataflow-graph) for more details on the dataflow graphs as well as call graphs.
|
|
362
362
|
|
|
363
363
|
|
|
364
364
|
<details><summary>Example: Generating a dataflow graph with flowR</summary>
|
|
@@ -392,7 +392,7 @@ It offers a wide variety of features, for example:
|
|
|
392
392
|
|
|
393
393
|
```shell
|
|
394
394
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
395
|
-
flowR repl using flowR v2.8.
|
|
395
|
+
flowR repl using flowR v2.8.15, R grammar v14 (tree-sitter engine)
|
|
396
396
|
R> :dataflow* test/testfiles/example.R
|
|
397
397
|
```
|
|
398
398
|
|
|
@@ -402,7 +402,6 @@ It offers a wide variety of features, for example:
|
|
|
402
402
|
|
|
403
403
|
```text
|
|
404
404
|
https://mermaid.live/view#base64:eyJjb2RlIjoiZmxvd2NoYXJ0IEJUXG4gICAgMChbXCJgIzkxO1JTeW1ib2wjOTM7IHRlc3RcbiAgICAgICgwKVxuICAgICAgKjEuMS00KmBcIl0pXG4gICAgMShbXCJgIzkxO1JTeW1ib2wjOTM7IHRlc3RmaWxlc1xuICAgICAgKDEpXG4gICAgICAqMS42LTE0KmBcIl0pXG4gICAgMltbXCJgIzkxO1JCaW5hcnlPcCM5MzsgL1xuICAgICAgKDIpXG4gICAgICAqMS4xLTE0KlxuICAgICgwLCAxKWBcIl1dXG4gICAgYnVpbHQtaW46X1tcImBCdWlsdC1Jbjpcbi9gXCJdXG4gICAgc3R5bGUgYnVpbHQtaW46XyBzdHJva2U6Z3JheSxmaWxsOmdyYXksc3Ryb2tlLXdpZHRoOjJweCxvcGFjaXR5Oi44O1xuICAgIDMoW1wiYCM5MTtSU3ltYm9sIzkzOyBleGFtcGxlLlJcbiAgICAgICgzKVxuICAgICAgKjEuMTYtMjQqYFwiXSlcbiAgICA0W1tcImAjOTE7UkJpbmFyeU9wIzkzOyAvXG4gICAgICAoNClcbiAgICAgICoxLjEtMjQqXG4gICAgKDIsIDMpYFwiXV1cbiAgICAyIC0tPnxcInJlYWRzLCBhcmd1bWVudFwifCAwXG4gICAgMiAtLT58XCJyZWFkcywgYXJndW1lbnRcInwgMVxuICAgIDIgLS4tPnxcInJlYWRzLCBjYWxsc1wifCBidWlsdC1pbjpfXG4gICAgbGlua1N0eWxlIDIgc3Ryb2tlOmdyYXk7XG4gICAgNCAtLT58XCJyZWFkcywgYXJndW1lbnRcInwgMlxuICAgIDQgLS0+fFwicmVhZHMsIGFyZ3VtZW50XCJ8IDNcbiAgICA0IC0uLT58XCJyZWFkcywgY2FsbHNcInwgYnVpbHQtaW46X1xuICAgIGxpbmtTdHlsZSA1IHN0cm9rZTpncmF5OyIsIm1lcm1haWQiOnsiYXV0b1N5bmMiOnRydWV9fQ==
|
|
405
|
-
Copied mermaid url to clipboard (dataflow: 0ms).
|
|
406
405
|
```
|
|
407
406
|
|
|
408
407
|
|
|
@@ -698,7 +697,7 @@ It offers a wide variety of features, for example:
|
|
|
698
697
|
```
|
|
699
698
|
|
|
700
699
|
|
|
701
|
-
(The analysis required _1.
|
|
700
|
+
(The analysis required _1.9 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
702
701
|
|
|
703
702
|
|
|
704
703
|
|
|
@@ -6,9 +6,10 @@ import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/pro
|
|
|
6
6
|
import type { DataFrameOperations, DataFrameShapeInferenceVisitor } from '../shape-inference';
|
|
7
7
|
/**
|
|
8
8
|
* Maps a concrete data frame access operation to abstract data frame operations.
|
|
9
|
-
* @param node
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
9
|
+
* @param node - The R node of the access
|
|
10
|
+
* @param inference - The data frame shape inference visitor
|
|
11
|
+
* @param dfg - The data flow graph for resolving the arguments
|
|
12
|
+
* @param ctx - The current flowR analyzer context
|
|
12
13
|
* @returns The mapped abstract data frame operations for the access operation, or `undefined` if the node does not represent a data frame access operation
|
|
13
14
|
*/
|
|
14
15
|
export declare function mapDataFrameAccess(node: RNode<ParentInformation>, inference: DataFrameShapeInferenceVisitor, dfg: DataflowGraph, ctx: ReadOnlyFlowrAnalyzerContext): DataFrameOperations;
|
|
@@ -16,9 +16,10 @@ const SpecialAccessArgumentsMapper = {
|
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Maps a concrete data frame access operation to abstract data frame operations.
|
|
19
|
-
* @param node
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
19
|
+
* @param node - The R node of the access
|
|
20
|
+
* @param inference - The data frame shape inference visitor
|
|
21
|
+
* @param dfg - The data flow graph for resolving the arguments
|
|
22
|
+
* @param ctx - The current flowR analyzer context
|
|
22
23
|
* @returns The mapped abstract data frame operations for the access operation, or `undefined` if the node does not represent a data frame access operation
|
|
23
24
|
*/
|
|
24
25
|
function mapDataFrameAccess(node, inference, dfg, ctx) {
|
|
@@ -8,6 +8,7 @@ import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/pro
|
|
|
8
8
|
import { RNull } from '../../../r-bridge/lang-4.x/convert-values';
|
|
9
9
|
import type { RParseRequest } from '../../../r-bridge/retriever';
|
|
10
10
|
import type { DataFrameShapeInferenceVisitor } from '../shape-inference';
|
|
11
|
+
import { Identifier } from '../../../dataflow/environments/identifier';
|
|
11
12
|
/**
|
|
12
13
|
* The location of a function parameter for mapping function call arguments to function parameters.
|
|
13
14
|
* - `pos` contains the position of the function parameter (use `-1` for non-existent or non-positional arguments)
|
|
@@ -72,7 +73,7 @@ export declare function getFunctionArguments(node: RFunctionCall<ParentInformati
|
|
|
72
73
|
* @param dfg - The data flow graph for checking the outgoing edges
|
|
73
74
|
* @returns The name of all unresolved symbols in the expression
|
|
74
75
|
*/
|
|
75
|
-
export declare function getUnresolvedSymbolsInExpression(expression: RNode<ParentInformation> | typeof EmptyArgument | undefined, dfg?: DataflowGraph):
|
|
76
|
+
export declare function getUnresolvedSymbolsInExpression(expression: RNode<ParentInformation> | typeof EmptyArgument | undefined, dfg?: DataflowGraph): Identifier[];
|
|
76
77
|
/**
|
|
77
78
|
* Checks whether a list of arguments contains any critical argument.
|
|
78
79
|
* @param args - The list of arguments to check
|
|
@@ -22,6 +22,7 @@ const convert_values_1 = require("../../../r-bridge/lang-4.x/convert-values");
|
|
|
22
22
|
const assert_1 = require("../../../util/assert");
|
|
23
23
|
const files_1 = require("../../../util/files");
|
|
24
24
|
const resolve_args_1 = require("../resolve-args");
|
|
25
|
+
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
25
26
|
/** Regular expression representing valid columns names, e.g. for `data.frame` */
|
|
26
27
|
const ColNamesRegex = /^[A-Za-z.][A-Za-z0-9_.]*$/;
|
|
27
28
|
/** Regular expression representing line terminations (LF, CRLF, CR) */
|
|
@@ -136,7 +137,7 @@ function getUnresolvedSymbolsInExpression(expression, dfg) {
|
|
|
136
137
|
if (node.type === type_1.RType.Symbol) {
|
|
137
138
|
const vertex = dfg.get(node.info.id);
|
|
138
139
|
if ((0, vertex_1.isUseVertex)(vertex?.[0]) && vertex[1].size === 0) {
|
|
139
|
-
unresolvedSymbols.push((
|
|
140
|
+
unresolvedSymbols.push(identifier_1.Identifier.mapName(node.content, resolve_args_1.unquoteArgument));
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
});
|
|
@@ -179,9 +179,10 @@ declare const DataFrameFunctionMapper: {
|
|
|
179
179
|
type DataFrameFunction = keyof typeof DataFrameFunctionMapper;
|
|
180
180
|
/**
|
|
181
181
|
* Maps a concrete data frame function call to abstract data frame operations.
|
|
182
|
-
* @param node
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
182
|
+
* @param node - The R node of the function call
|
|
183
|
+
* @param inference - The data frame shape inference visitor
|
|
184
|
+
* @param dfg - The data flow graph for resolving the arguments
|
|
185
|
+
* @param ctx - The current flowR analyzer context
|
|
185
186
|
* @returns The mapped abstract data frame operations for the function call, or `undefined` if the node does not represent a data frame function call
|
|
186
187
|
*/
|
|
187
188
|
export declare function mapDataFrameFunctionCall<Name extends DataFrameFunction>(node: RNode<ParentInformation>, inference: DataFrameShapeInferenceVisitor, dfg: DataflowGraph, ctx: ReadOnlyFlowrAnalyzerContext): DataFrameOperations;
|
|
@@ -11,6 +11,7 @@ const assert_1 = require("../../../util/assert");
|
|
|
11
11
|
const dataframe_domain_1 = require("../dataframe-domain");
|
|
12
12
|
const resolve_args_1 = require("../resolve-args");
|
|
13
13
|
const arguments_1 = require("./arguments");
|
|
14
|
+
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
14
15
|
/**
|
|
15
16
|
* Represents the different types of data frames in R
|
|
16
17
|
*/
|
|
@@ -517,9 +518,10 @@ const DataFrameFunctionParamsMapper = {
|
|
|
517
518
|
};
|
|
518
519
|
/**
|
|
519
520
|
* Maps a concrete data frame function call to abstract data frame operations.
|
|
520
|
-
* @param node
|
|
521
|
-
* @param
|
|
522
|
-
* @param
|
|
521
|
+
* @param node - The R node of the function call
|
|
522
|
+
* @param inference - The data frame shape inference visitor
|
|
523
|
+
* @param dfg - The data flow graph for resolving the arguments
|
|
524
|
+
* @param ctx - The current flowR analyzer context
|
|
523
525
|
* @returns The mapped abstract data frame operations for the function call, or `undefined` if the node does not represent a data frame function call
|
|
524
526
|
*/
|
|
525
527
|
function mapDataFrameFunctionCall(node, inference, dfg, ctx) {
|
|
@@ -527,8 +529,9 @@ function mapDataFrameFunctionCall(node, inference, dfg, ctx) {
|
|
|
527
529
|
return;
|
|
528
530
|
}
|
|
529
531
|
const resolveInfo = { graph: dfg, idMap: dfg.idMap, full: true, resolve: config_1.VariableResolve.Alias, ctx };
|
|
530
|
-
|
|
531
|
-
|
|
532
|
+
const n = identifier_1.Identifier.getName(node.functionName.content);
|
|
533
|
+
if (isDataFrameFunction(n)) {
|
|
534
|
+
const functionName = n;
|
|
532
535
|
const mapper = DataFrameFunctionMapper[functionName].mapper;
|
|
533
536
|
const params = DataFrameFunctionParamsMapper[functionName];
|
|
534
537
|
const args = (0, arguments_1.getFunctionArguments)(node, dfg);
|
|
@@ -540,7 +543,7 @@ function mapDataFrameFunctionCall(node, inference, dfg, ctx) {
|
|
|
540
543
|
}
|
|
541
544
|
}
|
|
542
545
|
else {
|
|
543
|
-
const mapping = getOtherDataFrameFunction(node.functionName.content);
|
|
546
|
+
const mapping = getOtherDataFrameFunction(identifier_1.Identifier.getName(node.functionName.content));
|
|
544
547
|
if (mapping === undefined) {
|
|
545
548
|
return;
|
|
546
549
|
}
|
|
@@ -841,7 +844,7 @@ function mapDataFrameFilter(args, params, inference, info) {
|
|
|
841
844
|
const result = [];
|
|
842
845
|
const filterArgs = args.filter(arg => arg !== dataFrame);
|
|
843
846
|
const filterValues = filterArgs.map(arg => (0, resolve_args_1.resolveIdToArgValue)(arg, info));
|
|
844
|
-
const accessedNames = filterArgs.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph));
|
|
847
|
+
const accessedNames = filterArgs.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph).map(identifier_1.Identifier.getName));
|
|
845
848
|
const condition = filterValues.every(value => typeof value === 'boolean') ? filterValues.every(cond => cond) : undefined;
|
|
846
849
|
if (accessedNames.length > 0) {
|
|
847
850
|
result.push({
|
|
@@ -929,7 +932,7 @@ function mapDataFrameMutate(args, params, inference, info) {
|
|
|
929
932
|
.map(arg => (0, resolve_args_1.resolveIdToArgName)(arg, info));
|
|
930
933
|
// only column names that are not created by mutation are preconditions on the operand
|
|
931
934
|
const accessedNames = mutateArgs
|
|
932
|
-
.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph))
|
|
935
|
+
.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph).map(identifier_1.Identifier.toString))
|
|
933
936
|
.filter(arg => !mutatedCols?.includes(arg));
|
|
934
937
|
deletedCols = (0, arguments_1.filterValidNames)(deletedCols, params.checkNames, params.noDupNames, undefined, true);
|
|
935
938
|
mutatedCols = (0, arguments_1.filterValidNames)(mutatedCols, params.checkNames, params.noDupNames, undefined, true);
|
|
@@ -970,7 +973,7 @@ function mapDataFrameGroupBy(args, params, inference, info) {
|
|
|
970
973
|
}
|
|
971
974
|
const result = [];
|
|
972
975
|
const byArgs = args.filter(arg => arg !== dataFrame);
|
|
973
|
-
const accessedNames = byArgs.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph));
|
|
976
|
+
const accessedNames = byArgs.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph)).map(identifier_1.Identifier.toString);
|
|
974
977
|
const byNames = byArgs.map(arg => (0, arguments_1.isNamedArgument)(arg) ? (0, resolve_args_1.resolveIdToArgName)(arg, info) : (0, resolve_args_1.resolveIdToArgValueSymbolName)(arg, info));
|
|
975
978
|
const mutatedCols = byArgs.some(arguments_1.isNamedArgument) || byNames.some(assert_1.isUndefined);
|
|
976
979
|
if (accessedNames.length > 0) {
|
|
@@ -999,7 +1002,7 @@ function mapDataFrameSummarize(args, params, inference, info) {
|
|
|
999
1002
|
const summarizedCols = summarizeArgs.map(arg => (0, resolve_args_1.resolveIdToArgName)(arg, info));
|
|
1000
1003
|
// only column names that are not created by summarize are preconditions on the operand
|
|
1001
1004
|
const accessedNames = summarizeArgs
|
|
1002
|
-
.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph))
|
|
1005
|
+
.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph).map(identifier_1.Identifier.toString))
|
|
1003
1006
|
.filter(arg => !summarizedCols.includes(arg));
|
|
1004
1007
|
if (accessedNames.length > 0) {
|
|
1005
1008
|
result.push({
|
|
@@ -11,6 +11,7 @@ const resolve_args_1 = require("../resolve-args");
|
|
|
11
11
|
const semantics_1 = require("../semantics");
|
|
12
12
|
const access_mapper_1 = require("./access-mapper");
|
|
13
13
|
const arguments_1 = require("./arguments");
|
|
14
|
+
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
14
15
|
/** Mapper for mapping the supported data frame replacement functions to mapper functions */
|
|
15
16
|
const DataFrameReplacementFunctionMapper = {
|
|
16
17
|
'colnames': mapDataFrameColNamesAssignment,
|
|
@@ -42,9 +43,9 @@ function mapDataFrameReplacementFunction(node, expression, inference, dfg, ctx)
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
else if (node.type === type_1.RType.FunctionCall && node.named && node.arguments.length === 1 && node.arguments[0] !== r_function_call_1.EmptyArgument) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const mapper = DataFrameReplacementFunctionMapper[
|
|
46
|
+
const n = identifier_1.Identifier.getName(node.functionName.content);
|
|
47
|
+
if (isDataFrameReplacement(n)) {
|
|
48
|
+
const mapper = DataFrameReplacementFunctionMapper[n];
|
|
48
49
|
return mapper(node.arguments[0], expression, inference, resolveInfo, parent);
|
|
49
50
|
}
|
|
50
51
|
else {
|
|
@@ -172,7 +173,7 @@ function mapDataFrameColNamesAssignment(operand, expression, inference, info, pa
|
|
|
172
173
|
...(parent !== undefined ? { options: { partial: true } } : {})
|
|
173
174
|
}];
|
|
174
175
|
}
|
|
175
|
-
function mapDataFrameRowNamesAssignment(operand,
|
|
176
|
+
function mapDataFrameRowNamesAssignment(operand, _expression, inference) {
|
|
176
177
|
if (!(0, arguments_1.isDataFrameArgument)(operand, inference)) {
|
|
177
178
|
return;
|
|
178
179
|
}
|
|
@@ -182,7 +183,7 @@ function mapDataFrameRowNamesAssignment(operand, expression, inference) {
|
|
|
182
183
|
type: semantics_1.ConstraintType.OperandModification
|
|
183
184
|
}];
|
|
184
185
|
}
|
|
185
|
-
function mapDataFrameDimNamesAssignment(operand,
|
|
186
|
+
function mapDataFrameDimNamesAssignment(operand, _expression, inference) {
|
|
186
187
|
if (!(0, arguments_1.isDataFrameArgument)(operand, inference)) {
|
|
187
188
|
return;
|
|
188
189
|
}
|
|
@@ -192,7 +193,7 @@ function mapDataFrameDimNamesAssignment(operand, expression, inference) {
|
|
|
192
193
|
colnames: undefined
|
|
193
194
|
}];
|
|
194
195
|
}
|
|
195
|
-
function mapDataFrameUnknownAssignment(operand,
|
|
196
|
+
function mapDataFrameUnknownAssignment(operand, _expression, inference) {
|
|
196
197
|
if (!(0, arguments_1.isDataFrameArgument)(operand, inference)) {
|
|
197
198
|
return;
|
|
198
199
|
}
|
|
@@ -13,6 +13,7 @@ const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
|
13
13
|
const assert_1 = require("../../util/assert");
|
|
14
14
|
const r_value_1 = require("../../util/r-value");
|
|
15
15
|
const strings_1 = require("../../util/text/strings");
|
|
16
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
16
17
|
/**
|
|
17
18
|
* Returns the argument name of a function argument
|
|
18
19
|
*/
|
|
@@ -62,7 +63,7 @@ function resolveIdToArgStringVector(id, info) {
|
|
|
62
63
|
function resolveIdToArgValueSymbolName(id, info) {
|
|
63
64
|
const node = resolveIdToArgument(id, info);
|
|
64
65
|
if (node?.value?.type === type_1.RType.Symbol) {
|
|
65
|
-
return unquoteArgument(node.value.content);
|
|
66
|
+
return unquoteArgument(identifier_1.Identifier.toString(node.value.content));
|
|
66
67
|
}
|
|
67
68
|
else if (node?.value?.type === type_1.RType.String) {
|
|
68
69
|
return node.value.content.str;
|
package/benchmark/slicer.d.ts
CHANGED
|
@@ -75,22 +75,6 @@ export declare class BenchmarkSlicer {
|
|
|
75
75
|
*/
|
|
76
76
|
init(request: RParseRequestFromFile | RParseRequestFromText, config: FlowrConfigOptions, autoSelectIf?: AutoSelectPredicate, threshold?: number): Promise<void>;
|
|
77
77
|
private calculateStatsAfterInit;
|
|
78
|
-
/**
|
|
79
|
-
* Counts the number of stored indices in the dataflow graph created by the pointer analysis.
|
|
80
|
-
*/
|
|
81
|
-
private countStoredVertexIndices;
|
|
82
|
-
/**
|
|
83
|
-
* Counts the number of stored indices in the dataflow graph created by the pointer analysis.
|
|
84
|
-
*/
|
|
85
|
-
private countStoredEnvIndices;
|
|
86
|
-
/**
|
|
87
|
-
* Counts the number of stored indices in the passed definitions.
|
|
88
|
-
*/
|
|
89
|
-
private countStoredIndices;
|
|
90
|
-
/**
|
|
91
|
-
* Recursively counts the number of indices and sub-indices in the given collection.
|
|
92
|
-
*/
|
|
93
|
-
private countIndices;
|
|
94
78
|
/**
|
|
95
79
|
* Slice for the given {@link SlicingCriteria}.
|
|
96
80
|
* @see SingleSlicingCriterion
|
package/benchmark/slicer.js
CHANGED
|
@@ -142,9 +142,6 @@ class BenchmarkSlicer {
|
|
|
142
142
|
}
|
|
143
143
|
return false;
|
|
144
144
|
});
|
|
145
|
-
const storedVertexIndices = this.countStoredVertexIndices();
|
|
146
|
-
const storedEnvIndices = this.countStoredEnvIndices();
|
|
147
|
-
const overwrittenIndices = storedVertexIndices - storedEnvIndices;
|
|
148
145
|
const split = loadedContent.split('\n');
|
|
149
146
|
const nonWhitespace = (0, strings_1.withoutWhitespace)(loadedContent).length;
|
|
150
147
|
this.stats = {
|
|
@@ -169,9 +166,6 @@ class BenchmarkSlicer {
|
|
|
169
166
|
numberOfCalls: numberOfCalls,
|
|
170
167
|
numberOfFunctionDefinitions: numberOfDefinitions,
|
|
171
168
|
sizeOfObject: (0, size_of_1.getSizeOfDfGraph)(this.dataflow.graph),
|
|
172
|
-
storedVertexIndices: storedVertexIndices,
|
|
173
|
-
storedEnvIndices: storedEnvIndices,
|
|
174
|
-
overwrittenIndices: overwrittenIndices,
|
|
175
169
|
},
|
|
176
170
|
// these are all properly initialized in finish()
|
|
177
171
|
commonMeasurements: new Map(),
|
|
@@ -181,47 +175,6 @@ class BenchmarkSlicer {
|
|
|
181
175
|
totalCommonTimePerToken: { raw: 0, normalized: 0 }
|
|
182
176
|
};
|
|
183
177
|
}
|
|
184
|
-
/**
|
|
185
|
-
* Counts the number of stored indices in the dataflow graph created by the pointer analysis.
|
|
186
|
-
*/
|
|
187
|
-
countStoredVertexIndices() {
|
|
188
|
-
return this.countStoredIndices(this.dataflow?.out.map(ref => ref) ?? []);
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Counts the number of stored indices in the dataflow graph created by the pointer analysis.
|
|
192
|
-
*/
|
|
193
|
-
countStoredEnvIndices() {
|
|
194
|
-
return this.countStoredIndices(this.dataflow?.environment.current.memory.values()
|
|
195
|
-
?.flatMap(def => def)
|
|
196
|
-
.map(def => def) ?? []);
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Counts the number of stored indices in the passed definitions.
|
|
200
|
-
*/
|
|
201
|
-
countStoredIndices(definitions) {
|
|
202
|
-
let numberOfIndices = 0;
|
|
203
|
-
for (const reference of definitions) {
|
|
204
|
-
if (reference.indicesCollection) {
|
|
205
|
-
numberOfIndices += this.countIndices(reference.indicesCollection);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return numberOfIndices;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Recursively counts the number of indices and sub-indices in the given collection.
|
|
212
|
-
*/
|
|
213
|
-
countIndices(collection) {
|
|
214
|
-
let numberOfIndices = 0;
|
|
215
|
-
for (const indices of collection ?? []) {
|
|
216
|
-
for (const index of indices.indices) {
|
|
217
|
-
numberOfIndices++;
|
|
218
|
-
if ((0, vertex_1.isParentContainerIndex)(index)) {
|
|
219
|
-
numberOfIndices += this.countIndices(index.subIndices);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return numberOfIndices;
|
|
224
|
-
}
|
|
225
178
|
/**
|
|
226
179
|
* Slice for the given {@link SlicingCriteria}.
|
|
227
180
|
* @see SingleSlicingCriterion
|
package/benchmark/stats/print.js
CHANGED
|
@@ -159,9 +159,6 @@ Dataflow:
|
|
|
159
159
|
Number of edges: ${pad(stats.dataflow.numberOfEdges)}
|
|
160
160
|
Number of calls: ${pad(stats.dataflow.numberOfCalls)}
|
|
161
161
|
Number of function defs: ${pad(stats.dataflow.numberOfFunctionDefinitions)}
|
|
162
|
-
Number of stored Vtx indices: ${pad(stats.dataflow.storedVertexIndices)}
|
|
163
|
-
Number of stored Env indices: ${pad(stats.dataflow.storedEnvIndices)}
|
|
164
|
-
Number of overwritten indices: ${pad(stats.dataflow.overwrittenIndices)}
|
|
165
162
|
Size of graph: ${convertNumberToNiceBytes(stats.dataflow.sizeOfObject)}`;
|
|
166
163
|
if (stats.dataFrameShape !== undefined) {
|
|
167
164
|
result += `
|
|
@@ -261,9 +258,6 @@ Dataflow:
|
|
|
261
258
|
Number of edges: ${formatSummarizedMeasure(stats.dataflow.numberOfEdges)}
|
|
262
259
|
Number of calls: ${formatSummarizedMeasure(stats.dataflow.numberOfCalls)}
|
|
263
260
|
Number of function defs: ${formatSummarizedMeasure(stats.dataflow.numberOfFunctionDefinitions)}
|
|
264
|
-
Number of stored Vtx indices: ${formatSummarizedMeasure(stats.dataflow.storedVertexIndices)}
|
|
265
|
-
Number of stored Env indices: ${formatSummarizedMeasure(stats.dataflow.storedEnvIndices)}
|
|
266
|
-
Number of overwritten indices: ${formatSummarizedMeasure(stats.dataflow.overwrittenIndices)}
|
|
267
261
|
Size of graph: ${formatSummarizedMeasure(stats.dataflow.sizeOfObject, convertNumberToNiceBytes)}`;
|
|
268
262
|
if (stats.dataFrameShape !== undefined) {
|
|
269
263
|
result += `
|
|
@@ -40,9 +40,6 @@ export interface SlicerStatsDataflow<T = number> {
|
|
|
40
40
|
numberOfCalls: T;
|
|
41
41
|
numberOfFunctionDefinitions: T;
|
|
42
42
|
sizeOfObject: T;
|
|
43
|
-
storedVertexIndices: T;
|
|
44
|
-
storedEnvIndices: T;
|
|
45
|
-
overwrittenIndices: T;
|
|
46
43
|
}
|
|
47
44
|
export interface SlicerStatsDfShape<T = number> {
|
|
48
45
|
numberOfDataFrameFiles: T extends number ? 0 | 1 : number;
|
|
@@ -105,9 +105,6 @@ function summarizeAllSummarizedStats(stats) {
|
|
|
105
105
|
numberOfCalls: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.numberOfCalls)),
|
|
106
106
|
numberOfEdges: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.numberOfEdges)),
|
|
107
107
|
sizeOfObject: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.sizeOfObject)),
|
|
108
|
-
storedVertexIndices: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.storedVertexIndices)),
|
|
109
|
-
storedEnvIndices: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.storedEnvIndices)),
|
|
110
|
-
overwrittenIndices: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.overwrittenIndices)),
|
|
111
108
|
},
|
|
112
109
|
dataFrameShape: stats.some(s => s.dataFrameShape !== undefined) ? {
|
|
113
110
|
numberOfDataFrameFiles: (0, arrays_1.arraySum)(stats.map(s => s.dataFrameShape?.numberOfDataFrameFiles).filter(assert_1.isNotUndefined)),
|
|
@@ -192,9 +189,6 @@ function summarizeAllUltimateStats(stats) {
|
|
|
192
189
|
numberOfCalls: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.numberOfCalls)),
|
|
193
190
|
numberOfEdges: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.numberOfEdges)),
|
|
194
191
|
sizeOfObject: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.sizeOfObject)),
|
|
195
|
-
storedVertexIndices: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.storedVertexIndices)),
|
|
196
|
-
storedEnvIndices: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.storedEnvIndices)),
|
|
197
|
-
overwrittenIndices: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.overwrittenIndices)),
|
|
198
192
|
},
|
|
199
193
|
dataFrameShape: stats.some(s => s.dataFrameShape !== undefined) ? {
|
|
200
194
|
numberOfDataFrameFiles: (0, arrays_1.arraySum)(stats.map(s => s.dataFrameShape?.numberOfDataFrameFiles).filter(assert_1.isNotUndefined)),
|
package/cli/benchmark-app.d.ts
CHANGED
package/cli/benchmark-app.js
CHANGED
|
@@ -70,7 +70,6 @@ async function benchmark() {
|
|
|
70
70
|
'--slice', options.slice, ...verboseAdd,
|
|
71
71
|
'--parser', options.parser,
|
|
72
72
|
...(options['dataframe-shape-inference'] ? ['--dataframe-shape-inference'] : []),
|
|
73
|
-
...(options['enable-pointer-tracking'] ? ['--enable-pointer-tracking'] : []),
|
|
74
73
|
'--max-slices', `${options['max-file-slices']}`,
|
|
75
74
|
...(options.threshold ? ['--threshold', `${options.threshold}`] : []),
|
|
76
75
|
'--sampling-strategy', options['sampling-strategy'],
|
|
@@ -38,11 +38,7 @@ async function benchmark() {
|
|
|
38
38
|
if (directory !== '') {
|
|
39
39
|
fs_1.default.mkdirSync(directory, { recursive: true });
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
const config = (0, config_1.amendConfig)((0, config_1.getConfig)(), c => {
|
|
43
|
-
c.solver.pointerTracking = options['enable-pointer-tracking'];
|
|
44
|
-
return c;
|
|
45
|
-
});
|
|
41
|
+
const config = (0, config_1.getConfig)();
|
|
46
42
|
// ensure the file exists
|
|
47
43
|
const fileStat = fs_1.default.statSync(options.input);
|
|
48
44
|
(0, assert_1.guard)(fileStat.isFile(), `File ${options.input} does not exist or is no file`);
|
package/cli/common/options.d.ts
CHANGED
|
@@ -75,11 +75,6 @@ export declare const benchmarkOptions: [{
|
|
|
75
75
|
readonly type: BooleanConstructor;
|
|
76
76
|
readonly description: "Infer the shape of data frames using abstract interpretation (includes control flow graph extraction)";
|
|
77
77
|
readonly defaultValue: false;
|
|
78
|
-
}, {
|
|
79
|
-
readonly name: "enable-pointer-tracking";
|
|
80
|
-
readonly type: BooleanConstructor;
|
|
81
|
-
readonly description: "Run dataflow analysis with pointer tracking";
|
|
82
|
-
readonly defaultValue: false;
|
|
83
78
|
}, {
|
|
84
79
|
readonly name: "max-file-slices";
|
|
85
80
|
readonly type: NumberConstructor;
|
|
@@ -168,11 +163,6 @@ export declare const benchmarkHelperOptions: [{
|
|
|
168
163
|
readonly type: BooleanConstructor;
|
|
169
164
|
readonly description: "Infer the shape of data frames using abstract interpretation (includes control flow graph extraction)";
|
|
170
165
|
readonly defaultValue: false;
|
|
171
|
-
}, {
|
|
172
|
-
readonly name: "enable-pointer-tracking";
|
|
173
|
-
readonly type: BooleanConstructor;
|
|
174
|
-
readonly description: "Run dataflow analysis with pointer tracking";
|
|
175
|
-
readonly defaultValue: false;
|
|
176
166
|
}, {
|
|
177
167
|
readonly name: "max-slices";
|
|
178
168
|
readonly type: NumberConstructor;
|