This commit is contained in:
Nilton Constantino
2026-01-30 11:58:15 +00:00
parent 91af0d6f98
commit 76660294d5
6 changed files with 230 additions and 105 deletions
-69
View File
@@ -1,72 +1,3 @@
# PR-02 — Define `ir_vm` ISA v0 (Memory & Gates Only)
### Goal
Define a minimal, PBS-compatible but PBS-agnostic VM instruction set.
### Required Instructions
#### Constant Pool
* `PushConst(ConstId)`
#### HIP Allocation (Deterministic)
* `Alloc { type_id: TypeId, slots: u32 }`
#### Gate-Based Heap Access
* `GateLoad { offset: u32 }`
* `GateStore { offset: u32 }`
> All heap access must follow: gate validation → base+slots resolution → bounds check → read/write.
#### Scope Markers (Semantic Preservation)
* `GateBeginPeek` / `GateEndPeek`
* `GateBeginBorrow` / `GateEndBorrow`
* `GateBeginMutate` / `GateEndMutate`
> These may be runtime no-ops in v0 but must exist to preserve semantics and debug invariants.
#### Safe Point Hook
* `FrameSync` (optional but recommended)
### Non-goals
* No RC implementation
* No VM execution logic
### Tests
* Unit tests ensuring the instruction enum is stable and cloneable
* Snapshot or debug-format test to lock the ISA surface
---
# PR-03 — Remove “Ref” Leakage from `ir_vm`
### Goal
Eliminate pointer-based mental models from the VM IR.
### Required Changes
* Rename any existing `LoadRef` / `StoreRef` to:
* `LocalLoad { slot: u32 }`
* `LocalStore { slot: u32 }`
* Remove or rename any type named `Ref` that refers to HIP
**Hard rule:** the word `Ref` must never refer to HIP memory in `ir_vm`.
### Tests
* Grep-style or unit test ensuring no `Ref`-named HIP ops exist in `ir_vm`
---
# PR-04 — Update `core_to_vm` Lowering (Kill Placeholders)
### Goal