Implement cellular automata framework with core components#55
Open
lrleon wants to merge 68 commits into
Open
Conversation
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.
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.
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
Tests/ca_multi_field_test.cc (1)
42-45: ⚡ Quick winShould 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
📒 Files selected for processing (4)
Tests/ah-mapping_test.ccTests/ca_multi_field_test.ccTests/fft_test.ccah-map-arena.H
… 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.
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.
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.
…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.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit
Nuevas Características
Chores
Ejemplos
Tests
Documentación