34 lines
1021 B
Markdown
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) |