오류 코드
이 페이지에서

오류 코드

코드 85개

컴파일러가 진단에 붙이는 코드를 모두 모았습니다. 커밋 26de7be8의 레지스트리 두 곳에서 읽어 왔습니다. "use typeshade" 프런트엔드의 코드가 47개, 그 아래 코어 IR 계층의 코드가 36개입니다.

49개 페이지에는 코드를 내는 프로그램과 그 프로그램을 고친 모습이 함께 실려 있습니다. 둘 다 빌드할 때 고정된 컴파일러로 컴파일하므로, 프로그램이 더는 그 코드를 내지 않거나 고친 프로그램에 진단이 남으면 빌드가 멈춥니다. 예제 태그가 붙은 행이 그런 페이지입니다.

레지스트리 설명과 컴파일러 메시지는 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

프런트엔드 코드

TS80xx 코드는 프런트엔드의 TS_CODES에 들어 있습니다. "use typeshade" 파일은 IR을 만들기 전에 이 코드들로 먼저 검사받습니다.

파일

TS8001 MISSING_DIRECTIVE 예제
TypeShade로 컴파일하는 파일에 "use typeshade" 지시문이 아예 없습니다.
TS8013 HOST_STMT 예제
Host control flow and the JavaScript runtime forms no shader has: await, yield, an async or generator function, try/catch/throw, for…in, var, a spread outside an object literal, and a template string.
TS8014 TOP_LEVEL 예제
파일 최상위에 컴파일러가 선언으로 받을 수 없는 것이 있습니다. 선언이 아닌 문이거나, 거부하는 형태의 모듈 수준 선언입니다.
TS8030 SYNTAX 예제
A TypeScript parse error (an unclosed parenthesis, a missing brace, an unexpected token) in a "use typeshade" file, carried through as a TypeShade diagnostic so a compile() caller sees it without running tsc.
TS8050 ENABLE_NAME 예제
A file-level "enable <extension>"; directive (§50) naming an extension outside the vocabulary the WGSL backend's capability profile carries a directive for (clip_distances, dual_source_blending, f16, primitive_index, subgroups).
TS8072 IMPORT 예제
An import the compiler does not follow (Rule 3.9, surface §68, proposals 0022 and 0024): a path that names no file or one this compile cannot read, a file that is not a shader module, a package no node_modules holds, a subpath a package's exports does not name, a package's name alone when it has no exports, a # specifier or one that is neither relative nor a package name, a name the module does not export, and the forms a shader module has no use for (a default import or export, an import that names nothing, import(...), require, a module namespace used as a value).
TS8099 UNSUPPORTED 예제
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.

타입과 이름

TS8002 UNKNOWN_TYPE 예제
A type name nothing declares, said once for the file wherever it is written (a parameter, a claim, a type argument, B<vec3<Foo>> included, an alias, an implements clause, the base a class or an interface extends, a body no call lowers), a type the library declares for TypeScript alone (Number) where the file declares none of its name, or a type this surface does not take in a position the mapper reads (Rule 2.1).
TS8003 TYPE_MISMATCH 예제
연산자나 조건, 선언, 반환, 인자처럼 두 값이 만나는 자리에서 타입이 서로 맞지 않거나, 컴파일러가 접는 상수를 WGSL이 거부합니다. 31을 넘는 시프트 양, 0인 제수, 서로 엇갈린 clamp 경계, 범위를 넘는 f32 값이 그렇습니다.
TS8005 CONST_ASSIGN 예제
const나 읽기 전용 리소스처럼 바뀔 수 없는 이름에 값을 대입합니다.
TS8010 STRUCT_FIELD 예제
An invalid struct field or declaration shape.
TS8016 INDEX_OOB 예제
상수 인덱스가 대상의 길이를 벗어납니다.
TS8018 ASSIGN_TARGET 예제
An assignment or ++/-- target that is not a writable place, such as a temporary or an input that has no writable value local.
TS8022 UNKNOWN_NAME 예제
Reference to a name TypeShade cannot resolve (identifier, struct field, or struct shape) that is not a function call (UNKNOWN_FN) or a type name (UNKNOWN_TYPE), in a body a call lowers or in one no call lowers; a name the library declares for TypeScript's own use (Object, Math, Symbol), or the file declares as an enum, a namespace, a class or a type, read as a value says what it is.
TS8023 DUPLICATE_SYMBOL 예제
The same function, binding, module constant or struct name declared twice in one scope.
TS8053 INT_LITERAL_DEPRECATION 예제
A deprecation warning, not an error: an undecided integer-written declaration still defaults to f32 and will default to i32 (§13).

함수와 클래스

