Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary interface: Add fsm_determinise_with_config. #498

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

silentbicycle
Copy link
Collaborator

This works, but we may want to make some naming changes. I'd prefer to use a struct rather than a single parameter here -- as long as other fields have a sensible default when zeroed, the callers will only need to make the interface change once.

I think it's worth having some kind of limit here, since determinisation is most likely to have wide variation in resource usage.

  • The names (particularly the enum) are cumbersome here, but I would really rather have a distinct return value for exceeding the passed-in limit, rather than using something that nominally fits something from errno, like E2BIG.
  • It seems a bit silly to pass in a struct with just the one field, but as long as they have a reasonable default when zeroed, we could add other fields to the struct later without needing interface changes. We could just give fsm_determinise an extra step_limit argument, but if we're potentially going to add any other options at any point (logging flags?) then a struct would be less hassle.
  • I'm adding a separate function fsm_determinise_with_config to avoid an interface change with fsm_determinise directly (which is called all over the place). We could either change fsm_determinise (once) and take a struct, come up with a naming convention for <function>_with_an_extra_configuration_struct (fsm_determinise_with_config? fsm_determinise_cfg?) and keep both (and possibly add similar variants for other functions later), or just add a state_limit param, but that would be my last choice.

This works, but we may want to make some naming changes. I'd prefer to
use a struct rather than a single parameter here -- as long as other
fields have a sensible default when zeroed, the callers will only need
to make the interface change once.
@katef katef merged commit bfeb7ce into main Oct 10, 2024
346 checks passed
@katef katef deleted the sv/determinise-with-config branch October 10, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants