Skip to main content

Module program_caps

Module program_caps 

Source
Expand description

Program-level capability bits surfaced from the runtime. Program → required-capability analysis.

Scan a Program and report the hardware capabilities its lowering will need. Callers (backends, conformance harnesses, certificate emitters) compare the required set against what a backend advertises and surface MissingCapability before handing the kernel to the device, avoiding panics inside create_shader_module / createComputePipeline.

The scanner is strictly syntactic: it walks every Expr and Node in the program and checks the IR surface. It intentionally does not know anything about backend-specific lowering rules — that would make it a circular dependency of the very thing it is supposed to gate.

Structs§

MissingCapability
The reason a backend cannot execute a program.
RequiredCapabilities
Capabilities a Program needs from whichever backend executes it.

Functions§

check_backend_capabilities
Return Ok(()) when a backend with the given advertised capabilities can run a program whose required set is required, otherwise return the missing-capability explanation.
scan
Walk the program and collect the union of capabilities it requires.