prometeu-runtime/docs/specs/pbs/files/PRs para Junie.md
Nilton Constantino 83e24920b4
pr 49
2026-01-31 18:48:22 +00:00

1.4 KiB

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.

PR-13 — Optional: Refactor Value representation (tagged slots) for clarity

Why: If current Value representation is the source of complexity/bugs, refactor now.

Scope (only if needed)

  • Make Slot explicit:

    • Slot::I32, Slot::I64, Slot::U32, Slot::Bool, Slot::ConstId, Slot::GateId, Slot::Unit
  • Multi-slot types become sequences of slots.

Acceptance

  • Simpler, more verifiable runtime.

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)