CoolerSpace:一种用于物理正确且计算高效的颜色编程语言
CoolerSpace: A Language for Physically Correct and Computationally Efficient Color Programming
AI总结:
CoolerSpace 通过类型系统约束物理合法的颜色计算,并利用等式饱和优化生成高效程序,在防止颜色编程错误的同时实现最高 5.7 倍加速。
摘要:
颜色程序员操纵光源、材质以及由光与材质交互产生的颜色。现有的颜色编程库仅在矩阵运算之上提供了一层薄薄的抽象。因此,颜色程序容易受到由数学上允许但物理上无意义的矩阵计算所引发的错误的影响。正确的实现难以编写和优化。我们引入 CoolerSpace,以促进物理正确且计算高效的颜色编程。CoolerSpace 通过允许程序员专注于描述颜色物理的逻辑,提升了颜色编程的抽象层次。正确性和效率由 CoolerSpace 处理。CoolerSpace 中的类型系统为用户定义的对象赋予物理含义和量纲。类型规则仅允许由颜色物理和感知所支持的合法计算。除了类型检查之外,CoolerSpace 还利用等式饱和生成性能优化的程序。CoolerSpace 以 Python 库的形式实现,并编译到 ONNX——一种用于张量计算的通用中间表示。CoolerSpace 不仅防止了颜色编程中的常见错误,而且在不产生运行时开销的情况下做到了这一点:即使未经优化的 CoolerSpace 程序,其性能也比现有的基于 Python 的颜色编程系统高出最多 5.7 倍;我们的优化还额外提供了最多 1.4 倍的加速。
英文摘要:
Color programmers manipulate lights, materials, and the resulting colors from light-material interactions. Existing libraries for color programming provide only a thin layer of abstraction around matrix operations. Color programs are, thus, vulnerable to bugs arising from mathematically permissible but physically meaningless matrix computations. Correct implementations are difficult to write and optimize. We introduce CoolerSpace to facilitate physically correct and computationally efficient color programming. CoolerSpace raises the level of abstraction of color programming by allowing programmers to focus on describing the logic of color physics. Correctness and efficiency are handled by CoolerSpace. The type system in CoolerSpace assigns physical meaning and dimensions to user-defined objects. The typing rules permit only legal computations informed by color physics and perception. Along with type checking, CoolerSpace also generates performance-optimized programs using equality saturation. CoolerSpace is implemented as a Python library and compiles to ONNX, a common intermediate representation for tensor computations. CoolerSpace not only prevents common errors in color programming, but also does so without run-time overhead: even unoptimized CoolerSpace programs out-perform existing Python-based color programming systems by up to 5.7 times; our optimizations provide up to an additional 1.4 times speed-up.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。