---
tags: minutes
---
# Multicore Applications meeting notes
# 2023
## 01 Feb
Bikal:
* Worked on some Eio PRs
* Eio bug get and set
Christiano:
* More work with parallelism experiments
* libuv signals
Thomas:
* found some bugs in dune - reported to dune
* Weird CI failure on EoF
* Libuv loop not closing, leaking File Descriptors
* Windows signals works now - needs a patched version of OCaml and Eio
* Bugs in faraday library - reported upstream
* Preparing for Eio 0.8 release
Bartosz:
* Releasing reagents
* false sharing on lockfree
Vesa:
* Eio on Windows - issue with building flexdll resolved
* kcas algorithm clean up PRs
Sudha:
* Q1 reviews
* Minidebconf presentations
## 17 Jan
Christiano:
- Mirage PR - mostly working, but TLS (thread-local storage) is broken. Lucas has an idea to fix this.
- Sigmal mask PR has been merged into ocaml.
- Working on Tasks abstractions and thinking about semantics of doing multiple operations on a single FD. Tricky even within one domain. Will write up thoughts on this.
Lucas:
- Has been looking at the Runtime events PR. Nearly there now.
- Looking at Meio (Eio monitoring). We want to get caller location from e.g. Fiber.fork without the user doing extra work, but tail-call optimisations mess this up. Also affects non-Eio stuff like assert. The Rust compiler has explicit support for this. Fred B had a patch for this but it was rejected.
Bartosz:
- kCAS review. Reviewed hashmap. Will likely be slower than array-based one, but allows snapshots and resizing is better. Looking at parallel composition in kCAS. It adds a lot of complexity - maybe not worth it. Documented in comment.
Bikal:
- cohttp-eio. Made a Server.run API for Eio.
- Hitting 64-item uring limit. This was supposed to be mixed in uring/main, but with that is was even worse! Possibly we need to update Eio to use the new feature properly. Will make a simple test-case we can use to reproduce and later confirm it's fixed.
Vesa:
- The MDX non-blocking problem turned out to be a regression. It's being reverted.
- flexdll hack is needed on Windows. utop and MDX are both broken on Windows - can't load C libraries. Might be an upstream OCaml bug. Will try with `ocaml` toplevel.
- Multicore: Atomic.get followed by compare_and_set does an unnecessary acquire. This slows things down a bit. Has a library to work around this and will move it to ocaml-multicore.
- Is also making a domain manager library. Eio's own Eio.Domain_manager was intended to do this too, but might make sense to have it separate.
Thomas:
- Working on lock-free streams. Non-blocking operations are tricky. e.g. a non-blocking add that finds the consumer cancelling doesn't know whether it will cancel or not. Normally it would leave the value with it and continue, but then we don't know where the item will end up in the sequence.
## 10 Jan
Carine: fix for dscheck issue.
Thomas:
* spent time on converting to lockfree, passes dscheck. try_lock feature to be added. Paper says naive way doesn't work, but paper's argument is unconvincing.
* Went through TLS issues and created a meta issue.
* Signals on libuv doesn't get handled, bug on libuv have potential fixes.
Bikal: Working on TLS, DNS and typed header for cohttp.
Vesa:
* reviewed lockfree Semaphore
* reviewed KCas PRs
* New algorithm for kcas
* experimenting with work-stealing
* mdx works on windows, unable to load libuv
* Thomas: bytecode issue maybe
* Vesa: utop doesn't work too
* Christiano: utop also runs on byte mode
Bartosz:
* working on channels in reagents
* parallel composition in reagents is actually sequential, need to implement from scratch.
Christiano:
* solo5 for OCaml 5 is done.
* library for get_addr_info needs to be released
Sudha:
* completed Lambda retreat and Engineer spotlight blog. Reviewed GC blog
## 03 Jan
Bartosz: Fixing issues with Michael Scott Queue in reagents. Atomic references have different semantics in reagents, which may force users to write it from scratch.
Thomas: Lockfree CQS. Using it in signal handlers, makes it faster. some issues/PRs on dscheck in the process. Optimized version of dscheck may be buggy - have a minimal testcase to show the failure. lockfree semaphores and promises. Invited to ocaml cafe for a talk on Eio.
Lucas: Busy with Thales work past month. This week rebased the custom events PR to trunk. No comments from JS. Going to look into tokio console and Eio consle this week.
Vesa: off sick for a week. Progress on libuv windows, David found the same segfault on windows and proposed a fix. Going to test non-mdx tests on Windows. Experiments with parallel primitives.
Sudha: blog posts on Benchmarksgame, Lambda retreat. Planning work.
---
# 2022
## 20 Dec
Vesa: Eio benchmarks segfault on Windows, narrowed it down to a part in luv.
* Thomas: can we reproduce without Eio?
* Vesa: should be possible with enough stack allocations.
Bartosz: reference types in reagents - implementation of recursive locks. Fixing task.
Thomas: Eio 1.0 checklist. Cancellation support in tls-eio. Lockfree waiters - working now, need to benchmark. Rework cancellation system, can simplify a lot.
Bikal: ocaml-tls - trying to reproduce issue with TLS overflow.
* Thomas: maybe sending message to other side to close.
Sudha:
## 13 Dec
Bikal: Worked on cohttp-eio. Will work on a blog post for cohttp-eio next. Has an ocaml-dns bug which is hard to track down - gives lots of misleading errors about TLS failures, poisoned mutexes, etc. Probably just needs a mutex around the write operation.
Vesa: Trying to test Eio on Windows, but needs to get the platform set up first. Building OCaml 5 (trunk) and a dev version of opam. The released version of opam doesn't work on Windows (but the OCaml 5-rc1 compiler itself does?). Unclear whether you need a special opam-repository fork - will talk to David about it.
Bartosz: Working on reagents. Found that multi-CAS is broken with overlapping locations!
Thomas: Working on lock-free waiters, using dscheck to test it (main branch is too slow, but there's a PR which helps a lot). Released Eio 0.7. Made an alternative getaddrinfo to avoid licensing problem using the code from OCaml. There is a deadlock problem with the Luv backend on multiple domains - fix might be simple but need to test that next.
We should make some plans for Eio 1.0 when Sudha and Christiano are back.
## 6 Dec
Carine: hash table. debugging tests for treiber stack. admin work.
Bartosz: reagents work, test failures are unrelated to OCaml 5 port. Going to merge the port and continue fixing errors.
Lucas: worked on Thales project. going to work on runtime events and mirage n/w
Bikal: debugging error with DNS
Christiano: documentation fix for domain. Eio Signals.
Thomas: unify signals. lockfree waiters will be useful.
Sudha: blog post for benchmarks game. Quarter planning.
## 29 November 2022
Bartosz: Treiber Stack and MS Queue, experiment with Backoff.
Bikal: open PRs to cohttp, and others. DNS client work
Christiano: signal implementation for Eio.
Jon: testing Windows fixes to opam-repo
## 22 November 2022
Bikal: OCaml DNS. Cohttp. Hacking days - kqueue. cohttp - outstanding PRs updating as per reviewers
Carine: solution to MPSC queue. try to finish SPMC queue. Reviewing MPSC queue.
Bartosz: alignd atomics - create Atomics aligned with cache lines. dscheck release - add to lockfree.
Jon: finishing up dune work
Sudha: finished porting tutorials. working on releasing sequential domainslib.
## 15 November 2022
Bartosz: MPMC Queue - more into literature. Treiber stack and MSQueue. Stack has the ABA, the queue is fine.
Bikal: Eio Net, not implemented in the Luv backend. Users don't set socket options - PR open. Migrate cohttp-tests, cram tests and mock to mdx.
Jon: dune issues, will be back to iocp
## 08 November 2022
Bartosz: MPMC Queue. It may violate FIFO. Bugs found in the library.
Debugging benchmarks in current_bench.
Carine: Review Bartosz PRs. hard to properly define lockfree data structures.
Christiano: most Eio outstanding stuff done. DNS discussion with hannes. Working on Signals on Eio. Multicore DNS resolver.
Bikal: n/w issues for Eio, using UDP - solved and merged. Eio socket options with Eio. Typed cohttp API - using GADTs.
## 25 October 2022
Christiano: Working on Eio Stat. Libuv gives limited stat - can call only on TCP, file streams. Kernel bug - when pipe is blocking or use splice. Finish this and implement signals.
Bartosz: spent time wrapping up lockfree PRs. Bug fixes. Reviewing dscheck PRs.
Bikal: working on benchmark. ocaml error fixed on trunk.
## 18 October 2022
Bikal: trying to build OCaml compiler and try custom events PR. porting ocaml-tar to Eio. Trying to build with magic-trace. Background reading on epoll.
* Christiano: Luv is already using epoll. They're not using non-blocking poll.
* Sandboxing is difficult with libuv
Carine: finished lockfree linked list. hashtable.
Bartosz: current-bench, add lockfree benchmarks. SPMC queue - we can plug into domainslib. Fully FIFO. dscheck, one test for dscheck, dscheck needs to be changed - iterates through all possibilities.
Christiano: Eio stat to get a stat. Fighting libuv, uring. PR to change getrandom. review ocaml5 solo5 bits. continue working on Eio.
## 11 October 2022
Carine: Hashtable. Issue with DLS.
Bartosz:
Christiano: fast-forward queue will be nice to have. Fixed bug in luv locally. Bug fixes
Bikal: non blocking socket in Eio could be nice.
Jon: what's the use case for having blocking vs non-blocking. More Windows IOCP stuff.
## 28 June 2022
Attendees:
- Thomas
- Bikal
- Jon
- Sudha
Bikal: Submitted a PR to `ocaml-dns`. CI issues. Testing on eio Windows and try to enable it in CI.
Thomas: Cohttp PR had no opposition, merged now. Working on a new release for eio. Merlin with OCaml 5 support isn't released, can be pinned. Added mock backend for Eio. Optimizing Buffered Reader, magic-trace works well!
Jon: Stripping lwt from tezos logging library. Idea is to still be able to run Lwt with `lwt_eio`.
Sudha: Irmin benchmarks rebasing. Sequential version of domainslib work in progress.
## 14 June 2022
Attendees:
- Carine
- Jon
- Christiano
- Lucas
- Bikal
- Jan
- Thomas
Carine: Verifying Eio's Lf_queue. https://arxiv.org/pdf/2111.12682.pdf might be useful too.
Jon: Mostly odoc work at the moment.
Christiano: Proposed PR for OCaml for getting the recommended number of domains. Learning dune and finishing cpu detection library. Got it working on Apple now. Has also been looking at mirage-tcp. Wants to try testing it with https://github.com/google/packetdrill.
Lucas: Also working on TCP. Has been trying to improve error handling using extensible variables, but ended up reinventing exceptions, so switched to that instead. Unclear what the best approach is: TCP needs to be able to differentiate between errors that should cause it to retry vs errors like out-of-memory for which it should abort. Also working on tezos-ci.
Bikal: Cohttp-eio PR got merged. Is now working on the client side of that. Wants to add some tests next. Also looking at converting DNS to Eio, which will require finishing tls_eio.
Jan: Continuing to work on test tools, adding more combinators to make it more usable. It's based on QCheck, which is blackbox in contrast to AFL. For multicore with non-determinism, this makes things a bit easier.
Thomas: Read the async code and made https://github.com/talex5/async_eio to allow mixing async and eio code. Combined with https://github.com/ocaml-multicore/lwt_eio, this also allows mixing all three together in one process: e.g. https://github.com/talex5/async-eio-lwt-chimera. Currently working on Eio.Mutex, based on Lucas's PR.
## 3 May 2022
Attendees:
- Bikal
- Jan
- Jon
- Patrick
- Sudha
Patrick: trying to narrow down the MacOS bug, removed dream from the dependency.
Jon: done with odoc work, going to resume multicore work.
Bikal: resolving issues with cohttp tests and CI.
Jan: chasing the macos bug on multicoretests with lldb.
Sudha: building irmin benchmark with trunk.
## 19 April 2022
Attendees:
- Bikal
- Carine
- Jon
- KC
- Lucas
- Patrick
- Sudha
Sudha: Catching up with sandmark PRs, outreachy applications. Revived trunk build for tezos and patched up ocamlformat.
Patrick: `ocaml-lsp` for trunk. Fixed the segfault with `ppx_inline_test`, problem actually in base. Looked at how to use generators for jsoo.
Bikal: setting up trunk CI with setup-ocaml. Will start looking at cohttp-eio client implementation.
Jon: wrapping up odoc work.
Lucas: port mirage-tcp tests to eio. New interfaces proposed for eio.
## 25 Feb 2022
Attendees:
- Thomas Leonard
- Patrick
- Bikal
- Deepali
- Sudha
Bikal: finalising cohttp-eio PR, working on resolving issues with parser. Generating graphs for retro-httpaf benchmarks
Patrick: started testing on Windows, IOCP is compatible with eio. Looking at tokio-console to import features for eio-console
ThomasL: worked on docs. Renamed `Fibre` to `Fiber`. Lucas' ping example works. Adding file to send and recv in uring.
Deepali: working on connector between eio and domainslib, domainslib task works inside fiber w/o blocking. fib example uses both domainslib and eio. reading papers/discuss posts on cancellation.
Sudha: tezos compiles with trunk, going to run benchmarks on trunk. Made patches for tezos-ci to work with multicore compiler and sent to CI team.