1
0
mirror of https://github.com/fluencelabs/aquavm synced 2025-03-16 13:00:50 +00:00

94 Commits

Author SHA1 Message Date
Ivan Boldyrev
5fdc8e68ac
feat(tools): VM-194 performance metering ()
* Experimental performance metering
* Average on repeated runs with `--repeat` option
* Add "version" field to the report
The version is got from `air/Cargo.toml`.

* Allow disabling preparing binaries
with the `--no-prepare-binaries` option.

* Human-readable execution time in the report

* Add dashboard benchmark
* Human-readable text report
2023-02-03 23:26:06 +07:00
Ivan Boldyrev
8f587b7803
feature(execution-engine): Canon data with CID ()
* Use CID values for tetraplets and `canon` vectors.

* Rename `cid_store` to `value_store`

It is consistent with the new `tetraplet_store` and `canon_store`
fields.

* Make canon data more typeful

The `CanonResult` doesn't take a JSON value anymore that is further
deserialized elsewhere, but is a struct that has all data deserialized.

* Typeful `CID` type

The `CID` type has a phantom type paramter defining its value's type.

* Group cid stores and trackers

Group cid stores into `CidInfo` struct, and trackers into `ExecutionCidState` struct.
2023-01-09 13:22:57 +07:00
Mike Voronov
86fce01e67
chore(execution-engine): more handy way to work with subgraph_complete () 2022-12-28 14:09:03 +03:00
Mike Voronov
1fc132d0d0
chore(execution-engine): rename air folder to instructions () 2022-12-27 18:40:10 +03:00
Ivan Boldyrev
0226c062f8
feat!(execution-engine): Store call executed values as CIDs in the data ()
The trace stores CID strings for call result values.  These strings are to be resolved to real values with `InterpreterData::cid_store` map.
2022-12-26 15:45:14 +07:00
Ivan Boldyrev
004ce10abd
Make unstable clippy happy with clippy --fix ()
Most of changes either move variables into `format!` templates
or remove excessive clones.
2022-12-12 22:37:05 +07:00
Mike Voronov
9fe7afb897
feat(all): reduce stream usage scope ()
This PR intended to reduce stream usage scope in order to make AquaVM truly deterministic.

Refs: .

Co-authored-by: Ivan Boldyrev <ivan@fluence.one>
Co-authored-by: Anatoly Laskaris <github_me@nahsi.dev>
2022-11-30 17:38:32 +03:00
Ivan Boldyrev
fb344084a7
Make new clippy happy () 2022-11-23 21:02:28 +07:00
Anatolios Laskaris
9896306573
chore: Fix needless-borrow warning() 2022-11-16 14:12:31 +02:00
Ivan Boldyrev
9c88567e59
More convenient error messages ()
Data is printed last as it is very long and made it difficult to find
the original error message.
2022-11-01 15:06:56 +07:00
Mike Voronov
8c3f9a3090
feat(interpreter-data): add interpreter version in data () 2022-10-13 12:50:32 +03:00
Mike Voronov
a60b61e1a1
fix(execution-engine): save order between current generations ()
Co-authored-by: Valery Antopol <valery.antopol@gmail.com>
2022-10-12 04:29:31 +03:00
Mike Voronov
bf8aee7f15
fix(execution-engine): fix invalid iteration over stream ()
This PR is mostly a revertion of , that is needed to make stream work correctly in fold itrerations.

Closes .
2022-10-11 01:41:22 +03:00
Mike Voronov
eafdec5d86
fix(aquavm): temporary fix entire value in canon () 2022-10-10 22:15:28 +03:00
Mike Voronov
910f1665eb
fix(trace-handler): fix fold and canon compatibility ()
Fixes bug of traces divergence when `canon` is used inside `fold`.

Closes .
2022-10-09 12:56:12 +03:00
Mike Voronov
cd598c28ae
refactor(aquavm): improve readability of ap merger and handler ()
At the moment `Ap` state contains vector of generations, although the ap instruction itself allow to specify only one stream. It was done to support several streams in a result position in a future. But the current realization allows to handle empty vector that was implemented to support states for scalars and it turned out (for more info see ) that states for scalars aren't actually needed.

Closes .
2022-10-07 14:38:29 +03:00
Mike Voronov
a8b227caf5
refactor(aquavm): getting rid of CallOutputValue in call merger ()
This PR refactors call merger of `TraceHandler`. Previously it requires `CallOutputValue` to determine a type of call output value (stream or scalar). And internally it checked correspondence between data result and call output type and return a error if they are not equal. Although execution engine component also had a match over these values and does nothing if they are not matched since `TraceHandler` did this job. This PR eliminate such behaviour and improve isolation of AquaVM modules.
2022-10-06 19:59:47 +03:00
Mike Voronov
ccbd3262a3
feat(aquavm): allow to set last instruction of fold () 2022-10-01 23:41:30 +03:00
Ivan Boldyrev
2e98712cb2
fix(execution-engine) Restricted stream bugfix ()
Use proper stream generation structures for call results merged from current data.

