Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add Loom model checking for synchronization primitives

Abierto
#185 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
rust
Área
backend, testing

Línea de trabajo

Comienza con el modelo funcional de Loom en los cambios de RwLock enlazados desde PR 184 y, después, revisa la infraestructura existente de pruebas unitarias, de integración, de estrés y multihilo. Determina si se debe adoptar Loom y qué elementos internos de sincronización están dentro del alcance. Se considera terminado cuando los modelos acotados cubren los casos de sincronización seleccionados y la ejecución en CI sigue siendo práctica.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

As a library providing several synchronization primitives, Asyncband relies on atomic state transitions, waiter queues, and wake-up handling. Conventional unit and stress tests exercise many concurrent schedules, but they cannot systematically explore every relevant execution ordering. Rare interleavings may therefore hide missed wake-ups, leaked ownership, deadlocks, or invalid state transitions.

Loom provides deterministic model checking for concurrent Rust code. Small, focused models can systematically explore relevant interleavings and validate invariants such as:

  • Readers and writers never holding incompatible ownership
  • Waiter publication racing with lock release without missing a wake-up
  • Cancellation before or after ownership is granted
  • Queue-head cancellation preserving follower progress
  • Atomic upgrade and downgrade transitions
  • Correct memory ordering between lock holders

Loom can only explore concurrency performed through its own instrumented primitives. Every atomic, mutex, thread, cell, or other synchronization operation relevant to a model must therefore use the corresponding Loom type. Any synchronization left using an uninstrumented std type falls outside Loom’s scheduler and reduces the model’s coverage, however, this is for the most part covered by the existing test infrastructure. Asyncband would use conditional compilation to select Loom primitives during model checking and the existing std implementations in normal production builds.

A working draft has been added to the RwLock changes (here), where the previous semaphore-based implementation was replaced with a purpose-built atomic scheduler. The draft model-checks ownership exclusion, waiter publication, cancellation around grant, queue progress, upgrade priority, and downgrade handoff.

If the project decides not to adopt Loom, the draft can be removed from the RwLock PR before merging. If adopted, support can be expanded through separate, individual PRs for other synchronization internals, such as:

  • Semaphore
  • AtomicOptionBox
  • Mutex scheduling
  • Countdown and wait-set primitives
  • Channel state machines

The models should remain small and bounded to keep CI execution practical. Loom would exist only to complement the existing unit, integration, stress, and multithreaded tests.

Lenguaje dominante
Rust
Estrellas
283
Forks
49
Merge medio
1 d 9 h
PR fusionados (30 d)
39

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/asyncband

Todos los issues de apache/asyncband

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.