Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New fract4dc interface #85

Merged
merged 32 commits into from
May 7, 2020

Conversation

mindhells
Copy link
Member

A new interface for the fract4dc has been created by introducing a new python extension type called controller.
The goal of this new interface is to avoid objects swinging in and out from fract4dc to python and the other way around all the time (which forces the need of having ugly interfaces and complicates the state handling).
No python scripts have been modified yet but only a new test has been created to demonstrate how to use it. Also the methods that would be deprecated by moving to this new interface have been marked in fract4d_module.cpp
In addition, a new folder examples has been created containing:

  • python examples: demonstrating the minimum steps necessary to generate a mandelbrot image (using the new interface)
  • C++ standalone examples: to explain how the engine (the pure C++ part of the fract4dc extension) works to do the same as the example above

The idea behind all this is to transfer all the knowledge gotten from analyzing and reorganizing the code to future developers.

examples/cpp/multithread_mandelbrot.cpp Outdated Show resolved Hide resolved
fract4d/c/fract4dmodule.cpp Outdated Show resolved Hide resolved
examples/python/simple_mandelbrot.py Show resolved Hide resolved
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks promising, but as example C++ code there are a few things that stand out to me.

examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
examples/cpp/raw_mandelbrot.cpp Outdated Show resolved Hide resolved
@dragonmux
Copy link
Member

My comments on malloc() usage still apply thanks to object lifetimes in the C++ VM, but your review of C compat head usage looks good otherwise

@mindhells
Copy link
Member Author

I've applied most of the suggestions from @DX-MON to the examples (need to undo the const_cast though).
I think it makes sense to apply them to the extension codebase (sources under fract4d/c ... I like to call it "gnofract engine") itself. That would take some time so I would leave that out of the scope of this PR.

@dragonmux
Copy link
Member

dragonmux commented Apr 24, 2020

Looks much better, thank you. the rbga_t comment remains, but otherwise approved for merge.

Edit: re-checked, you did actually fix that.

@dragonmux dragonmux self-requested a review April 24, 2020 16:42
@mindhells
Copy link
Member Author

Hey @edyoung @DX-MON I don't have write access so, if you think the PR is ok to merge, please proceed

@dragonmux dragonmux merged commit c5209eb into fract4d:master May 7, 2020
@mindhells mindhells deleted the new-fract4dc-interface branch May 7, 2020 09:00
@edyoung
Copy link
Member

edyoung commented May 7, 2020

As far as I can tell you should have the same access as a member of the 'fract4d' org. I don't mind granting write access - thought you already had it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants