규칙 11.9
11장, 대상과 오라클 테스트
A console call computes nothing a shader reads: its arguments must be evaluated once, in order, on every target, and the call then delivers an event, { method, args, span, invocation }.
A console.table call must take exactly one value, and a matrix it takes must be delivered as its columns, on every path that delivers the event.
On the CPU (the oracle, the generated CPU code, the lockstep dispatch) the event goes to the host’s sink.
On WGSL under console: 'gpu', a call a compute or fragment entry reaches must be written into the console buffer (Rule 6.11), and decodeConsole must turn the buffer into the same events in the order the CPU runs a dispatch in: by invocation, z, then y, then x, and in program order within one.
A call the WGSL cannot record (one a vertex entry reaches, one with an argument that has no fixed size or is not a value, one in a stage that already binds eight storage buffers) must be a TS8071 warning on the call; GLSL ES 3.00 records nothing, with no diagnostic (Rule 10.5).
규칙 본문과 그 아래 항목은 설계 문서에 적힌 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
근거
the GPU is an optimization level of the CPU program (docs/dx.md), so what a program logs must not depend on where it ran; the order a GPU wrote in is the scheduler’s and means nothing, so the decoder restores the CPU’s.
출처
changes/0014-gpu-console.md, changes/0019-console-table.md, measured on Tint and SwiftShader in Chromium 141 (a vertex stage that reaches the buffer: var with 'storage' address space and 'read_write' access mode cannot be used by vertex pipeline stage); a fragment’s helper invocations and a discarded one write nothing, measured on the same browser; surface §66.
검증 방식
테스트로 확인합니다. 테스트나 게이트 스크립트, CI 워크플로가 이 규칙을 가리키고, 아래 파일 가운데 하나라도 규칙을 더는 가리키지 않으면 추적 검사가 실패합니다.
컴파일러가 이 규칙을 적용하는 곳을 규칙이 직접 적은 내용입니다.
src/core/passes/console-buffer.test.ts, which runs the lowered module on the oracle and holds the decoded events equal to the sink’s, overflow included, and pins each TS8071 reason; src/compiler/ts/console.test.ts, for the CPU delivery and console.table in both halves; src/core/debug/console.test.ts, for a stepped run.
커밋 c66579bf에서 이 규칙을 확인하는 파일입니다. 파일마다 규칙을 처음 가리키는 줄로 연결했습니다.
설명하는 절
커밋 c66579bf의 표면 문서에서 이 규칙을 설명하는 절입니다.
적용하는 오류 코드
규칙이 Enforced by 항목에서 가리키는 진단 코드와, 레지스트리 설명에서 이 규칙을 가리키는 진단 코드입니다.
-
TS8071CONSOLE_NOT_RECORDED - A warning under
compile(src, { console: 'gpu' }): aconsolecall the WGSL does not record, on the call, with the reason (a vertex entry reaches it, an argument has no fixed size or is not a value, the stage has no room for another storage buffer).
함께 보기
소스
커밋 c66579bf의 규칙 원문:
docs/language-design.md:1203(설계 문서)reqs/rules/RULE-1109.md(추적 항목)