Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC4 operators & improved optimisation #104

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

ARC4 operators & improved optimisation #104

wants to merge 1 commit into from

Conversation

achidlow
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Feb 20, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/puya
   __main__.py30197%110
   arc4_util.py63494%28, 64, 78, 97
   arc32.py66297%87, 98
   compile.py151398%137, 151–154
   errors.py1242977%47–48, 52, 54–57, 82, 124, 144–145, 150–164, 175–178
   logging_config.py1292878%15, 36–39, 45, 47, 50–54, 69, 88, 141–143, 146–148, 150, 163–172, 194
   models.py80298%11–12
   options.py29293%12–13
   parse.py2041891%86, 98, 127, 166, 169, 223, 266, 276, 278, 282, 310–315, 319, 349, 363, 376–377
   utils.py1501987%49, 53, 87, 93, 108, 111–113, 120, 142, 155–156, 160, 164–167, 196, 198, 221
src/puya/awst
   function_traverser.py186398%113, 143–144
   nodes.py9636893%19–28, 44, 53, 87, 93, 97–100, 134, 140, 144–147, 275, 281, 486, 524, 729–730, 750, 762, 800, 806–807, 837, 863, 867–871, 883, 939, 981–982, 987, 1002, 1053, 1058, 1116, 1139, 1156, 1335, 1340–1341, 1348–1353, 1465, 1513, 1522, 1550, 1557, 1570, 1619, 1630, 1632, 1637, 1645, 1650, 1655, 1664, 1669, 1674, 1681
   to_code_visitor.py3181496%83–84, 87–90, 114–115, 196, 321–322, 332, 413–414, 485, 513
   visitors.py2147067%7, 15, 19, 23, 27, 31, 35, 39, 43, 47, 53, 59, 65, 69, 73, 77, 83, 87, 91, 95, 99, 105, 109, 113, 117, 121, 125, 129, 133, 139, 143, 147, 153, 159, 163, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 231, 234, 237, 243, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309
   wtypes.py2853687%21, 64, 176–187, 202–205, 222, 224, 268, 271, 296, 298, 302–303, 306, 330, 350, 386, 389, 416–417, 426–427, 435–436, 447, 450, 509, 516, 532
src/puya/awst_build
   base_mypy_visitor.py1334467%39, 59, 71–77, 95, 106–121, 135, 139, 143, 154, 158, 166, 172, 178, 196, 202, 207, 210, 213, 222, 226, 231, 236, 242, 247, 253, 260, 264, 268, 272, 276, 280, 284, 288, 292, 296, 300, 304, 308
   context.py1402086%124–129, 137, 139–144, 147–148, 168, 173, 177, 190, 202–203
   contract.py3349372%133–134, 136–139, 147–148, 151, 163, 174, 196, 214, 220, 222, 233, 243, 252, 280, 284, 300–304, 312–313, 318, 321, 324, 327, 332–333, 336, 339, 342, 345, 348, 351, 354, 357, 360, 363, 366, 380, 394–401, 410–417, 424–425, 451, 461, 490, 492, 495, 507, 536–537, 552, 556, 559, 565, 568, 571, 574, 582, 590, 593, 596–608, 611, 620, 623, 640, 650–651, 658, 664, 686–692
   intrinsic_models.py32584%21, 26–29
   main.py47394%32, 44, 54
   module.py3708078%67, 115, 133–134, 141, 149, 155, 161–165, 174, 198–199, 210, 240, 266–267, 290, 297, 305–318, 331–332, 355–360, 414–415, 426, 450, 453, 459, 467, 470, 477, 483, 495, 498, 519, 538–539, 556–587, 615–616, 630–632, 634, 636–637, 669–676, 688, 690
   subroutine.py6117588%214, 225, 280, 348, 352, 366, 374, 407–408, 545–559, 567, 575, 578, 590, 619–620, 625, 630, 666, 686–687, 717–723, 743, 776–777, 782, 798, 801, 804, 812–818, 841, 873, 877–878, 882–883, 899, 901, 904–906, 933–934, 942, 977–985, 1020, 1048, 1052, 1083, 1180, 1187, 1197, 1208–1212, 1221, 1224, 1227, 1230, 1233, 1238, 1243, 1250, 1257
   utils.py1742486%47–48, 63, 100, 115–116, 118, 138–139, 159, 173, 184, 189, 196, 208, 228–241, 262, 315–316
src/puya/awst_build/eb
   utils.py391074%22–23, 55–63, 66–67, 74–82, 85–86
   app_account_state.py1282878%51–54, 62, 79, 81, 114–115, 136–143, 165–166, 171, 178–179, 181, 198–199, 206–207, 236, 241–242
   app_state.py1202282%47–54, 76–77, 82, 92–93, 98, 115–116, 123–124, 165–166, 190, 209
   array.py684534%26–27, 30–32, 37–44, 57–73, 78–80, 83, 86–89, 94–96, 101–103, 113–125
   base.py2076171%24–31, 103, 107, 111, 117, 121, 127–132, 143–149, 154–160, 166, 172, 182, 193, 197, 201, 211, 214, 217, 220, 223, 226, 231, 234, 256, 277, 280, 285, 288, 291, 294, 297, 302, 305, 316, 329, 340, 343, 356, 377, 382, 392, 395, 399, 406, 409, 412, 417, 422, 427, 433
   biguint.py821878%33–37, 62–63, 77, 92, 102–105, 127–130, 147–152
   bool.py401270%27–31, 48–55, 73
   bytes.py1401986%55–59, 82–83, 94–95, 116–117, 121, 125, 130, 132–133, 153, 175, 296–297, 330
   bytes_backed.py29486%38–39, 48–49
   ensure_budget.py481569%25–29, 50–51, 71–72, 80, 92, 98–103
   intrinsics.py1564372%32–34, 56–57, 65–66, 72–73, 90–91, 98, 128, 137, 139–163, 170–171, 215, 223, 235–236, 238, 255–256, 268, 273, 280, 283
   log.py591181%26–30, 85–95, 105, 107
   named_int_constants.py20290%23–24
   struct.py321553%21–22, 25, 36–42, 47–49, 52–57
   subroutine.py35294%52, 72
   tuple.py982080%39–40, 47, 58, 60–61, 83–84, 93–94, 107, 113, 131–132, 137–138, 150, 158, 166, 198
   type_registry.py27293%138–139
   uint64.py721185%37–41, 63–64, 85, 103, 126, 145–148
   unsigned_builtins.py701184%30–34, 52, 59, 94, 97–98, 129, 132–133
   value_proxy.py391269%24, 27, 30, 33, 36, 41, 56, 66, 75, 85, 88, 91
src/puya/awst_build/eb/arc4
   arrays.py2252987%61–65, 78–79, 107, 138, 158–159, 195, 197, 231, 263, 279–280, 293, 336–337, 390–391, 413, 423–424, 440, 470, 490–491, 499, 546
   base.py1191885%34–38, 68–69, 90–91, 159, 180, 197–198, 212–213, 230–231, 241, 251, 256
   bool.py28679%22–29, 55–56
   numeric.py1546657%40–44, 56, 71, 102–103, 105, 108–109, 126, 133–134, 152, 166–167, 172, 177, 199, 202, 219–222, 243–249, 254–280, 285–313, 318, 333
   string.py671282%32–36, 66–67, 102, 121–122, 147–148, 166–167
   struct.py57886%25–32, 68, 71, 106–107
   tuple.py862176%31–35, 50, 54–55, 80, 85–87, 96, 107, 116, 129, 133–134, 146, 162–163, 172–173
src/puya/awst_build/eb/reference_types
   account.py46883%24–26, 44, 53–57
   application.py31487%17–19, 41–42
   asset.py52688%27–29, 51–52, 89–90
   base.py44491%25–27, 61, 87
src/puya/awst_build/eb/transaction
   base.py33779%16, 24, 28, 33–34, 41, 50
   group.py57984%33–37, 88–89, 98, 145, 148–149
   inner.py56984%28–31, 64–65, 101–102, 116, 144
   inner_params.py981189%29–33, 46–47, 69, 105, 141, 166, 183, 215
src/puya/awst_build/validation
   arc4_copy.py28196%37
   inner_transactions.py931188%92, 100, 111, 121, 125, 128, 133, 141, 151, 164, 169
   scratch_slots.py37489%17, 30, 46, 48
