Closed daemontus closed 7 months ago
Coverage Report
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
357 | 0 :zzz: | 0 :x: | 0 :fire: | 44.766s :stopwatch: |
@daemontus any thoughts on how to reconcile this with #115? I'm thinking merge this first, then revert #115 to before the package rename and merge that, then make an entirely new pr just for the renaming. Not sure if there's a better way.
I just tried to rebase it locally from #115 and it seems that we can first do #115 and then I'll just update this PR with the new name. Interestingly, other than the the newly created files/functions, most of the changes merged without conflicts... so it should be an easy fix :)
This should now be fully rebased with the latest name change. (bcc: @jcrozum)
@jcrozum I think I resolved the issue with the "constant configuration values": SuccessionDiagram
now has a configuration dictionary that stores all of these and you can pass it as a constructor parameter. As such, if you serialize the diagram, the "configuration" is preserved. Furthermore, these are no longer global module "constants" so we don't have to worry about users needing to access/modify them.
Please have a quick look if that looks reasonable to you, and if yes, feel free to merge the PR.
Looks good, I'll merge it.
This PR proposes a major refactoring/update of the attractor detection mechanism to make it more practical on large networks.
I have slightly updated the vocabulary in the code:
Highlights:
pint
is now an "optional" dependency, because the first two optimizations make it largely redundant.pint
could eliminate a few extra candidate states, but for the most part, cases wherepint
was used would have to go to symbolic reachability anyway. Hence I modified the code in such a way thatpint
can still be used, but is not mandatory and does not have to be installed.mole
is fully replaced with symbolic reachability in AEON.100_000
). This usually happens if the network has a lot of free inputs and is easier to explain than a generic "out of memory" error that would be produced otherwise. The limit can be changed using a constant if needed.Performance results for "seed" state detection:
balm-analysis
repository, assuming we can build the succession diagram for them.random_nk2
andrandom_nk3
models, we can compute all of them without major issues.balm-new-real-models
, we can compute everything that doesn't have too many inputs (there, we can't expand the root node so it just crashes). We can fix those inputs to some random values and then we can compute everything AFAIK.random
models, there is one model where even the new optimization cannot produce a retained set with fewer than 1M candidate states. Other than that, all models reduce to a handful of candidate states (some take a few minutes to get there though). Out of these, three fail on symbolic reachability due to timeout, the rest finishes.Full attractor results (first is the new version, second is the old version, the random pass on the old version failed before the end due to unrelated reasons, but I think the picture is clear) full-attr.xlsx. There is one notable regression in the BBM dataset (ID195): here, the attractor search is very very simple and it actually isn't worth it to even compute the percolated network for each trap space, that's why it is taking longer now. But the actually hard instances like 002 or 211 do seem to benefit quite a bit, not just the random models.
Other relevant changes:
pypint
fromrequirements.txt
and marked it as optional inpyproject.toml
._sd_attractors
for most of the new (and some of the old) code. Subsequently, themotif_avoidant.py
module has been removed and its functionality is now mostly in the_sd_attractors
module. Similarly,_sd_algorithms/compute_attractor_seeds.py
is now in_sd_attractors
.motif_avoidant.py
code also moved to_pint_reachability.py
, which is now only responsible for the pint code, but hasn't changed much (I added a limit on the pint goal size because it was failing with more than a handful of candidate states).percolated_network
,percolated_petri_net
, andpercolated_nfvs
toNodeData
. These are computed lazily and can be removed either usingSuccessionDiagram.reclaim_node_data()
or by manually setting them toNone
. Each of these has a corresponding "compute" function in the succession diagram as well.attractor_candidates
,attractor_seeds
andattractor_sets
toNodeData
. Here, ifattractor_candidates
is unknown andattractor_seeds
is known,attractor_seeds
can be used instead. Also, computing one can subsequently populate the others if the result is valid (e.g. computing a single candidate state also uses it as a seed state immediately).symbolic_utils
function which converts aBddValuation
to aBooleanSpace
. This is used in the new simulation code.tests/motif_avoidant_test
is now ignored and should be replaced with better tests for the new attractor detection pipeline.--diff
option in the CI command forblack
, because it gave me different results on my machine and I needed to compare them. Could be useful in the future too :)TODOs:
benchmark
folder since not all scripts there are currently working (or just move everything tobalm-analysis
).