Skip to content
CAI
Software that uses CAICheck a score

lampepfl/gears

60.7

Adequate · 6 November 2026

3.1k

lines of production code

Scala

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add WebAssembly JSPI-based async support for Scala.js

This change introduces a new implementation of the async runtime for Scala.js targeting WebAssembly with JavaScript Promises Interop (JSPI). It adds \WasmJSPISuspend\ and related classes to handle suspension and resumption using native \js.await\ and promises, replacing previous manual patches. This enables efficient async/await semantics in WASM environments, with specific implementations for scheduling (\JsAsyncScheduler\) and integration with the existing \Async\ framework via \JsAsyncFromSync\.

js/src/main · high confidence

Added 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 a UDP client/server example (\clientAndServerUDP.scala\) showing network communication with \SocketUDP\, and file I/O examples (\readAndWriteFile.scala\, \readWholeFile.scala\) illustrating synchronous and asynchronous file reading and writing via \PIOHelper\. The examples utilize the \gears.async\ library for asynchronous operations, specifically using \.await\ and \.awaitResult\ methods on futures.

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

Added JVM-specific benchmarking tools for async performance

A new \measureTimes.scala\ file has been added to the JVM source directory, providing a suite of command-line benchmarks (\@main\ methods) to measure the performance overhead of the \gears.async\ library. These tools allow users to quantify the cost of future joins, race conditions, and channel operations by comparing them against native Java virtual threads and standard synchronization primitives, outputting metrics such as operations per second and relative overhead.

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

Introduce JVM-specific asynchronous POSIX-like I/O library

Adds a new \PosixLikeIO\ module for the JVM target, providing asynchronous file and UDP socket operations built on Java NIO channels and \gears.async\. The library exposes \File\ and \SocketUDP\ classes that wrap \AsynchronousFileChannel\ and \DatagramSocket\ respectively, allowing users to perform non-blocking reads, writes, and network communication using \Future\-based APIs. Helper utilities in \PIOHelper\ are also included to manage resource lifecycle automatically.

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

Introduces JVM-specific virtual-thread-based async support

The JVM module now provides a concrete implementation of the async runtime using Java Virtual Threads. This includes a new \VThreadSupport\ and \VThreadScheduler\ that leverage \Thread.ofVirtual()\ for execution and scheduling, replacing previous or placeholder implementations. The \JvmAsyncOperations\ object exposes standard async primitives like \sleep\ and \yield\, with \sleep\ implemented as an interruptible operation to ensure proper cancellation handling. Additionally, \JvmAsyncOperations\ is registered as the default \AsyncOperations\ given, making this virtual-thread-based behavior the standard for JVM users.

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 the \Async\ context and \CompletionGroup\ for managing cancellation scopes. The update introduces \Future\ for concurrent computations, \Channel\ (including synchronous, buffered, and unbounded variants) for inter-future communication, and \Resource\ for safe allocation and cleanup of asynchronous resources. It also includes utility features such as \Semaphore\ for concurrency control, \Timer\ for scheduled ticks, \Retry\ for resilient operations, and \AsyncOperations\ for \sleep\ and timeout handling, along with converters to integrate with the standard Scala \Future\ API.

shared/src/main · high confidence

Project initialization and repository setup

The repository has been initialized with the core project structure, including the Apache 2.0 license, a Nix flake for reproducible development environments, and a scalafmt configuration for code formatting. Documentation has been added, including a comprehensive README describing the library as an experimental asynchronous programming tool for Scala 3 and a CONTRIBUTING guide detailing build requirements (JDK 21+, sbt 2, Scala 3.9.0) and test execution.

(repo-wide) · 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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 61 (+1.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 74 → 74 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 52 → 55 (+3.7)
  • Readiness 52 → 52 (+0.0)
  • Security 80 → 80 (+0.0)
  • Performance 85 → 85 (+0.0)

Resolved (1)

  • Orphaned file (shared/src/main/scala/async/channels.scala)

New (2)

  • Orphaned file (js/src/main/scala/async/WasmJSPISuspend.scala)
  • Orphaned knowledge (shared/src/main/scala/async/futures.scala)

Changes since last survey

  • 3 commits — 2 feature/other, 1 fixes

By area

  • (repo) — 1 commit
  • project/build.properties — 1 commit
  • shared/src — 1 commit

Notable commits

  • fix: Fix a deadlock between select and channels (#211)
  • change: Merge pull request #208 from scala-steward/update/sbt-2.0.11
  • change: Update sbt to 2.0.12 (#212)

Written by cca.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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 253c242b4f4bc15c1efe111b699fe8e31622f525 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.