Skip to content

Implement cellular automata framework with core components#55

Open
lrleon wants to merge 68 commits into
masterfrom
cell-automata
Open

Implement cellular automata framework with core components#55
lrleon wants to merge 68 commits into
masterfrom
cell-automata

Conversation

@lrleon
Copy link
Copy Markdown
Owner

@lrleon lrleon commented Apr 30, 2026

Summary by CodeRabbit

  • Nuevas Características

    • Gran expansión del módulo Cellular Automata: motores síncrono y paralelo, Ghost/Grid/Hex/Triangular/Graph lattices, almacenamientos (dense/bit), reglas (deterministas, estocásticas, continuas, con historial), observadores, tiling/particionado y numerosos sinks/exportadores (PNG, GIF, SVG, TikZ, HTML, NPY, PPM/FFmpeg, DOT, JSON, CSV, RLE).
  • Chores

    • Nuevas opciones CMake (X11 viewer, Python bindings), vendorizado de miniz y ajustes CI/workflows.
  • Ejemplos

    • ~40 ejemplos nuevos: demos, benchmarks, visualizadores y utilidades de checkpoint.
  • Tests

    • 1000 pruebas nuevas cubriendo CA y utilidades.

  • Documentación

    • Nueva guía de arquitectura CA, README ampliado y correcciones Doxygen (complejidad actualizada).

lrleon added 30 commits January 28, 2026 09:44
Refactor algorithm documentation by adding complexity analysis and examples to various header files. This includes Bellman-Ford, LIS, Matrix Chain, Subset Sum, Knapsack, and Min Cost Matching, among others.
# Conflicts:
#	Bellman_Ford.H
#	Blossom.H
#	Hungarian.H
#	Knapsack.H
#	Matrix_Chain.H
#	Min_Cost_Matching.H
Add initial implementation for cellular automata core components,
including traits, storage, concepts, and lattice structures.
Includes corresponding tests and documentation.
Add complete implementation of cellular automata neighborhoods (Moore, Von Neumann, Hex, Triangular, Custom) and rules (Outer Totalistic, Totalistic, Lookup, Probabilistic, Composite) including Game of Life and Wolfram elementary rules. Introduce Offset_Vec and Neighbor_View type aliases, update RuleLike concept to accept the new signature, and add comprehensive unit tests and example programs. Include boundary policy examples, storage tests, and update build system and documentation.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Se agrega el método `me()` que realiza el cast a `Container*` para que la llamada a `find()` desde la clase base resuelva correctamente el método de la clase derivada en el patrón CRTP. Esto es necesario porque AppleClang realiza la búsqueda de miembros en el momento de definición de la plantilla, y sin el cast explícito no encuentra el método `find`. El cambio aplica también a la versión `const` mediante `const_me()`. No hay cambios de comportamiento ni API.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Tests/ca_multi_field_test.cc (1)

42-45: ⚡ Quick win

Should fix: nombre y documentación del test no reflejan la aserción real (tolerancia, no bit-identidad).

En Line 42-45 y Line 270 se anuncia “bit-by-bit”, pero en Line 314 y siguientes el contrato efectivo es “acuerdo dentro de tolerancia”. Renombrar/ajustar texto evita expectativas erróneas.

Also applies to: 270-271, 304-314

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Tests/ca_multi_field_test.cc` around lines 42 - 45, Update the test's name
and documentation strings that currently claim "bit-by-bit" or "bit-exact
identical" (occurrences around the block describing Gray-Scott and
Field_Slice_Rule and the comments at the regions noted) to correctly state that
the comparison is within a numerical tolerance (not bit-identical); search for
the literal phrases "bit-by-bit" / "bit-exact" in Tests/ca_multi_field_test.cc
(including the descriptive header near lines 42-45 and the comments around lines
~270-314) and replace them with wording like "agreement within tolerance" or
"within numerical tolerance" and adjust any test description/title variables to
match the actual assertion semantics used later (the tolerance-based comparison
around line ~314).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Tests/fft_test.cc`:
- Around line 3824-3827: El GTEST_SKIP() actual salta todo el test en AArch64 y
oculta aserciones válidas como las de phase_margin; en vez de envolver todo el
test con GTEST_SKIP(), restringe el salto sólo al bloque/las aserciones
relacionadas con gain_margin: mueve la comprobación `#if` defined(__aarch64__) /
GTEST_SKIP() de alrededor del test completo y colócalo alrededor del código que
calcula/verifica gain_margin (o envuelve únicamente las EXPECT/ASSERT que usan
gain_margin), dejando las verificaciones de phase_margin y demás lógica
ejecutarse normalmente; referencia gain_margin, phase_margin y GTEST_SKIP para
localizar donde aplicar el cambio.

---

Nitpick comments:
In `@Tests/ca_multi_field_test.cc`:
- Around line 42-45: Update the test's name and documentation strings that
currently claim "bit-by-bit" or "bit-exact identical" (occurrences around the
block describing Gray-Scott and Field_Slice_Rule and the comments at the regions
noted) to correctly state that the comparison is within a numerical tolerance
(not bit-identical); search for the literal phrases "bit-by-bit" / "bit-exact"
in Tests/ca_multi_field_test.cc (including the descriptive header near lines
42-45 and the comments around lines ~270-314) and replace them with wording like
"agreement within tolerance" or "within numerical tolerance" and adjust any test
description/title variables to match the actual assertion semantics used later
(the tolerance-based comparison around line ~314).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 88c93bdf-49b8-495b-95c0-d208d7f63fc7

