IRC logs of #shogun for Tuesday, 2019-04-23

--- Log opened Tue Apr 23 12:02:57 2019
-!- shogun-toolbox [~shogun@7nn.de] has joined #shogun12:02
-!- Irssi: #shogun: Total of 14 nicks [3 ops, 0 halfops, 0 voices, 11 normal]12:02
-!- Irssi: Join to #shogun was synced in 7 secs12:02
-!- sonney2k [~shogun@7nn.de] has joined #shogun12:33
-!- HeikoS [~heiko@174.pool85-48-187.static.orange.es] has quit [Ping timeout: 245 seconds]12:36
-!- wiking_ [~wiking@2001:67c:10ec:5784:8000::3ff] has joined #shogun13:21
wiking_gf712: pingu13:21
gf712wiking_: ping13:23
wiking_gf712: ok so i've got to the level of modelselection :)13:25
wiking_(if you ls src/shogun)13:25
gf712yup13:26
wiking_ 889 files changed, 8888 insertions(+), 9562 deletions(-)13:26
wiking_but SG_REF and SG_UNREF are removed... but not the lines13:27
wiking_clang rewriter is weird13:27
wiking_:)13:27
gf712oh is that for all the refs?13:27
gf712nice13:27
wiking_yes13:27
wiking_idk if i'm too stupid13:27
wiking_but sometimes the whole rewriter13:27
gf712you can always replace with ASDF and then regex13:28
wiking_makes quite a lot of erros13:28
gf712hmmm13:28
wiking_meaning how it replaces stuff13:28
wiking_sometimes replacing explicit casts works fine13:28
gf712you mean with lib tool?13:28
wiking_but then sometimes the parenthesis is fucked up13:28
wiking_yes13:28
wiking_hence it's not like running the 'script' and done13:28
wiking_:)13:28
gf712how weird, because you should be replacing a node right?13:28
wiking_well13:28
wiking_it's not that easy13:29
wiking_:DDDD13:29
wiking_you get declarations etc13:29
wiking_and then you traverse there stuff13:29
wiking_i'll give u the code13:29
wiking_once i'm done with this13:29
gf712ok, thanks13:29
wiking_and i wanna write a script13:29
wiking_that basically does13:29
gf712I watched a talk on it to get started, was pretty good13:29
wiking_isSameOrDerived("CSGObject") -> replace C with ""13:29
wiking_so to drop the C prefix13:30
wiking_i dont see the point of it anymore13:30
wiking_gf712: that is actually a pretty easy task13:30
wiking_if u wanna give it a go13:30
wiking_here's the matcher for it13:30
gf712why was there a C in the first place?13:30
gf712yea, I can try it out13:30
wiking_imo to makr13:30
wiking_*mark that it's a SGObject like13:30
wiking_so that it needs SGref/unref13:31
wiking_cxxRecordDecl(13:31
wiking_        isSameOrDerivedFrom("CSGObject")13:31
wiking_      )13:31
wiking_use clang-query13:31
wiking_to test your ideas13:31
gf712btw have you used the python interface?13:31
wiking_no13:31
wiking_why would i ? :)13:31
gf712quick prototyping13:31
wiking_mmm13:31
wiking_clang-query13:31
gf712I haven't tried it13:31
wiking_;)13:31
wiking_that'll give you the matches13:32
wiking_in REPL mode13:32
wiking_so the one above will give you the record decl for cxx classes13:32
wiking_that inherit from SGObject13:32
wiking_and then basically there you need a rewrite13:32
wiking_you can bind to this13:32
wiking_and then you should go everywhere where this decl is being used13:32
gf712ok, I just need to get it on my mac13:33
gf712brew llvm ?13:33
gf712can't find it clang-query in my path13:34
wiking_brew install llvm13:34
wiking_and then13:34
wiking_ /usr/local/Cellar/llvm/8.0.0/bin/clang-query -extra-arg-before="-v" -extra-arg-before="-I/usr/local/Cellar/llvm/8.0.0/lib/clang/8.0.0/include" -p ~/shogun/bdauto ~/shogun/src/shogun/features/BinnedDotFeatures.cpp13:35
wiking_and of course13:35
wiking_in ~/shogun/bdauto13:35
wiking_i did this13:35
wiking_cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_TESTING=ON ..13:35
wiking_that'll generate you a json13:35
wiking_that clang needs13:35
wiking_ok i've tried a matcher for template13:36
wiking_mmmm13:36
wiking_:)13:36
wiking_maaaybe a regex will b faster :)13:36
wiking_this gives you all the variable declarations13:37
wiking_where sgobject like pointers are used13:37
wiking_varDecl(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject")))))13:37
wiking_varDecl(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject")).bind("decl"))))13:38
wiking_you wanna have bind on the record decl13:38
wiking_so that you can easily do there there replacement13:38
wiking_for casts explicitCastExpr(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject")))))13:39
wiking_:)13:39
wiking_etc etc13:39
gf712ok, let me see13:40
gf712why -extra-arg-before="-I/usr/local/Cellar/llvm/8.0.0/lib/clang/8.0.0/include" ?13:40
gf712is that to get stdlib.h?13:40
wiking_otherwise compilation error13:41
wiking_:)13:41
gf712aight13:42
gf712so in the repl just paste those commands?13:42
wiking_m matcher13:43
wiking_so for example13:43
wiking_m varDecl(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject")).bind("decl"))))13:43
gf712so the result is from traversing the ast of BinnedDotFeatures.cpp tu ?13:44
wiking_yeah and the headers13:45
gf712and follows the nodes for each CSGObject in there?13:45
gf712ah ok13:45
gf712those are coming from the headers13:45
wiking_yes13:45
wiking_as the code is actually compiled13:45
wiking_:)13:45
gf712so could you have main.cpp that includes all the shogun headers13:46
gf712and go from there?13:46
wiking_mmm no13:48
wiking_because implementations are still would miss13:48
wiking_right? :)13:48
wiking_header wise yes13:48
gf712yea, so thats what I was wondering, how do you replace stuff in the tu?13:51
wiking_tu?13:51
gf712translation unit13:51
wiking_#include "clang/Rewrite/Core/Rewriter.h"13:51
gf712im coining the abbreviation :p13:51
wiking_        rewrite_.InsertTextBefore(sr.getBegin(), "FOOBAR");13:52
wiking_get the source range13:52
wiking_when it's matched13:52
wiking_ p->getSourceRange();13:52
wiking_but this i only did via libtooling13:52
wiking_dunno if clang-query supports stuff like this13:52
gf712hmm ok I see13:52
gf712and the bind I didn't quite get13:53
gf712is that to bind it to a group?13:53
wiking_yes13:53
wiking_coz in this case13:53
wiking_you not only wanna replace the record declaration13:53
wiking_but where it is being used in var decl13:53
wiking_this way if you bind the record decl matcher13:53
wiking_later you can get your clang cursor there with a simple get13:53
gf712ah ok ok13:54
gf712and that you do using lib tooling ?13:54
wiking_yes13:54
wiking_if(const ParmVarDecl* p = result.Nodes.getNodeAs<ParmVarDecl>(BIND_NAME))13:54
wiking_for example13:55
wiking_if you know that BIND_NAME is binding to a ParmVarDecl13:55
gf712ah I see13:55
wiking_now shit starts to hit the fan13:56
wiking_model selection fw13:56
wiking_is based on m_param13:56
wiking_aaaaand13:56
wiking_std::shared_ptr<WHATEVER>13:56
wiking_is foo bar :)13:56
gf712well, m_param should be gone soon13:56
gf712it depends on whether we remove it13:57
wiking_error: cannot take the address of an rvalue of type 'std::__1::shared_ptr<shogun::CSGObject>::element_type *' (aka 'shogun::CSGObject *')13:57
wiking_                                        p->add(&(m_sgobject.get()), m_node_name);13:57
gf712and then replace late on13:57
wiking_std::forward makes it lvalue13:57
wiking_or?13:57
gf712you need to derefence no?13:59
gf712dereference13:59
wiking_noupo13:59
wiking_yes13:59
gf712you got ref to pointer13:59
wiking_i mean no13:59
wiking_so .get() gives me an rvalue13:59
wiking_of CSGObject*13:59
wiking_basically CSGObject*&&13:59
wiking_but i need lvalue of that shiatz14:00
wiking_maybe i just comment out this line14:00
wiking_and model selection wont work14:00
wiking_as for sure we are not adding shared_ptr support14:00
wiking_to old param fw14:00
gf712wiking_: pretty sure it should be &(*m_sgobject.get())14:04
gf712but yea14:05
gf712the old param is going away soon14:05
wiking_holly cow14:06
gf712I just don't know if Heiko wants to wait until the new framework is in place14:06
wiking_DynArray<DynArray<Parameter*>*> param_sets;14:06
wiking_:(14:06
gf712and then replace14:06
gf712or wait delete now and replace later14:06
wiking_replace what?14:06
gf712old model selection stuff14:06
wiking_down in the drain14:06
wiking_:)14:06
wiking_it's develop14:06
gf712DynArray<DynArray<Parameter*>*> is quite a beast14:06
gf712but then should release first14:07
gf712and then remove?14:07
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has quit [Quit: Page closed]14:07
wiking_nono14:08
wiking_no point in reelasing anymore14:08
wiking_sooo many abi changes already14:08
-!- gf712 [9052083f@gateway/web/freenode/ip.144.82.8.63] has quit [Ping timeout: 256 seconds]14:12
-!- HeikoS [~heiko@106.pool85-48-187.static.orange.es] has joined #shogun14:55
-!- mode/#shogun [+o HeikoS] by ChanServ14:55
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has joined #shogun15:31
@HeikoSgeektoni: yo15:31
geektoniHeikoS: hello hello15:31
@HeikoShow are things?15:32
@HeikoSsaw the email with ahmed?15:32
geektoniHeikoS: everything is okay. I saw the email :)15:33
@HeikoScool, so maybe we have a solution to these problems soon, let's see15:34
geektoniHeikoS: yup, hopefully15:35
@HeikoSgeektoni: anything I can have a look at while I am here?15:38
geektoniHeikoS: I'm working at the blog post and LARS, but there is still nothing reviewable atm15:39
@HeikoSok no worries15:39
@HeikoSshare early though :)15:39
geektoniI would also like to fix that sg_dispatch thing15:39
geektonisure sure15:39
geektonimmh I can't see Gil around15:40
@HeikoSah yeah15:41
@HeikoSjust email him15:41
@HeikoSyou have his address?15:41
@HeikoSwell I sent it15:42
@HeikoSI have to run now. Talk to you later!15:42
geektonisee you!15:43
-!- HeikoS [~heiko@106.pool85-48-187.static.orange.es] has quit [Ping timeout: 258 seconds]15:47
-!- gf712 [9052083f@gateway/web/freenode/ip.144.82.8.63] has joined #shogun15:50
gf712wiking_: is there a meeting today?15:59
geektoniping gf71216:02
gf712geektoni: hey16:03
geektonigf712: hey! I have a quick question about your sg_any_dispatch16:03
geektonido you have a couple of minutes? :)16:03
gf712yup, go ahead :)16:04
geektonigreat! so16:04
geektonigf712: have a look at this line here https://github.com/shogun-toolbox/shogun/pull/4615/files#diff-f4e4aac153f6345d89d18867208beb3dR4216:05
geektoniI'm trying to use a lambda and sg_any_dispatch to print the content of a SGVector/SGMatrix16:06
gf712yup16:07
gf712is it not working?16:07
geektoniso I've written the needed code inside the lambda which should be used when the any is matched to a SGVector16:07
geektoniextactly :) even if v is declared auto, if I call v.to_string() the compiler complains16:07
gf712what error do you get?16:08
geektoniit basically tells me that "v is of type int"16:08
geektonilet me find you the complete error16:09
gf712mhhh thats very odd16:10
geektonigf712: here you are https://pastebin.com/ZFgnB8Sg16:14
geektoniit is quite massive16:14
gf712yea, because it tries out lots of types it creates this huge trace16:15
gf712but let me have a look!16:15
geektoniat line 49 you can see the error message it gives me16:15
geektonithank you :)16:15
geektonimaybe I'm missing something trivial16:15
gf712geektoni: its a bug16:24
gf712in my code16:24
gf712I fixed it in a pr that hasn't been merged yet16:24
gf712basically the pr is unrelated but I had the same issue16:24
gf712geektoni: I will create a pr with just the fix now16:25
geektonithat's perfect! Thank you very much :)16:25
gf712geektoni: this should fix your issue https://github.com/shogun-toolbox/shogun/pull/461716:29
geektonigf712: \o/ I'll let you know how it goes16:31
gf712ok!16:31
-!- besser82 [~besser82@fedora/besser82] has quit [Quit: Freedom, Friends, Features, First [fedoraproject.org]]17:38
-!- besser82 [~besser82@fedora/besser82] has joined #shogun17:39
-!- mode/#shogun [+o besser82] by ChanServ17:39
-!- wiking_ [~wiking@2001:67c:10ec:5784:8000::3ff] has quit [Remote host closed the connection]17:45
-!- gf712 [9052083f@gateway/web/freenode/ip.144.82.8.63] has quit [Ping timeout: 256 seconds]18:07
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun18:47
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection]19:32
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun19:36
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has quit [Quit: Page closed]19:38
-!- braceletboy [67157d53@gateway/web/cgi-irc/kiwiirc.com/ip.103.21.125.83] has quit [Ping timeout: 276 seconds]23:18
--- Log closed Wed Apr 24 00:00:46 2019

Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!