Multicore OCaml: January 2022
Welcome to the January 2022 Multicore OCaml monthly update! This update along with the previous updates has been compiled by @avsm, @ctk21, @kayceesrk and @shakthimaan.
@xavierleroy clicked “merge” on the upstream Multicore OCaml PR#10831 to upstream OCaml, which simultaneously made for a great start to the new year and prepared us for the hard work ahead to get to a stable release of OCaml 5.00.0! Since the merge, we have continued to work on the release via bug fixes, code improvements, and tooling support directly in the main ocaml repository. Notably, a new draft PR for ARM64 backend support has already been proposed.
OCaml 5.0 trunk also removes a number of deprecated modules, and renames EffectHandlers to Effect for consistency with the rest of the standard library. In the ecosystem, several of the key support libraries like uring, multicore-opam, and domainslib have had updates to work with 5.0.0+trunk. The Eio effects-based direct-style parallel IO for OCaml has had significant enhancements, and now also builds with OCaml 5.00.0+trunk. The Sandmark benchmarking suite now provides a 5.00.0+stable and 5.00.0+trunk OCaml variants to build the benchmarks for trunk.
OCaml 5.00 Release Planning
The core development team is currently pinning down exactly what will constitute the OCaml 5.00 release in terms of supported features. Anything that will be part of OCaml 5.00 but not currently supported must be in this list so that we can plan for its implementation. If you spot something that isn’t below but should be, please get in touch or post a reply. This list is, as always, subject to change as the core development team plans and implements the release.
Runtime
- Mark stack overflow
- Currently the mark-stack is allowed to grow to an unbounded size. There is a multicore implementation of mark stack overflow in mc#466 .
This design is complex and concurrently touches the major GC logic for determining when marking is complete. There is a feeling that a better design is to handle mark stack overflow with a stop-the-world section, but this has not yet been tried.
- Currently the mark-stack is allowed to grow to an unbounded size. There is a multicore implementation of mark stack overflow in mc#466 .
- Statmemprof
- Make the runtime memory model safe
- Ensure that the implementation of
caml_modifyis correct. - Fix warnings reported by Thread Sanitizer on the testsuite.
- Ensure that the implementation of
- Mark pre-fetching optimisation
- Minor heap design that reduces virtual memory consumption
- #10955 proposes deciding size of the minor area at program startup rather than fixed 256GB reservation now. Fixes Valgrind and AFL (with default limited virtual memory).
- Designs exploring alternative organisation of minor heap (DLAB, BiBoP) is
- Too risky to undertake now due to code change
- Benefits unclear. See experiments in mc#508.
- Make runtime safe for async callbacks
- See the meta issue on asynchronous callback handling in #10915
- Potentially requires changes to both the stop-the-world mechanism and major GC logic
- Currently no proposed plan or implementation. Implementation will require significant testing and benchmarking
- May make sense to complete as part of statmemprof work as both will potentially encounter similar implementation issues
- Eventring runtime tracing eventlog replacement
- Monitoring and optimising GC in multicore programs is difficult, current multicore eventlog was a temporary fix
- PR that adds eventring support to trunk in #10964
- Runtime is capable of running bytecode-only for 32-bit platforms?
- sequential or multiple domains?
- Remove the use of mmap for
Caml_state(see mc#796)
Stdlib
- Finish the Stdlib audit (#10960)
- Domains, Mutex, Semaphore, Condition in 4.14
- Support systhread based implementation of Domains and related modules. Mutex, Semaphore and Condition work as is.
- 4.14 is pretty much frozen already; so an emulation of Domains can be provided by a separate compatibility library.
- API Docs
- Write API docs for effect handlers and domains
- Manual chapters
- New manual chapters for effect handlers, domains and memory model
- OCamldoc thread-safety annotations
- Introduce an OCamldoc tag for thread-safety (#10983).
- Partial order between
domain-safe,systhread-safe,fiber-safe.not-concurrency-safeas default placeholder for those API functions, modules not audited for thread-safety.
- Atomic arrays
- Atomic mutable record fields
- Concurrency-safe lazy
- Lazy that is safe for domains, systhreads and fibers
Backend / middle-end
- Flambda support
- Arm64 support
- Currently being worked on in trunk.
- Targets are Mac M1 and AWS Graviton
- 32-bit support (
- Sequential-only native backend is achievable on x86. 32-bit ARM can probably support multiple domains. Time to drop x86-32 to bytecode only?
- Wasm is 32-bit only now.
- RISC-V, Power, …
- OpenBSD, FreeBSD merged.
- #10875 adds OpenBSD support
- MSVC support on Windows.
- Framepointer support
- Useful for
perfbased performance benchmarking. - x86 and/or arm64?
- Useful for
Tooling
- Revive
ocamldebug
January 2021 updates
As always, the Multicore OCaml updates are listed first, which are then followed by the ecosystem tooling updates. Finally, the Sandmark benchmarking tasks are listed for your reference.
Multicore OCaml
Ongoing
Discussion
-
ocaml-multicore/ocaml-multicore#750
Discussing the design of Lazy under MulticoreA design discussion of Lazy under Multicore OCaml that involves
sequential Lazy, concurrency problems, duplicated computations, and
memory safety. -
ocaml-multicore/ocaml-multicore#795
MakeMinor_heap_maxandMax_domainsasOCAMLRUNPARAMoptionsThe
Minor_heap_maxis defined as 2GB andMax_domainsas 128 in
runtime/caml/config.h, and there is an OOM issue on Multicore
OCaml when running tools like AFL and Valgrind. TheOCAMLRUNPARAM
option can be used to pass these parameters as arguments. An
upstream discussion has been initiated for the same at
ocaml/ocaml#10971. -
ocaml-multicore/ocaml-multicore#806
Unify GC interrupt and signal triggering mechanismsThe interaction between signal and GC interrupts need to be
reworked, as they exist as two independent mechanisms. There has
been progress on asynchronous actions in trunk in parallel with the
Multicore implementation. -
ocaml/ocaml#10861
Outstanding comments in the OCaml Multicore PRA tracker issue to record and document outstanding comments in the
Multicore PR for the 5.00 milestone. -
ocaml/ocaml#10915
Meta-issue on asynchronous action handling in MulticoreA discussion on unifying GC interrupt and signal triggering
mechanisms and review comments from Multicore OCaml PR#10831. -
ocaml/ocaml#10930
Downstream patch changes for removedStreamandPervasiveslibrary PR#10896A review of the recommended patch changes for Sandmark dependencies
used to run parallel benchmarks for 5.00.0+trunk. -
ocaml/ocaml#10960
Auditstdlibfor mutable stateThe OCaml 5.00 stdlib implementation should be both memory and
thread-safe, and this issue tracker has been created to audit stdlib
for mutable state.
Upstream
-
ocaml/ocaml#10876
Make Format buffer more efficient to MulticoreThe Format buffer implementation needs to be made more efficient. In
particular, when a second domain is spawned, Format switches to a
buffered implementation for stdout/stderr where the writes only
happen on flushes. -
ocaml/ocaml#10953
ocamltest/summarize.awknot properly reporting abort failures on testsuite runsThe
summarize.awkandocamltestcan skip reporting failures if
the log is improperly formatted, and this needs to be addressed. -
ocaml/ocaml#10971
Means of limiting how much memory is being reserved by the runtime,
so that Valgrind and AFL can be usedThe amount of virtual memory to be reserved in the OCaml runtime can
be limited and this needs to be made a runtime parameter. -
ocaml/ocaml#10974
domain.c: Use an atomic counter for domain unique IDsThe dependency on a fixed
Max_domainssetting needs to be removed
to dynamically configure the same during program execution.
Improvements
-
ocaml-multicore/ocaml-multicore#796
Caml_statefor domains should not use mmapThe
Caml_stateis no longer located adjacent to the minor heap
area whose allocation is done using mmap. A PR for the same is
actively being worked upon. -
ocaml/ocaml#10908
Fix possible race incaml_mem_mapon WindowsThe
runtime/platform.chas been updated to fix a possible race
condition incaml_mem_map, and debugging printf statements have
been removed. -
ocaml/ocaml#10925
Rename symbol forCaml_statetocaml_stateCaml_stateis a macro in Mac OS, and hence the same has been
renamed tocaml_stateto avoid a name collision. -
ocaml/ocaml#10950
Allocate domain state usingmallocinstead ofmmapThe PR replaces the unnecessary use of
mmapwithmallocto
simplifyCaml_statemanagement. -
ocaml/ocaml#10965
Thread safety for all runtime hooksThe PR implements the thread-safety of hooks and restores the GC
timing hooks in Multicore. -
ocaml/ocaml#10966
Simplifications/cleanups/clarifications for Multicore reviewThe APIs for signals/actions have been simplified,
caml_modifyhas
been documented, and dead code has been removed. -
ocaml/ocaml#10969
Switch tostrerror_tfor reentrant error string conversionThe PR uses
strerror_tfor string conversion asstrerrorin the
runtime is not reentrant in the presence of multiple threads.
ARM64
-
ocaml/ocaml#10943
Introduce atomic loads in Cmm and Mach IRsThe
Patomic_loadprimitive needs to be enhanced to ease support
for other architectures. This is required for the ARM64 support. -
ocaml/ocaml#10972
ARM64 Multicore SupportA draft PR that implements the assembler, proc and emit changes
needed to get ARM64 working has been proposed. The changes have been
tested on MacOS/M1 and a Linux/Graviton2.
Metrics
-
ocaml/ocaml#10961
Handle orphaning of GC statisticsThe allocation of
domain_stateto usemallocin Multicore
implementation prevents freeingCaml_stateat domain termination,
and this issue needs to be addressed. -
ocaml/ocaml#10964
Ring-buffer based runtime tracing (eventring)Eventring is a runtime tracing system designed for continuous
monitoring of OCaml applications. The following illustration shows
how eventring can be used to log the runtime data using Chrome’s
trace viewer.
Completed
Upstream
-
ocaml-multicore/ocaml-multicore#822
Revertarray.cto trunk. Introduce word-sizememmove.The word sized
memmoveis used only when there is more than one
domain running, andarray.chas been updated to be closer to the
trunk implementation. -
ocaml-multicore/ocaml-multicore/826
Addressocaml/ocaml#10831unnecessary diff review commentsThe PR updates the differences between Multicore OCaml and trunk
based on the review ofocaml/ocaml#10831. -
ocaml-multicore/ocaml-multicore#827
Re-introduce sigpending change from trunkThe
otherlibs/unix/signals.cfile has been updated to introduce
thesigpendingcode from trunk. -
ocaml-multicore/ocaml-multicore#833
Addressocaml/ocaml#10831review commentsThe
runtime/code has been to updated to address the code review
comments and suggestions fromocaml/ocaml#10831. -
ocaml-multicore/ocaml-multicore#834
More changes addressing review comments on ocaml-10831The additionoal feedback from
ocaml/ocaml#10831have been
incorporated in this PR. -
ocaml/ocaml#10831
Multicore OCamlThe PR to merge Multicore OCaml to
ocaml/ocamlwith
support for shared-memory parallelism through domains, and
concurrency through effect handlers has been merged! -
ocaml/ocaml#10872
Change domain thread name setting to be more portable and best-effort_allThe
caml_thread_setnamehas been changed to best-effort, and cases
to handle BSD permutations of functions have been added. -
ocaml/ocaml#10879
RenameEffectHandlersmodule toEffectThe
EffectHandlersmodule has been renamed toEffectto be
consistent with the rest ofstdlib. -
ocaml/ocaml#10975
Add missing changes from #10136 that may have been lost during a rebaseThe
runtime/io.ccode has been updated with changes from the
PR#10831 review.
Improvements
-
ocaml-multicore/ocaml-multicore#830
RemoveInt/Long/Bool_fieldmacrosThe
Long_val(Field())usage alone is now sufficient as theInt,
LongandBool_fieldmacros are no longer needed. -
ocaml-multicore/ocaml-multicore#831
Revert changes toocaml_floatarray_blitThe
ocaml_floatarray_blitchanges inruntime/array.care
retained to not break 32-bit compilation. -
ocaml-multicore/ocaml-multicore#836
Move bytecode only startup code intostartup_byt.cThe
startup_byt.cfile has been updated to contain the bytecode
only startup code fromstartup_aux.c. -
ocaml-multicore/ocaml-multicore#837
mingw-w64backport to 4.12A
mingw-w64backport of
ocaml-multicore/ocaml-multicore#351
with changes rebased to 4.12+domains+effects. -
ocaml/ocaml#10742
Reimplementation of Random using anLXMpseudo-random number generatorThe new PRNG implementation using the
L64X128variant of the LXM
family has been implemented to test the merged Multicore OCaml
PR. The performance improvements on 64-bit, and not so nice
degradation on 32-bit platform is shown below (time in seconds):x86 64 bits 4.13 LXM 0.30 0.21 bit 0.28 0.20 bits 0.42 0.31 int 0xFFEE 0.71 0.40 int32 0xFFEEDD 0.97 0.32 int64 0xFFEEDDCCAA 0.72 0.31 float 1.0 11.35 0.02 full_init 3 (/100) ARMv7 32 bits 4.13 LXM 1.75 4.84 bit 1.53 2.78 bits 4.63 6.16 int 0xFFEE 5.12 6.89 int32 0xFFEEDD 30.92 20.51 int64 0xFFEEDDCCAA 3.36 8.30 float 1.0 47.40 0.13 full_init 3 (/100) -
ocaml/ocaml#10880
Use a bit-vector to record pending signalsThe PR uses an array of bits instead of an array of
NSIGatomic
0-or-1 integers to store the presence of pending signals. The
testsuite performance with current trunk is as follows:
real 14m8.349s
user 20m52.485s
sys 0m46.666s
Event count (approx.): 5024892760014
Overhead Command Shared Object Symbol
16.43% Domain0 ocamlrun [.] caml_check_for_pending_signals
14.16% Domain0 ocamlrun [.] caml_interprete
6.67% Domain1 ocamlrun [.] caml_check_for_pending_signals
...
The testsuite output with this PR is given below:
real 8m32.072s
user 10m16.386s
sys 0m45.736s
Event count (approx.): 2483613262503
Overhead Command Shared Object Symbol
22.67% Domain0 ocamlrun [.] caml_interprete
4.21% Domain1 ocamlrun [.] caml_interprete
3.20% Domain3 ocamlrun [.] caml_interprete
-
ocaml/ocaml#10887
Generalize theDomain.DLSinterface to split PRNG state for child domainsThe PR implements a “proper” PRNG+Domains semantics for the case
when spawning a domain splits the PRNG state. -
ocaml/ocaml#10890
Removing unused OCAMLRUNPARAM parameters from the code and manualAfter the audit of OCAMLRUNPARAM options, the unused parameters have
now been removed from the code and the manual.backtrace_enabled: in use cleanup_on_exit: in use eventlog_enabled: in use init_fiber_wsz: in use init_heap_wsz: UNUSED init_heap_chunk_sz: UNUSED init_max_stack_wsz: in use init_custom_major_ratio: in use init_custom_minor_ratio: in use init_custom_minor_max_bsz: in use init_percent_free: in use init_max_percent_free: UNUSED parser_trace: in use init_minor_heap_wsz: in use trace_level: in use verb_gc: in use verify_heap: in use caml_runtime_warnings: in use -
ocaml/ocaml#10935
ReimplementThread.exitusing an exceptionThe PR reimplements
Thread.exitby simply raising a dedicated
Thread.Exitexception for better resource management, instead of
stopping the current thread.
Fixes
-
ocaml-multicore/ocaml-multicore#823
Minor fixesAdditional fixes in
runtime/,middle_endandotherlibscode to
be more aligned with trunk. -
ocaml-multicore/ocaml-multicore#828
Initialiseextern_flagsto 0 on extern stat initThe
extern_flagsneed to be initialised to zero. Otherwise, its
subsequent use inreachable_wordsreturns junk values resulting in
memory corruption. -
ocaml-multicore/ocaml-multicore#829
Fix pthread name setting on FreeBSD/OpenBSD/NetBSDThe portability changes for
pthreadnaming in order to build for
FreeBSD, OpenBSD and NetBSD. -
ocaml/ocaml#10853
Fix a crash inObj.reachable_wordsA segmentation fault in
Obj.reachable_wordshas been fixed in this
PR. A marshaling operation can leave theextern_flagswith the
NO_SHARINGbit set, and hence the same is now initialized before
callingextern_init_position_table. -
ocaml/ocaml#10873
FixupFilename.check_suffix; remove duplicate,fix for OCAMLRUNPARAMThe PR includes the
caml_parse_ocamlrunparamduplicate fix for
empty,in OCAMLRUNPARAM, and an update toFilename.check_suffix
from the review of Multicore OCaml PR#10831. -
ocaml/ocaml#10881
Fix build formingw-w64on JenkinsThe
winpthread-1.dllfile is required as it sets the desired PATH
for the builds. -
ocaml-multicore/ocaml-multicore#832
Fix reachable words, part deuxThe
Obj.reachable_wordshas been updated to not cause a
segmentation fault. Also, the changes have been synchronised with
the 4.14 branch.
Testing
-
ocaml/ocaml#10888
Re-enableafl-instrumentationtest, run without a virtual memory limitThe
afl-fuzztest program, run as a child process, requires more
than 50MB of virtual memory for multicore. Hence, a fix is provided
to remove the memory limit, and theafl-instrumentationtests for
OCaml 5.00.0+trunk have been enabled. -
ocaml/ocaml#10918
Add an explicit afl-fuzz testAn
afl-fuzztest without an timeout, and based on the
readline-example in the manual has been added.
Cleanup
-
ocaml-multicore/ocaml-multicore#835
Removeget_bucket,get_creditandhuge_fallback_countThe
get_bucket,get_creditandhuge_fallback_countfunctions
have been removed fromstdlib. -
ocaml/ocaml#10863
Get rid of<caml/compatibility.h>As a follow-up to the merged Multicore OCaml PR#10831, the
caml/compatibility.hheader file has been removed. -
ocaml/ocaml#10973
Remove unusedgc_regs_slotindomain_stateThe
gc_regs_slotis unused and is not required in the domain state
structure. The same has been removed from the
otherlibs/systhreads/st_stubs.cfile.
Sundries
-
ocaml-multicore/ocaml-multicore#793
Ring buffer-based runtime tracing (eventring)Eventringis a low-overhead runtime tracing system for continuous
monitoring of OCaml applications. The issue has been closed to create a PR onocaml/ocaml. -
ocaml-multicore/ocaml-multicore#810
Getting segfault/undefined behavior using Multicore with custom blocksThe segmentation fault was being caused in C code and not OCaml, and
hence the issue has been closed. -
ocaml-multicore/ocaml-multicore#816
Filter-tree to normalise email address from commitersThe inconsistent names and email addresses among committers in
Multicore OCaml has been fixed and merged using filter-tree.
Ecosystem
Ongoing
Eio
-
ocaml-multicore/eio#124
Decide how to represent pathnamesThe paths in Eio are strings, but, we need to think on how to
provide support for Windows paths. -
ocaml-multicore/eio#125
Test on WindowsEio needs to be supported on Windows, and a CI must be setup for
this environment. -
ocaml-multicore/eio#126
API for spawning sub-processesA mechanism to create and manage sub-processes, similar to
Lwt_processis required inEio. This must work using multiple
domains, allow passing pipes, check or report the process’s exit
status etc. -
ocaml-multicore/eio#138
Integrate Eio’s CTF tracing with OCaml’s tracingThe proposed
eventringto replace the OCaml CTF-basedeventlog
system can allow users to add custom events that need to be stored. -
ocaml-multicore/eio#140
Decide oncstructvsbytesThe IO operations with the kernel require that the GC does not move
the address of a buffer, which can be implemented using
Cstruct.t. If OCaml 5.00 guarantees that regular strings are not
moved, then usingbytescan be an option. Performance measurements
to comparecstructandbytesneed to be performed. -
ocaml-multicore/eio#146
lib_eio: Addtake_allfunctionThe
take_allfunction has been added tolib_eio/stream.ml. -
ocaml-multicore/eio#155
AddEio_unix.FDAn
FDmodule has been added tolib_eio/unix/eio_unix.mlto be
used with theLuv.0.5.11asynchronous I/O library.
Sundries
-
ocaml-multicore/parallel-programming-in-multicore-ocaml#13
Setup CIA weekly CI build using GitHub Actions will be useful to detect any
build failures. -
ocaml-multicore/tezos#13
Merge upstream updatesAn issue tracker to merge the January 24, 2022 updates to the
4.12.0+domainsbranch. -
ocaml-multicore/tezos#24
Test suite failureAn
Alcotest_engine__Core.Make(P) (M)error has been reported when
running the test suite. -
ocaml-multicore/effects-examples#26
Port to OCaml 5.00A work-in-progress to port all the Effects examples to run with
OCaml 5.00, without the dedicated effects syntax.
Completed
Eio
Added
-
ocaml-multicore/eio#120
AddFibre.fork_on_acceptandNet.acceptThis PR that updates
fork_on_acceptto use an accept function in a
new switch, and passes the successful result to a handler function
in a new fibre has been merged. -
ocaml-multicore/eio#130
Add Luv polling functionsThe Luv polling functions wrapped in Eio have been added to
lib_eio_luv/eio_luv.mlfor Lwt integration. -
ocaml-multicore/eio#133
AddSwitch.dumpandCancel.dumpfor debuggingThe
Switch.dumpandCancel.dumpfunctions have been added for
debugging purpose. A sample output is shown below:Switch 6 (1 extra fibres): on [4] cancelling(Failure("Background switch turned off")) [] cancelling(Failure("Background switch turned off")) [] on (protected) [7] -
ocaml-multicore/eio#135
Add~close_unixflag toFD.of_unixThe user can now handle closing of the FD using the
close_unix
flag for better integration with APIs. -
ocaml-multicore/eio#139
Addeio.unixmodule for Unix integrationA new
eio.unixmodule provides bothawait_readableand
await_writablefunctions, and allowsLwt_eioto work with either
backends. Eio needs to work on browsers and unikernels, and hence it
must not depend directly onUnix. -
ocaml-multicore/eio#141
lib_eio: implementStream.is_emptyA
lengthandis_emptyfunction have been implemented in
lib_eio/stream.mlsources. -
ocaml-multicore/eio#159
AddEio.Buf_readThe addition of
Buf_readin Eio provides a low-level API to view
the internal buffer and to mark bytes as consumed. Also, it now has
a high-level API to read characters, strings, and multi-line text. -
ocaml-multicore/eio#161
Add more functions toBuf_readThe functions
peek_char,skip,pair,map,bind,*>and
<*have been added tolib_eio/buf_read.mlto match the Angstrom
API. Additional fuzz testing with crowbar have also been included. -
ocaml-multicore/eio#163
AddBuf_read.{seq,lines}andDir.{load,save}convenience functionsA
at_end_of_inputfunction has been added, andeofhas been
renamed toend_of_inputto match Angstrom API. The
Buf.read.{seq,lines}andDir.{load.save}convenience functions
have been added to make it easy to load and save files, and to read
a file line by line.
Build
-
ocaml-multicore/eio#128
Depend onbase-domainsThe opam repository now provides a
base-domainspackage, which
will be used instead of hard-coding an explicit dependency on
ocaml.4.12.0+domains. -
ocaml-multicore/eio#137
Renameeunixtoeio.utilsThe collection of utility modules for building
Eiobackends have
been renamed fromenixtoeio.utils, as a separate OPAM package
is not required. -
ocaml-multicore/eio#147
Remove unusedbigstringafdependencyThe
bigstringafdependency is no longer required and the same has
been removed. -
ocaml-multicore/eio#149
Remove dependency on ppxlibThe
lib_ctf/ctf.mlfile was using ppxlib, and the relevant code
has been inlined. Hence, the dependency onppxlibhas been removed
to build for 5.00.0. -
ocaml-multicore/eio#151
Add support for OCaml 5.00+trunkThe PR updates
eioto build for OCaml 5.00.0+trunk and keeps
compatibility with 4.12+domains. -
ocaml-multicore/eio#157
RemoveUnixdependency from EioThe dependency on Unix is removed from Eio in order to use it in a
unikernel or a browser. TheEio.Unix_perm.treplaces
Unix.file_perm, andEio.Net.Ipaddr.treplacesUnix.inet_addr.
Improvements
-
ocaml-multicore/eio#156
[eio_linux] Allow running uring in polling modeA
polling_timeoutoption has been added to run uring in polling
mode. This is faster because Linux can start handling requests
without waiting for us to submit them. -
ocaml-multicore/eio#158
Spliteio.mlout into separate modulesA code refactor to split the
lib_eio/eio.mlinto separate modules.
Fixes
-
ocaml-multicore/eio#134
Simplify and improve error reportingAn error raised and lost when cancelling an operation is now
fixed. The cancellation contexts are now handled by the switches. -
ocaml-multicore/eio#160
FixBuf_read.take_allA fix in
lib_eio/buf_read.mlto read everything in the stream and
not just what is present in the buffer.
Testing
-
ocaml-multicore/eio#153
Allow reading absolute paths withStdenv.fsStdenv.fscan be used to access absolute paths. A test case has
also been added to the PR. -
ocaml-multicore/eio#154
[eio_linux] Avoid copy inread_intoThe
readvimplementation can now be used to read directly into the
user’s buffer to avoid the copy withread_into.
Documentation
-
ocaml-multicore/eio#123
Add missing word in README.mdThe README.md documentation has been updated to provide the context
of aSwitch.run. -
ocaml-multicore/eio#136
Add README example of a cache using promisesA concurrent cache example has been included in the README that
demonstrates the use of Promise. -
ocaml-multicore/eio#144
Minor updates to READMEThe README has been updated with information on
Lwt_eiowith minor
changes to clarify theSwitchbehaviour. -
ocaml-multicore/eio#145
Add Multicore Guide explaining the new memory modelA new
doc/multicore.mdfile has been added that explains the
memory model with the following topics:1. Introduction 2. Problems with Multicore Programming a. Optimisation 1: Caching b. Optimisation 2: Out-of-Order Execution c. Optimisation 3: Compiler Optimisations d. Optimisation 4: Multiple COres 3. The OCaml Memory Model. 4. Guidelines 5. Further reading -
ocaml-multicore/eio#152
Fix minor documentation errorsThe
dune build @docwarnings have been fixed for
doc/rationale.md,lib_ctf/unix/ctf_unix.mli,
lib_eio_linux/eio_linux.mliandlib_eio_luv/eio_luv.mlifiles. -
ocaml-multicore/eio#162
Use MDX to test Multicore guideThe dune file has been updated to test the
multicore.md
documentation using MDX. -
ocaml-multicore/eio#164
Document the new load and save functionsThe README.md file has been updated with documentation on
Dir.save,Dir.open_out,Dir.open_in, andDir.with_lines.
Parallel Programming in Multicore
-
ocaml-multicore/parallel-programming-in-multicore-ocaml#11
Unhandled exception when executing programs that use theparallel_forprimitiveAn exception reported by @H-N41K (Hemendra M. Naik) for the
parallel_forprimitive has been fixed with an update to the
domainslib.0.4.0 package. -
ocaml-multicore/parallel-programming-in-multicore-ocaml#12
Update to domainslib.0.4.0The breaking changes introduced by domainslib.0.4.0 have been fixed,
and the README.md has been updated for OCaml 5.00.
OCaml Uring
-
ocaml-multicore/ocaml-uring#43
RemovebigstringafdependencyThe
bigstringafdependency has been removed, and we now use the
same functions provided bycstruct. -
ocaml-multicore/ocaml-uring#44
Allow running in polling modeThe
lib/uring/uring.mlhas been updated to now run in polling mode
with apolling_timeoutargument. -
ocaml-multicore/ocaml-uring#45
Cmdlineris only needed for testsThe
cmdlinerdependency is only required for testing, and the same
has been updated in bothdune-projectanduring.opamfiles.
Domainslib
-
ocaml-multicore/domainslib#61
Use new name of EffectHandlers (Effect)The
lib/task.mlcode has been updated to useEffectsince
upstream
ocaml/ocaml#10879 has
renamed theEffectHandlersmodule toEffect. -
ocaml-multicore/domainslib#63
Run CI with trunk OCamlThe GitHub Actions CI build has been updated to build with
ocaml/ocamltrunk.
Multicore OPAM
-
ocaml-multicore/retro-httpaf-bench#18
Switch Eio benchmark to use faster polling modeThe retro-httpaf benchmark now uses the latest Eio that adds support
for polling mode, and makes it the fastest performing benchmark.

-
ocaml-multicore/multicore-opam#61
RemoveomakeThe PR removes omake, which is required only for +effects, and also
removescaml_modify_fieldwhich does not exist in trunk. -
ocaml-multicore/multicore-opam#62
RemovedomainslibDomainslib.0.3.0has been removed from this repository as it has
been upstream to opam-repository. -
ocaml-multicore/multicore-opam#63
base-domainshas been upstreamed inopam-repositorylong agoThe
base-domainsdependency has been removed frommulticore-opam
as it has been upstreamed to the opam repository.
Benchmarking
Sandmark
Ongoing
-
ocaml-bench/sandmark#272
Delay benchmark runs if the machine is activeA load average check needs to done to ensure that no active
benchmarking jobs are being executed on a machine, before triggering
a new set of benchmark runs. -
ocaml-bench/sandmark#273
Use just 5.00+trunk for OCaml variant buildsThe OCaml variants in Sandmark need to be updated to have only the
5.00.0+trunk builds. -
ocaml-bench/sandmark#274
Custom Variant SupportA requirement to allow Sandmark benchmark runs for compiler
developer branches. The configuration should allow a URL to a
specific branch, with configure options, runtime parameters, name of
the variant, and an expiry date until which the Sandmark nightly
runs should occur. For example:[ { "url" : "https://github.com/ocaml-multicore/ocaml-multicore/archive/parallel_minor_gc.tar.gz", "configure" : "-q", "runparams" : "v=0x400", "name": "5.00+trunk+kc+pr23423", "expiry": "YYYY-MM-DD"}, ...] -
ocaml-bench/sandmark#275
Move from drone CI to GitHub actionsThe present .drone.yml CI needs to be replaced with builds using
GitHub Actions.
Completed
-
ocaml-bench/sandmark#268
Update README CI Build status to main branchThe CI
Build Statusfor themainbranch in Sandmark has been
updated to point to the main branch. -
ocaml-bench/sandmark#270
Update to 5.00.0+domainsThe dependencies and benchmarks to run 5.00.0+domains variant have
been updated to build in the Sandmark master branch. -
ocaml-bench/sandmark#271
Parameterize ocaml-variants information as Docker environment variablesThe following variables have been parameterized in the Sandmark
Makefile to be used as environment variables to support theCustom Variant Supportfeature request:SANDMARK_DUNE_VERSION SANDMARK_URL SANDMARK_REMOVE_PACKAGES SANDMARK_OVERRIDE_PACKAGES -
ocaml-bench/sandmark#276
Re-add 5.00.0+trunk with CI failure:ignore optionThe .drone.yml CI is updated to ignore a failed build for
5.00.0+trunk, so that we can continue to merge changes as long as
5.00.0+stable Sandmark builds fine. -
ocaml-bench/sandmark#277
Sync and update README from master branchThe README changes from the Sandmark master branch have been synced
up with the main branch, as we will soon switch to using the main
branch as the default branch in Sandmark.
Sandmark-nightly
Ongoing
-
ocaml-bench/sandmark-nightly#26
Update the nightly scriptsThe PR updates the scripts in the
nightly/folder to run the
5.00.0 variants on both the Turing and Navajo servers. -
ocaml-bench/sandmark-nightly#27
Include the baseline variant information in the normalised graphsThe normalised graph must include the information of the baseline
variant used for comparison.
-
ocaml-bench/sandmark-nightly#32
Support custom variants from private GitHub repoThe Sandmark nightly runs should allow building custom developer
branch variants from a GitHub repository. -
ocaml-bench/sandmark-nightly#33
Permalink to graphsA permalink in the dashboard UI on selected options and graphs will
be useful to share among users. -
ocaml-bench/sandmark-nightly#34
Parallel benchmarks should be run on ocaml/ocaml#trunkThe parallel benchmark runs should also be run on
ocaml/ocaml#trunk, now that Multicore OCaml PR has been merged. -
ocaml-bench/sandmark-nightly#36
Add a custom run to Sandmark nightlyA custom variant run with configure options
--enable-mmap-stack
and--disable-mmap-stackneeds to be added to Sandmark nightly. -
ocaml-bench/sandmark-nightly#37
Sequential results comparison is brokenA TypeError is shown when selecting sequential results comparison in
the UI, and this needs to be fixed. -
ocaml-bench/sandmark-nightly#38
Baseline for normalised graphs are missing entriesAll the variants with their commits need to be shown in the drop
down menu for the normalized graphs. -
ocaml-bench/sandmark-nightly#40
The information in the landing page is out of dateThe information on the list of variants in the Sandmark nightly
landing page needs to be synced with the latest results.
Completed
-
ocaml-bench/sandmark-nightly#24
Use git clone from ocurrent-deployerThe Dockerfile has been updated to use git clone from
ocurrent-deployer, instead ofocaml-bench/sandmark-nightly. -
ocaml-bench/sandmark-nightly#28
Make number of default variants to be 1 in parallel benchmarksThe number of default variants for the parallel benchmarks has been
switched from two to one. -
ocaml-bench/sandmark-nightly#30
Add a landing page to Sandmark NightlyAn
index.pylanding page has been created for Sandmark Nightly
with information on how the benchmarks are executed along with
machine details. -
ocaml-bench/sandmark-nightly#31
Add archive message for instrumented benchmarksA message to inform the end user that the instrumented pausetimes
benchmarks are not updated for the latest 5.00.0 OCaml variants. -
ocaml-bench/sandmark-nightly#35
Update icon and titleThe title and favicon defaults to the Streamlit logo, and the same
have now been updated toSandmark Nightly. -
ocaml-bench/sandmark-nightly#39
Parallel results can’t be seen on sandmark.ocamllabs.ioThe hotfix in the UI to show multiple variants mapped to a single
commit correctly displays the parallel benchmarks in the UI.
current-bench
Ongoing
-
ocurrent/current-bench#282
Docker compose for stack deployA
docker-compose.yamlfile has been added to deploy the backend
pipeline and frontend stack. -
ocurrent/current-bench#292
Return better HTTP error codes for API requestsThe PR adds exceptions to return correct HTTP error codes for client
API requests. -
ocurrent/current-bench#293
Make log links noticeable by removing log ID from link textThe log UUIDs from the execution logs are now replaced with a link
for better clarity.
Completed
Fixes
-
ocurrent/current-bench#272
Ignore NaNs when computing the meanThe NaN entries should not be included when computing the mean, and
the same have been updated inLineGraph.res. -
ocurrent/current-bench#276
Production fix: validate-env for graphql URLsThe
scripts/validate-env.shscript has been updated to validate
the path/_hasura/v1/graphql. -
ocurrent/current-bench#278
Fix for productionUse port
8082instead of port 80 for the frontend Nginx running
inside Docker. -
ocurrent/current-bench#284
Couple of fixes with handling multiple benchmarks dataA list of named benchmarks are now supported when handling data for
multiple benchmarks. The benchmarks menu is now hidden only for
unnamed benchmarks. -
ocurrent/current-bench#289
Fix URL missing pull numberThe PR number is lost when a redirect to add a worker or Docker
image is issued, and the same has been fixed.
Frontend
-
ocurrent/current-bench#268
Fix frontend: Add worker and Docker image to URLThe worker and Docker image were not reflected in the URL, and the
same have now been included. -
ocurrent/current-bench#273
Support overlaying graphs using metric names to specify hierarchyThe frontend now supports overlay of graphs for better comparisons
as illustrated below:
-
ocurrent/current-bench#275
Frontend fix: Display warning and old metrics rather than an empty pageAn orange display and previous benchmark metric results are now
shown if the latest execution is still running, or has failed to
complete, or got cancelled. -
ocurrent/current-bench#277
Display last values with a colourful legend for overlay graphsThe most recent values for the overlay graphs are now displayed with
a colourful legend as shown below:
-
ocurrent/current-bench#288
Nginx frontend: Fix for URLs containing slashesA fix in the production deployment where the
/was causing a 404
not found error.
Monitoring
-
ocurrent/current-bench#270
Basic Prometheus and Alertmanager configA Prometheus integration setup and configuration to use with
current-bench deployments has been created. -
ocurrent/current-bench#271
Add Prometheus alert when host is out of disk spaceAn alert to be triggered for the current-bench host machine when it
reaches 90% disk capacity has been added. -
ocurrent/current-bench#274
Fix alertmanager alert URLsThe alertmanager URLs have now been updated to point to
autumn.ocamllabs.io. -
ocurrent/current-bench#283
Scrape metrics from the pipeline serverThe Prometheus configuration is updated to obtain OCaml GC metrics,
GitHub webhook and cache statistics.
Sundries
-
ocurrent/current-bench#281
Document how to add new workersThe
HACKING.mdhas been updated with documentation on adding new
workers to the cluster. -
ocurrent/current-bench#287
HTTP API end-point for capturing benchmark resultsThe benchmark results can be added to the database using a new HTTP
API end-point, without actually requiring thecurrent-bench
frontend. For example:curl -X POST -H 'Authorization: Bearer <token>' <scheme>://<host>/benchmarks/metrics --data-raw ' { "repo_owner": "ocurrent", "repo_name": "current-bench", "commit": "c66a02ea54430d99b3fefbeba4941921501796ef", "pull_number": 286, "run_at": "2022-01-28 12:42:02+05:30", "duration": "12.45", "benchmarks": [ { "name": "benchmark-1", "results": [ { "name": "test-1", "metrics": [ { "name": "time", "value": 18, "units": "sec" } ] } ] }, { "name": "benchmark-2", "results": [ { "name": "test-1", "metrics": [ { "name": "space", "value": 18, "units": "mb" } ] } ] } ] } '
We would like to thank all the OCaml users, developers and
contributors in the community for their continued support to the
project. Stay safe!
Acronyms
- AFL: American Fuzzy Lop
- API: Application Programming Interface
- ARM: Advanced RISC Machines
- AWK: Aho Weinberger Kernighan
- BSD: Berkeley Software Distribution
- CI: Continuous Integration
- CTF: Common Trace Format
- DLS: Domain Local Storage
- FD: File Descriptor
- GB: Gigabyte
- GC: Garbage Collector
- HTTP: Hypertext Transfer Protocol
- IO: Input/Output
- IR: Intermediate Representation
- MD: Markdown
- OOM: Out of Memory
- OPAM: OCaml Package Manager
- OS: Operating System
- PR: Pull Request
- PRNG Pseudo-Random Number Generator
- UI: User Interface
- URL: Uniform Resource Locator



