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

Ethan Chen, Jiwon Chang, Yuhao Zhu
{"title":"CoolerSpace: A Language for Physically Correct and Computationally Efficient Color Programming","authors":"Ethan Chen, Jiwon Chang, Yuhao Zhu","doi":"arxiv-2409.02771","DOIUrl":null,"url":null,"abstract":"Color programmers manipulate lights, materials, and the resulting colors from\nlight-material interactions. Existing libraries for color programming provide\nonly a thin layer of abstraction around matrix operations. Color programs are,\nthus, vulnerable to bugs arising from mathematically permissible but physically\nmeaningless matrix computations. Correct implementations are difficult to write\nand optimize. We introduce CoolerSpace to facilitate physically correct and\ncomputationally efficient color programming. CoolerSpace raises the level of\nabstraction of color programming by allowing programmers to focus on describing\nthe logic of color physics. Correctness and efficiency are handled by\nCoolerSpace. The type system in CoolerSpace assigns physical meaning and\ndimensions to user-defined objects. The typing rules permit only legal\ncomputations informed by color physics and perception. Along with type\nchecking, CoolerSpace also generates performance-optimized programs using\nequality saturation. CoolerSpace is implemented as a Python library and\ncompiles to ONNX, a common intermediate representation for tensor computations.\nCoolerSpace not only prevents common errors in color programming, but also does\nso without run-time overhead: even unoptimized CoolerSpace programs out-perform\nexisting Python-based color programming systems by up to 5.7 times; our\noptimizations provide up to an additional 1.4 times speed-up.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"4 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.02771","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

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 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.
CoolerSpace:一种物理上正确、计算上高效的色彩编程语言
色彩编程人员可以操作灯光、材料以及灯光与材料相互作用产生的色彩。现有的色彩编程库仅为矩阵运算提供了一层薄薄的抽象层。因此,色彩程序很容易受到数学上允许但物理上无意义的矩阵计算所产生的错误的影响。正确的实现很难编写和优化。我们引入了 CoolerSpace,以促进物理上正确、计算上高效的色彩编程。CoolerSpace 允许程序员专注于描述色彩物理逻辑,从而提高了色彩编程的抽象程度。正确性和效率由 CoolerSpace 处理。CoolerSpace 的类型系统为用户定义的对象赋予物理意义和尺寸。类型规则只允许根据色彩物理和感知进行合法计算。除了类型检查,CoolerSpace 还能使用质量饱和度生成性能优化的程序。CoolerSpace 不仅能防止色彩编程中的常见错误,还能在没有运行时开销的情况下做到这一点:即使是未经优化的 CoolerSpace 程序,其性能也比现有的基于 Python 的色彩编程系统高出 5.7 倍;经过优化后,其速度最多可提高 1.4 倍。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信