New Issue: Should we have a module/user code equivalent of '--verify'?

18417, "e-kayrakli", "Should we have a module/user code equivalent of '--verify'?", "2021-09-13T23:03:54Z"

The Chapel compiler has a --verify flag that's mainly used by developers/nightly testing to sanity check the AST and the state of the compiler. Should we have a module level flag that gets set with --verify or have something separate but equivalent?

This came about when we noticed a performance issue with a verification for a string optimization that happened with --boundsChecking. This verification was too slow to the extent that it was causing testing to timeout. More references for this context:

Are there other potential use cases for this verification? Things that I can think of besides the string metadata caching are:

  • UTF-8 validation during string deinit and/or string methods that assumes UTF-8 data
  • Constant domain optimization: we could halt if operator = is called on a domain where definedConst is set.
  • We can make localAccess do a check on the index and halt if it isn't local. (Currently, I think we get an OOB error that might look a little strange to the user)