aqua/model/transform
Dmitry Kurinskiy 012cba493c
Op model (#403)
* Separating raw FuncOp from OpModel WIP

* Model compiles, fighting with transform

* Refactoring WIP

* transform compiles

* Fixing AquaCompiler WIP

* Compiler compiles WIP

* AquaContext's allFuncs, allValues

* WIP trying to compile the CLI

* It compiles

* It runs and fails to compile

* Compiles wrong way

* fix TopologySpec

* Sugar bugfix

* fix TransformSpec compilation

* fix test compilation

* fix SemanticSpec

* Topology debugging

* TransformSpec fixed

* Do not import aqua.model

* Take parts in Semantics

* Fix for re-exports

* Maybe a fix for streams

* Maybe a fix for declarations

* streamArgs.aqua in test examples

* more aqua code with bugs

* FuncOp removed

* removed wrapNonEmpty

* fix TransformSpec

* fix SemanticSpec compilation, delete FuncOps

* Separated model/res, model/inline

* tiny fix

* Tests fixed

* TreeNode to wrap labels into cofree standard way

* TreeNodeCompanion with defauls show, equalsOrShowDiff for all Cofree trees we have

* Simple TagInlinerSpec

* Failing test in TagInlinerSpec

* test wip

* test fixed

* delete Node

* delete test-kit, move tests

* fix constants

* Failing TagInliner test

* More complex case for TagInlinerSpec

* TagInlinerSpec fix

* Split RawValueInliner, TagInliner

* Dumb case for ArrowInlinerSpec

* spec for stream renaming

* renaming stream test

* Exports fixed

* SeqModel.wrapWithEmpty for tests

* Deleted EmptyModel

* Bring back EmptyModel

* ArrowInlinerSpec wip

* ArrowInlinerSpec fixed

* Test fixed

* fix

* stream in callback test WIP

* Slightly better logging for TagInliner

* add example in aqua

* test update

* Removed occasional abilities override

* test

* AquaCompilerSpec WIP

* AquaCompilerSpec failing

* AquaCompilerSpec fixed

* fix test

* compiler test, add RestrictionTag

* break test

* fix stream passing to box arguments

* fix exports in context

* Do not reexport builtins

* init for topology bug

* test for topology

* Reproduced the import-reexport bug

* Hops are working...

* Issue #397 does not reproduce!

* foldJoin reproduces the bug

* Reexports inefficiently fixed

* Topology test fixed

* topology bug

* Cache compiled parts

* Cache compiled parts

* ignore the wip topology test

* delete test

* hanging

* add builtin

* Use linked-data-structure `equals` instead of recursive `hashCode`

* A bit more logs

* eq is faster than ==

* Try to join one by one

* op.identity for join

* reverting op.noop for join

* Fix for renaming when value has the same name as argument

* Bump the version to .6

* broken test for names

* second test for renaming

* this test works but i must break it

* add index in call

* JoinModel breaks test

* the test works fine with a fix, but we should check it closely. and `foldJoin.aqua` integration test become broken

* broken test with xor

* Fixed naming issue for lambda's variables substitution

* Topology bug wip

* Fixes #397

* Maybe fix

Co-authored-by: DieMyst <dmitry.shakhtarin@fluence.ai>
2022-01-31 14:48:13 +03:00
..
2022-01-31 14:48:13 +03:00
2021-12-22 15:21:37 +03:00
2021-12-22 15:21:37 +03:00

Topology transformations

Beware cycles!

img.png

  • Before: where execution happened before entering into this tag
  • Begin: where execution is expected to be in the beginning of this tag

Usually tags handle their beforePaths: inject pathway from location Before to location Begin, to ensure that execution can get there.

  • End: where execution is expected to end when all the children of the tag are executed
  • After: where execution flow should go after this tag is handled

Usually Before == previous End or parent's Begin, and After == next Begin or parent's After.

  • Finally: either After, if tag takes care of getting from its internal scope to the outer scope, or End if it doesn't

Usually tags do not care about the afterPath and inject nothing. But in some cases this path is super necessary, e.g. returning from the Par branch must be done within that Par branch, as doing it later is too late.

Tag Before Begin End After Finally Force Exit
Default parent.begin OR path path <- begin <- ends force ? <- after: <- ends false
seq - - lastChild.finally - - -
seq/* prev.finally OR default - - next.begin OR parent.after - -
xor/*:0 - - - parent.after - hasExecLater
xor/*:1 prev.ends - - parent.after - hasExecLater
xor - - lastChild.finally - - -
par/* - - <- before parent.after - exportsUsedLater
for - fc.begins(until i) - - - -
noExec - - <- begin - - -