Rule 8.6
Chapter 8, Functions and entry points Test
An entry point must not be called from another function, and neither may a kernel function (Rule 8.22).
The rule text and the parts under it are the compiler's own English, as the design document writes them.
Rationale
WGSL forbids it, and an entry’s parameters are stage inputs no caller can supply. A kernel function’s arrays are the call’s storage, which no shader function can hand over, and its loops are dispatches the host makes.
Derives from
Restrictions on Functions (“an entry point must never be the target of a function call”).
How it is verified
Checked by a test. A test, a gate script or a CI workflow names this rule, and the traceability check fails when a file listed below stops naming it.
Where the rule says the compiler enforces it:
TS8099 ("fs" is a fragment entry point and cannot be called; the pipeline invokes it. Move the body into a plain function and call that from both.), pinned by src/compiler/ts/operators-statements.test.ts (refuses calling an entry point) (#160); for a kernel function TS8099 ("total" is a kernel function, which host code calls and whose arrays are the call's storage, so no function can call it. …), pinned by src/compiler/ts/kernel-loops.test.ts in the compiler and the language service.
The files that verify it at commit 26de7be8, each at the first line that names the rule:
Explained in
The sections of the surface document that explain this rule, at commit 26de7be8:
Error codes that enforce it
The diagnostic codes the rule names under Enforced by, or whose registry text names the rule:
-
TS8099UNSUPPORTED UNSUPPORTED(TS8099) is the one deliberate exception to "sequential": it is the catch-all for a diagnostic whose site does not yet deserve its own code, so it stays parked past the sequential range instead of at its head.
See also
Source
The rule at commit 26de7be8:
docs/language-design.md:657(the design document)reqs/rules/RULE-0806.md(its traceability item)