TS8004 UNKNOWN_FN 예제
파일이 선언하지도 가져오지도 않은 함수를 부릅니다.
TS8019 ARITY_MISMATCH 예제
Wrong number of arguments, elements, or fields at a call or constructor site.
TS8020 FUNCTION_SHAPE 예제
A function declaration or parameter shape TypeShade does not support (missing name or body, optional/rest/destructured parameter).
TS8021 RETURN_SHAPE 예제
A return shape problem: bare return where a value is required, or an entry function with no return type annotation that returns a value.
TS8031 RECURSION 예제
A call cycle: a function that reaches itself, directly or through other functions.
TS8035 CLASS_MEMBER 예제
A class member shape the surface does not take, or a use of a member the class rules refuse, and a new that builds no class (Rule 8.13).
TS8036 MATH_ARGUMENT 예제
A math builtin called with arguments its signature does not take: two shapes that had to agree (dot(vec3, vec2), clamp(v, 0., 1.) with a vector v), an element kind the builtin has no form for (sin on an integer vector, mix on one), a scalar where a vector is due (normalize(s), cross on a vec2), mix's factor or refract's eta of the wrong shape, ldexp's exponent not an i32 of x's shape, a bit offset or count that is not a u32, or transpose/determinant on a non-matrix.

제어 흐름

TS8006 LOOP_BOUND 예제
컴파일러가 종료를 증명할 수 없는 for 루프입니다. 카운터를 경계와 비교하지 않거나, 본문이 경계를 씁니다.
TS8007 LOOP_INFINITE 예제
끝나지 않는 것이 확실한 루프입니다. break나 return이 없는데 조건이 true인 while, 또는 카운터를 경계에서 멀어지게 하는 증가입니다. 조건은 그대로 썼든 상수만으로 계산했든 같습니다.
TS8008 LOOP_INDUCTION 예제
for 루프의 카운터가 i32나 u32 타입의 let 하나가 아니거나, 갱신이 상수만큼 움직이지 않습니다.
TS8009 BREAK_OUTSIDE 예제
감싸는 루프나 switch가 없는 곳에 break를 썼습니다.
TS8017 SWITCH_CASE 예제
Invalid switch case: a label that is not an integer constant, does not fit the selector, or repeats another; an empty clause with no body below it to share (a trailing one, or one above default:); a body whose end is reachable above a clause with a body, which TypeScript would run on into and WGSL does not (Rule 7.3); or continue in a switch no loop encloses.
TS8034 BARRIER_PLACEMENT 예제
workgroupBarrier() / storageBarrier() somewhere a barrier cannot stand (§25): in a vertex or fragment entry, which has no workgroup; or as a value, since a barrier is a statement (roadmap 0.2 item 5).
TS8052 UNIFORMITY 예제
A call that needs uniform control flow — textureSample and the other implicit-LOD forms, the derivatives, a barrier, or workgroupUniformLoad — reached under a condition that is not uniform across the invocations that run together (an if, a switch, a loop's condition, the left side of && or ||, the condition of a ?: WGSL writes as an if), or after a return, break or continue taken under one (§54).

진입점과 입출력

TS8024 BUILTIN_NAME 예제
@builtin("...") names an id outside WGSL's builtin vocabulary (WgslBuiltinName in core/sot.ts).
TS8025 BUILTIN_STAGE 예제
A @builtin(...) id used as the wrong stage's input or output, e.g. frag_depth on a vertex return, or front_facing on a vertex parameter.
TS8026 WORKGROUP_SHAPE 예제
A warning: @compute([x, y, z]) exceeds one of WebGPU's default compute limits (x and y 256, z 64, 256 invocations in all), so a device requested without raising that limit refuses the pipeline.
TS8028 ATTRIBUTE_NAME 예제
A decorator identifier outside the attribute vocabulary "use typeshade" defines (@vertex, @fragment, @compute, @builtin, @location), e.g. a misspelled @vertx: without this, the decorated function or field just silently stops being an entry point or an I/O field.
TS8029 STRUCT_FIELD_MISSING_ATTR 예제
A field of a struct used as an entry function's parameter or return type carries neither @builtin(...) nor @location(...): WGSL rejects an entry-IO struct member with no attribute, so this is caught at the front end instead of reaching the backend as invalid emitted WGSL.
TS8037 WORKGROUP_ARG 예제
@compute(...) with an argument that is not an array literal of one to three whole numbers: an object, a bare number, an identifier, an empty or four-wide array.

리소스와 메모리

TS8032 UNSIZED_ARRAY_LENGTH 예제
.length, or arrayLength(x), on an array<T> with no N that is not in storage: a uniform<array<T>>, a local, or a parameter.
TS8033 MODULE_VAR 예제
A module variable (let x: workgroup<T>, let y: T = init, §24) declared or used where its address space forbids: a const with an address-space wrapper, a workgroup variable with an initializer, a type the space cannot hold (a texture, a runtime-sized array, an atomic in a per-invocation variable), an initializer that is not a constant, or a workgroup variable reached from a vertex or fragment entry (roadmap 0.2 item 5).
TS8041 TEXTURE_ARGUMENT 예제
A plain argument of a texture read that the target has no overload for: a coordinate or gradient of the wrong width for the texture's dim or of an element kind the read does not take (a sampled read is by normalised f32, a texel fetch by whole i32/u32 texel), a layer, mip level or sample index that is not an integer or is not a whole number of 0 or more, and a level, bias or depth_ref that is not an f32.
TS8051 LAYOUT 예제
A buffer binding's store type breaks one of WGSL's host-shareable rules (§51), which a struct hides from the type map and the backend only meets as emitted text: a bool, alone or in a vector, in a uniform or storage binding, as a field, a runtime array's element or the whole type (type 'bool' cannot be used in address space 'uniform' as it is non-host-shareable, and the same of vec3<bool>), a runtime-sized array<T> that is not its struct's last member, or a runtime-sized array in a uniform, whose type must be constructible.

에뮬레이션 배정밀도

TS8027 MAT_UNSUPPORTED 예제
A non-square matCxR<f64>: the fp64 pass carries one df64 body per dimension (DF64MatN, matmul, matvec, transpose), so only a square matrix of doubles lowers.
TS8038 F64_ENTRY_IO 예제
An emulated double (f64, a vec64) on an entry's IO boundary — a @location parameter, a @location field of an IO struct, or an entry's return.

대상

TS8015 BACKEND 예제
프런트엔드가 받아들인 모듈을 백엔드가 출력하지 못하고 거부했습니다. 메시지는 백엔드가 쓴 그대로입니다.
TS8068 RESERVED_NAME 예제
A declared name that a target reserves, checked on the name the emit actually carries: half as a struct field, which ANGLE answers with "Illegal use of reserved word" in generated text the author never wrote.

폐기된 번호

TS8011
A gap (8011 and 8012 are retired) is never reused.
TS8012
A gap (8011 and 8012 are retired) is never reused.

그 밖의 코드

TS8069 MISPLACED_DIRECTIVE 예제
A "use typeshade" directive after another top-level statement (Rule 3.1).
TS8070 KERNEL_LOOP_ON_CPU
A warning on a loop of a kernel function (Rule 8.22, surface §65, proposal 0013) that the independence proof refused: the loop runs on the CPU, and the message names the line and the author's names that stop it, and the remedy.
TS8071 CONSOLE_NOT_RECORDED 예제
A warning under compile(src, { console: 'gpu' }): a console call 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).

