Skip to content

fix(hash): Keep hash tables consistent through copy, move and swap - #111

Merged
lrleon merged 2 commits into
masterfrom
fix/7.0.1-hash
Oct 14, 2026
Merged

lrleon merged 2 commits into
masterfrom
fix/7.0.1-hash

Conversation

@lrleon

@lrleon lrleon commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Correcciones

    • Las tablas hash conservan sus funciones hash, umbrales y configuración al copiarse, moverse o intercambiarse.
    • Se mejora el manejo de errores durante la copia y la reserva de memoria, así como el comportamiento de las tablas sin capacidad.
    • Los mapas hash devuelven sus valores y siguen siendo utilizables tras operaciones de movimiento.
    • Las funciones hash proporcionadas como lambdas sin capturas o punteros se aceptan en más tablas.
  • Documentación

    • Se aclara que cambiar la función hash no recoloca las claves y cuándo es necesario reubicarlas.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T22:17:01.283009Z 07c2fe6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lrleon/Aleph-w/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 85ea9625-a84f-48fc-981a-8fad42eeb27a
📥 Commits

Reviewing files that changed from the base of the PR and between 07c2fe6 and 4beb4bb.

📒 Files selected for processing: 4
  • Tests/hash-it.cc
  • tpl_arrayStack.H
  • tpl_odhash.H
  • tpl_olhash.H

Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

Walkthrough

El cambio actualiza la gestión de capacidad cero y las operaciones de copia, movimiento y swap en varias tablas hash. También añade constructores para determinadas funciones hash, documenta cuándo se requiere rehash() y amplía las pruebas. En ArrayStack y FixedStack cambian algunos accesos y tipos de parámetros.

Changes

Comportamiento de las tablas hash

Layer / File(s) Summary
Constructores y contratos de funciones hash
hash-dry.H, tpl_odhash.H, tpl_olhash.H, tpl_lhash.H, tpl_linHash.H, Tests/hash-it.cc
Se añade un concepto para restringir constructores que aceptan funciones convertibles a punteros. La documentación indica que cambiar una función hash no recoloca las claves y describe cuándo llamar a rehash(). Las pruebas cubren los constructores y el rehash.
Capacidad cero y almacenamiento movido
hashDry.H, tpl_odhash.H, tpl_olhash.H, Tests/hash-it.cc
Las tablas de direccionamiento abierto transfieren el almacenamiento al moverse y gestionan el estado sin capacidad en consultas, eliminación, rehash e inserciones. Las pruebas comprueban la reutilización de las tablas movidas.
Copia, swap y configuración
hashDry.H, tpl_lhash.H, tpl_odhash.H, tpl_olhash.H, Tests/hash-it.cc, Tests/dynsethash.cc
Las operaciones de copia usan una copia temporal y swap en distintas tablas. swap intercambia la configuración aplicable. Las pruebas cubren configuración, umbrales, política de redimensionamiento y fallos de copia por excepción.
Operaciones de mapas hash dinámicos
tpl_dynSetHash.H, Tests/dynsethash.cc
DynHashTable asigna mediante una copia temporal. DynMapHashTable incorpora operaciones de copia, movimiento y swap que incluyen la función hash original. values() devuelve los datos del mapa.
Acceso y parámetros de pila
tpl_arrayStack.H
La sobrecarga const de ArrayStack::top usa MemArray::access. También cambian los tipos de parámetros del constructor y popn de FixedStack.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4beb4

The reviewed changes have no established user-visible regression in hash-table construction, copying, moving, or swapping; no actionable issue remains to block merging.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed El título resume de forma clara el cambio principal: mantener la coherencia de las tablas hash durante las operaciones de copia, movimiento e intercambio.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Header Docstring Coverage Passed La cobertura supera el umbral. El diff contiene ocho headers de biblioteca dentro del alcance y no cuenta los dos archivos de Tests. En un inventario conservador de 29 declaraciones públicas añadidas …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07c2fe6a36

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tpl_olhash.H
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Baseline was recorded on Intel(R) Core(TM) Ultra 7 265KF but this run used AMD EPYC 7763 64-Core Processor. Absolute times are not comparable across CPUs, so the gate is advisory until the baseline is regenerated on this hardware (run the perf-update workflow on master).

Cellular-automata perf gate

baseline CPU Intel(R) Core(TM) Ultra 7 265KF · compiler gcc 13.3.0 · recorded 2026-06-08T18:09:09Z

Benchmark Baseline (ms) Current (ms) Δ Threshold Status
gol_1024 3426.47 3679.19 +7.4% ±8% ℹ️ advisory
gray_scott_512 7328.14 17395.79 +137.4% ±8% ℹ️ advisory
hashlife_breeder 2057.25 2395.07 +16.4% ±12% ℹ️ advisory
multi_field_lv_512 4285.60 4608.54 +7.5% ±10% ℹ️ advisory
parallel_gol_2048 998.97 7377.15 +638.5% ±20% ℹ️ advisory
wolfram_30_1d 4063.23 11942.52 +193.9% ±8% ℹ️ advisory

Lower wall time is better; Δ is current vs. baseline.

Prevent potential division by zero when calculating average and
variance for hash tables that have been emptied by a move operation.
Updated tpl_odhash.H and tpl_olhash.H to ensure these statistics
default to zero when the table has no buckets. Added corresponding
test cases in hash-it.cc to verify the fix.
Copilot AI balanced review requested due to automatic review settings October 14, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@lrleon
lrleon merged commit c6291a4 into master Oct 14, 2026
72 checks passed
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