Skip to content
CAI
Software that uses CAICheck a score

lampepfl/gears

58.6

Adequate · 20 September 2026

3.1k

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a cross-platform asynchronous programming library for Scala 3, providing structured concurrency primitives such as Futures, Channels, and Semaphores. It implements platform-specific async runtimes for the JVM (using virtual threads), JavaScript/WebAssembly (using JSPI), and Native (using ForkJoinPool), enabling efficient non-blocking I/O and task scheduling. The library includes comprehensive test coverage and benchmarking tools to verify correctness and performance across all supported targets.

How it got here

2023 — Initial scaffolding and async core implementation

12 changes.

The project was initialized with a multi-platform Scala 3 structure and subsequently developed a shared asynchronous programming library featuring structured concurrency, channels, and futures. Platform-specific implementations were added for the JVM using virtual threads and POSIX-like I/O, alongside a Native backend utilizing ForkJoinPool, supported by comprehensive cross-platform testing and benchmarking tools.

2025–2026 — WebAssembly async support and release signing

5 changes.

This period focused on implementing WebAssembly-specific asynchronous runtime support for Scala.js using JavaScript Promises Interop, alongside comprehensive test coverage for both single-threaded and native async environments. Additionally, PGP public key infrastructure was added to the publication process to enable signed artifact releases.

Features

Add JVM-specific PosixLikeIO example programs

New example programs have been added to the JVM source directory to demonstrate the PosixLikeIO library's capabilities. These include clientAndServerUDP.scala for UDP socket communication, readAndWriteFile.scala for basic file I/O, and readWholeFile.scala for reading file contents, all utilizing the gears.async library for asynchronous operations.

jvm/src/main/scala/PosixLikeIO/examples · high confidence

Add JVM-specific async performance benchmarking tools

A new file, \measureTimes.scala\, has been added to the JVM source directory to provide benchmarking utilities for the async library. This file introduces several command-line entry points (\@main\ methods) that measure and compare the performance overhead of various asynchronous operations, including thread joins versus future joins, race conditions among futures, and channel throughput compared to raw Java virtual threads. These tools allow users to quantify the latency and throughput characteristics of the \gears.async\ primitives on the JVM platform.

jvm/src/main/scala/measurements · high confidence

Add WebAssembly JSPI-based async support for Scala.js

Introduces a new implementation of the async runtime for Scala.js targeting WebAssembly environments with JavaScript Promises Interop (JSPI). This change adds specific support for suspending and resuming computations using JSPI async/await, including a dedicated scheduler and suspension support classes, enabling more efficient asynchronous operations in WASM contexts.

js/src/main · high confidence

Initial project scaffolding and documentation

The repository is initialized with the Apache 2.0 license, a Nix flake for reproducible development environments, and comprehensive documentation including a README and contributing guide. The project is configured as a Scala 3 library using sbt 2, targeting JVM, Scala Native, and Scala.js (WASM), with specific tooling requirements such as JDK 21+ and Node.js 26+ for testing.

(repo-wide) · high confidence

Introduce JVM-specific asynchronous POSIX-like file and UDP socket I/O

A new \PIO.scala\ implementation is added for the JVM target, providing asynchronous file operations (\File\) and UDP networking (\SocketUDP\) built on Java NIO \AsynchronousFileChannel\ and \DatagramSocket\. These classes expose non-blocking read/write and send/receive methods that return \Future\ values, utilizing \Future.withResolver\ to bridge Java's \CompletionHandler\ callbacks with the project's async model. Helper utilities in \PIOHelper\ are also provided to manage resource lifecycle automatically via \withFile\ and \withSocketUDP\ blocks.

jvm/src/main/scala/PosixLikeIO · high confidence

Introduce JVM-specific virtual-thread-based async support

The JVM module now provides a concrete implementation of the async runtime using Java virtual threads (Project Loom). This includes a new \VThreadSupport\ and \VThreadScheduler\ that manage concurrency via virtual threads, a \JvmAsyncOperations\ object exposing interruptible sleep and yield primitives, and supporting infrastructure like \AsyncImpl\ and \ListenerImpl\ for locking and blocking behavior. This change establishes the foundational async capabilities for the JVM platform within the \gears.async\ package.

jvm/src/main/scala/async · high confidence

Introduces structured concurrency and async primitives