코어 코드

SDxxxx 코드는 typeshade/dev가 내보내는 CODES 카탈로그에 들어 있습니다. 코어 IR 계층은 fn() 빌더에서도 "use typeshade" 파일에서도 이 코드를 냅니다. 다만 같은 실수 가운데 상당수는 프런트엔드가 자기 코드로 먼저 거부합니다.

타입과 이름

SD0001
matrix × vector size mismatch
SD0002
binary op on mismatched vectors
SD0003
arithmetic op on a bool operand
SD0004
binary op on incompatible types
SD0005
bitwise op requires a u32/i32 left operand
SD0006
component access on a non-vector
SD0007
vector component out of range
SD0008
swizzle on a non-vector
SD0009
.select() on a non-bool condition
SD0010
select branches have differing types
SD0011
matchExpr case type does not match the default
SD0015
array-texture layer must be an integer
SD0116
a scalar cast applied to a non-scalar value
SD0117
a one-argument .at(i) on a node that is not an array

빌더 호출

SD0012
statement sink not installed
SD0013
no active builder
SD0113
a fn whose body returns nothing at the TypeScript level returns a value at run time
SD0115
a branch body returned a value, which a branch cannot carry out

리소스와 메모리

SD0014
override (specialization constant) must be a WGSL scalar type
SD0016
host-owned resource has a shape the target cannot spell
SD0114
a variable a function reads has no declaration in the module

대상

SD0017
literal cannot be spelled by the target
SD0020
module validation failed
SD0030 예제
unsupported feature for this backend

에뮬레이션 배정밀도

SD0040
f64 type leaked past fp64Lower into a backend emitter
SD0041
unsupported operation on f64 operands
SD0042
conflicting fp64 guard declaration
SD0043 예제
reserved fp64 name
SD0044
f64 in an interpolated @location IO field

린트 규칙

SD0107
assignment to an immutable 'let' binding
SD0108 예제
smoothstep with constant edge0 >= edge1 (undefined in GLSL ES)
SD0109
a fragment-only builtin is reachable from a vertex or compute entry
SD0112
a local name is declared twice in one function

이식형 커널

SD0110
portable declared on a non-compute entry
SD0111
portable kernel outside the gather-only tier

그 밖의 코드

SD0118
grad cannot differentiate this function

번호 매기기

프런트엔드 레지스트리는 번호를 매기는 방식을 파일 머리 주석에 직접 적어 두었습니다.

Numbering: TS8 + a zero-padded sequential number, assigned in the order a code was added. A gap (8011 and 8012 are retired) is never reused. 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.

One more kind of gap exists from TS8039 to TS8067. While several sessions worked the issue list of #162 in parallel, each was given a BLOCK of codes to draw from, so two branches in flight at once could not claim one number twice. F64_ENTRY_IO (TS8038) is the last code in the sequential range; TEXTURE_ARGUMENT (TS8041) and RESERVED_NAME (TS8068) were assigned from blocks, and the numbers a block did not spend stay unspent. A block's unused codes stay unused, exactly as 8011 does — a gap is never reused.

Implements: Rule 3.7 (docs/language-design.md; traced in reqs/).

이 페이지 편집 문제 보고