Skip to content

Cycles Renderer : Update pause() to wait until the render has paused - #7094

Open
murraystevenson wants to merge 1 commit into
GafferHQ:mainfrom
murraystevenson:cyclesPauseWait
Open

Cycles Renderer : Update pause() to wait until the render has paused#7094
murraystevenson wants to merge 1 commit into
GafferHQ:mainfrom
murraystevenson:cyclesPauseWait

Conversation

@murraystevenson

Copy link
Copy Markdown
Contributor

We've run into intermittent test failures on CI where renders in tests such as InteractiveRenderTest.testLights fail to produce the expected image after a pause, edit, resume. One recent clue from the new assertEventually reporting shows those failing renders having early iterations representing the previous scene state.

I'm able to reproduce the failures locally with a debug build, stress -c 128, and gaffer test GafferCyclesTest.InteractiveCyclesRenderTest.testLightsWithSVM -repeat 100 . A bit of instrumentation showed that in those failing cases, the session reset in Renderer::render() never occurs as m_scene->need_reset() returns false. It seems like we're running into a timing issue where we ask Cycles to pause in Renderer::pause() but then make scene edits before the render has actually paused. Meanwhile Cycles clears the update flags, pauses, and then our later m_scene->need_reset() check returns false when resuming the render.

As an experiment, I've made Renderer::pause() poll the session status waiting for it to report that the render is paused before returning. I'm not super happy with this, but I've yet to come up with a better alternative...

We've run into intermittent test failures on CI where renders in tests such as InteractiveRenderTest.testLights fail to produce the expected image after a pause, edit, resume. One recent clue from the new assertEventually reporting shows those failing renders having early iterations representing the previous scene state.

I'm able to reproduce the failures locally, and a bit of instrumentation showed that in those failing cases, the session reset in `Renderer::render()` never occurs as `m_scene->need_reset()` returns false. It seems like we're running into a timing issue where we ask Cycles to pause in `Renderer::pause()` but then make scene edits before the render has actually paused. Meanwhile Cycles clears the update flags, pauses, and then our later `m_scene->need_reset()` check returns false when resuming the render.

As an experiment, I've made `Renderer::pause()` poll the session status waiting for it to report that the render is paused before returning. I'm not super happy with this, but I've yet to come up with a better alternative...
@murraystevenson

Copy link
Copy Markdown
Contributor Author

8 CI runs without a Cycles failure, might be on the right track...

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

Labels

None yet

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

1 participant