samdauwe / BabylonCpp

A port of Babylon.js to C++
Apache License 2.0
284 stars 37 forks source link

Sync load option #76

Closed pthom closed 4 years ago

pthom commented 4 years ago

Debugging the file loading with all the callbacks and the asynchronous execution of code is not that easy. I will have to think more how to make it easier.

I made something that might help you! With the command line, the argument '-A' will switch to the async mode, and if it is not present, you switch back to the sync mode. So, I would advise to first solve the issues in sync mode first, and then we will study the async issues.

Here are the results I have now:

Async mode:

How to run it:

# -a stands for "run all samples and test them / take a screenshot
# -A stands for "use async mode"
BabylonStudio -a -A 

And I get different results with different executions: this show we may have some races conditions:

{"nbEmptyRendering":11,"nbProcessFailures":120,"nbProcessHung":3,"nbSuccess":139}
{"nbEmptyRendering":10,"nbProcessFailures":133,"nbProcessHung":6,"nbSuccess":127}

Sync mode:

How to run it:

BabylonStudio -a

And I get consistent results with different executions:

{"nbEmptyRendering":61,"nbProcessFailures":9,"nbProcessHung":3,"nbSuccess":200}

Could you please run BabylonStudio -a on your side, and may be first focus on the failures in synchronous mode (9 seg fault, and 61 empty rendering)?

After you run BabylonStudio -a, you can find the failures by looking at file names inside the Screenshot/folder.

Could you also post the results you obtain on your side? I hope they are consistent but they might differ!

Thanks

samdauwe commented 4 years ago

Hello Pascal,

That is a really useful option you added to enable and disable the async mode. This will help a lot in debugging the failing examples.

I don't have time to try this out today but I will send you the statistics numbers tomorrow.

Cheers, Sam

samdauwe commented 4 years ago

Hello Pascal,

these are the statistics when running on my side on Linux: stats: {"nbEmptyRendering":61,"nbProcessFailures":11,"nbProcessHung":6,"nbSuccess":198}

The numbers are comparable with what you reported on your side.

From what I see on my side:

I am going to focus on fixing these issues in the next weeks! With the option to enable/disable the async mode the debugging became easier.

Cheers, Sam

samdauwe commented 4 years ago

Hello Pascal,

here are the updated numbers after a weekend of debugging: {"nbEmptyRendering":5,"nbProcessFailures":16,"nbProcessHung":11,"nbSuccess":249}

The main issues were:

The sprite examples do not render yet and models imported from .babylon appear in a black color for some examples. I will further debug those issues this week.

Cheers, Sam