This commit is contained in:
2026-03-24 13:40:42 +00:00
parent bd507aeaa5
commit 8d1e0a57d6
11 changed files with 232 additions and 73 deletions
-58
View File
@@ -1,61 +1,3 @@
# PR-8.3 — Layered Test Suite Architecture
## Briefing
Tests must be structured by layer to isolate failures.
Layers:
1. Bytecode encode/decode
2. Verifier
3. VM execution
4. GC behavior
5. Scheduler behavior
## Target
Organize tests into modules per layer.
Enforce:
* No cross-layer assumptions.
* Verifier tests do not execute VM.
* VM tests assume verified input.
Add minimal coverage per layer.
## Acceptance Checklist
* [ ] Tests grouped logically.
* [ ] No duplicated logic.
* [ ] Clear separation of concerns.
## Tests
Add representative tests per layer:
* Encode/decode edge cases.
* Verifier rejects invalid closures.
* VM executes valid programs.
* GC collects unreachable closures.
* Scheduler deterministic ordering.
## Junie Instructions
You MAY:
* Refactor test layout.
* Add missing coverage.
You MUST NOT:
* Merge unrelated layers.
* Hide verifier failures inside runtime traps.
If a test spans layers, STOP and split appropriately.
---
# PR-8.4 — No Legacy Artifacts Enforcement
## Briefing
+37 -15
View File
@@ -1,15 +1,37 @@
Stress test outline (to add in PR‑7.9 or here if desired)
•
Build a bytecode program with a tight loop containing arithmetic + occasional YIELD and ensure:
◦
Under tiny budgets (1–n cycles), pc progression is identical across runs.
What I changed and why
Open in editor
◦
Switches (simulated by alternating between two VMs) occur only
▪
immediately after step() completes, or
▪
when run_budget returns FrameSync.
◦
No observable state change occurs when force‑switching between two VMs mid‑tick except at these safepoints.
Layered Test Suite Architecture (PR‑8.3)
Overview
- Tests are organized by runtime layer to isolate failures and clarify ownership of behavior.
- Location: `crates/dev/prometeu-layer-tests/tests/`
Layers and representative tests
1. Bytecode encode/decode
- `bytecode_encode_decode.rs` — round‑trip decoding for edge immediates and structure.
2. Verifier
- `verifier_closure_reject.rs` — rejects `CALL_CLOSURE` when TOS is not a closure.
- Rule: verifier tests never run the VM.
3. VM execution
- `vm_exec_valid.rs` — executes a tiny valid program; assumes verified input.
- Rule: VM tests do not depend on the verifier; they prepare ROM directly.
4. GC behavior
- `gc_collect_unreachable.rs` — unrooted closure is reclaimed; rooted one survives.
5. Scheduler behavior
- `scheduler_determinism.rs` — deterministic FIFO ordering for same‑tick wakeups.
Running the layered suite
- Run just the layered tests: `cargo test -p prometeu-layer-tests`
- Run the entire workspace: `cargo test`
Separation of concerns
- No cross‑layer assumptions in these tests.
- Verifier tests: no `VirtualMachine` execution.
- VM tests: assume pre‑verified bytecode; interact via public VM APIs only.
- GC and Scheduler tests: exercise their public APIs directly, without booting the VM.
DRY helpers
- Shared utilities should live in `crates/dev/prometeu-test-support` when needed. The current minimal suite avoids duplication by using tiny local helpers.