prometeu-runtime/docs/specs/pbs/files/PRs para Junie.md
Nilton Constantino ff4dcad5dc
pr 50
2026-01-31 20:39:05 +00:00

34 lines
1021 B
Markdown

## PR-12 — VM test harness: stepper, trace, and property tests
**Why:** Industrial quality means test tooling, not just “it runs”.
### Scope
* Add `VmRunner` test harness:
* step limit
* deterministic trace of stack deltas
* snapshot of locals
* Add property tests (lightweight):
* stack never underflows in verified programs
* verified programs never jump out of bounds
### Acceptance
* Debugging is fast, and regressions are caught.
---
## Definition of Done (DoD) for PBS v0 “minimum executable”
A single canonical cartridge runs end-to-end:
* `let` declarations (locals)
* arithmetic (+, -, *, /, %, comparisons)
* `if/else` control flow
* `when` expression (if present in lowering)
* function calls with params + returns (including `void`)
* multiple return slots (flattened structs / hardware value types)
* host syscalls (e.g., `GfxClear565`, `InputPadSnapshot`, `InputTouchSnapshot`)
* deterministic traps (OOB bounded, invalid local, invalid call target, stack underflow)