Adds a new asynchronous programming library to the shared module, providing structured concurrency via \Async\ contexts and \CompletionGroup\ for scoped cancellation. The update introduces \Future\ and \Source\ abstractions for handling asynchronous values, along with \Channel\ implementations (synchronous, buffered, and unbounded) for inter-task communication. It also includes utility features such as \Semaphore\ for concurrency control, \Resource\ for safe allocation/cleanup, \Retry\ for fault tolerance, and \Timer\ for scheduled events, alongside converters to integrate with the standard Scala \Future\ API.

shared/src/main · high confidence

Behavioural changes

Added PGP public key for publication signing

A PGP public key block has been added to the publish directory, enabling the signing of publication artifacts. This supports the CI pipeline's capability to produce signed releases or snapshots, ensuring artifact integrity for consumers who verify signatures against this key.

publish · high confidence

Native platform now uses ForkJoinPool-based async support with daemon sleeper thread

The native backend for asynchronous operations has been updated to use a ForkJoinPool-based implementation (ForkJoinSupport) instead of the previous default. This change introduces a dedicated daemon thread to handle scheduled tasks and sleep operations, optimizing system time usage and promise handling. The new implementation leverages native continuations for suspension support and ensures that the sleeper thread is properly managed as a daemon, improving resource cleanup and background execution behavior on native targets.

native/src/main · high confidence

Removal of default Hello World application entry point

The default Scala 3 application entry point defined in Main.scala has been removed. Users will no longer see the 'Hello world!' and 'I was compiled by Scala 3' output when running the default main class, as the file containing this logic has been deleted from the source tree.

src/main · high confidence

Test coverage

Added JVM-specific test infrastructure and cancellation behavior tests; Added comprehensive test suites for async primitives; Added test for CountdownLatch example; Added test infrastructure for single-threaded async support; Added tests for native async support and compatibility; Removed example test suite.

Dependencies

Upgrade to Scala 3.9.0 and MUnit 1.3.6 with cross-platform build restructuring

The build system has been upgraded to Scala 3.9.0 and MUnit 1.3.6, replacing the previous Scala 3.2.2 and MUnit 0.7.29 versions. The project structure has been reorganized to support cross-platform compilation for JVM, JS, and Native targets using sbt-crossproject. Additionally, the JavaScript build now targets ES2022 modules with WebAssembly support and JSPI (JavaScript Promises for Async), and the Native platform is configured for multithreading.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 59.

Lenses

  • Code Health 97
  • Architecture 100
  • Maturity 56
  • Readiness 46
  • Security 73

Changes since last survey

  • 299 commits — 278 feature/other, 21 fixes

By area

  • shared/src — 76 commits
  • (root) — 65 commits
  • src/main — 63 commits
  • (repo) — 26 commits
  • project/plugins.sbt — 18 commits
  • .github/workflows — 13 commits
  • jvm/src — 12 commits
  • project/build.properties — 11 commits
  • js/src — 4 commits
  • src/test — 4 commits
  • native/src — 2 commits
  • dependencies/scala-native — 1 commit
  • docs/2023-06-report — 1 commit
  • docs/2024-03-scalar-gears.pdf — 1 commit
  • summary/ch1.png — 1 commit
  • summary/summary.md — 1 commit

Notable commits

  • fix: Add pandoc PDF, make tables narrower and fix pandoc list rendering issues
  • fix: Add/fix lots of documentation (#52)
  • fix: Fix Listener#lockBoth IllegalMonitorStateException
  • fix: Fix bad references in documentation (#70)
  • fix: Fix compilation error (#11)
  • fix: Fix completion group linking
  • fix: Fix correct lock ordering
  • fix: Fix flaky "race successful with wait" test
  • fix: Fix flaky time-based all listeners in chain fire test
  • fix: Fix race in onComplete
  • fix: Fix timer not removing listeners on tick
  • fix: Merge pull request #36 from m8nmueller/fix-transformValues-listener
  • fix: Merge pull request #42 from natsukagami/fix-flaky-test
  • fix: Minor fixed in Source.values
  • fix: chore: Fix execute not start vt issue.
  • fix: fix dropping of listeners for transformValuesWith
  • fix: fix groups for Async.blocking, uninterruptible, and future completion
  • fix: fix new listener inconsistencies
  • fix: fix timing of onComplete in SourceBehavior
  • fix: measureTimes fix to make measureRaceOverheadVsJava run
  • …and 279 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

lampepfl/gears was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit cd1a5fea685375ce3de7949d0c581d860c17fe36 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.