Move some SM hooks from render_context to SM actions#217
Merged
Conversation
VitjanZ
reviewed
Jun 16, 2026
| if ctx.conformance_tests_render_attempts >= MAX_CONFORMANCE_TEST_RERENDER_ATTEMPTS: | ||
| error_msg = f"The renderer was unable to produce an implementation that passes conformance tests for functionality '{render_context.frid_context.frid}' after many attempts. Please review and rewrite the specification. (Render ID: {render_context.run_state.render_id})" | ||
| render_context.last_error_message = error_msg | ||
| return self.LIMIT_EXCEEDED_OUTCOME, None |
Collaborator
There was a problem hiding this comment.
Wherever we return SOME_STATE, None and this triggers ExitWithError, then None may be printed for no reason. The first line of ExitWithError is console.error(previous_action_payload) which in this case is console.error(None) which prints "None".
VitjanZ
approved these changes
Jun 16, 2026
VitjanZ
left a comment
Collaborator
There was a problem hiding this comment.
LGTM and passes benchmarks. I left a minor comment regarding error logging.
b263189 to
8a84195
Compare
367c772 to
ef798af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This moves some code from
on_enter/on_exithooks to the relevant actions.The added value of these changes is:
RenderContextmachine.dispatch(...)calls in order to get the full picture of the SM just from its configThis PR doesn't get rid of all of the dispatches in the
RenderContext, the main chunk is in thestart_conformance_tests_for_fridfunction and its delegated functions but I will try to do that at a later time in a separate PR.