Files
LithosAnanake/src/test_runner/modules
Robert Allan JamesandClaude Sonnet 5 abb858a300 Add POST coverage for physics-freeze words (Module 27), fix two real bugs found in the process
Cluster 4 of the POST-coverage sweep: physics_freeze_words_test.c covers the 6
words proof/StarForth_Physics_Freeze_Words.thy actually gives real lemmas for
(FREEZE-WORD, UNFREEZE-WORD, FROZEN?, HEAT!, HEAT@, DECAY-RATE@), correcting
an earlier fork summary's wrong "5 words" scope.

Writing the tests surfaced two independent, pre-existing bugs in
physics_freeze_words.c, both now fixed:

- Every address-taking word cast the VM's caddr directly to a host pointer
  instead of resolving it through vm_ptr() -- caddr is an offset into
  vm->memory, not a host pointer. Fixed in all 9 call sites (the 5 in-scope
  words plus SHOW-HEAT, which shares the identical pattern).
- Every underflow check used dsp < N (item count) instead of dsp < N-1, since
  this VM's dsp is a 0-indexed top-of-stack pointer. Fixed in all 6 checks.

Together these meant every word in this file taking a stack-supplied name has
been broken for any real caller since the file was written. Verified zero
build warnings and a clean three-arch QEMU boot (amd64/aarch64/riscv64), 1009
passed / 0 failed / 0 errors identically on all three, dict_hash matching
across arches.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-19 00:12:09 -04:00
..

src/test_runner/modules/

Per-category test files, one per FORTH-79 word category plus integration/stress/adversarial suites, run in this order by test_runner.c (POST order).

Word-category tests (validate each src/word_source/*.c file): arithmetic_words_test.c, mixed_arithmetic_words_test.c, stack_words_test.c, control_words_test.c, defining_words_tests.c, memory_words_test.c, return_stack_words_test.c, double_words_test.c, logical_words_test.c, io_words_test.c, string_words_test.c, block_words_test.c, format_words_test.c, system_words_test.c, dictionary_words_test.c, dictionary_manipulation_words_test.c, vocabulary_words_test.c, starforth_words_test.c, mama_forth_words_test.c, acl_words_test.c.

Cross-cutting tests:

  • integration_tests.c — multi-word interaction tests.
  • stress_tests.c — load/volume tests.
  • break_me_tests.c — adversarial/fuzzing tests.

Note: not every src/word_source/*.c file has a dedicated test module here (e.g. defer_words.c, log_words.c, inference_words.c, lifecycle_words_hosted.c, editor_words.c are exercised indirectly via integration tests or the tools/hermes_*.sh smoke tests rather than a standalone *_test.c module).