paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CoolerSpace: A Language for Physically Correct and Computationally Efficient Color Programming

CoolerSpace:一种用于物理正确且计算高效的颜色编程语言
OOPSLA 8(OOPSLA2)2024匹配度 3/10 · 该论文属于程序语言与领域特定语言方向,其量纲类型系统、等式饱和优化以及编译到 ONNX 的技术手段与用户关注的静态分析/验证方法有间接的方法论交集,但应用领域是颜色物理与渲染,既不涉及 LLM/Agentic 程序,也不涉及浮点程序分析或贝叶斯程序分析,与画像的核心问题距离较远。引用 1 inbox
Ethan Chen, Jiwon Chang, Yuhao Zhu
dblp: 2026-09-10crossref: 2026-09-10arxiv: 2026-09-10

AI 速览

一句话:CoolerSpace 通过赋予物理量纲的类型系统与等式饱和优化,让颜色编程既物理正确又计算高效。

现有颜色编程库仅对矩阵运算做薄封装,程序员容易被数学上合法但物理上无意义的计算引入缺陷,正确实现既难写又难优化。CoolerSpace 提高颜色编程的抽象层次,让程序员专注于描述颜色物理的逻辑,而把正确性与效率交给语言处理。其类型系统为用户定义对象赋予物理意义和量纲,类型规则只允许符合颜色物理与感知的合法计算;在类型检查的同时,CoolerSpace 利用等式饱和(equality saturation)生成性能优化后的程序。它实现为 Python 库并编译到张量计算常用中间表示 ONNX。评估显示,CoolerSpace 不仅能防止颜色编程中的常见错误,而且没有运行时开销:未优化的程序已比现有基于 Python 的颜色编程系统快至多 5.7 倍,其优化还能再提供至多 1.4 倍的加速。

问题
现有颜色编程库只是矩阵运算的薄抽象,数学上可执行但物理上无意义的矩阵计算容易导致程序缺陷,且正确实现难以编写与优化。
方法
CoolerSpace 用带物理量纲的类型系统约束用户定义对象与计算,只允许符合颜色物理与感知的规则,并借助等式饱和自动生成优化程序,最终编译到 ONNX。
评估
以 Python 库形式实现并编译到 ONNX,通过防止常见颜色编程错误以及性能对比进行评估:未优化版比现有 Python 系统快至多 5.7 倍,优化再带来至多 1.4 倍加速,且无运行时开销。
原文摘要(Abstract)

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 C ooler S pace to facilitate physically correct and computationally efficient color programming. C ooler S pace 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 C ooler S pace . The type system in C ooler S pace 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, C ooler S pace also generates performance-optimized programs using equality saturation. C ooler S pace is implemented as a Python library and compiles to ONNX, a common intermediate representation for tensor computations. C ooler S pace not only prevents common errors in color programming, but also does so without run-time overhead: even unoptimized C ooler S pace 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.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@article{ChenC024,
  title = {CoolerSpace: A Language for Physically Correct and Computationally Efficient Color Programming},
  author = {Ethan Chen and Jiwon Chang and Yuhao Zhu},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689741}
}