Commit graph

1 commit

Author SHA1 Message Date
DeFiDude
b9e8a1d7a4 tools/check_stack.py: worst-case stack-depth analyzer
Walks every src/**/*.S, parses each function's @stack annotation and
its call/tail/jal outgoing edges, builds a call graph rooted at
_reset, and reports the deepest cumulative stack along any reachable
path. Fails the build if the deepest path exceeds STACK_SIZE from
src/include/config.S.

Cycles are flagged as recursion (recursion is forbidden today; allowing
it needs a separate ADR). Functions reachable from _reset whose .S is
absent are reported as warnings.

Wired into 'make ci': registry → stack → test. Current binary:
deepest path _reset → _main → log_event → log_hex = 48 bytes,
well under STACK_SIZE = 16384.

OQ-4 resolved in docs/open-questions.md.

154 tests, all green.
2026-05-01 23:09:19 -06:00