Draft modifiers recursive calling of recompute when selecting more than 27 document objects

A forum dedicated to the Draft, Arch and BIM workbenches development.
carlopav
Posts: 804
Joined: Mon Dec 31, 2018 1:49 pm

Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby carlopav » Sun Feb 09, 2020 5:00 pm

In the attached file, but in general in every document that have many objects.
If I run Draft move or rotate on more than 27 object this error is triggered:

Code: Select all

11594.6 <App> Document.cpp(3106): Recursive calling of recompute for document Unnamed
And objects are moved/rotated twice the given quantity.

If instead i toggle skip recompute from the document context menu in the treeview (right click on the document name in the treeview and skip recompute) everything seems to work fine.

What I imagined is that moving lots of objects cause many recomputes and this is not good, so perhaps we should disable recomputing during commands execution. But how? In the Todo function?

EDIT: the bug is not present in 0.18.4, while confirmed in :

Code: Select all

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19510 (Git)
Build type: Release
Branch: master
Hash: c3eb6d9001c4d60ff7f7cae89f50bd3c965a9940
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Attachments
Bug Draft move recursive calling of recompute.FCStd
(85.65 KiB) Downloaded 5 times
User avatar
bitacovir
Posts: 886
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby bitacovir » Sun Feb 09, 2020 11:05 pm

carlopav wrote:
Sun Feb 09, 2020 5:00 pm
In the attached file, but in general in every document that have many objects.
If I run Draft move or rotate on more than 27 object this error is triggered:

Code: Select all

11594.6 <App> Document.cpp(3106): Recursive calling of recompute for document Unnamed
And objects are moved/rotated twice the given quantity.

If instead i toggle skip recompute from the document context menu in the treeview (right click on the document name in the treeview and skip recompute) everything seems to work fine.

What I imagined is that moving lots of objects cause many recomputes and this is not good, so perhaps we should disable recomputing during commands execution. But how? In the Todo function?

EDIT: the bug is not present in 0.18.4, while confirmed in :

Code: Select all

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19510 (Git)
Build type: Release
Branch: master
Hash: c3eb6d9001c4d60ff7f7cae89f50bd3c965a9940
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Similar reports in this thread https://forum.freecadweb.org/viewtopic. ... ve+calling
::bitacovir::
===================================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

My personal web site
My GitHub repository
My old Blog
Mini Airflow Tunnel Project
carlopav
Posts: 804
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby carlopav » Tue Feb 11, 2020 5:12 am

Yes that's similar and quite annoying.
I don't know if it's something I introduced or something that changed in freecad and we should consider in Draft... I'll make some more tests thesedays...
Anybody that I could eventually ping for help?
vocx
Posts: 3341
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby vocx » Tue Feb 11, 2020 6:21 am

This is most probably a realthunder bug.

He already submitted various pull requests with tons of small fixes, so maybe one of those commits solves this. The problem is those pull requests have been sitting in the queue for several weeks now.
Last edited by vocx on Wed Feb 12, 2020 6:32 pm, edited 1 time in total.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.
User avatar
yorik
Site Admin
Posts: 11701
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby yorik » Wed Feb 12, 2020 12:36 pm

We are busy processing realthunder's PRs. But some are quite complex so it takes time. (It always helps if someone is willing to test and give feedback on the PRs, just to say that it works)
User avatar
bitacovir
Posts: 886
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby bitacovir » Thu Feb 13, 2020 7:51 pm

yorik wrote:
Wed Feb 12, 2020 12:36 pm
(It always helps if someone is willing to test and give feedback on the PRs, just to say that it works)
No idea how to do that. I just wait for the next development version release.
::bitacovir::
===================================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

My personal web site
My GitHub repository
My old Blog
Mini Airflow Tunnel Project
vocx
Posts: 3341
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby vocx » Fri Feb 14, 2020 1:07 am

bitacovir wrote:
Thu Feb 13, 2020 7:51 pm
No idea how to do that. I just wait for the next development version release.
First set up your own fork, and your own remote (origin and upstream) repositories, as indicated in Source code management.

Then you can test somebody else's branch. We assume we are in the "source" directory where we initially downloaded (cloned) our repository.

0. Optionally, we can use the "gitk" program to visualize the branches and commits. This gives a better idea of all commits made in the checked branches. We use the ampersand symbol to run "gitk" in the background so we don't block the terminal and can run other commands.

Code: Select all

gitk --branches &
In "gitk" press Shift+F5 to reload the database of branches.

1. Add realthunder's repository as a remote

Code: Select all

git remote add realthunder https://github.com/realthunder/FreeCAD
2. Fetch the information in his repository to know the available branches.

Code: Select all

git fetch realthunder
3. Now, make sure you are in the master branch, and then create and checkout the specific branch that is indicated in the pull request in your local system. Example, pull request #3045.

Code: Select all

git checkout master
git checkout -b DressUpTransform realthunder/DressUpTransform
4. Optional: that branch may not be based on the latest code in the upstream repository, so we could rebase it ourself to make sure it is using the latest code.

Code: Select all

git pull --rebase upstream master
If there are any conflicts, they will appear at this step; these conflicts in the code in realthunder's branch will have to be solved before continuing (this requires a bit of experience and actually understanding the code).

5. If there are no conflicts and everything seems to be okay, we can proceed with compiling.

6. In Linux, we move to the build directory and compile the source.

Code: Select all

cd ../freecad-build
cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 ../freecad-source
make -j3
7. If the branch introduced only Python code, the compilation will be very fast, and it should finish after three minutes or less. If the branch modified C++ code, it may take a long time depending on the type of code that was introduced. If core files were created or modified, it may take up to two hours to recompile and link everything.

8. After the compilation is done, the new generated executables are inside the bin/ directory. Launch the program and test that everything works fine; also perform the unit tests.

Code: Select all

bin/FreeCAD
bin/FreeCAD -t 0
9. Report your findings. "This branch is great and fixes the problem." "This branch fixes this but breaks that which was working before."
Last edited by vocx on Sat Feb 15, 2020 2:36 am, edited 1 time in total.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.
User avatar
bitacovir
Posts: 886
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby bitacovir » Fri Feb 14, 2020 11:30 am

Thank you Vocx for this complete instruction. I had a remote repository, but later my laptop went a mess and I had to run a hard reset and delete all. I will see if I can reinstall a repository again. But if the process of checking pull requests requires reading or understanding the code, I could not help.
::bitacovir::
===================================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

My personal web site
My GitHub repository
My old Blog
Mini Airflow Tunnel Project
vocx
Posts: 3341
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft modifiers recursive calling of recompute when selecting more than 27 document objects

Postby vocx » Sat Feb 15, 2020 2:29 am

bitacovir wrote:
Fri Feb 14, 2020 11:30 am
...But if the process of checking pull requests requires reading or understanding the code, I could not help.
If you just checkout a branch it should not cause a conflict. You should be able to compile it as is, as long as you have all dependencies and follow the instructions in Compiling. Well, also assuming that the author of the branch wrote the code correctly.

It is only when I do the optional step of "rebasing" that a conflict may appear. This conflict you have to solve yourself, or rather, it has to be solved by the author of the branch when he or she makes the pull request against the master branch.

Once in a while you have to update your own master branch, otherwise your copy of the source code gets too old.

Code: Select all

git checkout master
git pull upstream master
So, in general, testing a branch shouldn't be too big of a problem. Just follow my instructions, compile, and use the program.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.