Repository navigation
Remove duplicate environment creation - #651
Conversation
|
👍 How can we catch regressions? |
|
I'm not sure; I'm hoping our current tests and fidelity tests will tell us. Can you think of new cases we should add? |
|
Our current test suite is not comprehensive, and we rely on folks layering on regression tests and feature tests as changes are made. Off the top of my head, I see tests here for checking the background color when nothing is configured, but not the environment lighting: Since the comment that you removed claims that Separately, we are fixing a problem where the environment is updated too many times. We can probably author a test that measures the number of times the environment is updated for a given configuration and assert that it is the expected number. |
|
Good idea, I've added the unconfigured tests. As for checking how many times the environment is generated, I would spend significantly more time making that test than on the whole PR and I still wouldn't be convinced it would reliably catch those perf bugs. I think this is a relatively unlikely regression, so I would skip this particular test, but you're welcome to overrule me if this is more important than our other work. |
This is the reason why easy / small PRs are dangerous :) |
|
I think for the near term let's just add a test that waits for a reasonable window of time (call it one second) after the model loads and asserts that the environment did not re-generate in that window of time. In some failure scenarios, this test will fail flakily. But, I think flakey failure in this case is better than no test at all. |
* removed firstUpdate * added tests * added duplicate environment test
Fixes #649
Our environments were getting loaded twice, once in firstUpdate, and again in update. I think generation only happened once because of three's caching, but reading in the HDR file and running PMREM were both definitely happening twice, and are both quite expensive. I can't see anything going wrong from removing the firstUpdate function, but I'm also not sure why it was there, so please let me know if I've missed some side effect.