Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e285daa
Add initial PVM test vectors
koute Jun 24, 2024
19d2ad8
Pre-clobber the output reg in `inst_div_unsigned_with_overflow`
koute Jun 25, 2024
9ba4b5b
Replace underscores with hypens, because ASN.1 doesn't like underscores
koute Jun 25, 2024
e89f6b7
Add JSON Schema and ASN.1 schema
koute Jun 25, 2024
96025c7
Add comments to the ASN.1 schema, reference the paper, update README
koute Jun 25, 2024
1d43b7d
Add the instruction/program counter to the tests
koute Jun 25, 2024
9b35cf4
Correct the expected PC for when the program halts
koute Jun 25, 2024
f4c9f3f
Add tests involving memory
koute Jun 25, 2024
dbbfbd4
Remove accidental `OPTIONAL` from the ASN.1 schema
koute Jun 25, 2024
3e18a7f
Add gas
koute Jun 26, 2024
e267a75
Rename `code` -> `program`
koute Jun 26, 2024
5581280
Fix some typos in the ASN.1 schema
koute Jun 26, 2024
a2b1870
Align reg3 serialization with the GP and add extra testcases
koute Jun 28, 2024
0a4c99b
PVM tests v0.2: add 'invalid' to disassemblies to mark implicit traps
koute Oct 4, 2024
8659541
PVM tests v0.2: bitmask paddings are now filled with zeros
koute Oct 4, 2024
fb4de8a
PVM tests v0.2: `inst_rem_signed`: make output non-zero
koute Oct 4, 2024
fa6cf0a
PVM tests v0.2: `inst_rem_signed_with_overflow`: non-zero initial val…
koute Oct 4, 2024
83596b5
PVM tests v0.2: `inst_set_*`: non-zero initial value of output reg
koute Oct 4, 2024
51e134e
PVM tests v0.2: add more load/store tests
koute Oct 4, 2024
30ba85a
PVM tests v0.2: update README
koute Oct 4, 2024
a54d7cf
PVM tests v0.3: remove tests which expose gas precharging
koute Oct 10, 2024
bf3c81a
PVM tests v0.4
koute Jan 24, 2025
cd85648
PVM tests v0.4: remove read-only panicking tests
koute Jan 27, 2025
e231523
PVM tests v0.4: remove `inst_load_u8_nok` and `inst_store_u8_trap_ina…
koute Feb 18, 2025
5427958
Merge remote-tracking branch 'origin/master' into HEAD
koute Mar 23, 2026
d60a459
PVM tests v0.5: updated for GP 0.8.0
koute Mar 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions pvm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# PVM Test Vectors, version 0.1

## How to use this

The [`programs`](./programs) directory contains `.json` files, each containing a single test.

Here's an example of such a test:

```
{
"name": "inst_add",
"initial_regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0],
"code": [0, 0, 3, 8, 121, 8, 249],
"expected_status": "trap",
"expected_regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0]
}
```

* `name` -- a unique identifier for the test
* `initial_regs` -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed
* `code` -- the code blob of the program to be executed as part of the test
* `expected_status` -- the way the program is supposed to end; currently it can be one of the following:
- `"trap"` -- the execution ended with a trap (the `trap` instruction was executed, the execution went "out of bounds", an invalid jump was made, or an invalid instruction was executed)
- `"halt"` -- the execution finished gracefully (a dynamic jump to address `0xffff0000` was made)
* `expected_regs` -- the expected values of each of the 13 registers *after* the test program is executed
Comment thread
koute marked this conversation as resolved.
Outdated

See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases.

## Changelog

### v0.1

* Initial test vectors.
Loading