prism

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 0 Imported by: 0

README

prism

The shared GPU-codegen substrate for M31 Labs' GPU-DSL compilers. Prism provides a canonical type vocabulary, a Dialect layer that spells types and builtins correctly for each shader backend (WGSL, GLSL, GLSL-ES, Metal), backend source descriptors for generated kernel variants, and a validation harness that runs tools such as naga and glslangValidator when available. It is consumed by Elio, Selena, Eos, and gosx, and it never depends on any of them.

Documentation

Overview

Package prism is the shared GPU-codegen toolkit for M31 Labs' GPU-DSL compilers (Elio, Selena, Eos) and gosx.

Prism provides three things:

  • A canonical GPU type vocabulary — scalar, vector, matrix, sampler, and texture types that every compiler can reference without re-declaring them. Consumers opt in; nothing is forced on the host AST.

  • A Dialect layer that spells types, builtins, and swizzles correctly for each shader backend: WGSL, GLSL (desktop/ES), and Metal (MSL). Compilers delegate spelling decisions to Prism rather than hard-coding per-backend string tables.

  • A validation harness that invokes offline validators — naga (for WGSL) and glslangValidator (for GLSL/GLES) — and surfaces structured diagnostics back to the caller.

  • Backend source descriptors and entry-shape checks for generated GPU kernel variants. This lets compilers such as Eos validate emitted CUDA, Metal, Vulkan, DirectML, and WebGPU source without Prism knowing their artifact IR.

Prism depends only on gotreesitter. It is consumed by Elio, Selena, Eos, and gosx, and it deliberately never imports any of those packages.

Directories

Path Synopsis
Package dialect provides the per-backend spelling layer for GPU shader codegen.
Package dialect provides the per-backend spelling layer for GPU shader codegen.
Package gputype is the canonical GPU type vocabulary shared by all M31 GPU-DSL compilers (Elio, Selena, Eos).
Package gputype is the canonical GPU type vocabulary shared by all M31 GPU-DSL compilers (Elio, Selena, Eos).
Package validate provides a thin harness for running offline shader-compiler tools (naga, glslangValidator, …) as subprocesses.
Package validate provides a thin harness for running offline shader-compiler tools (naga, glslangValidator, …) as subprocesses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL