Open iquah1 opened 2 years ago
Thanks for reporting. I can reproduce the problem locally (though with an extra cmake ../
in the build/
folder).
It is a rather large project so I'm not completely sure what is going on, but my gut-feeling is that there may be a bad interaction between having duplicate C++ declarations and then some xref lookup code. This should of course not result in an assertion.
I don't have much time right now, but if possible it would be great if you could experiment with making a smaller version that reproduces the problem. Then I'll take a deeper look at it as soon as possible.
The name where it goes wrong in my test is bigintnat::NativeIntegerT::Integer
. It looks like there are NativeIntegerT
declarations in both assets/sphinx_rsts/modules/core/math/core_math_bigintnat
and assets/sphinx_rsts/modules/core/math/core_math
, so perhaps a brutal limitation to those two files (and maybe just a small part of them).
though with an extra cmake ../ in the build/ folder
Ahh, so sorry, I've edited it to include those lines in case someone else takes a look too.
duplicate C++ declarations and then some xref lookup code
Gotcha!
The name where it goes wrong in my test is bigintnat::NativeIntegerT::Integer. It looks like there are NativeIntegerT declarations in both assets/sphinx_rsts/modules/core/math/core_math_bigintnat and assets/sphinx_rsts/modules/core/math/core_math
You got it! Out of curiosity how did you narrow it down to those two? When I run it I get between 5 to 10K lines of messages so it's hard to parse through all of them
The name where it goes wrong in my test is bigintnat::NativeIntegerT::Integer. It looks like there are NativeIntegerT declarations in both assets/sphinx_rsts/modules/core/math/core_math_bigintnat and assets/sphinx_rsts/modules/core/math/core_math
You got it! Out of curiosity how did you narrow it down to those two? When I run it I get between 5 to 10K lines of messages so it's hard to parse through all of them
The output is indeed rather large. I get close to 13k lines :-). This assertion has triggered before so I have inserted som extra debug output to help diagnose it. The situation is that it is trying to resolve an xref and first needs to find the symbol for the current scope, but for some reason that lookup fails. The first line of the debug output starts with Target:
, which is the xref to resolve, and then a line with ParentKey:
which is a specification of the current scope to start lookup from. Then follows 9k lines with a dump of the complete symbol tree for the C++ domain.
I thus found
Target: NativeInt
ParentKey: [(<ASTNestedNameElement>, None, '_CPPv49bigintnat'), (<ASTNestedNameElement>, <ASTTemplateParams>, '_CPPv4I0EN9bigintnat14NativeIntegerTE'), (<ASTNestedNameElement>, None, '_CPPv4N9bigintnat14NativeIntegerT7IntegerE')]
Edit: of which the key actually is
ParentKey: [(bigintnat, None, _CPPv49bigintnat), (NativeIntegerT, template<typename NativeInt> , _CPPv4I0EN9bigintnat14NativeIntegerTE), (Integer, None, _CPPv4N9bigintnat14NativeIntegerT7IntegerE)]
and a bit of grepping in the symbol tree resulted in the lines
NativeIntegerT: template<typename I> bigintnat::NativeIntegerT (assets/sphinx_rsts/modules/core/math/core_math)
NativeIntegerT: template<typename NativeInt> bigintnat::NativeIntegerT : public lbcrypto::BigIntegerInterface<NativeIntegerT<NativeInt>> (assets/sphinx_rsts/modu
les/core/math/core_math_bigintnat)
One guess is that the finds the wrong NativeIntegerT
, but I'm not sure. Hence the request for a cut down version where the complete symbol tree is more manageable :-)
I've made the subset of the documentation where I only include the two files you mentioned! Notably, it still builds without error-ing out so I'm not sure what's up.
I then added back in all the files that should trigger an error (because of lots of conflicts) here, in a later commit but it's still successfully building.
I'd love your insight into this if you have any
Describe the bug
So I have a build running where everything is going fine. When I add a new file which is rather simple (along the lines of the following)
and I run the build, I run into the assertion error from above.
How to Reproduce
The working build
which should generate everything just fine. Now, check out this other branch,
documentation_broken
. Now, clone the branch where it is breakingand you'll see that it is breaking
Expected behavior
Does not run into the issue
Your project
https://github.com/openfheorg/openfhe-temp
Screenshots
No response
OS
Linux
Python version
3.9
Sphinx version
4.2
Sphinx extensions
autodoc, doctest, mathjax, viewcode, imgmath, duration, todo
Extra tools
breathe
Additional context
You can see the diff between
documentation
anddocumentation_broken
here. Any insight into the issue would be greatly appreciated.The error log: