Stream: general

Topic: lightbeam


view this post on Zulip zeroexcuses (Jul 26 2021 at 19:47):

I really like the idea of lightbeam (fan of dynasmrt too). Is there (1) a documentation somewhere of why it became unmaintaneid and (2) last known good version? I'm looking for a semi-working starting point to hack from.

view this post on Zulip Dan Gohman (Jul 26 2021 at 20:02):

(1) the maintainer stopped working on it. but the basic idea of it still makes sense.

view this post on Zulip Dan Gohman (Jul 26 2021 at 20:05):

(2) I expect the current trunk is as good as any other revision. That said, the code is fairly complex, in part because it had ambitions of doing advanced optimizations on the fly, so if you want something simple (and a single-pass wasm jit can be fairly simple), it may be easier to start something new.

view this post on Zulip zeroexcuses (Jul 26 2021 at 21:52):

https://github.com/bytecodealliance/wasmtime/tree/main/crates/lightbeam looks like there is some type of rewrite / migration going on ... and quit halfway

Standalone JIT-style runtime for WebAssembly, using Cranelift - wasmtime/crates/lightbeam at main · bytecodealliance/wasmtime

view this post on Zulip Dan Gohman (Jul 26 2021 at 23:17):

Lightbeam was always in a state of migration; I don't recall a time when it really settled in.

view this post on Zulip Haoran Xu (Jul 27 2021 at 19:49):

I had worked on a paper involving wasm baseline compiler so I have investigated this a bit. I have actually bisected the git history, and my conclusion is that such "good version" never existed: (1) lightbeam never supported br_table. You will hit this wasm instruction if your source code has anything like a function pointer or virtual methods, so you will get an unsupported error for basically any real-world module. (2) I have hit another error saying "virtual registers have run out", so it seems like lightbeam is making unreasonable assumptions on the size/complexity of input code as well.

view this post on Zulip zeroexcuses (Jul 28 2021 at 06:10):

@Haoran Xu : Thank you for sharing the insightful experience. I am still trying to get Lightbeam to exeucte \ x y -> x + y applied to (5_u32, 3_u32). One thing I do like about Lighteam is I am fasicnated by the idea of wasm -> dynasm without involving LLVM / Cranelift. For your paper, did you end up sticking with Lighteam or dod you go with wasmer-singlepass (which I believe also does wasm -> dynasm).

view this post on Zulip Haoran Xu (Jul 28 2021 at 07:11):

I wrote my own baseline compiler so lightbeam/wasmer singlepass (and those from web browsers) are my benchmark rivals. The paper is still moving through the conf reviewing process, but if you are interested in productionzing my baseline compiler (currently supporting wasm 1.0 spec but nothing more) feel free to PM me.

view this post on Zulip zeroexcuses (Jul 29 2021 at 01:47):

I have been refactoring lightbeam. I got the following to work:

(i32.const 42)

(i32.const 20) (i32.const 22) i32.add

It seems that when passing parameters to lightbeam, it can't read the args properly (i.e. passing (5, 3) it gets (5, some gigantic large number)). This looks like a calling convention problem. I am going to hack on lightbeam a bit more, still hopeful there is an interesting core to refactor out of it.


Last updated: Nov 22 2024 at 16:03 UTC