[00:13] <timo> I threw tsan at rakudo and I've been trying to figure out if I can do something about any of the data races it's reporting; there's surely some that aren't a problem because the rest of the system is built to take them into account

[00:14] <timo> but I don't know enough about the nitty-gritty details of atomics and memory models to figure all of that out

[00:32] *** kjp left
[00:33] *** kjp joined
[00:35] *** kjp left
[00:35] *** kjp joined
[10:50] *** sugarbeet left
[11:00] *** sugarbeet joined
[12:05] *** Nicholas left
[13:06] *** Nicholas joined
[13:51] <lizmat> hmmm ... looking with a fresh eye at ParaSeq code, found this:

[13:51] <lizmat>         if nqp::atomicload_i($!unhandled) {

[13:51] <lizmat>             nqp::atomicdec_i($!unhandled);

[13:51] <lizmat> I assume that's a race condition, right ?

[13:52] <timo> indeed, you would want to have a compare-and-set, or depending on what exactly the rest of the code does, use the result from an unconditional decrement?

[13:53] <timo> sorry, compare-and-swap is the correct term

[13:55] <timo> there's also test-and-set which is a similar kind of thing

[13:55] <lizmat> right

[14:02] *** apogee_ntv joined
[14:04] <lizmat> not really in the right mindset for this atm.. will look at it tonight...  

[17:58] <lizmat> looks like in interesting underlying library: https://raku.land/zef:apogee/CRoaring

[17:59] <apogee_ntv> Yeah it's great, the API is really clean too.

[18:00] <lizmat> does it build on Windows ?

[18:00] <apogee_ntv> It's used in most high perf tag search engines via various levels of indirection.

[18:00] <apogee_ntv> With great difficulty.

[18:00] <lizmat> meh

[18:01] <apogee_ntv> It doesnt help that I don't know the Windows C ecosystem at all, so I don't even really know how to do a Build script for it.

[18:02] <apogee_ntv> My guess is if you have mingw it will probably be fine

[18:06] <apogee_ntv> https://raku.land/zef:apogee/Roaring::Tags I mostly wrapped it to build this

[18:14] <lizmat> well, feels like this might be a useful addition to the MoarVM core

[18:14] <lizmat> but **only** if it can be built on Windows

[18:22] <apogee_ntv> I will try to take a look at how to build on Windows later today or tomorrow. I should be able to spin up a VM.

[18:24] <lizmat> ++apogee_ntv 

[18:25] <apogee_ntv> What compiler should I be testing on? Best to use what's used in the moarvm release process?

[18:38] <apogee_ntv> lizmat: Looks like it builds fine, just have to make a defs file for the symbols you want to export: https://github.com/m-doughty/CRoaring-Raku/actions/runs/24098094861/job/70301908884

[18:39] <lizmat> and now I wonder how easy it could be made to support 1, 2, 4 bit native (shaped) arrays

[18:41] <timo> i'm not sure this can do what you want it to

[18:41] <lizmat> ah... ok

[18:41] <timo> it only stores a large one bit array very efficiently

[18:42] <lizmat> right...

[18:42] <timo> you can't have the same number twice, or store an order of the numbers

[18:42] <lizmat> hmmm...in that light: ah... ok, I guess I shoulda've read the docs  :-)   sorry for the noise here

[18:43] <timo> i assume the algorithm doesn't generalize to multisets (which would allow one value to appear multiple times) or ordered sets (so you can have an order of items stored)

[18:43] <lizmat> Otoh, I wonder if this could be of use in regexes ?

[18:43] <timo> it could still be interesting for our unicode database

[18:43] <lizmat> right

[18:43] <timo> yeah, in regexes for character classes / sets

[18:43] <lizmat> replace several deep hash lookups by a single bit union?

[18:44] <timo> hm?

[18:45] <lizmat> nvm... I would need to think about this more

[18:45] <timo> which hashes were you thinking of?

[18:49] <lizmat> the uniprop ones ?

[18:50] <timo> ah, I'm not sure we have nested hashes there, isn't it mostly one huge flat table?

[18:51] <timo> after you go from a name of the property to an index, i think that's where hashes end

[18:52] <lizmat> ah...  ok...  that makes sense

[18:53] <lizmat> ShimmerFairy is probably the most up-to-date in that area nowadays ?

[18:56] <timo> not all properties are bits, of course, but in theory you can just assign multiple consecutive bits to a single property of a single codepoint, but then the operations like and/or/xor and such are perhaps not meaningful / useful any more

[18:56] <lizmat> yeah...  also makes sense  :)

[18:56] <timo> i'm not saying there's nothing to be gained though

[19:00] <timo> with an ahead-of-time-known set of values you can also look into Perfect Hashing

[19:01] <timo> not sure how well it applies to unicode properties though

