{"title":"CoolerSpace:一种物理上正确、计算上高效的色彩编程语言","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":"{\"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}","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}
CoolerSpace: A Language for Physically Correct and Computationally Efficient Color Programming
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.