|
| 1 | +# PVM Test Vectors, version 0.4 |
| 2 | + |
| 3 | +## How to use this |
| 4 | + |
| 5 | +The [`programs`](./programs) directory contains `.json` files, each containing a single test. |
| 6 | + |
| 7 | +These are meant to test the PVM function Ψ from the Graypaper's Appendix A (equation 203 from v0.2.1 of the paper). |
| 8 | + |
| 9 | +See [schema.asn](./schema.asn) for a human-readable schema of what each of the fields mean. |
| 10 | + |
| 11 | +See [schema.json](./schema.json) for a JSON Schema. |
| 12 | + |
| 13 | +See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases. |
| 14 | + |
| 15 | +## TODO |
| 16 | + |
| 17 | + * 100% instruction coverage |
| 18 | + * Tests for abnormal skip values for each instruction type |
| 19 | + * Tests involving host calls |
| 20 | + * Tests for invalid/malformed program blobs |
| 21 | + * More gas metering tests; proper gas cost model (current one is a placeholder) |
| 22 | + |
| 23 | +## Changelog |
| 24 | + |
| 25 | +### v0.4 |
| 26 | + |
| 27 | + * The tests now target 64-bit PVM, in alignment with GP 0.5.4. |
| 28 | + * The `trap` exit status is now called `panic` to align with the GP. |
| 29 | + * Added new exit status: `page-fault`; tests which previously panicked when accessing unpaged memory now generate page faults. |
| 30 | + * Added 106 new tests from the [RISC-V test suite](https://github.com/riscv-software-src/riscv-tests) transpiled into PVM. |
| 31 | + |
| 32 | +### v0.3 |
| 33 | + |
| 34 | + * Removed tests which were testing gas behavior that is not yet described in the GP: |
| 35 | + - `inst_load_u8_trap` |
| 36 | + - `inst_store_u8_trap_inaccessible` |
| 37 | + - `inst_store_u8_trap_read_only` |
| 38 | + |
| 39 | +### v0.2 |
| 40 | + |
| 41 | + * Bitmask paddings are now filled with zeros, in alignment with the GP. |
| 42 | + * Disassemblies now end with an `invalid` instruction to signify places where |
| 43 | + the execution traps when going out of bounds. This is a purely cosmetic change |
| 44 | + to the reference disassemblies and doesn't affect the test vectors themselves. |
| 45 | + * The `inst_rem_signed` test was changed to make the output value non-zero. |
| 46 | + (The behavior is unchanged; the instruction still works the same as before.) |
| 47 | + * Set the initial value of the output register to a non-zero for the following tests: |
| 48 | + (The behavior is unchanged; the instructions still work the same as before.) |
| 49 | + - `inst_rem_signed_with_overflow` |
| 50 | + - `inst_set_greater_than_signed_imm_0` |
| 51 | + - `inst_set_greater_than_unsigned_imm_0`, |
| 52 | + - `inst_set_less_than_signed_0` |
| 53 | + - `inst_set_less_than_signed_imm_0` |
| 54 | + - `inst_set_less_than_unsigned_0`, |
| 55 | + - `inst_set_less_than_unsigned_imm_0` |
| 56 | + * Add new tests: |
| 57 | + - `inst_load_i16` |
| 58 | + - `inst_load_i8` |
| 59 | + - `inst_load_imm_and_jump` |
| 60 | + - `inst_load_indirect_i16_with_offset` |
| 61 | + - `inst_load_indirect_i16_without_offset` |
| 62 | + - `inst_load_indirect_i8_with_offset` |
| 63 | + - `inst_load_indirect_i8_without_offset` |
| 64 | + - `inst_load_indirect_u16_with_offset` |
| 65 | + - `inst_load_indirect_u16_without_offset` |
| 66 | + - `inst_load_indirect_u32_with_offset` |
| 67 | + - `inst_load_indirect_u32_without_offset` |
| 68 | + - `inst_load_indirect_u8_with_offset` |
| 69 | + - `inst_load_indirect_u8_without_offset` |
| 70 | + - `inst_load_u16` |
| 71 | + - `inst_load_u32` |
| 72 | + - `inst_store_imm_u16` |
| 73 | + - `inst_store_imm_u32` |
| 74 | + - `inst_store_imm_u8` |
| 75 | + |
| 76 | +### v0.1 |
| 77 | + |
| 78 | + * Initial test vectors. |
0 commit comments