lizmat afk& 00:01
00:03 finanalyst left
timo a good chunk of time during startup is spent deserializing objects. you would assume / hope that some portion of those are not actually necessary and there may be ways to prevent some of that work from being necessary 00:13
ok, we actually first check if getcurhllsym("module_loader") is null before we attempt to loadbytecode ModuleLoader, i wonder if we register the module loader a bit too late in the right hlls so we don't get it from its hll symbol every time? 00:21
huh, v6d.bootstrap.moarvm seems rather tiny 00:22
okay what on earth is going on here haha 00:29
in bootstrap.c/BOOTSTRAP.nqp there's the "my class BOOTSTRAPATTR" at the top
it has a bunch of methods that are basically accessors, so like `method box_target() { $!B
`method box_target() { $!box_target }` 00:30
the bytecode we generate for it is basically:
checkarity 1,1; param_rp_o loc_2_obj, 0; paramnamesused
and then 8 times in a row: loadlib "libperl6_ops_moar.so", "libperl6_ops_moar.so"; loadext "libperl6_ops_moar.so", "Rakudo_ops_init"; 00:31
27 times in a row in the case of `method name() { $!name }` 00:32
no, that is actually `method type() { $!type }` that has 27 00:33
it actually looks like we've also compiled these methods a whole bunch of times?
there are 34 frames in the moar bytecode file named "dimensions" 00:34
each one has one more instance of loadlib + loadext than the previous one 00:35
that's pretty funny
did the latest nqp revision bump go wrong? i have the very latest nqp but here it shows up as 2024.12-4-g31d5cc698 instead of the 2024.12-5-g9a843dc6e we ask for in the nqp revision file 02:03
... i was on a branch 02:04
guifa timo: happens to the best of us 02:11
timo well, complaining on IRC is by far the most effective way to immediately find the source of the problem yourself :) :) 02:13
02:13 djinni` left
guifa 99% of problems are solved by complaining about them 02:13
and then immediately finding the solution
if you hadn't've said anything, it would never have been solved
timo i'm sure that's true 02:15
02:34 djinni` joined 07:59 finanalyst joined 10:26 sena_kun joined 10:29 sena_kun left 10:31 sena_kun joined
SmokeMachine Hi! Would someone say this is a bug? www.irccloud.com/pastebin/LupEUlFX/ 12:06
this is related to this: github.com/FCO/Cromponent/pull/9 Does any one have any idea on what's happening here? I am manipulating the EXPORT, so it is probably my fault... But I'm not sure if this kind of error should be thrown (`lang-call cannot invoke object of type 'VMNull' belonging to no language at line` (with no line number)) 12:09
lizmat that is typically a problem with something not being initialized properly 12:11
m: use nqp; BEGIN nqp::null()() # like this 12:12
camelia ===SORRY!=== Error while compiling <tmp>
An exception X::Comp::AdHoc occurred while evaluating a BEGIN:
lang-call cannot invoke object of type 'VMNull' belonging to no language
at <tmp>:1
Exception details:
===SORRY!=== Error while compili…
SmokeMachine oh! when trying to run that as a function() 12:13
s/"()"/?/
should a raku only code (messing with EXPORT) be able to do that? 12:15
lizmat: ^^ 12:16
lizmat if it exports an nqp::null as a Callable somehow, yes
although it probably should complain :) 12:17
SmokeMachine it's not using nqp directly... but it's using Cro template's compilation and exporting it... 12:22
ok... I think the problem is being thrown by the template compilation... 12:25
lizmat yeah, that may do some NQP stuff under the hood
Geth rakudo/main: 3265ff3bb6 | (Elizabeth Mattijsen)++ | docs/dispatchers.md
Update documentation of recently added syscalls
12:38
13:41 guifa left 13:57 finanalyst left 13:58 finanalyst joined
SmokeMachine lizmat: it seems my problem is not related to nqp... 14:11
but to when this code is EVAL()ed... I have no idea why... www.irccloud.com/pastebin/cf3unkeS/
any suggestion? 14:16
ab5tract SmokeMachine: I wonder if breaking down some of the embedded logic into subs would help isolate the issue? 14:47
SmokeMachine ab5tract: I'm trying to do that... but it's not so eazy... 14:53
ab5tract :(
Does it need to be BEGIN? 14:54
14:55 librasteve_ joined
SmokeMachine ab5tract: not sure... that's generated by Cro template's compilation... 14:55
ab5tract Ah! Okay, that helps explain why it looks like generated code ;) 14:56
So… one approach you might explore would be to compare the QAST of this code vs a smaller, working generated template 14:57
Ee, “compiled” template
SmokeMachine and it works if I use the module Todo (that exports that code), but it doesn't if I use a module that uses Todo...
ab5tract: may this help on context? github.com/FCO/Cromponent/pull/9 15:00
I'm extremaly lost... and I don't know where to go from here... 15:04
The only difference from the code that works 15:15
The only difference from the code that works to the code that does not work is the order on the prelude (that comes from a hash, so it may always be different)... usercontent.irccloud-cdn.com/file/.../image.png 15:17
Any suggestion? I'm really lost... :( 15:23
ab5tract Checking but simultaneously engaging with rambunctious nephews 15:26
Smoke
SmokeMachine: it’s a long shot but does switching to -I. change anything? 15:28
SmokeMachine Thanks!
let me try...
ab5tract: no luck... :( 15:30
ab5tract Boo :(
SmokeMachine ab5tract: but, please, don't let me to be between you and your nephews 15:31
If I run `todo-routes.rakumod` as if it was a script (`raku -I. -Ibin/lib bin/lib/todo-routes.rakumod`) it works as expected... 15:44
I recuded `Todo` to a minimal, and now it id just creating an empty `__TEMPLATE_SUB__Todo`... it still breaks if using `todo-routes` 15:46
This is the generated code now: www.irccloud.com/pastebin/o2IPxffA/ 15:47
it seems that if I remove the prelude it works... 15:52
But the code becomes only this: www.irccloud.com/pastebin/GCMjGOqq/code.raku 15:53
No... I was wrong... that doesn't wor... but the error changes... 15:56
www.irccloud.com/pastebin/ugSKj3o0/ 15:57
ab5tract Oh, that’s kind of interesting! 15:58
SmokeMachine www.irccloud.com/pastebin/DEm4ECEq/ 16:00
any idea of what could cause this missing or wrong version of dependency? 16:01
but it's after compiling... 16:02
ab5tract SmokeMachine: no idea :( 16:15
Have you tried any of these variations with RakuAST enabled?
SmokeMachine no, I didn't... let me try now... 16:16
jdv what is the state of the ast effort? is it the gnarly bits left?
SmokeMachine ab5tract: no luck... even if I --target=ast, it dies on begin time... :( 16:19
ab5tract That’s a good question actually. I think nine++ was actually tackling things in sort order of spectests. This was intended to reduce the chances of “big” things being left to the end / the dark side of pareto 16:20
SmokeMachine and remofint the prelude did't work either...
ab5tract I’m considering picking things back up in the new year. I figure if I do anything sub optimally, it may act as a summoning spell :) 16:21
SmokeMachine: I’ll try to clone and poke at it at some point today
It’s the code from the PR you linked earlier? 16:22
SmokeMachine ab5tract: thank you very much! I'll commit som comments pointing to the prelude removal...
yes 16:23
ab5tract Cool :)
SmokeMachine ab5tract: the PR: github.com/FCO/Cromponent/pull/9 16:32
ab5tract: the comment: the comment: github.com/FCO/Cromponent/pull/9/f...1R140-R165 16:33
lizmat Question: should 16:56
raku -e ''
be *writing* out any bytecode ? 16:57
timo ^^ ?? 16:59
according to the MVM_COVERAGE_LOG of raku -e ''
it spends a log of time in NQP::src/vm/moar/QAST/QASTCompilerMAST.nqp 17:00
writing headers and frames
timo yeah we can't run code without writing a compunit and loading it into moar 17:07
it should only go into a buffer, not a file, though
please be aware that the overhead of the coverage log is probably significant, and not every line takes the same amount of time, so using it to estimate how much time is spent in one place is not reliable 17:11
SmokeMachine: with MVM_COVERAGE_LOG=blabla.txt and MVM_COVERAGE_CONTROL=2 you'll get a file with every line everywhere that is run, so you'll also get lines before the mysterious error happens 17:15
it might become very big, however
without the COVERAGE_CONTROL, the same line should only appear a few times, rather than every time it's run 17:17
SmokeMachine timo: thanks! I'm trying to understand the generated file... 17:39
that's huge 17:40
11790681 lines 17:41
timo yeah 17:44
just look at the last few hundred 17:45
ignore the first few million
SmokeMachine from back to front, 17 hits on SETTING::src/core.c/Exception.rakumod (on different lines); 19 hits on SETTING::src/core.c/Rakudo/Internals.rakumod (lines 1823, 1825, 1828, 1806, 1805 and 1804); 5 hits on src/vm/moar/dispatchers.nqp on lines (1825 and 1835); 5 hits on SETTING::src/core.c/Int.rakumod (line 78); 6 hits on src/vm/moar/dispatchers.nqp (lines 1817, 1821, 1825); 16 hits on SETTING::src/core.c/List.rakumod (lines 492 17:57
and 493); 2 hits on SETTING::src/core.c/Rakudo/Internals.rakumod (lines 1819 and 1823); thousands of hits on SETTING::src/core.c/IO/Handle.rakumod (line 37);
timo that's probably in big parts the printing of the exception 17:58
SmokeMachine I'm not being able to make sense of it... :( 18:16
timo right, you would have to cross-reference with the rakudo and nqp sources, or it won't make any sense at all :) 18:22
how big does the file remain after you run zstd over it, maybe with -12 or -16? 18:23
ab5tract SmokeMachine: I've got the code checked out, but I'm a bit confused... `todo-routes` is a sub with the export trait. But `use` is for requiring + importing packages 18:25
SmokeMachine ab5tract: todo-routes I mean is the file: bin/lib/todo-routes.rakumod 18:27
ab5tract yes, but that only contains a sub definition
so `use todo-routes` doesn't make sense to me, at least at first glance 18:28
SmokeMachine yes, that should be used here: bin/lib/todo-routes.rakumod
yes, that should be used here: github.com/FCO/Cromponent/pull/9/f...7bde692R12
that's just a way for testing... it is used in bin/spreaded-routes.raku 18:29
ab5tract but `use todo-routes;` isn't correct 18:31
the file is named `todo-routes.rakumod` but it does not contain a package
module / class / package / etc
so there isn't anything for the `todo-routes` sub to export out of 18:32
SmokeMachine but that should not be needed, should it?
timo is there a requirement for having something like "unit package blah;" so that the export/import machinery will work?
Geth whateverable/main: 05ec1f2f2b | (Will Coleda)++ | .ping
touch a file to make things wake up
ab5tract SmokeMachine: I'm not aware of `use` being an operation that can do anything besides require and import a package 18:33
SmokeMachine I think I have already exported out of nothing (but I can be wrong...)
timo have you already tried to poke at it from the REPL?
SmokeMachine let me try adding that on a class...
timo i'm not sure where exactly we are in the troubleshooting process
SmokeMachine adding a unit class it got the same error... :( 18:35
ab5tract I think you'd want `unit module todo-routes`
still installing dependencies
18:37 committable6 left, shareable6 left, quotable6 left, linkable6 left, benchable6 left, bisectable6 left, releasable6 left, notable6 left, evalable6 left, unicodable6 left
SmokeMachine usercontent.irccloud-cdn.com/file/.../image.png 18:37
ab5tract interesting... TIL
Geth whateverable/main: 0b0cd4b445 | (Will Coleda)++ | .ping
touch with *recent* commit to force a reconnect?
18:39
18:39 shareable6 joined 18:40 bloatable6 joined, greppable6 joined, unicodable6 joined, linkable6 joined, benchable6 joined, releasable6 joined, committable6 joined, bloatable6 left, committable6 left, shareable6 left, greppable6 left, unicodable6 left, benchable6 left, releasable6 left, linkable6 left
jdv ab5tract: nice 18:41
SmokeMachine ab5tract: same result with module instead of class...
ab5tract yeah, I see that now too :S
So it looks like the parser phase completes without issue
SmokeMachine yes... it breaks on templte's AST compilation... 18:42
18:43 shareable6 joined, quotable6 joined, coverable6 joined, benchable6 joined, greppable6 joined 18:44 sourceable6 joined, notable6 joined, releasable6 joined, evalable6 joined, tellable6 joined, unicodable6 joined 18:45 bloatable6 joined, linkable6 joined, committable6 joined, nativecallable6 joined
ab5tract so I guess we will need to dive into the compiler 18:45
18:45 bisectable6 joined
SmokeMachine this is what I did to see what the compiler was doing: www.irccloud.com/pastebin/mejcKNv5/ 18:46
timo i'm not sure if this is helpful, but have you tried RAKUDO_MODULE_DEBUG yet? 18:47
SmokeMachine not, let me try 18:48
timo: no, I didn't... let me try it, thanks
timo it might not be the right hammer, maybe it'll just show that the module loading parts are going just fine? 18:49
18:50 Xliff joined
SmokeMachine ... 18:57
sorry...
timo: the end of the print: www.irccloud.com/pastebin/wKSwc0sT/ 18:58
timo do you actually have all the evals as files on disk? that would maybe be interesting ... 18:59
SmokeMachine timo: I have a way to print the code to be evaluated... bu I need to implment many things it need to run (because to print it I have to override what runs it and I lose access to many functions...) 19:01
timo ah, ok that's fair 19:02
it's always extra fun™ when there's multiple processes involved etc etc
SmokeMachine timo: this is the code it EVAL()s: www.irccloud.com/pastebin/wbzFSDaL/eval.raku 19:04
timo can you change the code that runs the eval? can you tell the compiler to, for example, turn stagestats on, or rxtrace for example? 19:06
SmokeMachine but the main point (I think) is that if I use `Todo` directly it works... it just doesn't work if I use `todo-routes` that uses `Todo`...
I can try attach code after and/or before that... what should I add? 19:07
timo so, the "BEGIN time" thing being run could be the code implementing the trait TEMPLATE-EXPORT-SUB 19:08
SmokeMachine yes, it could... ant this is the thing: github.com/croservices/cro-webapp/...od#L18-L35 19:10
but just to remember: it works when using Todo directly...
timo would it be OK for me to walk you through a little gdb debug session? 19:12
SmokeMachine yes, please 19:13
timo with gdb it won't be so difficult to reach the point where the "cannot invoke" error happens and inspect where it actually happens
you're on a mac?
SmokeMachine yes
timo ok, lldb would also work
i'll just be slower with that
SmokeMachine timo: www.irccloud.com/pastebin/02SENFg9/ 19:17
timo would it be okay to share a tmate session? going back and forth over irc with pastebin can be quite tedious 19:18
SmokeMachine I dont know tmate... :( 19:19
timo it's like a tmux session that gets a publically reachable tunnel set up for you and it spits out a read-only as well as a read-write commandline that someone else can just run (basically just an `ssh blabla:foobar@blabla.tmate.com` or whatever) and by running that you join the shared tmux 19:21
quite obviously you should only give these access credentials to people you trust, and if you give them the readonly link while the read-write link is still being displayed and they join and see it, they can just switch over
think of it like screenshare without video or audio, just terminal
SmokeMachine timo: I'm not sure if I'll be able to do that :(because I'm using the company's computer... and they really care about that... :( I'm very sorry... 19:23
timo no problem 19:24
ok, i'll give you some commands to run inside lldb
SmokeMachine (sorry for that...) 19:25
timo break disp/boot.c:326
SmokeMachine error: command 'breakpoint' did not recognize 'disp /boot.c:326' as valid (subcommand might be invalid).
timo no space before the / 19:27
SmokeMachine I did not add a space... odd...
timo: www.irccloud.com/pastebin/0R1ll1fg/ 19:28
timo could be it requires quotation marks around paths?
not very familiar with lldb commands
if the breakpoint gets set successfully, you can try "r" and see if that properly starts the program from the beginning 19:29
SmokeMachine when I start it, it runs and breaks, if I run `bt all` it says the code should be running, it does not accept breakpoint... I'm not being able to use it... :( 19:57
www.irccloud.com/pastebin/4WeKBmPm/ 19:58
timo yeah at the point you created the breakpoint, the process wasn't running 20:00
"r" should run it from the beginning, and the breakpoint should still be there
oh, but it's most probably launching a subprocess to do the compilation, and then lldb probably won't attach to that by default 20:01
SmokeMachine :( 20:02
timo we can try this: settings set target.process.follow-fork-mode child
20:03 MasterDuke joined
SmokeMachine the set was accepted... but the breakpoint continues not working... 20:04
timo did it say anything about attaching to a child process? does it say that the breakpoint has resolved? 20:06
it's possible my copy of disp/boot.c has different lines from yours
we can try instead breaking on MVM_exception_throw_adhoc 20:07
SmokeMachine no, it seems to not know about that file....
www.irccloud.com/pastebin/KPAcboze/ 20:08
MasterDuke did you compile moarvm with --debug?
SmokeMachine I did rakubrew it...
MasterDuke or try just boot.c without the 'disp/'
timo can you run it and just hit ctrl-c at a random spot while it's running? 20:09
SmokeMachine www.irccloud.com/pastebin/019vhrSz/ 20:10
timo maybe the command only works with "b" instead of "break" 20:11
SmokeMachine timo: with a ctrl www.irccloud.com/pastebin/pPrbSVzK/
ctrl+c
timo backtrace please? does it have any MVM_ functions in it with filenames and line numbers?
SmokeMachine www.irccloud.com/pastebin/Mo7PGLZM/ 20:12
timo: www.irccloud.com/pastebin/83VtcCmG/
I fell like I'm doing something wrong... should I be running this on the same dir as the code or raku binary? 20:13
timo that doesn't look like line numbers, ok we probably don't have debug symbols for moar here 20:14
without --debug on the Configure.pl of moarvm we won't be able to do much of anything
MasterDuke fyi, `lldb -- raku -e 'say "hi"'` seemed to work, and then I could `b disp/boot.c:326`, but I've compiled my moarvm with --debug=3 20:15
SmokeMachine it seems I may need recompile rakudo... any way of doing what I need with rakubrew? 20:17
MasterDuke theoretically you only need to recompile moarvm, but I don't use rakubrew, so I don't know if that's actually easier 20:18
ugexe you can pass --configure-opts to `rakubrew build ...` to pass whatever options to Configure.pl
it ends up being something like `--configure-opts=--moar-opts=--foo
timo yes, no need to rebuild nqp or rakudo, just moarvm will be enough 20:19
but i don't know if rakubrew allows that
SmokeMachine once I'm there... I'll get the last version of everything...
timo OK 20:20
SmokeMachine I'm getting error: www.irccloud.com/pastebin/hySMJvJT/ 20:34
timo > Error fetching paste 20:35
huh.
any errors or warnings earlier than that? 20:36
SmokeMachine no... :( 20:38
timo anything you can do to force rakubrew to really do a clean build? 20:40
ugexe you can do whatever you want to `~/.rakubrew/versions/moar-whatever/nqp/MoarVM`. I often modify moarvm source code there and run `make install` 20:43
ab5tract Another option is to point rakubrew at a moar-local that is your Rakudo source tree 20:44
Just don’t forget to run make install
timo i really want --debug to be the default for moarvm 20:46
MasterDuke don't think I would object 20:47
SmokeMachine while running make on MoarVM after running `perl Configure.PL --debug`: www.irccloud.com/pastebin/MAlWJPkv/ 21:07
timo wtf. our macos builds on CI were green weren't they? 21:08
MasterDuke and I just seconds ago built moarvm+nqp+rakudo on macOS 15.2 21:12
SmokeMachine after checkingout to main and trying agein: www.irccloud.com/pastebin/JEatqnWc/ 21:13
that's probably my fault... but I don't know what I'm doing wrong... 21:14
MasterDuke what version of macOS are you using? 21:15
ugexe rakubrew build moar-blead --configure-opts=--moar-option=--debug
SmokeMachine I confess I might not being able to pay as much attention as needed to it... I haven't sleep he last night trying to solve the Cromponent problem...
MasterDuke: usercontent.irccloud-cdn.com/file/.../image.png 21:16
MasterDuke huh 21:17
SmokeMachine ugexe: let me try that
timo can you try to get an x86_64 build with rosetta or something?
SmokeMachine it seems it passed libuv... 21:19
ugexe that suggests your moarvm checkout is messed up
or was rather 21:20
timo from the submodules maybe?
ugexe almost certainly 21:21
SmokeMachine www.irccloud.com/pastebin/J9lEc0Qe/ 21:22
timo: www.irccloud.com/pastebin/itjyYcfa/ 21:24
timo: with ctrl+c: www.irccloud.com/pastebin/WrgaM6i9/ 21:25
timo is that the right version? did you need to rakudobrew switch? 21:29
SmokeMachine I didn't, sorry... doing now 21:30
timo no need to apologise
SmokeMachine timo: www.irccloud.com/pastebin/QLP0TlGD/ 21:36
timo yes, huge difference 21:38
ok, that process you're in right now is i think just waiting for data to come in, so it's probably already created the child process that we're interested in 21:39
SmokeMachine timo: www.irccloud.com/pastebin/jhqEK52K/ 21:52
timo is that another random ctrl-c press? 21:53
can you try with the follow-mode set to child like i pasted earlier?
SmokeMachine the same. 21:54
I did, If I'm not mistaken... let me try again
ab5tract oh! I don't if you want top be using the `rakudo-lldb-m` wrapper 21:56
I had a lot of trouble with that
maybe it's fine though, 🤷 21:57
timo the wrappers have the drawback of immediately running your program, so you can't set up stuff before it begins running
SmokeMachine timo: It doesnot stop on the breakpoint... www.irccloud.com/pastebin/bXKol7Bf/ 21:59
Geth rakudo/ugexe/deprecate-multi-file-operations: 05c8484717 | ab5tract++ | src/core.c/io_operators.rakumod
Simplify candidates by going with IO() only
22:00
ab5tract timo: There's that indeed, though I vaguely remember broader troubles 22:05
SmokeMachine I think I'll have to leave that for tomorrow... I completed 24 hours playing with that... 22:08
timo all right!
ab5tract SmokeMachine: no worries! Get some rest! I'll try to poke at it a bit 22:09
SmokeMachine but if someone is interested on that and would like to take a look, the problem is here: github.com/FCO/Cromponent/pull/9 22:10
ab5tract: thank's! please if you find something, please send me a message, my ircclient notifies me... (I can't sleep yet... my daughters are still awake) 22:11
22:44 MasterDuke left 22:52 guifa joined 23:25 librasteve_ left 23:32 sena_kun left 23:49 guifa left