prometeu-runtime/docs/specs/pbs/files/PRs para Junie Global.md
Nilton Constantino 373f1190e2
pr 37
2026-01-31 00:22:34 +00:00

29 lines
1.1 KiB
Markdown

> **Status:** Ready to copy/paste to Junie
>
> **Goal:** expose hardware types **1:1** to PBS and VM as **SAFE builtins** (stack/value), *not* HIP.
>
> **Key constraint:** Prometeu does **not** have `u16` as a primitive. Use `bounded` for 16-bit-ish hardware scalars.
>
> **Deliverables (in order):**
>
> 1. VM hostcall ABI supports returning **flattened SAFE structs** (multi-slot).
> 2. PBS prelude defines `Color`, `ButtonState`, `Pad`, `Touch` using `bounded`.
> 3. Lowering emits deterministic syscalls for `Gfx.clear(Color)` and `Input.pad()/touch()`.
> 4. Runtime implements the syscalls and an integration cartridge validates behavior.
>
> **Hard rules (do not break):**
>
> * No heap, no gates, no HIP for these types.
> * No `u16` anywhere in PBS surface.
> * Returned structs are *values*, copied by stack.
> * Every PR must include tests.
> * No renumbering opcodes; append only.
## Notes / Forbidden
* DO NOT introduce `u16` into PBS.
* DO NOT allocate heap for these types.
* DO NOT encode `Pad`/`Touch` as gates.
* DO NOT change unrelated opcodes.
* DO NOT add “convenient” APIs not listed above.