Closes .

Co-authored-by: vms <michail.vms@gmail.com>
2022-09-30 03:10:24 +07:00
Mike Voronov
8889291af8
fix(execution-engine): treat non-defined stream as empty in canon ()
This PR forces `canon` instruction to treat streams as empty, it's crucial for deterministic behaviour.

Closes .
2022-09-29 23:05:04 +03:00
Ivan Boldyrev
4a2e8be178
refactor(parser): use AirPos type for AIR script position ()
Use a dedicated wrapper type for better type safety and self-documented code.
2022-09-29 00:16:37 +03:00
Mike Voronov
c85b2e2fbf
feat(execution-engine): change behaviour of fold over streams ()
feat(execution-engine): change behaviour of fold over streams

Change behaviour of fold over streams to make it more similar to pi-calculus channels/names (for more info see ).

Closes .

BREAKING CHANGE:

The new stream behaviour is not compatible with old one, such as
```
(fold $stream iterator
   (seq
       (call ...)
       (next iterator)))
```
will never end after this change (for more info again see ).
2022-09-28 22:03:54 +03:00
Mike Voronov
20bb230a3a
Introduce never instruction () 2022-09-19 14:36:46 +03:00
Mike Voronov
84e36747d8
fix(execution-engine): change position mappings in ap with canon streams ()
Fix sheme of mapping variables produced by applying `ap` to canonicalized streams.

Fixes .
2022-09-14 19:33:21 +03:00
Mike Voronov
a4011ef038
Introduce length functor () 2022-09-08 16:58:04 +03:00
Mike Voronov
626796b299
fix clippy warnings () 2022-09-08 16:32:28 +03:00
Mike Voronov
e5d9681beb
Fix fold over canon streams () 2022-09-06 10:53:33 +03:00
Ivan Boldyrev
0ddcfb94ea
Bug: join behavior on CanonStream ()
The AquaVM returned an error instead of joining.

Resolves 
2022-09-06 14:32:15 +07:00
Ivan Boldyrev
619e8829a9
Get rid of unsafe code in the interpreter ()
* Get rid of unsafe code unless really necessary

* Add lint levels where appropriate

Some crates (air-beautifier, air-testing-framework) have lot of
rust_2018_idioms violations, that will be resolved later.
2022-09-06 00:03:30 +07:00
Mike Voronov
1cb6901caa
Populate restricted streams generations from data () 2022-09-05 17:57:26 +03:00
Mike Voronov
5072fba9d6
Introduce canon instruction () 2022-08-26 00:43:43 +03:00
Ivan Boldyrev
0c387f7415
Adjust air-trace options ()
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.
2022-08-04 20:51:54 +07:00
Ivan Boldyrev
c3cea695c8
air-trace util for measuring AquaVM performance with tracing crate.
`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.
2022-07-07 18:44:58 +07:00
Ivan Boldyrev
090eceef85
Get rid of unconditional logging code ()
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.
2022-06-22 16:25:22 +07:00
Ivan Boldyrev
6df2b9d084
Introduce TracePos type for trace positions ()
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.
2022-06-10 12:29:56 +07:00
Ivan Boldyrev
1c70a3d17d
Make clippy happier by resolving some warnings ()
1. Use $crate inside macros.
2. Remove unused lifetime.
3. Use write! instead of String::push_str + format! to reduce allocation.
2022-05-31 18:44:45 +07:00
Mike Voronov
24f0d66bed
Rename subtree to subgraph ()
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 , it's
no more a subtree, but a subgraph.
2022-05-17 15:53:33 +03:00
Mike Voronov
3f510e1581
Improve scope error handling () 2022-04-21 18:01:06 +03:00
Mike Voronov
7e0c87d72a
Introduce %ttl% () 2022-04-21 11:44:18 +03:00
Mike Voronov
490791b177
introduce %timestamp% () 2022-04-20 23:05:37 +03:00
Mike Voronov
69a42cf111
Introduce new for non iterable scalars () 2022-04-20 11:43:46 +03:00
Mike Voronov
06d275ea16
Improve non iterable scalar scoping () 2022-04-15 22:25:03 +03:00
Mike Voronov
b29883e990
Refactor tests () 2022-03-10 16:06:43 +03:00
Mike Voronov
914ad74516
Make fold by streams truly deterministic () 2022-03-10 01:32:07 +03:00
Mike Voronov
a64a4fc0a6
support empty array literal in fold () 2022-03-07 13:50:08 +03:00
Mike Voronov
c00b453a48
Remove RefCell from streams () 2022-03-03 19:09:48 +03:00
Mike Voronov
cc54e4c383
Introduce recursive streams () 2022-02-25 23:55:40 +03:00
Mike Voronov
ac050abc8a
Fix ap trace handler behaviour () 2022-02-25 10:24:28 +03:00
Mike Voronov
78a2bc9d58
Fix tetraplets json path () 2022-02-18 18:00:42 +03:00
Mike Voronov
1ca121cf93
fix data handling in Ap () 2022-02-17 13:37:36 +03:00