MikePopoloski / slang

SystemVerilog compiler and language services
MIT License
546 stars 114 forks source link

Add a stress test for concurrently visiting the AST #952

Open MikePopoloski opened 1 month ago

MikePopoloski commented 1 month ago

AST construction is not thread safe, and the first full visitation / elaboration is not either (since AST nodes are constructed lazily). Once the full AST has been visited and every single node touched, it should be safe to visit the AST again concurrently since it should be effectively immutable thereafter.

Add a test that visits a large AST via multiple threads multiple times over and tries to weed out any cases where we are not actually immutable after construction. ThreadSanitizer may be helpful here.