---
title: "규칙 8.23: 함수와 진입점, TypeShade 셰이더 언어 설계 규칙과 그 근거, 출처, 검증 방식"
description: "TypeShade 언어 설계 규칙 8.23(함수와 진입점)입니다. A kernel function's parameter of an array with no size is the caller's array (change 0142)…"
url: https://typeshade.dev/ko/reference/rules/8-23/
language: ko
---

# 규칙 8.23

8장, 함수와 진입점 테스트

A kernel function’s parameter of an array with no size is the caller’s array (change 0142): the body reads its elements and its `.length`, writes its elements in place, and cannot assign it whole ([`TS8018`](https://typeshade.dev/ko/reference/errors/ts8018/)). The call reads back an array the body writes, and an array the body never writes comes back as it went in; `return` of the parameter gives the same array, or the same `Buffer`, with no copy. The author writes no qualifier, and a written `@inout` or `@out` is [`TS8073`](https://typeshade.dev/ko/reference/errors/ts8073/) ([Rule 8.25](https://typeshade.dev/ko/reference/rules/8-25/)); no call fills an array with zeros. A fixed-size array parameter, `array<T, N>`, is an object too ([Rule 8.8](https://typeshade.dev/ko/reference/rules/8-8/)). The `.length` of such an array counts elements, so an `array<vec4f>` counts vectors (change 0068). A `Buffer` of the parameter’s class, or of its scalars, is such storage too ([Rule 8.21](https://typeshade.dev/ko/reference/rules/8-21/)): the call reads and writes its device copy, and the host reads what the call wrote with `await buffer.read()`. A kernel function may also make the array it returns (change 0114, S5): one `const` at the top level of its body, before its first loop and its first store, initialized by `new Float32Array(n)` (`n` zeros of `f32`) or `new Array(n).fill(v)` (`n` copies of `v`, or for a struct `n` references to one object, as JavaScript’s `fill` gives), whose element is an `f32`, an `i32` or a `u32`, a vector of them, or a struct whose fields are these (slice 2), and returned on every path. `n` has any number type and reads only the value parameters, their components and fields, module constants, the `.length` of an array parameter, number literals, `u32`, `i32` and `f32` of these, and top-level `const`s of these, with `+`, `-`, `*`, `/`, `%`, `min` and `max`; `v` reads the same operands, and may be a vector or a struct built of them. The host evaluates `n` and `v` before anything runs, with the program’s arithmetic, and a length that is negative or not an integer throws a `RangeError` that names the function and the length. The body reads and writes the array’s elements and reads its `.length`, as for an array parameter, and `.length` reads `n` on every tier, 0 included; the call holds the array as an array parameter of its own (the compiler’s choice of representation, OD-9), checks every index against `n` as for a parameter, and resolves to it in the form Rule 8.21 gives an array parameter of its element: the scalar’s typed array for a scalar or a vector element, a vector’s components one after another (`Float32Array` for `vec4f[]`), and an array of objects for a struct, instances of its class when the module exports one. A struct fill shares one object (Amendment A8, item 4; OD-5): in the result, every element the run does not write as a whole is one object, which is the caller’s own object when `v` is a struct parameter or a field of one, and each element the run writes as a whole (`out[i] = w`) is its own object, so a write on the host to a field of one unwritten element shows in every other. Where the compiler cannot prove that the run writes every element, the kernel records a written mark for each element and the host reads the marks (the compiler’s choice, OD-9). A vector is a value, so a vector fill shares nothing. Refused as not supported yet ([`TS8099`](https://typeshade.dev/ko/reference/errors/ts8099/)), each with a sentence that names the form: an element that is a matrix, a `bool`, a key or an `f64`, or a struct that holds one; such an array in a helper or an entry; one made inside a loop, under a branch, or after a loop or a store; a length or a fill value that reads another operand; a whole write of a struct element whose object the compiler cannot tell is new to that element (`out[i] = w` where `w` is a parameter, another element or a `const` declared before the loop); `Array.from({ length: n }, f)` with such a length; another `return`; a use of the array as a value (`out.push(v)`, a second name, an argument of a call); and a function that also takes a 2D storage texture. A result of an array with no size that is no new array stays [`TS8020`](https://typeshade.dev/ko/reference/errors/ts8020/). The `const` may instead start empty, annotated with an array with no size of an element the made array may hold (`const out: f32[] = []`, change 0114, S5d), and grow with `out.push(v)` in the `for` and `for…of` loops of the body: a loop at the top level, a loop nested in one, or a loop under a top-level `if` whose condition reads only the operands `n` reads (change 0114, Amendment A12, form 2, Route 1). The compiler computes its capacity, the sum over the pushes of the product of the trip counts of every loop around a push (a push in an outer body counts once for each outer trip, a push in an inner body once for each inner trip of each outer trip, and a push under a branch inside a loop counts as one), where every loop’s start and bound read only the operands `n` reads, and a loop under a top-level `if` counts only when the host, evaluating the condition with the program’s arithmetic, finds its branch taken; the host evaluates the start and the bound with the program’s arithmetic and the capacity exactly, with no wrap, before anything runs, and holds the array as an array parameter of that capacity. A loop nested in a top-level loop may instead start or end at a value the host does not know before the run (the counter of a loop around it, an element of an array parameter, the length of the array itself), when the function is one the call may run twice (change 0114, Amendment A12, form 2, Route 2): every loop is one the proof of [Rule 8.22](https://typeshade.dev/ko/reference/rules/8-22/) accepts, the only write of the function is the push onto this one array, every push is a statement, the body reads no element of the grown array, an element of an array parameter is read only at the counter of a loop up to that array’s length, or at the counter of the top-level loop that holds the read when no element is read in that loop’s start or bound and the function has a GPU plan (the call checks such a read against the array’s length before anything runs, Rule 8.21; change 0114, Amendment A17), and no statement follows the loops but the return. The call then runs the function once to count the pushes, as a `u32` that stops at 4294967295, reserves exactly that many elements and runs it again, and a count of 4294967295 or more throws a `RangeError` before the second run; a call whose first and second run push different counts throws an `Error` and returns nothing. A function whose capacity Route 1 sizes within the limit keeps Route 1, and one it sizes past the limit takes Route 2. On WebGPU the first run dispatches only the count and scan steps of its loops (change 0078, with no store step) and reads the total, and the count stops at 4294967295 there as it does on the CPU tier; on every other tier the first run is the function’s run on the CPU tier. A capacity past 4294967295, or past what one host array of its element holds, in a function that Route 2 does not serve (below), takes Route 3 (below) at the call when the runtime’s tier list holds the CPU tier (change 0114, Amendment A17, R3-Q1); where the list holds no CPU tier, the call throws a `RangeError` that names the function, the array and the capacity before anything runs, since a length past that limit is not supported yet. The pushes append as they do onto an array parameter (below), in the order of a sequential run, on every tier; `out.length` in the body reads the number pushed so far; and the call resolves to a new array of exactly the elements pushed, in the made array’s form, which the caller owns. Pushes of a struct keep JavaScript’s objects (Amendment A8, item 4): when every push pushes one `const` object declared at the top level of the body, which only the pushes use, the elements are one object; a push of a new object each time gives each element its own. Refused as not supported yet (`TS8099`), each with a sentence that names the loop or the form: pushes of a struct that the compiler cannot tell are one object or new ones (one object mixed with new ones, or one the body changes); a push outside every loop; a loop at the top level whose start or bound reads another operand, a range the device holds included, unless the bound reads the length of the array itself (Route 3, below); an element the made array may not hold; and a read or a write of an element before the first loop. Any other loop that pushes onto the array or writes an element of it that can append (a `while`, a `for` that is no count from a start to a bound by a constant whole step or whose body writes its counter, a loop inside such a loop, and a loop under a `switch` or under a branch inside a loop; a loop nested in a top-level loop whose start or bound reads a value that no route can size, which is the counter of a loop around it or an element of an array parameter, in a function that Route 2 does not serve; a loop under a top-level `if` whose condition reads another operand; a top-level loop whose bound reads `out.length`; and a write the compiler cannot prove below the length in a loop inside another loop or under a branch; a `do … while` stays refused by the front end) takes Route 3 where Route 2 does not serve the function (change 0114, Amendment A12, section 1, Route 3): the call reserves no capacity, runs the function once on the CPU tier, which appends in the order of a sequential run, and resolves to a new array of exactly the elements pushed, which the caller owns. A length of 4294967295 or more throws the `RangeError` of Route 2, and a host that cannot hold the elements pushed throws a `RangeError` that names the function, the array and the length it reached. Where the proof of Rule 8.22 accepts every loop and the function could otherwise run on a device, a loop whose start or bound the compiler cannot read draws a [`TS8070`](https://typeshade.dev/ko/reference/errors/ts8070/) warning ([Rule 12.4](https://typeshade.dev/ko/reference/rules/12-4/)), in both halves, on the first such loop: `"for (let j: u32 = 0; j < counts[at[i]]; j++)" pushes onto "out", and its start or bound reads a value the call does not know before it runs, so this function runs on the CPU, where the array grows as it is pushed to.` A function that Route 1 sizes past the limit, or whose reserve the host cannot allocate, and that Route 2 does not serve, runs as Route 3 at the call when the runtime’s tier list holds the CPU tier. No GPU tier runs a function of Route 3: the reason a call names for WebGPU and WebGL2 is the proof’s, or else that growing an array during a run on those tiers is not supported yet, and a call whose list holds only those tiers throws the error of [Rule 11.8](https://typeshade.dev/ko/reference/rules/11-8/). The other refusals of the made array apply to it. An element of the array is read and written as JavaScript reads and writes it at that point of a sequential run (change 0114, Amendment A12, section 2): a read needs an index below the length, a write an index at most the length, and a write at the length appends as `push` does. An index the compiler proves below the length, the counter of a loop that counts up from 0 to `out.length` by 1 and that the body does not write, runs on every tier as an array parameter’s does. Any other index is checked at the call on the CPU tier only (A12, Q1 (C)): the function has no GPU plan, and the reason names the access; each such write counts as one push in the capacity; and an index past what the access may reach throws a `RangeError` that names the function, the access, the index and the length, before the caller’s arrays change. For a read-only, non-resident array of flat scalar objects, a private WebGPU input may contain only live fields in declaration order (change 0082). Field use includes all loops and reachable helpers. Unproved uses retain the full layout. Fusion facts do not select an execution mode: an eligible ordinary call can project inputs while its face carries full-layout facts (change 0085). The CPU and WebGL2 paths, authored entry bindings, raw bytes, resident and fused calls retain their original layout. Element indexing and array length do not change. A kernel function’s texture parameter (change 0077), a `texture_2d<f32>` or a 2D storage texture, stays the caller’s texture, passed by reference with no qualifier, as a `Map` and a `Set` do: the body loads it with `textureLoad`, measures it with `textureDimensions`, stores into a storage texture with `textureStore`, and cannot assign it whole. An array parameter a loop pushes onto (change 0078) starts empty in the function, or at its held length when the call passes one (change 0094): the pushes append in the order a sequential run of the function makes them, loop by loop, iteration by iteration and statement by statement, on every tier, so a second loop that pushes onto the array appends after the first, and its `.length` is the held length (0 without one) plus the count appended, a `u32`, which may exceed the host array’s length. The host array is the capacity: the call writes the elements from the held length up to `min(length, capacity) - 1` and leaves the rest as they were, and the host reads the length through the function’s own `return out.length`, or in the held length’s word, which the call leaves holding the new length. A held length is `{ array, length, offset? }` (Rule 8.21): `array` is what the parameter takes otherwise, and element `offset` of `length`, a `Buffer<u32>` (change 0138, Amendment A10, confirmation item 3), holds the array’s length when the call runs, as an array’s `length` before ECMAScript’s `push`. The call refuses, with a `TypeError` that names the function and the parameter, before anything runs: the object on an array no loop pushes onto (decision D5); a `length` that is no `Buffer<u32>`, a scratch array of a `fuse` scope or a disposed `Buffer`; an `offset` that is no whole number from 0, or is past `length`; a `length` that is another argument of the call or the `length` of another; and a `Buffer` of another owner (Rule 11.8). An object with another key is refused as a wrong array is. A `Map` or a `Set` parameter (change 0080) is the caller’s JavaScript `Map` or `Set`, passed by reference: its entries are there before the loop, and when the call resolves the entries a sequential run of the function leaves are in it. A key is added once, and its place in the order is the first `add` or `set` of it; a `Map` keeps the value of the last `set` of each key; keys compare by SameValueZero, so one `NaN` key holds every `NaN` and `-0` is `0`. The call refuses, with a `TypeError` that names the parameter, a value that is not a `Map` or a `Set` as the parameter says, and the first key or value that does not fit its type. For a key-type `K`, the host passes strings: the call converts keys to ids before the loops and back to strings after them, preserving insertion order; a key outside the union is a `TypeError`, and `Map<string, V>` and `Set<string>` stay refused (change 0081). A kernel function is emitted by no target, since it runs on the host’s side of the call; an `array<T, N>` parameter is an object (Rule 8.8).

규칙 본문과 그 아래 항목은 설계 문서에 적힌 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.

## 근거

a runtime-sized array exists only in storage ([Rule 12.6](https://typeshade.dev/ko/reference/rules/12-6/)). A kernel function’s array is the caller’s array, as a JavaScript function’s array parameter is, so a function that updates it writes its elements and the call writes them back; the compiler reads which arrays a body writes, so no qualifier says it (OD-5, change 0142). A write that nothing carries back is no longer a refusal: the caller’s array changes, as it does in JavaScript, and the code of that refusal is retired.

## 출처

change `0013` in `changes/`; change `0094` (a held length, and two loops that push onto one array); change `0138` (Amendment A10, Q-A and Amendment A15 give the value reading that change `0142` withdraws); change `0142` in `changes/`; [Rule 8.8](https://typeshade.dev/ko/reference/rules/8-8/); [Rule 12.6](https://typeshade.dev/ko/reference/rules/12-6/).

## 검증 방식

테스트로 확인합니다. 테스트나 게이트 스크립트, CI 워크플로가 이 규칙을 가리키고, 아래 파일 가운데 하나라도 규칙을 더는 가리키지 않으면 추적 검사가 실패합니다.

컴파일러가 이 규칙을 적용하는 곳을 규칙이 직접 적은 내용입니다.

`parseParams` and `fillFunctionBody` in `src/compiler/ts/lower/function.ts`, which take the parameter as an `inout` storage array for a kernel function and refuse it on any other ([`TS8020`](https://typeshade.dev/ko/reference/errors/ts8020/)); `runChecked` in `src/core/host-kernel.ts`, which reads back an array the body writes and no other, pinned by `src/compiler/ts/host-kernel-out.test.ts` (the array written in place on every call, an array the body never writes back as it went in, a `Buffer`, and a held length refused on an array no loop pushes onto); `withoutKernels` in `src/core/ir/kernels.ts`, which every backend and `reflect()` read through; pinned by `src/compiler/ts/kernel-loops.test.ts`, which runs a kernel function on the CPU oracle and holds the caller’s array written in place. A texture parameter is a handle binding of the loop’s entry (`lowerKernel` in `src/core/passes/kernel-lower.ts`) and a `texture` parameter of the face (`kernelFace` in `src/compiler/ts/host-face.ts`); pinned by `src/compiler/ts/host-kernel-texture.test.ts` and by the import journey, whose `invertImage` stores into a device’s texture on WebGPU in Chromium, each byte the reference’s. A pushed array’s count is `pushedParams` and `countPushedLengths` in `src/compiler/ts/lower/kernel-push.ts` and the builtins `push` and `pushCount` of `src/core/cpu-runtime.ts`; pinned by `src/compiler/ts/host-kernel-push.test.ts` on the CPU tier: the order, an empty result, a count past the capacity, two pushes in one iteration and a second call that starts empty. A held length (change 0094) is `heldArgument` in `src/core/host-arity.ts` and `checkHeld` in `src/core/host-kernel.ts`, which the CPU tier reads and writes through `startPushesAt` and `pushedLength` in `src/core/push-count.ts`, the table the builtins `push` and `pushCount` keep the count in, and the pushed parameter’s type in the host view from `kernelFace` and `viewText` in `src/compiler/ts/host-face.ts`; pinned by `src/compiler/ts/host-kernel-push.test.ts` (both halves on one source, the view under `tsc` and in the editor, the CPU tier from a held length inside, at and past the capacity, each refusal, and two loops onto one array). A `Map` or a `Set` is a `collection` parameter of the face (`kernelFace` in `src/compiler/ts/host-face.ts`), checked and copied by `checkCollection` in `src/core/host-kernel.ts` and written back by `collectionBack`, over the builtins of `src/core/cpu-runtime.ts`, which are JavaScript’s own `Map` and `Set`; pinned by `src/compiler/ts/host-kernel-collections.test.ts` on the CPU tier against JavaScript’s own on the same input: duplicates, the host’s entries before the call, the last value set, `NaN` and `-0` keys, a vector value, and each refusal. The array a kernel function makes and returns (change 0114, S5): `madeCandidate` and `refuseResultArray` in `src/compiler/ts/lower/made-array/candidate.ts`, `lowerMade` in `src/compiler/ts/lower/made-array/lower.ts`, which binds it as an array parameter of its own and refuses the elements later slices take ([`TS8099`](https://typeshade.dev/ko/reference/errors/ts8099/)), `settleMadeArray` in `src/compiler/ts/lower/made-array/settle.ts`, which checks the operands of its length and fill value, `lengthFromHost` in `src/compiler/ts/lower/made-array/length.ts`, which makes each read of its `.length` read the length the host computed, `madeFace` in `src/compiler/ts/host-face/made.ts`, which records the parameters the length and the fill value read, `madeArray` in `src/core/host-kernel-made/making.ts`, which evaluates the length and throws the `RangeError`, `callMadeKernel` in `src/core/host-kernel-made.ts`, which resolves to the array, and `callMadeOnResource` in `src/core/host-kernel-made/on-resource.ts`, which returns the new `Buffer` of a call on a resource (A1 item 7), throws the `RangeError` for a length of 0 and refuses the forms it does not support yet, pinned by `src/compiler/ts/host-kernel-made-resource.test.ts` (both halves, a chain of two calls, a vector element as its scalars, a `Buffer<C>`, the index check at the call, the length of 0, each refusal and the host view’s overload); pinned by `src/compiler/ts/host-kernel-made.test.ts` (both halves and the hover, the CPU tier against the parameter form and a JavaScript loop, the index check, the length of 0, the host view under `tsc`), by `src/compiler/ts/host-kernel-made-elements.test.ts` (vector and struct elements: both halves and the hover, the CPU tier against the parameter form, the length of 0, the index check in elements, the pushed vectors, instances of an exported class, the host view), by `src/compiler/ts/made-array-refusals.test.ts` (each refusal in both halves) and on WebGPU by `renderMade` of `journeys/_host-import`. A struct fill that shares one object (Amendment A8, item 4): `refuseSharedStores` in `src/compiler/ts/lower/made-array/identity.ts`, which refuses a whole write or a push whose object the compiler cannot tell, `writtenOf` and `markWrites` in `src/compiler/ts/lower/made-array/written.ts`, which prove every element written or record a written mark for each, and `callMadeKernel`, which gives the unwritten elements one object; pinned by `src/compiler/ts/host-kernel-made-shared.test.ts` (both halves, the face’s marks, the CPU tier against a JavaScript run with `===` and a host-side field write, the caller’s object of a parameter fill, pushes of one object and of new ones, each refusal in both halves) and on WebGPU by `shareMade` of `journeys/_host-import`. The array a kernel function grows with `push` (change 0114, S5d): `isGrownForm` in `src/compiler/ts/lower/made-array/candidate.ts`, `lowerGrown` in `src/compiler/ts/lower/made-array/grown.ts`, which binds it and refuses a push outside the top-level loops and an element read or write, `grownCapacity` in `src/compiler/ts/lower/made-array/capacity.ts`, which records each loop’s start, bound, step and pushes and refuses a top-level loop whose bound it cannot read, `settleMadeArray`, which makes the function return the number pushed, `exactCapacity`, `checkedCapacity` and `allocatedFor` in `src/core/host-kernel-made/capacity.ts`, which sum the capacity exactly and throw the `RangeError` past the limit, and `callMadeKernel`, which resolves to the elements pushed and throws if more were pushed than the capacity; pinned by `src/compiler/ts/host-kernel-grown.test.ts` (both halves and the hover, the CPU tier against a JavaScript loop: an unconditional push, a conditional push, two loops, two pushes in one iteration, `out.length` in the body, an empty result, the host view under `tsc`), by `src/compiler/ts/host-kernel-grown-capacity.test.ts` (both halves, the exact capacity past 2^32 of two pushes, a signed counter by a step of 3 and two loops, the limit and one past it, the `RangeError` before the run), by `src/compiler/ts/host-kernel-grown-nest.test.ts` (a push in a nest and under a top-level branch: both halves, the capacity summed over every push at every depth, exact past 2^32 where a `u32` product wraps to 0, a branch not taken that throws nothing, and the CPU tier against a JavaScript loop), by `src/compiler/ts/host-kernel-grown-nest-refusals.test.ts` (the refusals that stay, in both halves), by `src/compiler/ts/grown-array-refusals.test.ts` (each refusal in both halves), by `src/compiler/ts/host-kernel-grown-elements.test.ts` (an element of the grown array: both halves and the hover, the GPU plan where every access is proved and its absence where one is not, the capacity of an unproved write, the CPU tier against JavaScript, the `RangeError` and the caller’s arrays after it) and on WebGPU by `renderPushed` and `renderKept` of `journeys/_host-import`. `grownAccesses` and `grownChecks` in `src/compiler/ts/lower/made-array/bounds.ts` prove an index below the length and give the CPU tier its checked accesses (`pushedReadAt` and `pushedStoreAt` in `src/core/pushed-index.ts`); `madeFace` in `src/compiler/ts/host-face/made.ts` drops the GPU plan of a function with one. Route 3 (change 0114, Amendment A12, S5d slice 3): `nestTerms` in `src/compiler/ts/lower/made-array/nest.ts` marks a loop it cannot count, a branch it cannot read and a top-level bound that reads `out.length` open, and a nested header it cannot read unread, `routeOf` in `src/compiler/ts/lower/made-array/route.ts` gives the function `counted` or `growing`, never both, and hands the unread loop to `kernelLoopDiagnostics`, which draws the [`TS8070`](https://typeshade.dev/ko/reference/errors/ts8070/) warning, `cpuOnly` in `src/compiler/ts/host-face/made.ts` words the reason of the CPU tier (the proof’s, then the growing reason, then the access’s), and `growingRun`, `callGrowing` and `materialized` in `src/core/host-kernel-made/growing.ts` run it, and `onCpuTier` there with `callMadeKernel` gives a call whose capacity Route 1 cannot use the CPU face of Route 3; pinned by `src/compiler/ts/host-kernel-growing.test.ts`, `host-kernel-growing-run.test.ts`, `host-kernel-growing-route.test.ts`, `host-kernel-growing-retired.test.ts` and `host-kernel-growing-open.test.ts`. [`TS8080`](https://typeshade.dev/ko/reference/errors/ts8080/) is a retired code and is never reused (`src/compiler/ts/codes.ts`). Private field analysis is `projectKernelInputs` in `src/core/passes/kernel-project.ts`, serialized by `kernelFace` and selected by `projectedInputs` in `src/core/host-kernel.ts`. It is pinned by `src/compiler/ts/kernel-project.test.ts` with default and explicit fusion options, by `src/runtime/device.test.ts` alternating ordinary, resident and fused calls on one face, by the projected cases of `scripts/gpu-differential.ts`, and the packed import journey.

커밋 af54ddad5에서 이 규칙을 확인하는 파일입니다. 파일마다 규칙을 처음 가리키는 줄로 연결했습니다.

- [`scripts/gpu-differential.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/scripts/gpu-differential.ts#L1)
- [`scripts/kernel-length-cases.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/scripts/kernel-length-cases.ts#L2)
- [`src/compiler/ts/codes.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/codes.ts#L1)
- [`src/compiler/ts/grown-array-refusals.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/grown-array-refusals.test.ts#L1)
- [`src/compiler/ts/grown-length-index-words.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/grown-length-index-words.test.ts#L1)
- [`src/compiler/ts/host-face.ts:5`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-face.ts#L5)
- [`src/compiler/ts/host-face/made.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-face/made.ts#L1)
- [`src/compiler/ts/host-kernel-collections.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-collections.test.ts#L2)
- [`src/compiler/ts/host-kernel-counted-reads.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-counted-reads.test.ts#L1)
- [`src/compiler/ts/host-kernel-counted.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-counted.test.ts#L1)
- [`src/compiler/ts/host-kernel-gl-length.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-gl-length.test.ts#L1)
- [`src/compiler/ts/host-kernel-growing-open.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-growing-open.test.ts#L2)
- [`src/compiler/ts/host-kernel-growing-retired.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-growing-retired.test.ts#L1)
- [`src/compiler/ts/host-kernel-growing-route.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-growing-route.test.ts#L1)
- [`src/compiler/ts/host-kernel-growing-run.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-growing-run.test.ts#L1)
- [`src/compiler/ts/host-kernel-growing.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-growing.test.ts#L2)
- [`src/compiler/ts/host-kernel-grown-capacity.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-grown-capacity.test.ts#L1)
- [`src/compiler/ts/host-kernel-grown-elements.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-grown-elements.test.ts#L1)
- [`src/compiler/ts/host-kernel-grown-length.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-grown-length.test.ts#L1)
- [`src/compiler/ts/host-kernel-grown-nest-refusals.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-grown-nest-refusals.test.ts#L1)
- [`src/compiler/ts/host-kernel-grown-nest.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-grown-nest.test.ts#L1)
- [`src/compiler/ts/host-kernel-grown.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-grown.test.ts#L2)
- [`src/compiler/ts/host-kernel-made-elements.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-made-elements.test.ts#L2)
- [`src/compiler/ts/host-kernel-made-gl.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-made-gl.test.ts#L1)
- [`src/compiler/ts/host-kernel-made-resource.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-made-resource.test.ts#L2)
- [`src/compiler/ts/host-kernel-made-shared.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-made-shared.test.ts#L2)
- [`src/compiler/ts/host-kernel-made-waiting.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-made-waiting.test.ts#L2)
- [`src/compiler/ts/host-kernel-made.test.ts:3`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-made.test.ts#L3)
- [`src/compiler/ts/host-kernel-out.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-out.test.ts#L1)
- [`src/compiler/ts/host-kernel-push.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-push.test.ts#L1)
- [`src/compiler/ts/host-kernel-texture.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel-texture.test.ts#L2)
- [`src/compiler/ts/host-kernel.test.ts:3`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/host-kernel.test.ts#L3)
- [`src/compiler/ts/kernel-loops.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/kernel-loops.test.ts#L2)
- [`src/compiler/ts/kernel-project.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/kernel-project.test.ts#L2)
- [`src/compiler/ts/key-types.test.ts:3`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/key-types.test.ts#L3)
- [`src/compiler/ts/lower/collections.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/collections.ts#L2)
- [`src/compiler/ts/lower/function.ts:2363`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/function.ts#L2363)
- [`src/compiler/ts/lower/kernel-push.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/kernel-push.ts#L1)
- [`src/compiler/ts/lower/made-array/bounds.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/bounds.ts#L1)
- [`src/compiler/ts/lower/made-array/candidate.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/candidate.ts#L1)
- [`src/compiler/ts/lower/made-array/capacity.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/capacity.ts#L1)
- [`src/compiler/ts/lower/made-array/grown.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/grown.ts#L1)
- [`src/compiler/ts/lower/made-array/identity.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/identity.ts#L1)
- [`src/compiler/ts/lower/made-array/length.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/length.ts#L1)
- [`src/compiler/ts/lower/made-array/lower.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/lower.ts#L1)
- [`src/compiler/ts/lower/made-array/nest.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/nest.ts#L1)
- [`src/compiler/ts/lower/made-array/readable.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/readable.ts#L1)
- [`src/compiler/ts/lower/made-array/route.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/route.ts#L1)
- [`src/compiler/ts/lower/made-array/settle.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/settle.ts#L1)
- [`src/compiler/ts/lower/made-array/written.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/lower/made-array/written.ts#L1)
- [`src/compiler/ts/made-array-refusals.test.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/compiler/ts/made-array-refusals.test.ts#L2)
- [`src/core/cpu-runtime.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/cpu-runtime.ts#L1)
- [`src/core/host-arity.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-arity.ts#L1)
- [`src/core/host-kernel-counted.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel-counted.test.ts#L1)
- [`src/core/host-kernel-made.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel-made.ts#L1)
- [`src/core/host-kernel-made/capacity.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel-made/capacity.ts#L1)
- [`src/core/host-kernel-made/counted.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel-made/counted.ts#L1)
- [`src/core/host-kernel-made/growing.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel-made/growing.ts#L1)
- [`src/core/host-kernel-made/making.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel-made/making.ts#L1)
- [`src/core/host-kernel-made/on-resource.ts:2`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel-made/on-resource.ts#L2)
- [`src/core/host-kernel.ts:132`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/host-kernel.ts#L132)
- [`src/core/ir/kernels.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/kernels.ts#L1)
- [`src/core/passes/countable.test.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/countable.test.ts#L1)
- [`src/core/passes/countable.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/countable.ts#L1)
- [`src/core/passes/kernel-lower.ts:62`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/kernel-lower.ts#L62)
- [`src/core/passes/kernel-project.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/passes/kernel-project.ts#L1)
- [`src/core/push-count.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/push-count.ts#L1)
- [`src/core/pushed-index.ts:1`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/pushed-index.ts#L1)
- [`src/runtime/device.test.ts:12`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/device.test.ts#L12)
- [`src/runtime/resource-call.test.ts:10`](https://github.com/typeshade/typeshade/blob/af54ddad5/src/runtime/resource-call.test.ts#L10)

## 설명하는 절

커밋 af54ddad5의 언어 문서에서 이 규칙을 설명하는 절입니다.

- [§65 A loop that runs as a kernel](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/use-typeshade-surface.md#65-a-loop-that-runs-as-a-kernel)
- [§72 The common algorithms: `typeshade/algorithms`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/use-typeshade-surface.md#72-the-common-algorithms-typeshadealgorithms)

## 적용하는 오류 코드

규칙이 Enforced by 항목에서 가리키는 진단 코드와, 레지스트리 설명에서 이 규칙을 가리키는 진단 코드입니다.

**[`TS8020`](https://typeshade.dev/ko/reference/errors/ts8020/) `FUNCTION_SHAPE`**

TypeShade가 지원하지 않는 함수 선언이나 매개변수 모양입니다. 이름이나 본문이 없는 경우, 나머지 매개변수, 구조 분해 매개변수가 그렇습니다.

**[`TS8070`](https://typeshade.dev/ko/reference/errors/ts8070/) `KERNEL_LOOP_ON_CPU`**

독립성 증명이 거부한 커널 함수의 루프에 대한 경고입니다. 이 루프는 CPU에서 실행됩니다([규칙 8.22](https://typeshade.dev/ko/reference/rules/8-22/)). 메시지가 막는 줄과 이름, 그리고 고칠 방법을 알려 줍니다. 어느 쪽이든 프로그램은 올바릅니다.

**[`TS8080`](https://typeshade.dev/ko/reference/errors/ts8080/)**

Retired by change 0142 (VALUE\_ARRAY\_WRITE\_LOST): TS8080 was the refused write to an array parameter that no `return` carries back (change 0138, Amendment A15); change 0142 makes an array parameter the caller's object, so such a write is the program's meaning and no refusal has a true text.

**[`TS8099`](https://typeshade.dev/ko/reference/errors/ts8099/) `UNSUPPORTED`**

자기 코드를 받을 만하지 않은 진단을 위한 포괄 코드입니다. 순차 범위 뒤인 TS8099에 따로 둡니다.

## 함께 보기

- [규칙 8.22](https://typeshade.dev/ko/reference/rules/8-22/) 테스트
- [규칙 8.24](https://typeshade.dev/ko/reference/rules/8-24/) 테스트
- [규칙 8.8](https://typeshade.dev/ko/reference/rules/8-8/)
- [규칙 8.21](https://typeshade.dev/ko/reference/rules/8-21/)
- [규칙 8.25](https://typeshade.dev/ko/reference/rules/8-25/)
- [규칙 11.8](https://typeshade.dev/ko/reference/rules/11-8/)
- [규칙 12.4](https://typeshade.dev/ko/reference/rules/12-4/)
- [규칙 12.6](https://typeshade.dev/ko/reference/rules/12-6/)
- [설계 규칙](https://typeshade.dev/ko/reference/rules/)
- [오류 코드](https://typeshade.dev/ko/reference/errors/)

## 소스

커밋 af54ddad5의 규칙 원문:

- [`docs/language-design.md:1125`](https://github.com/typeshade/typeshade/blob/af54ddad5/docs/language-design.md#L1125) (설계 문서)
- [`reqs/rules/RULE-0823.md`](https://github.com/typeshade/typeshade/blob/af54ddad5/reqs/rules/RULE-0823.md) (추적 항목)
