Skip to content

Regression testing for rendering engine #634

Open

Description

@morevnaproject

We need a test script which identifies regressions in Synfig's render engine.

The script should render a set of sample files using latest version of Synfig and then compare the resulting images against the reference data.

In perspective it would be nice to measure performance and provide statistics, so we can identify performance drops or boosts from version to version.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. morevnaproject commented on Oct 2, 2018

    @morevnaproject
    MemberAuthor

    @reSHARMA I haven't perfectly understood your last comment at #499 (comment) - is your proposal to use https://ci.debian.net/ as a platform for that?

  2. reSHARMA commented on Oct 2, 2018

    @reSHARMA
    Contributor

    @morevnaproject We can use this test script after every build (our travis builds) but since I saw https://packages.debian.org/unstable/main/synfig the package at Debian, which can also use the same script and https://ci.debian.net/ would automatically install the latest debs and run this script.

    Just another utilization of the test script.

  3. morevnaproject commented on Oct 2, 2018

    @morevnaproject
    MemberAuthor

    Ah, got it now! ^__^

    Okay, lets elaborate about the task a bit.

    1. We need a set of sample files for verification.

    I suggest to start with simple tests: single layer tests. We have 50+ different layers in Synfig. Some of them are stand-alone layers - they draw something on the screen (Circle Layer, Outline Layer, Region Layer, etc). There are second type of layers - filters. Those are used in combination with other layers (Blur Layer, Shadow Layer, etc).

    For first type of layers (stand-alone): let's create a simple test file with just one layer inside. Thus, we will have one test file for each corresponding stand-alone layer type.

    For second type of layers (filters) we have to come up with something more complex. We need a test file with at least 2 layers: base layer + filter layer. The question is what is the best candidate for base layer? Or should we have several candidates?

    2. Reference images

    When we will have a set of sample files, we will need to create a rendered versions for each of them. This will be a reference images to compare with. The question: which Synfig version we will use to generate reference renderings?

    My proposal is to use Synfig 1.0.2, since it is the last version that uses old rendering engine. Later versions use new Cobra rendering engine, which is still in development now (and it is a subject of our tests).

    So, the purpose of the script is to build the latest commit from master branch of Synfig and compare with reference images (which represent renderings made by version 1.0.2).

    3. Where to keep all that stuff?

    I propose to create a separate GitHub repository for that. Since it is going to contain a lot of images (reference renderings), and it is possible the set of test images will eventually grow, so I suggest to use it in combination with GitLFS.

    4. Which platform to use for running our tests?

    There are plenty of options here: Travis, Azure Pipelines, etc.
    We need to choose something. We can start with something simple, and if we will need more power, then we can migrate to something else or own hosted solution.

    I think it is enough to run our tests on Linux hosts only, since I do not remember the situations when our rendering engine had OS-dependent behavior.

    Looking forward to hear your thoughts. ^__^

  4. reSHARMA commented on Oct 2, 2018

    @reSHARMA
    Contributor

    Many thanks for documenting the whole process :)

    Instead of incrementally following the steps, shall we first prepare some tests (~10). Set up the build infrastructure and do all the analysis from the results, and then we can fill our testsuite.

    My main motivations for this is:

    • Individual test can act a great first contribution and may attract some college students as well.
    • We can get good idea about the load using the present build infrastructure (as the number of test will increase at a fixed rate)
    1. We need a set of sample files for verification.
      The question is what is the best candidate for base layer? Or should we have several candidates?

    I don't have any idea about this right now, but as we proceed with the single layer test. I'll gain some familiarity and then can say something.

    1. Reference images
      My proposal is to use Synfig 1.0.2

    I agree, and later we may add a script to override the reference using another version.

    1. Where to keep all that stuff?
      I propose to create a separate GitHub repository for that. Since it is going to contain a lot of images (reference renderings), and it is possible the set of test images will eventually grow, so I suggest to use it in combination with GitLFS.

    This sounds great :)

    1. Which platform to use for running our tests?

    I propose to use the current linux travis job for this and as the load would increase (if it does) we can shift.

    What do you think? :)

  5. kaylangan commented on Oct 2, 2018

    @kaylangan

    I'm a Program Manager on Azure Pipelines. Looks like you're leaning Travis, but let me know if you have any questions about Azure Pipelines!

  6. reSHARMA commented on Oct 3, 2018

    @reSHARMA
    Contributor

    @kaylangan Thanks for showing interest :) I propose to start with Travis, as we already have Linux job on it but when these tests would take significant percentage of build time (someday they will) we need to shift and then Azure Pipelines is always an option.

    Though this is just a proposal, let's see what @morevnaproject think about it.

  7. morevnaproject commented on Oct 3, 2018

    @morevnaproject
    MemberAuthor

    @reSHARMA

    Instead of incrementally following the steps, shall we first prepare some tests (~10). Set up the build infrastructure and do all the analysis from the results, and then we can fill our test suite.

    Absolutely agree. ^__^

    I don't have any idea about this right now, but as we proceed with the single layer test. I'll gain some familiarity and then can say something.

    Yes, let's start with simple tests for the first types of layers.

    I have created a repository here - https://github.com/synfig/synfig-tests-regressions

    Added a few sample test files for Circle Layer. Notice, that I have used ".sif" format instead of ".sifz", since it is contains plain XML data and allows to track changes (SIFZ format is a gz-compressed SIF).

    Next step is to produce reference renderings. I suggest to render them at resolution of 1920x1080 - that should be enough. Since we will have a lot of sample files, it might be good idea to add some automatization script for rendering reference images. ^__^

    My proposal is to use Synfig 1.0.2

    I agree, and later we may add a script to override the reference using another version.

    Great. Here is a link to get prebuilt binaries of version 1.0.2 - https://sourceforge.net/projects/synfig/files/releases/1.0.2/

    Yes, I expect that for some reference images we eventually might use other versions of Synfig. There are at least two reasons for that. First, is that some layer types might not exist in 1.0.2. Second reason is that in newer versions of Synfig some layers might render better (at the end 1.0.2 is not bug-free as well). But that will be decided individually for each case. For now let's concentrate on trivial layers. I just want to mention that for every reference image it would be nice to attach information which version was used for its rendering.

    I propose to use the current linux travis job for this and as the load would increase (if it does) we can shift.

    Great, let's go for that.

  8. morevnaproject commented on Oct 3, 2018

    @morevnaproject
    MemberAuthor

    Hello @kaylangan! Thank you for your kind proposal! For now with this task I think it's good idea to go with something we already have. Though, I have a special interest for Azure Pipelines for another task - testing our code for build errors and deploying binary packages. Considering that Azure Pipelines provides possibility to build on all 3 platforms (Linux, Windows and OSX) that might be a great improvement for our project!

  9. reSHARMA commented on Oct 3, 2018

    @reSHARMA
    Contributor

    @morevnaproject

    Yes, let's start with simple tests for the first types of layers.

    I've added some tests and will move ahead. (Will share about this in my college community)
    Can I raise a issue for it with some tags like "help wanted" "good first issue" etc?

    I expect that for some reference images we eventually might use other versions of Synfig.

    Shall we create a config file which would have the mapping of version <--> layer or something similar and the script could read this and act accordingly?

  10. morevnaproject commented on Oct 3, 2018

    @morevnaproject
    MemberAuthor

    I've added some tests and will move ahead. (Will share about this in my college community)
    Can I raise a issue for it with some tags like "help wanted" "good first issue" etc?

    Sure! ^__^

    Shall we create a config file which would have the mapping of version <--> layer or something similar and the script could read this and act accordingly?

    How about this? - https://github.com/synfig/synfig-tests-regressions/tree/master/references/layers/circle
    (a text file for each reference image - with a version number inside)

  11. reSHARMA commented on Oct 3, 2018

    @reSHARMA
    Contributor

    How about this? - https://github.com/synfig/synfig-tests-regressions/tree/master/references/layers/circle
    (a text file for each reference image - with a version number inside)

    Sure, I'll come up with a script with this pattern.

  12. morevnaproject commented on Oct 4, 2018

    @morevnaproject
    MemberAuthor

    After thinking a bit more on that, I come to conclusion that it is not very good to keep .txt file in "references" directory. Might be better to have it in "sources", together with .sif file. So, you can add a new test (sif file) and place .txt file into same location (no need to jump into another dir).
    I have made the change for this - synfig/synfig-tests-regressions@d667666

    Second thought: it might be too boring (and cluttering) to add .txt file for each test. We can have some configuration file in the root dir, which specifies default version. If no .txt file exist, then default version is used. If it exists - then default version gets overridden.

  13. reSHARMA commented on Oct 4, 2018

    @reSHARMA
    Contributor

    We can have some configuration file in the root dir, which specifies default version. If no .txt file exist, then default version is used. If it exists - then default version gets overridden.

    Sure, this is better :) I'll come up with a script soon.

  14. reSHARMA commented on Oct 5, 2018

    @reSHARMA
    Contributor

    @morevnaproject I think we should use appimages for generating references or render output from sammples as different versions of synfig are not co-installable. I could not find appimage for version 1.0.2 or for anything other than latest. Do you ship and archive appimage for every version on sourceforge?

  15. morevnaproject commented on Oct 5, 2018

    @morevnaproject
    MemberAuthor

    @reSHARMA Oh, sorry, I forgot to mention that we do not have AppImage for Synfig version 1.0.2. But we have a binary in tar.bz2 archive, which you can unpack to any path and run from there - https://sourceforge.net/projects/synfig/files/releases/1.0.2/linux/synfigstudio-1.0.2.x86_64.tar.bz2/download
    For all higher versions of Synfig there is an AppImage package. ^__^

  16. 6 remaining items

  17. reSHARMA commented on Oct 27, 2018

    @reSHARMA
    Contributor

    @morevnaproject sorry my bad :) I misinterpreted that, this sounds awesome. I'll be coming up with a pr soon.

  18. morevnaproject commented on Oct 28, 2018

    @morevnaproject
    MemberAuthor

    Great! I think we can consider this task done as soon as synfig/synfig-tests-regressions#9 get merged. ^__^

  19. morevnaproject commented on Nov 2, 2018

    @morevnaproject
    MemberAuthor

    Okay, now we have everything working as expected. There are still two issues remaining (synfig/synfig-tests-regressions#10 (comment) and synfig/synfig-tests-regressions#11), but in general the system is ready for use.

    @reSHARMA would you be able to take care about those remaining two tasks? ^__^

  20. reSHARMA commented on Nov 2, 2018

    @reSHARMA
    Contributor

    @morevnaproject That seems to be an awesome news. I'm making some changes that would probably solve those two issues (synfig/synfig-tests-regressions#10 (comment) and synfig/synfig-tests-regressions#11) at synfig/synfig-tests-regressions#13

  21. morevnaproject commented on Nov 5, 2018

    @morevnaproject
    MemberAuthor

    @reSHARMA The changes are merged and I think we can mark this task as done. Thank you very much for your efforts and congratulations! ^__^

  22. reSHARMA commented on Nov 6, 2018

    @reSHARMA
    Contributor

    Thanks! It's my pleasure to be the part of it. If only filling up the test suite is left then I've some crowd sourcing plans for that. If something else is left, please let me know :)

  23. reSHARMA commented on Nov 6, 2018

    @reSHARMA
    Contributor

    @morevnaproject Many thanks for the opportunity, I enjoyed being the part :)

  24. morevnaproject commented on Nov 7, 2018

    @morevnaproject
    MemberAuthor

    @reSHARMA Yes, it's the filling of the suite left so far. Will appreciate any help here! ^__^

  25. reSHARMA commented on Nov 13, 2018

    @reSHARMA
    Contributor

    @morevnaproject sure it can act as a great first contribution for many, so I'm trying to go in that direction but anyway I'll try to get this done before mid December.

    I'm not sure if it's doable but if travis raise issue after the build if any test fail?

  26. morevnaproject commented on Nov 21, 2018

    @morevnaproject
    MemberAuthor

    About raising an issue on script fail: this sounds cool, but I am afraid that we will end up with a bunch of issues (if new issue will be raised after each commit). I am also not sure if that is possible. ^__^

  27. morevnaproject commented on Dec 13, 2018

    @morevnaproject
    MemberAuthor

    Hey, @reSHARMA! I have noticed the Travis job fails to render sources from the latest commits. I can see following errors in Travis log:

    ...
    Target name = png
    Outfilename = /home/travis/build/synfig/synfig-tests-regressions/sources/../references/layers/gradient-curve/gradient-curve-shape2-width-0.png
    boost::filesystem::canonical: No such file or directory: "/home/travis/build/synfig/synfig-tests-regressions/sources/../references/layers/gradient-curve"
    ...
    

    Can you please take a look? ^__^

  28. morevnaproject commented on Dec 16, 2018

    @morevnaproject
    MemberAuthor

    Wait, I have a better idea - I have added this issue for our NJACK participants - NJACKWinterOfCode/synfig-tests-regressions#18 ^__^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions