gintool / gin

GI in No Time - a Simple Microframework for Genetic Improvement
MIT License
43 stars 21 forks source link

command-line output improvement #4

Closed markuswagnergithub closed 6 years ago

markuswagnergithub commented 6 years ago

Example:

Markuss-MBP:git-gin wagner$ java -jar build/gin.jar examples/locoGP/SortBubbleDouble.java
Optimising source file: examples/locoGP/SortBubbleDouble.java

Initial execution time: 5377250.0 (ns)

Step 1 | COPY 11 -> 1:0 |*** New best *** Time: 4127871.0(ns)
Step 2 |Time: 5673439.0
Step 3 |Time: 4937142.0
Step 4 | COPY 11 -> 1:0 | DEL 12 |*** New best *** Time: 2406271.0(ns)
Step 5 | COPY 11 -> 1:0 | DEL 12 | COPY 11 -> 5:0 |Time: 4719200.0
Step 6 | DEL 12 |Time: 4197840.0
Step 7 | COPY 11 -> 1:0 | DEL 12 | DEL 15 |Patch invalid
Step 8 | COPY 11 -> 1:0 |Time: 5805536.0
Step 9 | COPY 11 -> 1:0 |Time: 3091739.0
Step 10 | COPY 11 -> 1:0 | DEL 12 | DEL 4 |Patch invalid
Step 11 | COPY 11 -> 1:0 | DEL 12 | MOVE 8 -> 3:1 |Time: 4251221.0
Step 12 | DEL 12 |Time: 2804988.0
Step 13 | COPY 11 -> 1:0 | DEL 12 | MOVE 19 -> 0:2 |Time: 3854282.0
Step 14 | DEL 12 |Time: 2794879.0
Step 15 | DEL 12 |Time: 2700009.0
Step 16 | COPY 11 -> 1:0 | DEL 12 | COPY 1 -> 6:0 |Time: 1.5343549E7
Step 17 | COPY 11 -> 1:0 | DEL 12 | DEL 13 |Patch invalid
Step 18 | DEL 12 |*** New best *** Time: 2008354.0(ns)
Step 19 | DEL 12 | DEL 0 |Failed to compile
Step 20 | DEL 12 | COPY 5 -> 2:0 |Time: 4259756.0
Step 21 |Time: 4324886.0
Step 22 | DEL 12 | MOVE 12 -> 6:0 |Patch invalid
Step 23 | DEL 12 | COPY 10 -> 4:0 |Failed to compile
Step 24 |Time: 2329325.0
Step 25 |Time: 3040417.0
Step 26 |Time: 2725780.0
Step 27 |*** New best *** Time: 1742064.0(ns)
Step 28 | MOVE 5 -> 1:0 |Failed to compile
Step 29 | MOVE 3 -> 2:0 |Time: 8787057.0
Step 30 | COPY 2 -> 1:0 |Time: 4770382.0
Step 31 | COPY 18 -> 5:0 |Failed to compile
Step 32 | DEL 17 |Time: 2432983.0
Step 33 | DEL 16 |Failed to compile
Step 34 | MOVE 1 -> 4:0 |Failed to compile
Step 35 | MOVE 6 -> 0:1 |Patch invalid
Step 36 | COPY 2 -> 2:0 |Failed to compile
Step 37 | COPY 6 -> 0:2 |Failed to compile
Step 38 | COPY 13 -> 4:0 |Failed to compile
Step 39 | MOVE 9 -> 3:1 |Failed to pass all tests
Step 40 | MOVE 9 -> 0:2 |Failed to compile
Step 41 | COPY 19 -> 0:0 |Failed to compile
Step 42 | DEL 2 |Patch invalid
Step 43 | DEL 11 |Patch invalid
Step 44 | MOVE 0 -> 2:0 |Failed to compile
Step 45 | MOVE 3 -> 2:0 |Time: 8274254.0
Step 46 | COPY 10 -> 0:1 |Time: 4223412.0
Step 47 | MOVE 11 -> 4:0 |Patch invalid
Step 48 | COPY 3 -> 5:0 |Failed to compile
Step 49 | MOVE 18 -> 5:0 |Failed to compile
Step 50 | MOVE 5 -> 6:2 |Failed to compile
Step 51 | DEL 2 |Patch invalid
Step 52 | DEL 10 |Time: 2993312.0
Step 53 | COPY 11 -> 6:0 |Failed to compile
Step 54 | MOVE 8 -> 3:2 |Time: 2385970.0
Step 55 | COPY 11 -> 4:0 |Time: 2803413.0
Step 56 | DEL 5 |Time: 3657767.0
Step 57 | COPY 9 -> 1:0 |Failed to compile
Step 58 | DEL 13 |Patch invalid
Step 59 | MOVE 4 -> 0:2 |Patch invalid
Step 60 | DEL 15 |Patch invalid
Step 61 | DEL 10 |Time: 2856155.0
Step 62 | DEL 4 |Patch invalid
Step 63 | MOVE 18 -> 1:0 |Failed to compile
Step 64 | COPY 5 -> 1:0 |Failed to compile
Step 65 | COPY 0 -> 2:0 |Failed to compile
Step 66 | MOVE 7 -> 5:0 |Failed to compile
Step 67 | COPY 2 -> 0:0 |Time: 2157261.0
Step 68 | DEL 13 |Patch invalid
Step 69 | MOVE 3 -> 0:2 |Time: 5331342.0
Step 70 | DEL 5 |Time: 3313758.0
Step 71 | COPY 16 -> 6:1 |Failed to compile
Step 72 | COPY 2 -> 0:1 |*** New best *** Time: 1394517.0(ns)
Step 73 |Time: 5582996.0
Step 74 | COPY 2 -> 0:1 | DEL 0 |Failed to compile
Step 75 | COPY 2 -> 0:1 | DEL 0 |Failed to compile
Step 76 | COPY 2 -> 0:1 | DEL 12 |Time: 3002779.0
Step 77 |Time: 5694114.0
Step 78 | COPY 2 -> 0:1 | MOVE 7 -> 5:0 |Failed to compile
Step 79 |Time: 3539437.0
Step 80 | COPY 2 -> 0:1 | MOVE 8 -> 2:0 |Failed to pass all tests
Step 81 | COPY 2 -> 0:1 | COPY 16 -> 0:1 |Failed to compile
Step 82 | COPY 2 -> 0:1 | MOVE 3 -> 5:0 |Failed to compile
Step 83 |Time: 2307858.0
Step 84 |Time: 4806585.0
Step 85 |Time: 4796634.0
Step 86 | COPY 2 -> 0:1 | DEL 4 |Patch invalid
Step 87 |Time: 2615552.0
Step 88 | COPY 2 -> 0:1 | COPY 13 -> 6:1 |Failed to compile
Step 89 | COPY 2 -> 0:1 | MOVE 15 -> 4:0 |Patch invalid
Step 90 |Time: 3400359.0
Step 91 |Time: 1422670.0
Step 92 | COPY 2 -> 0:1 | DEL 19 |Failed to compile
Step 93 | COPY 2 -> 0:1 | COPY 14 -> 2:0 |Time: 2111640.0
Step 94 | COPY 2 -> 0:1 | MOVE 6 -> 2:0 |Patch invalid
Step 95 |Time: 8795765.0
Step 96 | COPY 2 -> 0:1 | MOVE 14 -> 0:2 |Failed to compile
Step 97 |Time: 7091829.0
Step 98 |Time: 6114283.0
Step 99 |Time: 8386180.0
Step 100 |Time: 1971654.0

Best patch found: | COPY 2 -> 0:1 |
Found at step: 72
Best execution time: 1394517.0 (ns)
Speedup (%): 0.7406635361941513

==> Does New best mean that this patch passes all test cases, or just more than before? I assume Gin does not optimise in a multi-objective fashion right away, but maybe it optimises lexicographically <testsFailed,runtime>? Or what does it do? Minimise time, but always passing all tests? Yes, I have yet to look into the source code... Given the distinction of "patch invalid" and "failed to compile", I think the goal is runtime minimisation under the condition that all tests are passed, right? If so, this might be a statement for the Readme.md, e.g., "Running a Simple Example" with an explanation of the terms used.

==> Maybe "Speedup (%): 0.7406635361941513" can be rewritten to "Speedup (%): 74.06635361941513"? Strictly speaking, the speedup is no 0.74%.

drdrwhite commented 6 years ago

Fixed the percentage issue - will open the README issue separately and assign to Markus so he can submit a Pull Request :-)