libera/#clasp - IRC Chatlog
Search
13:08:36
yitzi
Yes. On mine it uses the x86 by default since M1 goes into /opt .... When I build on M1 I do `./koga --llvm-config=/opt/homebrew/... --pkg-config=/opt/homebrew/..."
13:09:55
yitzi
In the stuff that bike just merged I made it possible to bootstrap from an x86 sbcl in an arm build, btw.
13:14:07
yitzi
Its very important that you install everything needed into the M1 homebrew, including pkg-config. Otherwise it will get very confused.
13:16:47
drmeister
When I'm in an arm shell and I `brew install pkg-config` it says it's installed already. `which pkg-config` says: `/usr/local/bin/pkg-config`
13:21:19
drmeister
And the M1 stuff is merged right? I'll clone clasp and build it with M1 and poke around.
14:06:58
yitzi
Either SBCL is fine. I just used the x86 one since it is in PATH so I don't have to do `sbcl --script koga ...` everytime. Instead `./koga ...` works.
14:13:25
drmeister
yitzi: I'm ready to step into the wonderful world of homebrew arm - but this happened - is there something that I'm still missing?
14:13:28
yitzi
Yes, I want to eventually move more of the logic of "TARGET_OS_bla" out of koga and into claspconfig.h so that we can bootstrap from Lisps which may not have much in common.
14:13:58
drmeister
I tried to install arm /opt/homebrew/bin/brew llvm@16 and it says it's already installed (it is in x86)
14:14:46
drmeister
I did the same thing with llvm@15 and it did install llvm@15 into the /opt/homebrew hierarchy?
14:17:26
drmeister
I read on the internet that you can install x86 and arm homebrew but you should not install the same kegs - that random person didn't know what they were talking about.
14:17:59
drmeister
yitzi: When you get a chance - can you post the command you use to build clasp with this arm version?
14:18:04
yitzi
Yep, so `./koga --llvm-config=/opt/homebrew/Cellar/llvm/16.0.6/bin/llvm-config --pkg-config=/opt/homebrew/Cellar/pkg-config/...." or something
14:19:08
yitzi
You can use the x86 ninja. That shouldn't matter. In other words just `ninja -C build` is fine
14:20:40
drmeister
Yeah - I'll warm up lldb and poke around. I'll have to try and remember how we debugged things before the days of time travel.
14:26:08
drmeister
I'm really interested in getting the M1 native build because when I'm traveling I pull everything back to my M1 laptop and work on there.
14:35:20
drmeister
I'm a little mystified why I need pkg-config - that's a build thing - right? It's not really important though (unless it is).
14:36:40
yitzi
pkg-config locates the libraries by it's own root. the x86 one one be able to find the arm libraries
14:48:14
bike
for some reason the recurring problem i have with the fcells is with the :test argument to make-hash-table. it's so silly
14:53:21
bike
and in this case it's because cleavir's irc-fdefinition loads the _Function directly instead of going through Symbol_O::symbolFunction like i naively assumed. ah well.
14:54:42
bike
so to get this working right i guess i need to teach the compiler about the FunctionCell structure, and to avoid an extra indirection i'll need to futz with the faso stuff also
15:19:18
drmeister
I may go through _Function in more places. If you want to find them change the name of the _Function slot?
15:22:45
bike
i actually think that's the only place - it's the only thing in the code referring to info.%symbol% (along with irc-setf-fdefinition of course)
15:23:14
bike
and with the extra indirection put in everything mostly works, so now i just need to work on fasos until that's optimized away
17:26:21
yitzi
I haven't found out how to do that. Some documents (maybe outdated) seem to suggest you still have to use the legacy one for that. https://llvm.org/docs/NewPassManager.html
17:35:33
bike
if they're actually axing the old pass manager it's hard to imagine it's still necessary.
17:42:13
yitzi
Looking the release notes it says that PassManagerBuilder has been removed, not that PassManagerBase has been removed.
18:38:08
yitzi
Seems like it works. I had to disable some optimizations b.c. I don't know what the new version is yet or I haven't exposed that stuff to Lisp yet. I replaced the addPasses..andRun lisp function with EMIT-MODULE that handles usage of the old pass manager for codegen, thereby shielding us from its existance.
19:04:09
drmeister
I screwed up and hadn't installed the arm fmt library. I `/opt/homebrew/bin/brew install fmt` and then `ninja -C build` and it failed again linking fmt.
19:04:31
drmeister
I'm thinking I need to `koga --deep-clean` each time to reset everything - does that sound right?
19:07:33
yitzi
hehe. I had to disable some optimizations and I haven't exposed it to Lisp yet. But it compiles and runs.
19:09:35
yitzi
Yep. Although frame 52 is probably erroneous. I think the error is in frame 55 or frame 54
19:10:57
yitzi
Somewhere in that area (translate-logical-path "real-path") gets turned into (translate-logical-path "random-junk")
19:12:00
yitzi
Which made me think it was some kind of problem in bytecode_vm or Wrapper_Variadic...
19:44:45
yitzi
Looks they have removed the last non-opaque pointer stuff in LLVM17. So there isn't a getPointerElementType anymore.
20:01:11
yitzi
The new pass builder has a textual representation of the optimization pipeline that it can parse. That might be easier then exposing the classes that represent different passes to Lisp.
20:02:05
yitzi
For example, you can do stuff like `module(function(fpass1,fpass2,fpass3)) module(cgscc(cgpass1,cgpass2,cgpass3)) module(function(loop(lpass1,lpass2,lpass3)))`
20:09:31
yitzi
bike: I am suspicious that this is unused code https://github.com/clasp-developers/clasp/blob/main/src/lisp/kernel/cmp/cmpliteral.lisp#L571-L630
20:33:36
bike
i don't remember, but if it's not referenced outside that file i doubt it's used. all the literal stuff is in its own package, after all
22:06:29
drmeister
The M1 problem is reproducible using: `ninja -C build load_cclasp-boehmprecise` followed by `(compile-file "sys:src;lisp;kernel;lsp;generated-encodings.lisp")`
22:27:42
bike
getting the original arguments is tricky since you'd have to look at the lcc_args in the frame, which I do not know how to do programmatically
22:27:59
bike
of course everything ought to be available in the saved lexical variables, but that's not apparent in udb
23:09:29
bike
i have function cells working with everything now, i think. have to make some cleavir changes for the first time in a while
23:40:37
drmeister
yitzi: There are corrupted objects in memory - this may be the cause of the problem.
23:54:52
drmeister
If I start clasp with this: `./boehmprecise/iclasp --norc --disable-mpi --ignore-image --feature clasp-min --load load-clasp.lisp -- base 0 "SYS:SRC;LISP;KERNEL;STAGE;BASE;0-BEGIN.LISP"`
23:55:38
drmeister
Then run `(room :test)` it reports that memory is clean. This means that every slot in every object in memory that points to another object actually points to a valid object.
23:56:35
drmeister
If I start with... `ninja -C build load_cclasp-boehmprecise` and then do `(room)` it report memory errors. If I use `(room :test)` - a very stringent test, it hangs.
0:03:27
drmeister
I added a `(room)` invocation after every source file is loaded - it's going very far without errors...
0:26:43
drmeister
https://github.com/clasp-developers/clasp/blob/main/src/lisp/kernel/cleavir/bytecode-adaptor.lisp#L109