kumi 0.0.23 → 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 +8 -0
- data/README.md +2 -2
- 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_00_unoptimized.txt +33 -33
- data/golden/game_of_life/expected/lir_01_hoist_scalar_references.txt +33 -33
- data/golden/game_of_life/expected/lir_02_inlined.txt +1370 -1370
- data/golden/game_of_life/expected/lir_03_cse.txt +448 -448
- data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +448 -448
- data/golden/game_of_life/expected/lir_04_loop_invcm.txt +448 -448
- data/golden/game_of_life/expected/lir_06_const_prop.txt +448 -448
- 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_keys/schema.kumi +4 -5
- 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/ast.txt +48 -0
- data/golden/inline_rename_scope_leak/expected/input_plan.txt +10 -0
- data/golden/inline_rename_scope_leak/expected/lir_00_unoptimized.txt +35 -0
- data/golden/inline_rename_scope_leak/expected/lir_01_hoist_scalar_references.txt +35 -0
- data/golden/inline_rename_scope_leak/expected/lir_02_inlined.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_03_cse.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_04_1_loop_fusion.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_04_loop_invcm.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_06_const_prop.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/nast.txt +31 -0
- data/golden/inline_rename_scope_leak/expected/schema_javascript.mjs +51 -0
- data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +82 -0
- data/golden/inline_rename_scope_leak/expected/snast.txt +31 -0
- data/golden/inline_rename_scope_leak/expected.json +7 -0
- data/golden/inline_rename_scope_leak/input.json +4 -0
- data/golden/inline_rename_scope_leak/schema.kumi +24 -0
- 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/lir_00_unoptimized.txt +8 -8
- data/golden/roll/expected/lir_01_hoist_scalar_references.txt +8 -8
- data/golden/roll/expected/lir_02_inlined.txt +8 -8
- data/golden/roll/expected/lir_03_cse.txt +8 -8
- data/golden/roll/expected/lir_04_1_loop_fusion.txt +8 -8
- data/golden/roll/expected/lir_04_loop_invcm.txt +8 -8
- data/golden/roll/expected/lir_06_const_prop.txt +8 -8
- data/golden/roll/expected/schema_ruby.rb +1 -1
- data/golden/shift/expected/lir_00_unoptimized.txt +12 -12
- data/golden/shift/expected/lir_01_hoist_scalar_references.txt +12 -12
- data/golden/shift/expected/lir_02_inlined.txt +12 -12
- data/golden/shift/expected/lir_03_cse.txt +12 -12
- data/golden/shift/expected/lir_04_1_loop_fusion.txt +12 -12
- data/golden/shift/expected/lir_04_loop_invcm.txt +12 -12
- data/golden/shift/expected/lir_06_const_prop.txt +12 -12
- data/golden/shift/expected/schema_ruby.rb +1 -1
- data/golden/shift_2d/expected/lir_00_unoptimized.txt +48 -48
- data/golden/shift_2d/expected/lir_01_hoist_scalar_references.txt +48 -48
- data/golden/shift_2d/expected/lir_02_inlined.txt +48 -48
- data/golden/shift_2d/expected/lir_03_cse.txt +48 -48
- data/golden/shift_2d/expected/lir_04_1_loop_fusion.txt +48 -48
- data/golden/shift_2d/expected/lir_04_loop_invcm.txt +48 -48
- data/golden/shift_2d/expected/lir_06_const_prop.txt +48 -48
- 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/lir_00_unoptimized.txt +4 -4
- data/golden/tuples/expected/lir_01_hoist_scalar_references.txt +4 -4
- data/golden/tuples/expected/lir_02_inlined.txt +4 -4
- data/golden/tuples/expected/lir_03_cse.txt +4 -4
- data/golden/tuples/expected/lir_04_1_loop_fusion.txt +4 -4
- data/golden/tuples/expected/lir_04_loop_invcm.txt +4 -4
- data/golden/tuples/expected/lir_06_const_prop.txt +4 -4
- data/golden/tuples/expected/schema_ruby.rb +1 -1
- data/golden/tuples_and_arrays/expected/lir_00_unoptimized.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_01_hoist_scalar_references.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +17 -17
- data/golden/tuples_and_arrays/expected/lir_03_cse.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +14 -14
- 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/ast.txt +865 -0
- data/golden/us_tax_2024/expected/input_plan.txt +61 -0
- data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +901 -0
- data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +901 -0
- data/golden/us_tax_2024/expected/lir_02_inlined.txt +5178 -0
- data/golden/us_tax_2024/expected/lir_03_cse.txt +2499 -0
- data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +2519 -0
- data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +2499 -0
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +2499 -0
- data/golden/us_tax_2024/expected/nast.txt +976 -0
- data/golden/us_tax_2024/expected/schema_javascript.mjs +584 -0
- data/golden/us_tax_2024/expected/schema_ruby.rb +639 -0
- data/golden/us_tax_2024/expected/snast.txt +976 -0
- data/golden/us_tax_2024/expected.json +1 -0
- data/golden/us_tax_2024/input.json +168 -0
- data/golden/us_tax_2024/schema.kumi +203 -0
- data/golden/with_constants/expected/schema_ruby.rb +1 -1
- data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +227 -107
- data/lib/kumi/version.rb +1 -1
- metadata +33 -1
@@ -30,37 +30,37 @@
|
|
30
30
|
loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
|
31
31
|
%acc36 = decl_acc :: integer
|
32
32
|
%t37 = load_field departments_el_20["teams"] :: any
|
33
|
-
%
|
34
|
-
loop teams id=L8 in %t37 as el=%
|
35
|
-
%
|
36
|
-
%acc36 = acc_add agg.sum(%acc36, %
|
37
|
-
%
|
38
|
-
%
|
33
|
+
%acc44 = decl_acc :: integer
|
34
|
+
loop teams id=L8 in %t37 as el=%t38, idx=%t39
|
35
|
+
%t40 = load_field t38["headcount"] :: integer
|
36
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
37
|
+
%t48 = load_field t38["team_name"] :: string
|
38
|
+
%acc44 = acc_add agg.count(%acc44, %t48) :: integer
|
39
39
|
end_loop
|
40
|
-
%
|
41
|
-
%
|
42
|
-
%t24 = call core.div(%
|
40
|
+
%t41 = acc_load %acc36 :: integer
|
41
|
+
%t49 = acc_load %acc44 :: integer
|
42
|
+
%t24 = call core.div(%t41, %t49) :: float
|
43
43
|
yield %t24
|
44
44
|
end_loop
|
45
45
|
)
|
46
46
|
(Declaration is_above_average_team
|
47
47
|
%t25 = load_input "departments" :: array
|
48
48
|
loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
|
49
|
-
%
|
50
|
-
%
|
51
|
-
%
|
52
|
-
loop teams id=L10 in %
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
49
|
+
%acc56 = decl_acc :: integer
|
50
|
+
%t57 = load_field departments_el_26["teams"] :: any
|
51
|
+
%acc64 = decl_acc :: integer
|
52
|
+
loop teams id=L10 in %t57 as el=%t58, idx=%t59
|
53
|
+
%t60 = load_field t58["headcount"] :: integer
|
54
|
+
%acc56 = acc_add agg.sum(%acc56, %t60) :: integer
|
55
|
+
%t68 = load_field t58["team_name"] :: string
|
56
|
+
%acc64 = acc_add agg.count(%acc64, %t68) :: integer
|
57
57
|
end_loop
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
loop teams id=L7 in %
|
58
|
+
%t61 = acc_load %acc56 :: integer
|
59
|
+
%t69 = acc_load %acc64 :: integer
|
60
|
+
%t53 = call core.div(%t61, %t69) :: float
|
61
|
+
loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
|
62
62
|
%t31 = load_field teams_el_29["headcount"] :: integer
|
63
|
-
%t33 = call core.gt(%t31, %
|
63
|
+
%t33 = call core.gt(%t31, %t53) :: boolean
|
64
64
|
yield %t33
|
65
65
|
end_loop
|
66
66
|
end_loop
|
@@ -30,37 +30,37 @@
|
|
30
30
|
loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
|
31
31
|
%acc36 = decl_acc :: integer
|
32
32
|
%t37 = load_field departments_el_20["teams"] :: any
|
33
|
-
%
|
34
|
-
loop teams id=L8 in %t37 as el=%
|
35
|
-
%
|
36
|
-
%acc36 = acc_add agg.sum(%acc36, %
|
37
|
-
%
|
38
|
-
%
|
33
|
+
%acc44 = decl_acc :: integer
|
34
|
+
loop teams id=L8 in %t37 as el=%t38, idx=%t39
|
35
|
+
%t40 = load_field t38["headcount"] :: integer
|
36
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
37
|
+
%t48 = load_field t38["team_name"] :: string
|
38
|
+
%acc44 = acc_add agg.count(%acc44, %t48) :: integer
|
39
39
|
end_loop
|
40
|
-
%
|
41
|
-
%
|
42
|
-
%t24 = call core.div(%
|
40
|
+
%t41 = acc_load %acc36 :: integer
|
41
|
+
%t49 = acc_load %acc44 :: integer
|
42
|
+
%t24 = call core.div(%t41, %t49) :: float
|
43
43
|
yield %t24
|
44
44
|
end_loop
|
45
45
|
)
|
46
46
|
(Declaration is_above_average_team
|
47
47
|
%t25 = load_input "departments" :: array
|
48
48
|
loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
|
49
|
-
%
|
50
|
-
%
|
51
|
-
%
|
52
|
-
loop teams id=L10 in %
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
49
|
+
%acc56 = decl_acc :: integer
|
50
|
+
%t57 = load_field departments_el_26["teams"] :: any
|
51
|
+
%acc64 = decl_acc :: integer
|
52
|
+
loop teams id=L10 in %t57 as el=%t58, idx=%t59
|
53
|
+
%t60 = load_field t58["headcount"] :: integer
|
54
|
+
%acc56 = acc_add agg.sum(%acc56, %t60) :: integer
|
55
|
+
%t68 = load_field t58["team_name"] :: string
|
56
|
+
%acc64 = acc_add agg.count(%acc64, %t68) :: integer
|
57
57
|
end_loop
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
loop teams id=L7 in %
|
58
|
+
%t61 = acc_load %acc56 :: integer
|
59
|
+
%t69 = acc_load %acc64 :: integer
|
60
|
+
%t53 = call core.div(%t61, %t69) :: float
|
61
|
+
loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
|
62
62
|
%t31 = load_field teams_el_29["headcount"] :: integer
|
63
|
-
%t33 = call core.gt(%t31, %
|
63
|
+
%t33 = call core.gt(%t31, %t53) :: boolean
|
64
64
|
yield %t33
|
65
65
|
end_loop
|
66
66
|
end_loop
|
@@ -30,37 +30,37 @@
|
|
30
30
|
loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
|
31
31
|
%acc36 = decl_acc :: integer
|
32
32
|
%t37 = load_field departments_el_20["teams"] :: any
|
33
|
-
%
|
34
|
-
loop teams id=L8 in %t37 as el=%
|
35
|
-
%
|
36
|
-
%acc36 = acc_add agg.sum(%acc36, %
|
37
|
-
%
|
38
|
-
%
|
33
|
+
%acc44 = decl_acc :: integer
|
34
|
+
loop teams id=L8 in %t37 as el=%t38, idx=%t39
|
35
|
+
%t40 = load_field t38["headcount"] :: integer
|
36
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
37
|
+
%t48 = load_field t38["team_name"] :: string
|
38
|
+
%acc44 = acc_add agg.count(%acc44, %t48) :: integer
|
39
39
|
end_loop
|
40
|
-
%
|
41
|
-
%
|
42
|
-
%t24 = call core.div(%
|
40
|
+
%t41 = acc_load %acc36 :: integer
|
41
|
+
%t49 = acc_load %acc44 :: integer
|
42
|
+
%t24 = call core.div(%t41, %t49) :: float
|
43
43
|
yield %t24
|
44
44
|
end_loop
|
45
45
|
)
|
46
46
|
(Declaration is_above_average_team
|
47
47
|
%t25 = load_input "departments" :: array
|
48
48
|
loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
|
49
|
-
%
|
50
|
-
%
|
51
|
-
%
|
52
|
-
loop teams id=L10 in %
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
49
|
+
%acc56 = decl_acc :: integer
|
50
|
+
%t57 = load_field departments_el_26["teams"] :: any
|
51
|
+
%acc64 = decl_acc :: integer
|
52
|
+
loop teams id=L10 in %t57 as el=%t58, idx=%t59
|
53
|
+
%t60 = load_field t58["headcount"] :: integer
|
54
|
+
%acc56 = acc_add agg.sum(%acc56, %t60) :: integer
|
55
|
+
%t68 = load_field t58["team_name"] :: string
|
56
|
+
%acc64 = acc_add agg.count(%acc64, %t68) :: integer
|
57
57
|
end_loop
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
loop teams id=L7 in %
|
58
|
+
%t61 = acc_load %acc56 :: integer
|
59
|
+
%t69 = acc_load %acc64 :: integer
|
60
|
+
%t53 = call core.div(%t61, %t69) :: float
|
61
|
+
loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
|
62
62
|
%t31 = load_field teams_el_29["headcount"] :: integer
|
63
|
-
%t33 = call core.gt(%t31, %
|
63
|
+
%t33 = call core.gt(%t31, %t53) :: boolean
|
64
64
|
yield %t33
|
65
65
|
end_loop
|
66
66
|
end_loop
|
@@ -30,37 +30,37 @@
|
|
30
30
|
loop departments id=L5 in %t19 as el=%departments_el_20, idx=%departments_i_21
|
31
31
|
%acc36 = decl_acc :: integer
|
32
32
|
%t37 = load_field departments_el_20["teams"] :: any
|
33
|
-
%
|
34
|
-
loop teams id=L8 in %t37 as el=%
|
35
|
-
%
|
36
|
-
%acc36 = acc_add agg.sum(%acc36, %
|
37
|
-
%
|
38
|
-
%
|
33
|
+
%acc44 = decl_acc :: integer
|
34
|
+
loop teams id=L8 in %t37 as el=%t38, idx=%t39
|
35
|
+
%t40 = load_field t38["headcount"] :: integer
|
36
|
+
%acc36 = acc_add agg.sum(%acc36, %t40) :: integer
|
37
|
+
%t48 = load_field t38["team_name"] :: string
|
38
|
+
%acc44 = acc_add agg.count(%acc44, %t48) :: integer
|
39
39
|
end_loop
|
40
|
-
%
|
41
|
-
%
|
42
|
-
%t24 = call core.div(%
|
40
|
+
%t41 = acc_load %acc36 :: integer
|
41
|
+
%t49 = acc_load %acc44 :: integer
|
42
|
+
%t24 = call core.div(%t41, %t49) :: float
|
43
43
|
yield %t24
|
44
44
|
end_loop
|
45
45
|
)
|
46
46
|
(Declaration is_above_average_team
|
47
47
|
%t25 = load_input "departments" :: array
|
48
48
|
loop departments id=L6 in %t25 as el=%departments_el_26, idx=%departments_i_27
|
49
|
-
%
|
50
|
-
%
|
51
|
-
%
|
52
|
-
loop teams id=L10 in %
|
53
|
-
%
|
54
|
-
%
|
55
|
-
%
|
56
|
-
%
|
49
|
+
%acc56 = decl_acc :: integer
|
50
|
+
%t57 = load_field departments_el_26["teams"] :: any
|
51
|
+
%acc64 = decl_acc :: integer
|
52
|
+
loop teams id=L10 in %t57 as el=%t58, idx=%t59
|
53
|
+
%t60 = load_field t58["headcount"] :: integer
|
54
|
+
%acc56 = acc_add agg.sum(%acc56, %t60) :: integer
|
55
|
+
%t68 = load_field t58["team_name"] :: string
|
56
|
+
%acc64 = acc_add agg.count(%acc64, %t68) :: integer
|
57
57
|
end_loop
|
58
|
-
%
|
59
|
-
%
|
60
|
-
%
|
61
|
-
loop teams id=L7 in %
|
58
|
+
%t61 = acc_load %acc56 :: integer
|
59
|
+
%t69 = acc_load %acc64 :: integer
|
60
|
+
%t53 = call core.div(%t61, %t69) :: float
|
61
|
+
loop teams id=L7 in %t57 as el=%teams_el_29, idx=%teams_i_30
|
62
62
|
%t31 = load_field teams_el_29["headcount"] :: integer
|
63
|
-
%t33 = call core.gt(%t31, %
|
63
|
+
%t33 = call core.gt(%t31, %t53) :: boolean
|
64
64
|
yield %t33
|
65
65
|
end_loop
|
66
66
|
end_loop
|
@@ -34,14 +34,14 @@ export function _avg_headcount_per_dept(input) {
|
|
34
34
|
t19.forEach((departments_el_20, departments_i_21) => {
|
35
35
|
let acc36 = 0;
|
36
36
|
let t37 = departments_el_20["teams"];
|
37
|
-
let
|
38
|
-
t37.forEach((
|
39
|
-
let
|
40
|
-
acc36 +=
|
41
|
-
let
|
42
|
-
|
37
|
+
let acc44 = 0;
|
38
|
+
t37.forEach((t38, t39) => {
|
39
|
+
let t40 = t38["headcount"];
|
40
|
+
acc36 += t40;
|
41
|
+
let t48 = t38["team_name"];
|
42
|
+
acc44 += 1;
|
43
43
|
});
|
44
|
-
let t24 = acc36 /
|
44
|
+
let t24 = acc36 / acc44;
|
45
45
|
out.push(t24);
|
46
46
|
});
|
47
47
|
return out;
|
@@ -52,19 +52,19 @@ export function _is_above_average_team(input) {
|
|
52
52
|
let t25 = input["departments"];
|
53
53
|
t25.forEach((departments_el_26, departments_i_27) => {
|
54
54
|
let out_1 = [];
|
55
|
-
let
|
56
|
-
let
|
57
|
-
let
|
58
|
-
|
59
|
-
let
|
60
|
-
|
61
|
-
let
|
62
|
-
|
55
|
+
let acc56 = 0;
|
56
|
+
let t57 = departments_el_26["teams"];
|
57
|
+
let acc64 = 0;
|
58
|
+
t57.forEach((t58, t59) => {
|
59
|
+
let t60 = t58["headcount"];
|
60
|
+
acc56 += t60;
|
61
|
+
let t68 = t58["team_name"];
|
62
|
+
acc64 += 1;
|
63
63
|
});
|
64
|
-
let
|
65
|
-
|
64
|
+
let t53 = acc56 / acc64;
|
65
|
+
t57.forEach((teams_el_29, teams_i_30) => {
|
66
66
|
let t31 = teams_el_29["headcount"];
|
67
|
-
let t33 = t31 >
|
67
|
+
let t33 = t31 > t53;
|
68
68
|
out_1.push(t33);
|
69
69
|
});
|
70
70
|
out.push(out_1);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_798dac22208bafc0f2b7f93d43bef5ae4c1d550f52f4c3773c486db02058561a
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -66,16 +66,16 @@ module Kumi::Compiled::KUMI_621112a9f96fd9df9274375684d4aad116dd930db67521f72ec0
|
|
66
66
|
t19.each_with_index do |departments_el_20, departments_i_21|
|
67
67
|
acc36 = 0
|
68
68
|
t37 = departments_el_20["teams"] || departments_el_20[:teams]
|
69
|
-
|
70
|
-
t37.each_with_index do |
|
71
|
-
|
72
|
-
acc36 +=
|
73
|
-
|
74
|
-
|
69
|
+
acc44 = 0
|
70
|
+
t37.each_with_index do |t38, t39|
|
71
|
+
t40 = t38["headcount"] || t38[:headcount]
|
72
|
+
acc36 += t40
|
73
|
+
t48 = t38["team_name"] || t38[:team_name]
|
74
|
+
acc44 += 1
|
75
75
|
end
|
76
|
-
|
77
|
-
|
78
|
-
t24 =
|
76
|
+
t41 = acc36
|
77
|
+
t49 = acc44
|
78
|
+
t24 = t41 / t49.to_f
|
79
79
|
out << t24
|
80
80
|
end
|
81
81
|
out
|
@@ -86,21 +86,21 @@ module Kumi::Compiled::KUMI_621112a9f96fd9df9274375684d4aad116dd930db67521f72ec0
|
|
86
86
|
t25 = input["departments"] || input[:departments]
|
87
87
|
t25.each_with_index do |departments_el_26, departments_i_27|
|
88
88
|
out_1 = []
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
89
|
+
acc56 = 0
|
90
|
+
t57 = departments_el_26["teams"] || departments_el_26[:teams]
|
91
|
+
acc64 = 0
|
92
|
+
t57.each_with_index do |t58, t59|
|
93
|
+
t60 = t58["headcount"] || t58[:headcount]
|
94
|
+
acc56 += t60
|
95
|
+
t68 = t58["team_name"] || t58[:team_name]
|
96
|
+
acc64 += 1
|
97
97
|
end
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
98
|
+
t61 = acc56
|
99
|
+
t69 = acc64
|
100
|
+
t53 = t61 / t69.to_f
|
101
|
+
t57.each_with_index do |teams_el_29, teams_i_30|
|
102
102
|
t31 = teams_el_29["headcount"] || teams_el_29[:headcount]
|
103
|
-
t33 = t31 >
|
103
|
+
t33 = t31 > t53
|
104
104
|
out_1 << t33
|
105
105
|
end
|
106
106
|
out << out_1
|
@@ -2,54 +2,54 @@
|
|
2
2
|
(Declaration roll_right
|
3
3
|
%t1 = load_input "cells" :: array
|
4
4
|
loop cells id=L1 in %t1 as el=%cells_el_2, idx=%cells_i_3
|
5
|
-
%t4 =
|
5
|
+
%t4 = length %t1 :: integer
|
6
6
|
%t5 = const 1 :: integer
|
7
7
|
%t6 = call core.sub(%cells_i_3, %t5) :: integer
|
8
8
|
%t7 = call core.mod(%t6, %t4) :: integer
|
9
9
|
%t8 = call core.add(%t7, %t4) :: integer
|
10
10
|
%t9 = call core.mod(%t8, %t4) :: integer
|
11
|
-
%t10 =
|
11
|
+
%t10 = gather %t1, %t9 :: integer
|
12
12
|
yield %t10
|
13
13
|
end_loop
|
14
14
|
)
|
15
15
|
(Declaration roll_left
|
16
16
|
%t11 = load_input "cells" :: array
|
17
17
|
loop cells id=L2 in %t11 as el=%cells_el_12, idx=%cells_i_13
|
18
|
-
%t14 =
|
18
|
+
%t14 = length %t11 :: integer
|
19
19
|
%t15 = const -1 :: integer
|
20
20
|
%t16 = call core.sub(%cells_i_13, %t15) :: integer
|
21
21
|
%t17 = call core.mod(%t16, %t14) :: integer
|
22
22
|
%t18 = call core.add(%t17, %t14) :: integer
|
23
23
|
%t19 = call core.mod(%t18, %t14) :: integer
|
24
|
-
%t20 =
|
24
|
+
%t20 = gather %t11, %t19 :: integer
|
25
25
|
yield %t20
|
26
26
|
end_loop
|
27
27
|
)
|
28
28
|
(Declaration roll_right_clamp
|
29
29
|
%t21 = load_input "cells" :: array
|
30
30
|
loop cells id=L3 in %t21 as el=%cells_el_22, idx=%cells_i_23
|
31
|
-
%t24 =
|
31
|
+
%t24 = length %t21 :: integer
|
32
32
|
%t25 = const 1 :: integer
|
33
33
|
%t26 = call core.sub(%cells_i_23, %t25) :: integer
|
34
34
|
%t27 = const 1 :: integer
|
35
35
|
%t28 = call core.sub(%t24, %t27) :: integer
|
36
36
|
%t29 = const 0 :: integer
|
37
37
|
%t30 = call core.clamp(%t26, %t29, %t28) :: integer
|
38
|
-
%t31 =
|
38
|
+
%t31 = gather %t21, %t30 :: integer
|
39
39
|
yield %t31
|
40
40
|
end_loop
|
41
41
|
)
|
42
42
|
(Declaration roll_left_clamp
|
43
43
|
%t32 = load_input "cells" :: array
|
44
44
|
loop cells id=L4 in %t32 as el=%cells_el_33, idx=%cells_i_34
|
45
|
-
%t35 =
|
45
|
+
%t35 = length %t32 :: integer
|
46
46
|
%t36 = const -1 :: integer
|
47
47
|
%t37 = call core.sub(%cells_i_34, %t36) :: integer
|
48
48
|
%t38 = const 1 :: integer
|
49
49
|
%t39 = call core.sub(%t35, %t38) :: integer
|
50
50
|
%t40 = const 0 :: integer
|
51
51
|
%t41 = call core.clamp(%t37, %t40, %t39) :: integer
|
52
|
-
%t42 =
|
52
|
+
%t42 = gather %t32, %t41 :: integer
|
53
53
|
yield %t42
|
54
54
|
end_loop
|
55
55
|
)
|
@@ -2,54 +2,54 @@
|
|
2
2
|
(Declaration roll_right
|
3
3
|
%t1 = load_input "cells" :: array
|
4
4
|
loop cells id=L1 in %t1 as el=%cells_el_2, idx=%cells_i_3
|
5
|
-
%t4 =
|
5
|
+
%t4 = length %t1 :: integer
|
6
6
|
%t5 = const 1 :: integer
|
7
7
|
%t6 = call core.sub(%cells_i_3, %t5) :: integer
|
8
8
|
%t7 = call core.mod(%t6, %t4) :: integer
|
9
9
|
%t8 = call core.add(%t7, %t4) :: integer
|
10
10
|
%t9 = call core.mod(%t8, %t4) :: integer
|
11
|
-
%t10 =
|
11
|
+
%t10 = gather %t1, %t9 :: integer
|
12
12
|
yield %t10
|
13
13
|
end_loop
|
14
14
|
)
|
15
15
|
(Declaration roll_left
|
16
16
|
%t11 = load_input "cells" :: array
|
17
17
|
loop cells id=L2 in %t11 as el=%cells_el_12, idx=%cells_i_13
|
18
|
-
%t14 =
|
18
|
+
%t14 = length %t11 :: integer
|
19
19
|
%t15 = const -1 :: integer
|
20
20
|
%t16 = call core.sub(%cells_i_13, %t15) :: integer
|
21
21
|
%t17 = call core.mod(%t16, %t14) :: integer
|
22
22
|
%t18 = call core.add(%t17, %t14) :: integer
|
23
23
|
%t19 = call core.mod(%t18, %t14) :: integer
|
24
|
-
%t20 =
|
24
|
+
%t20 = gather %t11, %t19 :: integer
|
25
25
|
yield %t20
|
26
26
|
end_loop
|
27
27
|
)
|
28
28
|
(Declaration roll_right_clamp
|
29
29
|
%t21 = load_input "cells" :: array
|
30
30
|
loop cells id=L3 in %t21 as el=%cells_el_22, idx=%cells_i_23
|
31
|
-
%t24 =
|
31
|
+
%t24 = length %t21 :: integer
|
32
32
|
%t25 = const 1 :: integer
|
33
33
|
%t26 = call core.sub(%cells_i_23, %t25) :: integer
|
34
34
|
%t27 = const 1 :: integer
|
35
35
|
%t28 = call core.sub(%t24, %t27) :: integer
|
36
36
|
%t29 = const 0 :: integer
|
37
37
|
%t30 = call core.clamp(%t26, %t29, %t28) :: integer
|
38
|
-
%t31 =
|
38
|
+
%t31 = gather %t21, %t30 :: integer
|
39
39
|
yield %t31
|
40
40
|
end_loop
|
41
41
|
)
|
42
42
|
(Declaration roll_left_clamp
|
43
43
|
%t32 = load_input "cells" :: array
|
44
44
|
loop cells id=L4 in %t32 as el=%cells_el_33, idx=%cells_i_34
|
45
|
-
%t35 =
|
45
|
+
%t35 = length %t32 :: integer
|
46
46
|
%t36 = const -1 :: integer
|
47
47
|
%t37 = call core.sub(%cells_i_34, %t36) :: integer
|
48
48
|
%t38 = const 1 :: integer
|
49
49
|
%t39 = call core.sub(%t35, %t38) :: integer
|
50
50
|
%t40 = const 0 :: integer
|
51
51
|
%t41 = call core.clamp(%t37, %t40, %t39) :: integer
|
52
|
-
%t42 =
|
52
|
+
%t42 = gather %t32, %t41 :: integer
|
53
53
|
yield %t42
|
54
54
|
end_loop
|
55
55
|
)
|
@@ -2,54 +2,54 @@
|
|
2
2
|
(Declaration roll_right
|
3
3
|
%t1 = load_input "cells" :: array
|
4
4
|
loop cells id=L1 in %t1 as el=%cells_el_2, idx=%cells_i_3
|
5
|
-
%t4 =
|
5
|
+
%t4 = length %t1 :: integer
|
6
6
|
%t5 = const 1 :: integer
|
7
7
|
%t6 = call core.sub(%cells_i_3, %t5) :: integer
|
8
8
|
%t7 = call core.mod(%t6, %t4) :: integer
|
9
9
|
%t8 = call core.add(%t7, %t4) :: integer
|
10
10
|
%t9 = call core.mod(%t8, %t4) :: integer
|
11
|
-
%t10 =
|
11
|
+
%t10 = gather %t1, %t9 :: integer
|
12
12
|
yield %t10
|
13
13
|
end_loop
|
14
14
|
)
|
15
15
|
(Declaration roll_left
|
16
16
|
%t11 = load_input "cells" :: array
|
17
17
|
loop cells id=L2 in %t11 as el=%cells_el_12, idx=%cells_i_13
|
18
|
-
%t14 =
|
18
|
+
%t14 = length %t11 :: integer
|
19
19
|
%t15 = const -1 :: integer
|
20
20
|
%t16 = call core.sub(%cells_i_13, %t15) :: integer
|
21
21
|
%t17 = call core.mod(%t16, %t14) :: integer
|
22
22
|
%t18 = call core.add(%t17, %t14) :: integer
|
23
23
|
%t19 = call core.mod(%t18, %t14) :: integer
|
24
|
-
%t20 =
|
24
|
+
%t20 = gather %t11, %t19 :: integer
|
25
25
|
yield %t20
|
26
26
|
end_loop
|
27
27
|
)
|
28
28
|
(Declaration roll_right_clamp
|
29
29
|
%t21 = load_input "cells" :: array
|
30
30
|
loop cells id=L3 in %t21 as el=%cells_el_22, idx=%cells_i_23
|
31
|
-
%t24 =
|
31
|
+
%t24 = length %t21 :: integer
|
32
32
|
%t25 = const 1 :: integer
|
33
33
|
%t26 = call core.sub(%cells_i_23, %t25) :: integer
|
34
34
|
%t27 = const 1 :: integer
|
35
35
|
%t28 = call core.sub(%t24, %t27) :: integer
|
36
36
|
%t29 = const 0 :: integer
|
37
37
|
%t30 = call core.clamp(%t26, %t29, %t28) :: integer
|
38
|
-
%t31 =
|
38
|
+
%t31 = gather %t21, %t30 :: integer
|
39
39
|
yield %t31
|
40
40
|
end_loop
|
41
41
|
)
|
42
42
|
(Declaration roll_left_clamp
|
43
43
|
%t32 = load_input "cells" :: array
|
44
44
|
loop cells id=L4 in %t32 as el=%cells_el_33, idx=%cells_i_34
|
45
|
-
%t35 =
|
45
|
+
%t35 = length %t32 :: integer
|
46
46
|
%t36 = const -1 :: integer
|
47
47
|
%t37 = call core.sub(%cells_i_34, %t36) :: integer
|
48
48
|
%t38 = const 1 :: integer
|
49
49
|
%t39 = call core.sub(%t35, %t38) :: integer
|
50
50
|
%t40 = const 0 :: integer
|
51
51
|
%t41 = call core.clamp(%t37, %t40, %t39) :: integer
|
52
|
-
%t42 =
|
52
|
+
%t42 = gather %t32, %t41 :: integer
|
53
53
|
yield %t42
|
54
54
|
end_loop
|
55
55
|
)
|
@@ -2,53 +2,53 @@
|
|
2
2
|
(Declaration roll_right
|
3
3
|
%t1 = load_input "cells" :: array
|
4
4
|
loop cells id=L1 in %t1 as el=%cells_el_2, idx=%cells_i_3
|
5
|
-
%t4 =
|
5
|
+
%t4 = length %t1 :: integer
|
6
6
|
%t5 = const 1 :: integer
|
7
7
|
%t6 = call core.sub(%cells_i_3, %t5) :: integer
|
8
8
|
%t7 = call core.mod(%t6, %t4) :: integer
|
9
9
|
%t8 = call core.add(%t7, %t4) :: integer
|
10
10
|
%t9 = call core.mod(%t8, %t4) :: integer
|
11
|
-
%t10 =
|
11
|
+
%t10 = gather %t1, %t9 :: integer
|
12
12
|
yield %t10
|
13
13
|
end_loop
|
14
14
|
)
|
15
15
|
(Declaration roll_left
|
16
16
|
%t11 = load_input "cells" :: array
|
17
17
|
loop cells id=L2 in %t11 as el=%cells_el_12, idx=%cells_i_13
|
18
|
-
%t14 =
|
18
|
+
%t14 = length %t11 :: integer
|
19
19
|
%t15 = const -1 :: integer
|
20
20
|
%t16 = call core.sub(%cells_i_13, %t15) :: integer
|
21
21
|
%t17 = call core.mod(%t16, %t14) :: integer
|
22
22
|
%t18 = call core.add(%t17, %t14) :: integer
|
23
23
|
%t19 = call core.mod(%t18, %t14) :: integer
|
24
|
-
%t20 =
|
24
|
+
%t20 = gather %t11, %t19 :: integer
|
25
25
|
yield %t20
|
26
26
|
end_loop
|
27
27
|
)
|
28
28
|
(Declaration roll_right_clamp
|
29
29
|
%t21 = load_input "cells" :: array
|
30
30
|
loop cells id=L3 in %t21 as el=%cells_el_22, idx=%cells_i_23
|
31
|
-
%t24 =
|
31
|
+
%t24 = length %t21 :: integer
|
32
32
|
%t25 = const 1 :: integer
|
33
33
|
%t29 = const 0 :: integer
|
34
34
|
%t26 = call core.sub(%cells_i_23, %t25) :: integer
|
35
35
|
%t28 = call core.sub(%t24, %t25) :: integer
|
36
36
|
%t30 = call core.clamp(%t26, %t29, %t28) :: integer
|
37
|
-
%t31 =
|
37
|
+
%t31 = gather %t21, %t30 :: integer
|
38
38
|
yield %t31
|
39
39
|
end_loop
|
40
40
|
)
|
41
41
|
(Declaration roll_left_clamp
|
42
42
|
%t32 = load_input "cells" :: array
|
43
43
|
loop cells id=L4 in %t32 as el=%cells_el_33, idx=%cells_i_34
|
44
|
-
%t35 =
|
44
|
+
%t35 = length %t32 :: integer
|
45
45
|
%t36 = const -1 :: integer
|
46
46
|
%t38 = const 1 :: integer
|
47
47
|
%t40 = const 0 :: integer
|
48
48
|
%t37 = call core.sub(%cells_i_34, %t36) :: integer
|
49
49
|
%t39 = call core.sub(%t35, %t38) :: integer
|
50
50
|
%t41 = call core.clamp(%t37, %t40, %t39) :: integer
|
51
|
-
%t42 =
|
51
|
+
%t42 = gather %t32, %t41 :: integer
|
52
52
|
yield %t42
|
53
53
|
end_loop
|
54
54
|
)
|