📥 Commits

Reviewing files that changed from the base of the PR and between 57811fd and dfdbefa.

📒 Files selected for processing (4)
  • Tests/ah-mapping_test.cc
  • Tests/ca_multi_field_test.cc
  • Tests/fft_test.cc
  • ah-map-arena.H

Comment thread Tests/fft_test.cc
Copilot AI review requested due to automatic review settings May 18, 2026 22:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

lrleon added 2 commits May 23, 2026 12:14
… el path

En macOS, la simple comprobación `__has_include(<X11/Xlib.h>)` no es suficiente,
porque XQuartz (instalado por Homebrew) deja sus cabeceras accesibles en la ruta
de inclusión, activando la ruta de código X11 aunque no se enlace `-lX11`.  Al
no enlazar la biblioteca, el enlazador produce símbolos indefinidos.

Se añade la definición de compilación `ALEPH_DISABLE_X11_VIEWER=1` en el
CMakeLists.txt cuando la opción `ALEPH_BUILD_X11_VIEWER` está desactivada, y se
protege la inclusión condicional en `ca-x11-viewer.H` con
`!defined(ALEPH_DISABLE_X11_VIEWER)`.  Así la opción de compilación prevalece
sobre la auto-detección.

Además, se reordena el test `RefinedMarginsTrackHighResolutionReference` en
`fft_test.cc` para que las aserciones de margen de fase se ejecuten siempre
antes del `GTEST_SKIP` condicional de aarch64, y se extraen las constantes LCG
a variables con nombre en el test geométrico para mejorar la portabilidad y
claridad del código.

No hay cambios de ruptura (breaking changes).
Introduce 'reschedule_step_ms' to ReschedulingEvent
to allow configurable reschedule intervals in the test.
Copilot AI review requested due to automatic review settings May 23, 2026 18:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

lrleon added 2 commits May 23, 2026 14:06
Add Homebrew include path to compiler flags on macOS to correctly
find GSL headers required by transitive dependencies of the SDK.
Adjust timing to handle CI runner jitter and clarify comments.
Also update CI header doc coverage script exclusions and keywords.
Copilot AI review requested due to automatic review settings May 23, 2026 20:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

lrleon added 2 commits May 23, 2026 15:57
Improve temporary file path generation in file_b_tree_test.cc to ensure
uniqueness across parallel test runs by including PID and atomic counter.

Adjust timeoutQueue_test.cc tolerances for CI environments.
Copilot AI review requested due to automatic review settings May 23, 2026 21:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

lrleon added 2 commits May 30, 2026 12:32
…cheduler

Se incrementan los tiempos de espera en la prueba CancelDuringTimeout para evitar
falsos fallos en runners macOS con alta variabilidad del scheduler.
Se extiende el retardo de e1 (de 100ms a 500ms) y e2 (de 200ms a 1500ms),
ajustando las pausas y agregando márgenes de seguridad. No hay cambios
funcionales ni breaking changes.
La prueba ahora utiliza un condition_variable para esperar la finalización del callback, verificando que el estado de ejecución sea `Executed` en lugar de depender de `sleep`. Esto hace la prueba más fiable y comprueba el comportamiento correcto del callback tras reprogramar el evento. No hay cambios de última hora.
Copilot AI review requested due to automatic review settings May 30, 2026 19:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

lrleon added 2 commits May 30, 2026 15:30
Reemplaza sleep_for por esperas condicionales con condition_variable
y mutex, eliminando dependencias de tiempo fijo. Añade callbacks de
completación para notificar la ejecución de eventos y verifica que
cancel_event devuelva true.
…r de espera

Se añade la función `wait_for_status` para esperar un estado específico de un evento,
reemplazando el uso de condition_variable en `RescheduleEvent`. Además, se incrementan
los timeouts de pruebas (de 3s a 30s) para evitar fallos intermitentes en entornos lentos.
Copilot AI review requested due to automatic review settings May 31, 2026 17:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

lrleon added 2 commits May 31, 2026 22:09
Se añade la opción BUILD_REPRODUCTIONS en CMake para compilar un conjunto de reproducciones de autómatas celulares, junto con una prueba de humo (smoke test) que verifica la integridad básica de las implementaciones. Además, se incluye un flujo de trabajo de GitHub Actions que se ejecuta semanalmente para ejecutar estas reproducciones y generar artefactos gráficos. El objetivo es garantizar la reproducibilidad y detectar regresiones en modelos como BTW, Schelling, Drossel–Schwabl, Gray–Scott y Game of Life. No hay cambios que rompan la compatibilidad.
Se añade la opción BUILD_REPRODUCTIONS en CMake para compilar un conjunto de reproducciones de autómatas celulares, junto con una prueba de humo (smoke test) que verifica la integridad básica de las implementaciones. Además, se incluye un flujo de trabajo de GitHub Actions que se ejecuta semanalmente para ejecutar estas reproducciones y generar artefactos gráficos. El objetivo es garantizar la reproducibilidad y detectar regresiones en modelos como BTW, Schelling, Drossel–Schwabl, Gray–Scott y Game of Life. No hay cambios que rompan la compatibilidad.
Copilot AI review requested due to automatic review settings June 1, 2026 03:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants