AlgebraicJulia / DiagrammaticEquations.jl

MIT License
9 stars 1 forks source link

@decapode not usable in source #74

Open lukem12345 opened 2 weeks ago

lukem12345 commented 2 weeks ago

Attempting to define a particular Decapode in any source file (of the DiagrammaticEquations package) causes a segmentation fault.

To reproduce:

  1. Go to any source file, such as src/language.jl
  2. Define a decapode. e.g.
    g = @decapode begin
    A == B + C
    end
  3. Open a REPL. Do using DiagrammaticEquations, DiagrammaticEquations.Deca. Attempt to construct a Decapode using the @decapode macro. This causes a segmentation fault.
lukem12345 commented 2 weeks ago

@jpfairbanks Is this an intertypes thing?

lukem12345 commented 2 weeks ago

Following the above steps on commit 88b18743976c55c3d77316e40af3117aec368f1b , no segfault occurs and everything runs as expected. I'll keep bisecting and see what might have introduced this. Hopefully it is something related to Revise.jl or some such

lukem12345 commented 2 weeks ago

Segfaults on 9bbe494bbb61f6d180c465ea8c834f6ce15a983f Does not segfault on e4df0b6009696711733a0d33bdb5706b53dd6ba6

lukem12345 commented 2 weeks ago

@quffaro Can you take a gander at this and see if this is an issue for ACSets.jl?

quffaro commented 2 weeks ago

@lukem12345 I was able to replicate the issue. Thank you for the helpful analysis! I'll look at the two commits you posted

jpfairbanks commented 2 weeks ago

I bet this has to do with the fact that we don't put the Decapodes ACSet types into their own submodule. So there is no module boundary between code that is in a src/x.jl file and the code that defines the types.

The tests and docs both live in modules that import DiagrammaticEquations rather than directly live inside it. So we can create decapodes outside that module, but not within it.

Hopefully the only fix we would need is to wrap any intertypes generated type with a submodule of the package.