---
title: "Rule 6.11: Declarations and resources in TypeShade"
description: "Rule 6.11 of the TypeShade language design, in Declarations and resources."
url: https://typeshade.dev/reference/rules/6-11/
language: en
---

# Rule 6.11

Chapter 6, Declarations and resources Test

The compiler adds one binding an author did not write for a `console` call, and only when a compile asks for GPU recording (`compile(src, { console: 'gpu' })`): `_console`, a `read_write` storage buffer of `struct _Console { cursor: atomic<u32>, dropped: atomic<u32>, words: array<u32> }`, at group 0, the first binding past the module’s own group-0 bindings, the slot the `_fp64` guard takes by the same rule (the guard, when there is one, comes one past it). `reflect(m, { console: 'gpu' })` must report it, as it reports `_fp64`, and `CompileResult.console` must say where it is.

The rule text and the parts under it are the compiler's own English, as the design document writes them.

## Rationale

a binding the author did not declare is one the host must still bind, so it has to be where the host already looks for the compiler’s own binding, and absent from every compile that did not ask for it, so that no host meets a layout it did not expect.

## Derives from

`changes/0014-gpu-console.md` (“the slot”); the `_fp64` guard’s placement in `src/core/passes/fp64-lower.ts`; surface §66.

## 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:

`src/core/passes/console-buffer.test.ts` (`binds the buffer at group 0 past the module bindings, and reflect reports it when asked`; `adds nothing and moves no byte under the default option`).

The files that verify it at commit af54ddad5, each at the first line that names the rule:

- [`src/core/passes/console-buffer.test.ts:9`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/console-buffer.test.ts#L9)
- [`src/core/passes/console-buffer.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/console-buffer.ts#L1)

## Explained in

The sections of the surface document that explain this rule, at commit af54ddad5:

- [§66 `console`: what reaches the host](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/use-typeshade-surface.md#66-console-what-reaches-the-host)

## See also

- [Rule 6.10](https://typeshade.dev/reference/rules/6-10/) Test
- [Rule 7.1](https://typeshade.dev/reference/rules/7-1/) Test
- [Design rules](https://typeshade.dev/reference/rules/)
- [Error codes](https://typeshade.dev/reference/errors/)

## Source

The rule at commit af54ddad5:

- [`docs/language-design.md:601`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/language-design.md#L601) (the design document)
- [`reqs/rules/RULE-0611.md`](https://github.com/typeshade/typeshade/blob/af54ddad5/reqs/rules/RULE-0611.md) (its traceability item)
