digitalmars.D - CTFE in coverage reports - I finally fixed it
- Stefan Koch (49/49) Jun 15 2020 Hi Guys,
- Bruce Carneal (5/21) Jun 15 2020 [snip of code demonstrating the improvement, better coverage
- Stefan Koch (6/18) Jun 15 2020 Thanks Bruce, it does help tremendously to get this kind of
- =?UTF-8?Q?Ali_=c3=87ehreli?= (4/5) Jun 15 2020 Sorry for being quiet but I always appreciate your work. It's inspring
- Max Samukha (2/7) Jun 15 2020 Same here. Stefan rox.
- Stefan Koch (2/12) Jun 15 2020 Thank you both Ali and Max.
- Faux Amis (3/23) Jun 15 2020 Stefan, let me then add that I always look up to your work.
- Stefan Koch (3/29) Jun 16 2020 Thanks.
- aberba (2/24) Jun 16 2020 Will you publish your tui library to dub? would like to try it.
- Stefan Koch (4/25) Jun 16 2020 Which one do you mean?
- aberba (4/31) Jun 16 2020 Ok ok, so its the same as qui in dub repo?
- Stefan Koch (6/40) Jun 16 2020 No it's not.
- Stanislav Blinov (4/9) Jun 15 2020 How to know that you did great work: nobody is saying anything,
- Jesse Phillips (5/11) Jun 15 2020 D has no much potential to take on so many different domains.
Hi Guys, CTFE not being in coverage reports has made 100% coverage unattainable for code which has if (__ctfe) branches. Well fret no more. A few hours ago I've gotten this result. --- 4|int f(int n) { int acc; 42| foreach(i;0 .. n) | { 10| acc += i; | } 4| return acc; |} | | |pragma(msg, f2(4)); |pragma(msg, f(4)); |pragma(msg, f2(4)); | |void main() |{ | import core.stdc.stdio; 1| printf("%d %d %d\n", f(1), f(2), f(3)); |} | |int f2(int n) |{ 2| int acc; 30| foreach(i;0 .. n) | { 8| acc += i; | } 2| return acc;} test_ctfe.d is 100% covered --- the function f2() is never called at runtime at yet we are 100% covered. The way it works is quite simple. During CTFE we keep an array which counts the lines we hit. When it comes time to do codegen we simply initialize the hidden __coverge symbol. Which is a uint[] representing the coverage counts for line numbers with that information rather than filling it with zeros. Therefore no modification to the runtime is necessary at all. It's open as DMD pr: https://github.com/dlang/dmd/pull/11279 and hopefully passing on all platforms. Cheers, Stefan
Jun 15 2020
On Monday, 15 June 2020 at 15:02:04 UTC, Stefan Koch wrote:Hi Guys, CTFE not being in coverage reports has made 100% coverage unattainable for code which has if (__ctfe) branches. Well fret no more.[snip of code demonstrating the improvement, better coverage stats]The way it works is quite simple. During CTFE we keep an array which counts the lines we hit. When it comes time to do codegen we simply initialize the hidden __coverge symbol. Which is a uint[] representing the coverage counts for line numbers with that information rather than filling it with zeros. Therefore no modification to the runtime is necessary at all. It's open as DMD pr: https://github.com/dlang/dmd/pull/11279 and hopefully passing on all platforms. Cheers, StefanThanks for this Stefan. Another nice step towards "it all just works" and a commendably simple implementation.
Jun 15 2020
On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:On Monday, 15 June 2020 at 15:02:04 UTC, Stefan Koch wrote:Thanks Bruce, it does help tremendously to get this kind of feedback. Cheers, Stefan P.S. let's meet at the online beerconf, if and when it happnes.Hi Guys, CTFE not being in coverage reports has made 100% coverage unattainable for code which has if (__ctfe) branches. Fret no mre. StefanThanks for this Stefan. Another nice step towards "it all just works" and a commendably simple implementation.
Jun 15 2020
On 6/15/20 10:11 AM, Stefan Koch wrote:it does help tremendously to get this kind of feedback.Sorry for being quiet but I always appreciate your work. It's inspring how you never give up and continue going forward. :) Ali
Jun 15 2020
On Monday, 15 June 2020 at 18:49:01 UTC, Ali Çehreli wrote:On 6/15/20 10:11 AM, Stefan Koch wrote:Same here. Stefan rox.it does help tremendously to get this kind of feedback.Sorry for being quiet but I always appreciate your work. It's inspring how you never give up and continue going forward. :) Ali
Jun 15 2020
On Monday, 15 June 2020 at 20:00:55 UTC, Max Samukha wrote:On Monday, 15 June 2020 at 18:49:01 UTC, Ali Çehreli wrote:Thank you both Ali and Max.On 6/15/20 10:11 AM, Stefan Koch wrote:Same here. Stefan rox.it does help tremendously to get this kind of feedback.Sorry for being quiet but I always appreciate your work. It's inspring how you never give up and continue going forward. :) Ali
Jun 15 2020
On 2020-06-15 19:11, Stefan Koch wrote:On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:Stefan, let me then add that I always look up to your work. Become one of the greats! ;)On Monday, 15 June 2020 at 15:02:04 UTC, Stefan Koch wrote:Thanks Bruce, it does help tremendously to get this kind of feedback. Cheers, Stefan P.S. let's meet at the online beerconf, if and when it happnes.Hi Guys, CTFE not being in coverage reports has made 100% coverage unattainable for code which has if (__ctfe) branches. Fret no mre. StefanThanks for this Stefan. Another nice step towards "it all just works" and a commendably simple implementation.
Jun 15 2020
On Monday, 15 June 2020 at 20:51:13 UTC, Faux Amis wrote:On 2020-06-15 19:11, Stefan Koch wrote:Thanks. I am happy you think so.On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:Stefan, let me then add that I always look up to your work. Become one of the greats! ;)On Monday, 15 June 2020 at 15:02:04 UTC, Stefan Koch wrote:Thanks Bruce, it does help tremendously to get this kind of feedback. Cheers, Stefan P.S. let's meet at the online beerconf, if and when it happnes.Hi Guys, CTFE not being in coverage reports has made 100% coverage unattainable for code which has if (__ctfe) branches. Fret no mre. StefanThanks for this Stefan. Another nice step towards "it all just works" and a commendably simple implementation.
Jun 16 2020
On Tuesday, 16 June 2020 at 16:03:11 UTC, Stefan Koch wrote:On Monday, 15 June 2020 at 20:51:13 UTC, Faux Amis wrote:Will you publish your tui library to dub? would like to try it.On 2020-06-15 19:11, Stefan Koch wrote:Thanks. I am happy you think so.On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:Stefan, let me then add that I always look up to your work. Become one of the greats! ;)On Monday, 15 June 2020 at 15:02:04 UTC, Stefan Koch wrote:Thanks Bruce, it does help tremendously to get this kind of feedback. Cheers, Stefan P.S. let's meet at the online beerconf, if and when it happnes.[...]Thanks for this Stefan. Another nice step towards "it all just works" and a commendably simple implementation.
Jun 16 2020
On Tuesday, 16 June 2020 at 18:25:27 UTC, aberba wrote:On Tuesday, 16 June 2020 at 16:03:11 UTC, Stefan Koch wrote:Which one do you mean? d-tui? That's not actually mine, I just forked it.On Monday, 15 June 2020 at 20:51:13 UTC, Faux Amis wrote:Will you publish your tui library to dub? would like to try it.On 2020-06-15 19:11, Stefan Koch wrote:Thanks. I am happy you think so.On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:Stefan, let me then add that I always look up to your work. Become one of the greats! ;)[...]Thanks Bruce, it does help tremendously to get this kind of feedback. Cheers, Stefan P.S. let's meet at the online beerconf, if and when it happnes.
Jun 16 2020
On Tuesday, 16 June 2020 at 18:30:49 UTC, Stefan Koch wrote:On Tuesday, 16 June 2020 at 18:25:27 UTC, aberba wrote:Ok ok, so its the same as qui in dub repo? What I'm doing is trying out D package so write posts/demo about them. A tour kind of...D's ecosystem.On Tuesday, 16 June 2020 at 16:03:11 UTC, Stefan Koch wrote:Which one do you mean? d-tui? That's not actually mine, I just forked it.On Monday, 15 June 2020 at 20:51:13 UTC, Faux Amis wrote:Will you publish your tui library to dub? would like to try it.On 2020-06-15 19:11, Stefan Koch wrote:Thanks. I am happy you think so.On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:Stefan, let me then add that I always look up to your work. Become one of the greats! ;)[...]Thanks Bruce, it does help tremendously to get this kind of feedback. Cheers, Stefan P.S. let's meet at the online beerconf, if and when it happnes.
Jun 16 2020
On Tuesday, 16 June 2020 at 20:23:50 UTC, aberba wrote:On Tuesday, 16 June 2020 at 18:30:49 UTC, Stefan Koch wrote:No it's not. It's a d port of borlands tvision library. Originally by https://github.com/klamonte I just fixed it up a little, and after he deleted his repo, it now looks like I am maintaining it, but I don't really :pOn Tuesday, 16 June 2020 at 18:25:27 UTC, aberba wrote:Ok ok, so its the same as qui in dub repo? What I'm doing is trying out D package so write posts/demo about them. A tour kind of...D's ecosystem.On Tuesday, 16 June 2020 at 16:03:11 UTC, Stefan Koch wrote:Which one do you mean? d-tui? That's not actually mine, I just forked it.On Monday, 15 June 2020 at 20:51:13 UTC, Faux Amis wrote:Will you publish your tui library to dub? would like to try it.On 2020-06-15 19:11, Stefan Koch wrote:Thanks. I am happy you think so.On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:Stefan, let me then add that I always look up to your work. Become one of the greats! ;)[...]Thanks Bruce, it does help tremendously to get this kind of feedback. Cheers, Stefan P.S. let's meet at the online beerconf, if and when it happnes.
Jun 16 2020
On Monday, 15 June 2020 at 17:11:25 UTC, Stefan Koch wrote:On Monday, 15 June 2020 at 16:49:16 UTC, Bruce Carneal wrote:How to know that you did great work: nobody is saying anything, everybody's just using it ;) Keep rocking!Thanks for this Stefan. Another nice step towards "it all just works" and a commendably simple implementation.Thanks Bruce, it does help tremendously to get this kind of feedback.
Jun 15 2020
On Monday, 15 June 2020 at 15:02:04 UTC, Stefan Koch wrote:Hi Guys, CTFE not being in coverage reports has made 100% coverage unattainable for code which has if (__ctfe) branches. Well fret no more. A few hours ago I've gotten this result.D has no much potential to take on so many different domains. Moving programming challenges to compile time creates some unique opportunity. It is nice to hear about your progress.
Jun 15 2020