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 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:
See also
- Rule 6.10 Test
- Rule 7.1 Test
- Design rules
- Error codes
Source
The rule at commit 26de7be8:
docs/language-design.md:484(the design document)reqs/rules/RULE-0611.md(its traceability item)