src/puya/ir
   arc4_router.py2722192%180, 281, 299, 307, 463, 543, 589, 656–657, 671, 711–712, 724, 729, 734, 739, 744, 749, 769–774
   avm_ops.py316299%44–45
   avm_ops_models.py34294%18, 26
   context.py881286%18, 59–60, 62, 80–86, 91, 102, 109, 119
   main.py165696%111, 114, 218, 220, 282, 293
   models.py4432694%29, 45, 63, 79, 186, 196, 200, 361, 435, 477, 557, 573, 614, 617, 624, 627, 674, 683, 691, 697, 708–710, 720, 732, 769
   ssa.py136993%43, 51–52, 99, 105, 141, 145, 166, 170
   to_text_visitor.py132795%82, 87, 169–174
   types.py49786%26–27, 51–55, 66
   visitor.py1643678%10–12, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 167, 179, 194, 197, 200, 203, 206, 212, 215, 218, 221, 224, 227, 230, 233
   visitor_mutator.py91298%134–135
   vla.py73297%50, 87
src/puya/ir/builder
   _utils.py71889%33, 44, 57, 79–80, 157, 203–204
   arc4.py4184889%75–76, 125, 149–155, 219, 227, 450, 462, 465, 621–635, 964–978, 1004–1028, 1037–1053, 1076, 1177–1178, 1223–1240, 1279–1280, 1333, 1366–1367, 1517–1518, 1581
   assignment.py43588%59, 75, 102, 133–134
   blocks.py931089%61, 71, 75, 111, 119, 123, 147–149, 155–157
   flow_control.py98496%63, 117, 141, 155
   iteration.py190597%46, 66, 95, 176–177
   itxn.py2231593%109–110, 119–120, 130–131, 139, 164, 443–444, 449–450, 456, 472–473
   main.py4835389%88, 105, 134, 138, 183–184, 199–200, 227, 235, 242–243, 314, 342–343, 358, 370, 387, 408, 415, 449, 462, 500, 513–514, 541, 602–603, 625, 673, 701, 709, 739–740, 815, 818, 824, 831–832, 862–863, 878, 924–925, 941–942, 976, 991–993, 1002, 1005–1006
src/puya/ir/destructure
   coalesce_locals.py941584%33, 36, 118, 127–128, 131–134, 137–139, 153–156
   parcopy.py84298%47, 83
src/puya/ir/optimize
   _utils.py28196%21
   collapse_blocks.py92595%65–69
   control_op_simplification.py96694%156–162, 232
   dead_code_elimination.py119298%288, 324
   intrinsic_simplification.py3704189%64, 128, 140, 202, 268, 326, 332, 383, 405, 426, 428, 434, 478, 480, 482, 489, 505, 519, 525, 527, 529, 534, 536, 538, 540, 542, 545–548, 553, 555, 557, 559, 561, 563, 565, 569, 592–593, 600
   main.py85396%106–107, 123
src/puya/mir
   annotaters.py173796%57, 63, 99, 103, 136, 140, 217
   builder.py120695%81, 129, 135, 142, 249–250
   context.py39197%35
   models.py3172293%13–18, 30, 41, 53, 64, 75, 86, 116, 226, 257, 294, 306, 323, 331–337, 343
   output.py61297%29, 31
   stack.py2502291%68, 72, 105, 109, 115, 125, 136, 147, 157, 172, 189, 199, 218, 236, 242, 244, 283, 294, 318, 350, 355, 393
   visitor.py732368%7, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99
src/puya/mir/stack_allocation
   baileys.py208697%31, 103, 123, 330–334, 359
   frame_allocation.py78396%21, 57–58
   koopmans.py61198%55
   peephole.py100694%75, 89, 99, 101, 103, 145
src/puya/teal
   models.py220399%181, 280, 286
src/puya/teal/optimize
   peephole.py106595%64, 147–157, 165
   repeated_rotations.py30197%13
   repeated_rotations_search.py88693%34, 40–41, 57, 67–68
TOTAL15059170989% 

Tests Skipped Failures Errors Time
236 2 💤 0 ❌ 0 🔥 2m 31s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant