* Refactor `avm-server` interface mod to new crate (#294)
The new crate name is `avm-interface`.
It allows to build fully native air-trace, including pure WASM build.
* Make fully native air-trace build
Unless `wasm` feature is enabled (default), fully native build is
produced. You may build WASM air-trace binary with
`cargo build --target wasm32-wasi --no-default-features --release -p air-trace`
* Fix tracing output on native air-trace build
Wrong option was used.
1. Introduce --runner-tracing-params for enable and disable tracing of runner.
2. Adjust some function's tracing levels to make default traces less noisy.
1. change names to use kebab naming:
`--call_results` -> `--call-results`
`--prev_data` -> `--prev-data`
2. rename `--runtime` option to `--interpreter`, and the associated env variable to `AIR_INTERPRETER_WASM_PATH`.
3. print trace into to stderr
Refs: VM-113.
Co-authored-by: ValeryAntopol
* Fix stale benchmarks
* Data (de)serialization and execution benchmarks:
Two kind of benchmark: relatively short, but with huge call results, and
long trace of small call results. Moreover, there are two case for each:
with same data to be merged with comparison, and data from different
par branches merged w/o comparison.
`air-trace run` subcommand allows to run AquaVM on any data, it allows to define most AquaVM inputs, providing defaults for most of them, and sets up either human-readable or JSON tracing output, the latter can be later processed by `air-trace stats`.
Anomaly data input is also supported, that is useful for slow data investigation.
Native execution mode can be used for native profiling. Please note, however, that current version cannot be built natively on Apple Sillicon processor yet, as invariably depends on the `avm-server` because of leaking types that should be refactored or hidden. The `--repeat` option can repeat the execution several times for the execution to dominate on input data reading and output.
High-level or rare calls have "info" trace level, instructions are "debug", and sub-instruction calls are "tracing". Over-detailed tracing can induce overhead that spoils timing data.
This PR adds two new methods in DataStore to determine anomaly and collect necessary data. Additionally
- a generic parameter of DataStore turned to be associative
- AVMOutcome contains additionally memory_delta and execution_time
The `log_instruction` macro unconditionally pre-formatted some string to
be logged, even if logging is disabled, making whole AquaVM very slow.
After getting it fixed, native execution time dropped from 5sec to
thousands of milliseconds.
Many internal structures refer to trace positions; this is an important type of values. In the code, it is sometimes `u32`, sometimes `usize`. While such variables usually have "_pos" suffix, having a dedicated type does improve code with type guarantees.
As `wasm32-wasi` target doesn't seem to support sanitizers, we are to
execute tests with native code. The feature `test_with_native_code` is
introduced for that.
Closes#247.
Older grammar allowed some variabilty in triple format. Now, the only
format allowed is:
`peer_id (service_id function_name)`
As less errors can happen during parsing of the triplet, the code was
simplified further .
Closes#267.
Intially, a fold instruction was designed based on idea that its iterable can't expand,
so AIR was considered as a subtree. But after introducing recursive streams in #225, it's
no more a subtree, but a subgraph.
Use pooled `avm::server::AVMRunner` instances of
air_iterpreter_server.wasm to reduce tests' running time. It avoids
repeated WASM loading and compilation.
On my hardware, `cargo test --release` execution time (precompiled)
decreases from almost 6 minutes to 1.5 minutes.