---
title: "ORACLE_GPU_STUB_NAMES: constant in CPU oracle, TypeShade API"
description: "ORACLE_GPU_STUB_NAMES, a constant in CPU oracle. The names of every GPU-only intrinsic the CPU backends cannot genuinely evaluate, as a read-only set…"
url: https://typeshade.dev/api/oraclegpustubnames/
language: en
---

# `ORACLE_GPU_STUB_NAMES`

Constant in CPU oracle

The names of every GPU-only intrinsic the CPU backends cannot genuinely evaluate, as a read-only set: `textureSample`, `textureSampleLevel`, `textureSampleBias`, `textureSampleGrad`, `textureLoad`, their 2d-array forms, the depth comparisons, `textureDimensions`, `textureNumLayers`, and the derivatives fwidth, dpdx and dpdy.

`import { ORACLE_GPU_STUB_NAMES } from 'typeshade'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
const ORACLE_GPU_STUB_NAMES: ReadonlySet<string>
```

## Description

A texture read needs the GPU’s sampler and texture memory, and a derivative needs neighbouring fragments; a CPU run of a single invocation has neither. Calling one of these from a module compiled with [`compileModule`](https://typeshade.dev/api/compilemodule/) or [`compileModuleJs`](https://typeshade.dev/api/compilemodulejs/) throws, unless the module was compiled with `{ gpuStubs: true }`; then it returns a placeholder: `[0, 0, 0, 1]` for a texture read, `[1, 1]` for `textureDimensions`, `1` for `textureNumLayers` and `0` for a derivative. Meant for tests: the union of this set and [`ORACLE_BUILTIN_NAMES`](https://typeshade.dev/api/oraclebuiltinnames/) should cover every intrinsic in [`INTRINSICS`](https://typeshade.dev/api/intrinsics/) and [`PORTABLE_INTRINSICS`](https://typeshade.dev/api/portableintrinsics/), so a test can assert that each intrinsic a shader can emit has either a CPU implementation or a documented placeholder.

## In the guide

- [The CPU oracle](https://typeshade.dev/guide/internals/the-cpu-oracle/)

## See also

- [`compileModule`](https://typeshade.dev/api/compilemodule/)
- [`compileModuleJs`](https://typeshade.dev/api/compilemodulejs/)
- [`ORACLE_BUILTIN_NAMES`](https://typeshade.dev/api/oraclebuiltinnames/)
- [`INTRINSICS`](https://typeshade.dev/api/intrinsics/)
- [`PORTABLE_INTRINSICS`](https://typeshade.dev/api/portableintrinsics/)

## Source

[`src/core/cpu-runtime/oracle-names.ts`, line 34](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/cpu-runtime/oracle-names.ts#L34), at commit af54ddad5
