Skip to content

F4.8: determinismo + garantía panic-free en rugus-core#86

Merged
guillo93 merged 1 commit into
mainfrom
f4.8-determinism-panic-free
Jun 3, 2026
Merged

F4.8: determinismo + garantía panic-free en rugus-core#86
guillo93 merged 1 commit into
mainfrom
f4.8-determinism-panic-free

Conversation

@guillo93
Copy link
Copy Markdown
Owner

@guillo93 guillo93 commented Jun 3, 2026

Resumen

  • Panic-free: rugus-core gana un gate de lints (deny clippy::unwrap_used/expect_used/panic/todo/unimplemented/unreachable, exento en cfg(test)) que falla CI si se introduce un punto de pánico explícito. El core ya estaba limpio; esto lo blinda hacia el futuro. Los pánicos implícitos (índice/overflow) se acotan por invariantes de MAX_TASKS/bandas y en release (overflow-checks=off) hacen wrap.
  • Determinismo: nuevo módulo determinism_tests (3 tests): planificación byte-idéntica entre ejecuciones idénticas (función pura del estado + reloj explícito), round-robin cíclico de periodo exacto = nº de tareas listas, y preempción por rodaja determinista. Sustenta el análisis de latencia (peor caso pick/preempt_tick = barrido O(MAX_TASKS), sin recursión ni espera no acotada).

Validación

  • host-tests 32 OK (29 → +3 determinismo).
  • clippy thumbv7em + thumbv7m, doc, rustfmt limpios.
  • Sin cambio de comportamiento en firmware (solo atributo de lint + tests host) → no requiere reflash.

Test plan

  • cargo test host-tests (incl. determinism_tests)
  • clippy ×2 targets (workspace embebido)
  • cargo doc -D warnings
  • cargo fmt --all + host-tests

🤖 Generated with Claude Code

- Garantía panic-free: rugus-core gana un gate de lints (deny clippy::unwrap_used/
  expect_used/panic/todo/unimplemented/unreachable, exento en `cfg(test)`) que
  falla CI (-D warnings) si se introduce un punto de pánico EXPLÍCITO. El core ya
  estaba limpio; esto lo blinda hacia el futuro empujando a manejo explícito de
  errores (Option/Errno). Los pánicos implícitos (índice/overflow) se acotan por
  invariantes de MAX_TASKS/bandas y en release (overflow-checks=off) hacen wrap.
- Determinismo: nuevo módulo `determinism_tests` en rugus-host-tests (3 tests):
  (1) dos schedulers idénticos operados igual generan trazas de planificación
  byte-idénticas (planificación = función pura del estado + reloj explícito, sin
  RNG/reloj implícito); (2) la rotación round-robin es cíclica de periodo exacto
  = nº de tareas listas (sin deriva, sirve cada tarea una vez); (3) la preempción
  por rodaja es determinista entre ejecuciones. Sustenta el análisis de latencia:
  el peor caso de pick/preempt_tick es un barrido O(MAX_TASKS) sin recursión ni
  espera no acotada.

Sin cambio de comportamiento en firmware (solo atributo de lint + tests host), no
requiere reflash. host-tests 32 OK (29→+3). clippy (×2 targets) + doc limpios.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@guillo93 guillo93 merged commit b290c8b into main Jun 3, 2026
9 checks passed
@guillo93 guillo93 deleted the f4.8-determinism-panic-free branch June 3, 2026 10:55
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.

1 participant