Describe the architecture of a shader compiler that ingests GLSL/HLSL and outputs SPIR-V or ISA. Cover lexical analysis, parsing to AST, conversion to SSA-based IR, optimization passes (e.g., constant folding, CSE, dead-code elimination), register allocation, and code generation. How would you design differential and property-based tests for such a compiler?