kumi 0.0.24 → 0.0.25
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/golden/array_element/expected/schema_ruby.rb +1 -1
- data/golden/array_index/expected/schema_ruby.rb +1 -1
- data/golden/array_operations/expected/schema_ruby.rb +1 -1
- data/golden/cascade_logic/expected/lir_02_inlined.txt +8 -8
- data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
- data/golden/chained_fusion/expected/lir_02_inlined.txt +36 -36
- data/golden/chained_fusion/expected/lir_03_cse.txt +23 -23
- data/golden/chained_fusion/expected/lir_04_1_loop_fusion.txt +25 -25
- data/golden/chained_fusion/expected/lir_04_loop_invcm.txt +23 -23
- data/golden/chained_fusion/expected/lir_06_const_prop.txt +23 -23
- data/golden/chained_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/chained_fusion/expected/schema_ruby.rb +28 -28
- data/golden/element_arrays/expected/schema_ruby.rb +1 -1
- data/golden/empty_and_null_inputs/expected/lir_02_inlined.txt +18 -18
- data/golden/empty_and_null_inputs/expected/lir_03_cse.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_1_loop_fusion.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_loop_invcm.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_06_const_prop.txt +17 -17
- data/golden/empty_and_null_inputs/expected/schema_javascript.mjs +13 -13
- data/golden/empty_and_null_inputs/expected/schema_ruby.rb +18 -18
- data/golden/game_of_life/expected/lir_02_inlined.txt +1291 -1291
- data/golden/game_of_life/expected/lir_03_cse.txt +396 -396
- data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +396 -396
- data/golden/game_of_life/expected/lir_04_loop_invcm.txt +396 -396
- data/golden/game_of_life/expected/lir_06_const_prop.txt +396 -396
- data/golden/game_of_life/expected/schema_javascript.mjs +85 -85
- data/golden/game_of_life/expected/schema_ruby.rb +86 -86
- data/golden/hash_keys/expected/schema_ruby.rb +1 -1
- data/golden/hash_value/expected/schema_ruby.rb +1 -1
- data/golden/hierarchical_complex/expected/lir_02_inlined.txt +15 -15
- data/golden/hierarchical_complex/expected/lir_03_cse.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +1 -1
- data/golden/hierarchical_complex/expected/schema_javascript.mjs +1 -1
- data/golden/hierarchical_complex/expected/schema_ruby.rb +2 -2
- data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +1 -1
- data/golden/input_reference/expected/schema_ruby.rb +1 -1
- data/golden/interleaved_fusion/expected/lir_02_inlined.txt +35 -35
- data/golden/interleaved_fusion/expected/lir_03_cse.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +27 -26
- data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +26 -26
- data/golden/interleaved_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/interleaved_fusion/expected/schema_ruby.rb +29 -29
- data/golden/let_inline/expected/schema_ruby.rb +1 -1
- data/golden/loop_fusion/expected/lir_02_inlined.txt +17 -17
- data/golden/loop_fusion/expected/lir_03_cse.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_1_loop_fusion.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_loop_invcm.txt +14 -14
- data/golden/loop_fusion/expected/lir_06_const_prop.txt +14 -14
- data/golden/loop_fusion/expected/schema_javascript.mjs +12 -12
- data/golden/loop_fusion/expected/schema_ruby.rb +16 -16
- data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
- data/golden/mixed_dimensions/expected/lir_02_inlined.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_03_cse.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_1_loop_fusion.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_loop_invcm.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +5 -5
- data/golden/mixed_dimensions/expected/schema_javascript.mjs +3 -3
- data/golden/mixed_dimensions/expected/schema_ruby.rb +6 -6
- data/golden/multirank_hoisting/expected/lir_02_inlined.txt +48 -48
- data/golden/multirank_hoisting/expected/lir_03_cse.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +35 -35
- data/golden/multirank_hoisting/expected/schema_javascript.mjs +34 -34
- data/golden/multirank_hoisting/expected/schema_ruby.rb +36 -36
- data/golden/nested_hash/expected/schema_ruby.rb +1 -1
- data/golden/reduction_broadcast/expected/lir_02_inlined.txt +30 -30
- data/golden/reduction_broadcast/expected/lir_03_cse.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_1_loop_fusion.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_loop_invcm.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_06_const_prop.txt +22 -22
- data/golden/reduction_broadcast/expected/schema_javascript.mjs +18 -18
- data/golden/reduction_broadcast/expected/schema_ruby.rb +23 -23
- data/golden/roll/expected/schema_ruby.rb +1 -1
- data/golden/shift/expected/schema_ruby.rb +1 -1
- data/golden/shift_2d/expected/schema_ruby.rb +1 -1
- data/golden/simple_math/expected/schema_ruby.rb +1 -1
- data/golden/streaming_basics/expected/lir_02_inlined.txt +25 -25
- data/golden/streaming_basics/expected/lir_03_cse.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +13 -13
- data/golden/streaming_basics/expected/lir_06_const_prop.txt +13 -13
- data/golden/streaming_basics/expected/schema_javascript.mjs +13 -13
- data/golden/streaming_basics/expected/schema_ruby.rb +14 -14
- data/golden/tuples/expected/schema_ruby.rb +1 -1
- data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +16 -16
- data/golden/tuples_and_arrays/expected/lir_03_cse.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +13 -13
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +13 -13
- data/golden/tuples_and_arrays/expected/schema_javascript.mjs +13 -13
- data/golden/tuples_and_arrays/expected/schema_ruby.rb +14 -14
- data/golden/us_tax_2024/expected/lir_02_inlined.txt +524 -524
- data/golden/us_tax_2024/expected/lir_03_cse.txt +283 -283
- data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +283 -283
- data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +320 -260
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +320 -260
- data/golden/us_tax_2024/expected/schema_javascript.mjs +24 -24
- data/golden/us_tax_2024/expected/schema_ruby.rb +25 -25
- data/golden/with_constants/expected/schema_ruby.rb +1 -1
- data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +118 -74
- data/lib/kumi/version.rb +1 -1
- metadata +1 -1
@@ -18,32 +18,32 @@
|
|
18
18
|
loop regions id=L3 in %t11 as el=%regions_el_12, idx=%regions_i_13
|
19
19
|
%acc21 = decl_acc :: integer
|
20
20
|
%t22 = load_field regions_el_12["sales"] :: any
|
21
|
-
loop sales id=L4 in %t22 as el=%
|
22
|
-
%
|
23
|
-
%acc21 = acc_add agg.sum(%acc21, %
|
21
|
+
loop sales id=L4 in %t22 as el=%t23, idx=%t24
|
22
|
+
%t25 = load_field t23["amount"] :: integer
|
23
|
+
%acc21 = acc_add agg.sum(%acc21, %t25) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%acc_10 = acc_add agg.sum(%acc_10, %
|
25
|
+
%t26 = acc_load %acc21 :: integer
|
26
|
+
%acc_10 = acc_add agg.sum(%acc_10, %t26) :: integer
|
27
27
|
end_loop
|
28
28
|
%t15 = acc_load %acc_10 :: integer
|
29
29
|
yield %t15
|
30
30
|
)
|
31
31
|
(Declaration adjusted_total
|
32
|
-
%
|
33
|
-
%
|
34
|
-
loop regions id=L5 in %
|
35
|
-
%
|
36
|
-
%
|
37
|
-
loop sales id=L6 in %
|
38
|
-
%
|
39
|
-
%
|
32
|
+
%acc28 = decl_acc :: integer
|
33
|
+
%t29 = load_input "regions" :: array
|
34
|
+
loop regions id=L5 in %t29 as el=%t30, idx=%t31
|
35
|
+
%acc36 = decl_acc :: integer
|
36
|
+
%t37 = load_field t30["sales"] :: any
|
37
|
+
loop sales id=L6 in %t37 as el=%t38, idx=%t39
|
38
|
+
%t40 = load_field t38["amount"] :: integer
|
39
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
40
40
|
end_loop
|
41
|
-
%
|
42
|
-
%
|
41
|
+
%t41 = acc_load %acc36 :: integer
|
42
|
+
%acc28 = acc_add agg.sum(%acc28, %t41) :: integer
|
43
43
|
end_loop
|
44
|
-
%
|
44
|
+
%t33 = acc_load %acc28 :: integer
|
45
45
|
%t17 = load_input "adjustment" :: integer
|
46
|
-
%t18 = call core.add(%
|
46
|
+
%t18 = call core.add(%t33, %t17) :: integer
|
47
47
|
yield %t18
|
48
48
|
)
|
49
49
|
)
|
@@ -18,32 +18,32 @@
|
|
18
18
|
loop regions id=L3 in %t11 as el=%regions_el_12, idx=%regions_i_13
|
19
19
|
%acc21 = decl_acc :: integer
|
20
20
|
%t22 = load_field regions_el_12["sales"] :: any
|
21
|
-
loop sales id=L4 in %t22 as el=%
|
22
|
-
%
|
23
|
-
%acc21 = acc_add agg.sum(%acc21, %
|
21
|
+
loop sales id=L4 in %t22 as el=%t23, idx=%t24
|
22
|
+
%t25 = load_field t23["amount"] :: integer
|
23
|
+
%acc21 = acc_add agg.sum(%acc21, %t25) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%acc_10 = acc_add agg.sum(%acc_10, %
|
25
|
+
%t26 = acc_load %acc21 :: integer
|
26
|
+
%acc_10 = acc_add agg.sum(%acc_10, %t26) :: integer
|
27
27
|
end_loop
|
28
28
|
%t15 = acc_load %acc_10 :: integer
|
29
29
|
yield %t15
|
30
30
|
)
|
31
31
|
(Declaration adjusted_total
|
32
|
-
%
|
33
|
-
%
|
34
|
-
loop regions id=L5 in %
|
35
|
-
%
|
36
|
-
%
|
37
|
-
loop sales id=L6 in %
|
38
|
-
%
|
39
|
-
%
|
32
|
+
%acc28 = decl_acc :: integer
|
33
|
+
%t29 = load_input "regions" :: array
|
34
|
+
loop regions id=L5 in %t29 as el=%t30, idx=%t31
|
35
|
+
%acc36 = decl_acc :: integer
|
36
|
+
%t37 = load_field t30["sales"] :: any
|
37
|
+
loop sales id=L6 in %t37 as el=%t38, idx=%t39
|
38
|
+
%t40 = load_field t38["amount"] :: integer
|
39
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
40
40
|
end_loop
|
41
|
-
%
|
42
|
-
%
|
41
|
+
%t41 = acc_load %acc36 :: integer
|
42
|
+
%acc28 = acc_add agg.sum(%acc28, %t41) :: integer
|
43
43
|
end_loop
|
44
|
-
%
|
44
|
+
%t33 = acc_load %acc28 :: integer
|
45
45
|
%t17 = load_input "adjustment" :: integer
|
46
|
-
%t18 = call core.add(%
|
46
|
+
%t18 = call core.add(%t33, %t17) :: integer
|
47
47
|
yield %t18
|
48
48
|
)
|
49
49
|
)
|
@@ -18,32 +18,32 @@
|
|
18
18
|
loop regions id=L3 in %t11 as el=%regions_el_12, idx=%regions_i_13
|
19
19
|
%acc21 = decl_acc :: integer
|
20
20
|
%t22 = load_field regions_el_12["sales"] :: any
|
21
|
-
loop sales id=L4 in %t22 as el=%
|
22
|
-
%
|
23
|
-
%acc21 = acc_add agg.sum(%acc21, %
|
21
|
+
loop sales id=L4 in %t22 as el=%t23, idx=%t24
|
22
|
+
%t25 = load_field t23["amount"] :: integer
|
23
|
+
%acc21 = acc_add agg.sum(%acc21, %t25) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%acc_10 = acc_add agg.sum(%acc_10, %
|
25
|
+
%t26 = acc_load %acc21 :: integer
|
26
|
+
%acc_10 = acc_add agg.sum(%acc_10, %t26) :: integer
|
27
27
|
end_loop
|
28
28
|
%t15 = acc_load %acc_10 :: integer
|
29
29
|
yield %t15
|
30
30
|
)
|
31
31
|
(Declaration adjusted_total
|
32
|
-
%
|
33
|
-
%
|
34
|
-
loop regions id=L5 in %
|
35
|
-
%
|
36
|
-
%
|
37
|
-
loop sales id=L6 in %
|
38
|
-
%
|
39
|
-
%
|
32
|
+
%acc28 = decl_acc :: integer
|
33
|
+
%t29 = load_input "regions" :: array
|
34
|
+
loop regions id=L5 in %t29 as el=%t30, idx=%t31
|
35
|
+
%acc36 = decl_acc :: integer
|
36
|
+
%t37 = load_field t30["sales"] :: any
|
37
|
+
loop sales id=L6 in %t37 as el=%t38, idx=%t39
|
38
|
+
%t40 = load_field t38["amount"] :: integer
|
39
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
40
40
|
end_loop
|
41
|
-
%
|
42
|
-
%
|
41
|
+
%t41 = acc_load %acc36 :: integer
|
42
|
+
%acc28 = acc_add agg.sum(%acc28, %t41) :: integer
|
43
43
|
end_loop
|
44
|
-
%
|
44
|
+
%t33 = acc_load %acc28 :: integer
|
45
45
|
%t17 = load_input "adjustment" :: integer
|
46
|
-
%t18 = call core.add(%
|
46
|
+
%t18 = call core.add(%t33, %t17) :: integer
|
47
47
|
yield %t18
|
48
48
|
)
|
49
49
|
)
|
@@ -18,32 +18,32 @@
|
|
18
18
|
loop regions id=L3 in %t11 as el=%regions_el_12, idx=%regions_i_13
|
19
19
|
%acc21 = decl_acc :: integer
|
20
20
|
%t22 = load_field regions_el_12["sales"] :: any
|
21
|
-
loop sales id=L4 in %t22 as el=%
|
22
|
-
%
|
23
|
-
%acc21 = acc_add agg.sum(%acc21, %
|
21
|
+
loop sales id=L4 in %t22 as el=%t23, idx=%t24
|
22
|
+
%t25 = load_field t23["amount"] :: integer
|
23
|
+
%acc21 = acc_add agg.sum(%acc21, %t25) :: integer
|
24
24
|
end_loop
|
25
|
-
%
|
26
|
-
%acc_10 = acc_add agg.sum(%acc_10, %
|
25
|
+
%t26 = acc_load %acc21 :: integer
|
26
|
+
%acc_10 = acc_add agg.sum(%acc_10, %t26) :: integer
|
27
27
|
end_loop
|
28
28
|
%t15 = acc_load %acc_10 :: integer
|
29
29
|
yield %t15
|
30
30
|
)
|
31
31
|
(Declaration adjusted_total
|
32
|
-
%
|
33
|
-
%
|
34
|
-
loop regions id=L5 in %
|
35
|
-
%
|
36
|
-
%
|
37
|
-
loop sales id=L6 in %
|
38
|
-
%
|
39
|
-
%
|
32
|
+
%acc28 = decl_acc :: integer
|
33
|
+
%t29 = load_input "regions" :: array
|
34
|
+
loop regions id=L5 in %t29 as el=%t30, idx=%t31
|
35
|
+
%acc36 = decl_acc :: integer
|
36
|
+
%t37 = load_field t30["sales"] :: any
|
37
|
+
loop sales id=L6 in %t37 as el=%t38, idx=%t39
|
38
|
+
%t40 = load_field t38["amount"] :: integer
|
39
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
40
40
|
end_loop
|
41
|
-
%
|
42
|
-
%
|
41
|
+
%t41 = acc_load %acc36 :: integer
|
42
|
+
%acc28 = acc_add agg.sum(%acc28, %t41) :: integer
|
43
43
|
end_loop
|
44
|
-
%
|
44
|
+
%t33 = acc_load %acc28 :: integer
|
45
45
|
%t17 = load_input "adjustment" :: integer
|
46
|
-
%t18 = call core.add(%
|
46
|
+
%t18 = call core.add(%t33, %t17) :: integer
|
47
47
|
yield %t18
|
48
48
|
)
|
49
49
|
)
|
@@ -19,9 +19,9 @@ export function _total_sales(input) {
|
|
19
19
|
t11.forEach((regions_el_12, regions_i_13) => {
|
20
20
|
let acc21 = 0;
|
21
21
|
let t22 = regions_el_12["sales"];
|
22
|
-
t22.forEach((
|
23
|
-
let
|
24
|
-
acc21 +=
|
22
|
+
t22.forEach((t23, t24) => {
|
23
|
+
let t25 = t23["amount"];
|
24
|
+
acc21 += t25;
|
25
25
|
});
|
26
26
|
acc_10 += acc21;
|
27
27
|
});
|
@@ -29,19 +29,19 @@ export function _total_sales(input) {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
export function _adjusted_total(input) {
|
32
|
-
let
|
33
|
-
let
|
34
|
-
|
35
|
-
let
|
36
|
-
let
|
37
|
-
|
38
|
-
let
|
39
|
-
|
32
|
+
let acc28 = 0;
|
33
|
+
let t29 = input["regions"];
|
34
|
+
t29.forEach((t30, t31) => {
|
35
|
+
let acc36 = 0;
|
36
|
+
let t37 = t30["sales"];
|
37
|
+
t37.forEach((t38, t39) => {
|
38
|
+
let t40 = t38["amount"];
|
39
|
+
acc36 += t40;
|
40
40
|
});
|
41
|
-
|
41
|
+
acc28 += acc36;
|
42
42
|
});
|
43
43
|
let t17 = input["adjustment"];
|
44
|
-
let t18 =
|
44
|
+
let t18 = acc28 + t17;
|
45
45
|
return t18;
|
46
46
|
}
|
47
47
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_948ef2383d338bae98f165855c5c82984da1d3f936bcaca00b80221e19f34c6a
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -49,31 +49,31 @@ module Kumi::Compiled::KUMI_f5ff83c5472452825724e8d6146d84050de84e9c1f3ece855cde
|
|
49
49
|
t11.each_with_index do |regions_el_12, regions_i_13|
|
50
50
|
acc21 = 0
|
51
51
|
t22 = regions_el_12["sales"] || regions_el_12[:sales]
|
52
|
-
t22.each_with_index do |
|
53
|
-
|
54
|
-
acc21 +=
|
52
|
+
t22.each_with_index do |t23, t24|
|
53
|
+
t25 = t23["amount"] || t23[:amount]
|
54
|
+
acc21 += t25
|
55
55
|
end
|
56
|
-
|
57
|
-
acc_10 +=
|
56
|
+
t26 = acc21
|
57
|
+
acc_10 += t26
|
58
58
|
end
|
59
59
|
acc_10
|
60
60
|
end
|
61
61
|
|
62
62
|
def _adjusted_total(input = @input)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
63
|
+
acc28 = 0
|
64
|
+
t29 = input["regions"] || input[:regions]
|
65
|
+
t29.each_with_index do |t30, t31|
|
66
|
+
acc36 = 0
|
67
|
+
t37 = t30["sales"] || t30[:sales]
|
68
|
+
t37.each_with_index do |t38, t39|
|
69
|
+
t40 = t38["amount"] || t38[:amount]
|
70
|
+
acc36 += t40
|
71
71
|
end
|
72
|
-
|
73
|
-
|
72
|
+
t41 = acc36
|
73
|
+
acc28 += t41
|
74
74
|
end
|
75
|
-
|
75
|
+
t33 = acc28
|
76
76
|
t17 = input["adjustment"] || input[:adjustment]
|
77
|
-
|
77
|
+
t33 + t17
|
78
78
|
end
|
79
79
|
end
|