timo did you have a chance to look at the gdb plugin commits yet? 00:10
00:54 MasterDuke joined
MasterDuke yeah, i may have distracted myself with looking at analyze_phi(). thinking about what happens now, we have a dispatch to `boolify-iter`, which just calls `MVM_iter_istrue()`. that just has a switch on the `body.mode` of the iterator, calling `MVM_iter_istrue_(array|hash)` 00:57
so i guess what we want is for that dispatch to get rewritten directly to the correct `MVM_iter_istrue_(array|hash)` when the type is a known fact? 00:59
i'm not sure how dispatches get optimized 01:02
timo if we successfully ensure that we can be certain of the kind of iterator and its mode we should be able to generate sp_ instructions that directly access the values inside the iterator 01:22
or if we can partially-escape-analyze it we can not allocate the iterator object itself and just have int registers and an object register 01:23
jitdump is in moarvm main now isn't it? 01:24
you can grab yourself "samply" which is a nice one-command-does-it-all kinda thing to make a recording and show it in the firefox profiler UI 01:25
do it like MVM_JIT_PERF_DUMP=$(mktemp -d) samply record rakudo -e 'blabla' or whatever, then you'll see jitted frames with all their info and also the assembly 01:26
MasterDuke hm. i don't see any blindingly obvious examples of other dispatches being optimized like that to crib from 01:27
timo there you should be able to see if the iter boolification is as costly as it was when i tried it
indeed
MasterDuke huh, haven't tried samply before, will give it a go
timo on linux it's a wrapper around perf but it also does something on macos i think 01:29
if you have something that's not very long running, make sure to turn the -r parameter up so it samples more times per second. 10k is not a bad value in my experience 01:36
default is 1k i think
have to spell the number out, 10000 01:37
MasterDuke if this is to be trusted, 8% in boolify_iter_impl
timo total or "self"? 01:38
MasterDuke self
timo you can have samples attributed to the assembly and also source lines as well 01:39
if you limit the timeline to the parts of the run where it's iterating over the list and not the parts where it's building up the list, it will probably be an even higher percentage 01:40
MasterDuke building the list is hardly any time anyway 01:45
timo ok good
MasterDuke btw, was that "indeed" confirming my observation about lack of optimized dispatches? 01:51
timo i think the dispatcher is expected to do an amount of the optimization itself, installing the necessary guards as it goes 02:00
then regular guard elimination can make the result more efficient
MasterDuke i gotta get to bed. will pick this back up later 02:25
btw, the gdb stuff is cool, i definitely like the idea of doing more with/in gdb to make debugging/data gathering better 02:26
02:32 MasterDuke left 02:54 japhb joined 04:04 vrurg_ joined 04:07 vrurg left 06:42 releasable6 left 07:46 librasteve_ joined 09:25 tellable6 left 09:29 Voldenet left
timo with a sufficiently robust "moar bt", it should be able to just attach to a rakudo process and do `taas moar bt` and get rakudo-level backtraces of all threads in one output for easy copy-pasting when trying to figure stuff out 09:36
C-level backtraces can also be good, though when the jit is active they tend to go wonky relatively quickly 09:37
(the jitreader branch would help with this, of course)
10:09 Voldenet joined 11:19 evalable6 left 11:21 unicodable6 left, greppable6 left, nativecallable6 left, bloatable6 left, quotable6 left, sourceable6 left, benchable6 left, coverable6 left, huggable6 left, committable6 left 11:22 notable6 left, bisectable6 left, shareable6 left, linkable6 left 11:23 coverable6 joined, bloatable6 joined 11:24 evalable6 joined, nativecallable6 joined, linkable6 joined, unicodable6 joined, notable6 joined, releasable6 joined, benchable6 joined 11:25 huggable6 joined, shareable6 joined, bisectable6 joined, tellable6 joined, committable6 joined, greppable6 joined 11:26 quotable6 joined, sourceable6 joined
librasteve_ rakudoweekly.blog/2026/06/29/2026-...lease-194/ 13:50
timo `moar bt` was rather sluggish, so I spent some time optimizing it ... 20:36
Geth MoarVM/moar-gdb-rrdb: 6 commits pushed by (Timo Paulssen)++
21:42 guifa_ joined
Geth MoarVM/moar-gdb-rrdb: d1c3683826 | (Timo Paulssen)++ | tools/libmoar.so-gdb.py
gdb plugin: read all annotations immediately

instead of having to do a million tiny expensive reads
22:14
MoarVM/moar-gdb-rrdb: 44621e5e17 | (Timo Paulssen)++ | tools/libmoar.so-gdb.py
gdb plugin: also cache repeated stringification of frame args

It's not rare for one frame to pass at least one of its arguments on to the next frame, especially when it's the "self" argument.
Therefore, if we see the same parameter twice in a row, take it from the cache so we don't even have to look past the pointer
22:24 sugarbeet left 22:25 sugarbeet joined 22:38 apogee_ntv left, apogee_ntv joined
Geth MoarVM/moar-gdb-rrdb: a04c774155 | (Timo Paulssen)++ | tools/libmoar.so-gdb.py
gdb plugin: Resolve gdb.Type objects only at the start
22:47
MoarVM/moar-gdb-rrdb: 3bfb669eca | (Timo Paulssen)++ | tools/libmoar.so-gdb.py
gdb plugin: Be resilient against invalid MVMString *
MoarVM/moar-gdb-rrdb: 12d0bee890 | (Timo Paulssen)++ | tools/libmoar.so-gdb.py
gdb plugin: fix annotation reading using wrong struct format
timo oof, gotta build a pretty printer / inspector thingie for P6opaque 22:59