GiggleLiu / NiLang.jl

A differential eDSL that can run faster than light and go back to the past.
https://giggleliu.github.io/NiLang.jl/dev
Apache License 2.0
250 stars 16 forks source link

Detect and optimize/error shared write and read-write #16

Closed GiggleLiu closed 4 years ago

GiggleLiu commented 4 years ago

The following code has the simultaneous read-write issue

x += x * y

One can not revert this operation by using x -= x * y.

The following code has the share write issue in the adjoint AD pass

y += x * x

Because, both x want to update its gradient field.

GiggleLiu commented 4 years ago

Fixed by a PR in NiLangCore.