What is this?
This pull request adds accurate stack traces to the runtime error messages of SaC even when large parts of the code have disappeared through optimisation. Instead of unwinding the memory stack that no longer relates to the source code as written by the programmer, this approach works by using a virtual shadow stack. The shadow stack is maintained at runtime by push and pop functions that the compiler inserts around function calls. Then when a runtime error is detected we can unwind the current virtual stack at the time of the error instead of the memory stack. Using SaC uniqueness types we can maintain the correct order of the pushes and pops to create accurate stack traces while still being able to aggressively optimise the code. The design of the stack trace was created by looking at stack traces of 30 other programming languages. Details about that are found here.
todo items
-
Fix the pipeline errors -
Fix the failing tests -
Make dish traversal insert flattened code -
Fix pragma safe -
Fix recursion over 1000 segfault -
Fix the tensor comprehension error -
Uniqueness types violation? -
Compiler flags usage text -
Compiler flags cli parser -
Compiler flags globals -
Do not copy expressions but copy the flat variable -
Compiler flags make them actually work -
Insert calls to configuration functions -
Make the disable flags work -
Track sel flag -
Live trace flag
-
-
Fix order of shape and dim -
Skip entire phase if -st-disableis set -
Stack trace help section for compiler flags -
Disable dimshape tracking configuration function? -
Missing configuration functions -
Check if -#d IVS breaks anything -
Check if production build works? -
Free unused source call strings -
Fix with loop body assignments -
Fix missing AP_PUSH links sometimes -
Deal with push to main that should not have AP_PUSH
-
-
Fix correct dim shape -
StringStack in Stackstruct -
Fix pretty string remvove all strings being overkill -
Fix representation of empty stack -
Fix renamed pragma safe functions appearing in stack -
Add color to Stack trace -
Fix arrow winding being wrong due to invisible color characters