규칙 11.20
11장, 대상과 오라클 테스트
A common module is a shader package the compiler repository publishes under a typeshade/<name> subpath: typeshade/algorithms and typeshade/random (change 0072). Every function of it is written in "use typeshade". Every function of it gives, on WebGPU, on WebGL2 and on the CPU tier, the bits the CPU oracle gives, under the determinism report’s rows (Rule 11.5), and the differential gate holds that. Every kernel function of it satisfies the planner’s facts (Rule 11.13), so that it fuses with its neighbours in a fuse scope. A common module imports typeshade/runtime and its sibling modules, and nothing of the compiler. The subpath serves two faces (change 0024): a "use typeshade" file imports the shader module under the typeshade condition, and host code imports the host face under default, which the compiler repository bakes from the shader module with the function the Vite plugin and tshc run.
규칙 본문과 그 아래 항목은 설계 문서에 적힌 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
근거
two hosts built on the compiler each wrote the same copy, maps, reductions, scan and random draw, with their own tests on their own tiers, and a fix in one reached neither the other nor the compiler. A module here inherits the oracle as its reference implementation, the differential gate and the change control, and proves that the language can write its own library, as C’s libc is written in C. A kernel function cannot carry a builtin’s name (it is then no kernel function), so a map or a reduction named <op>Map or <op>All in the shader module is exported by the host face under the builtin’s name (change 0072, Amendment 1).
출처
change 0072 in changes/, with its Amendment 1; Rule 11.5; Rule 11.8; Rule 11.13; change 0024 (the typeshade condition).
검증 방식
테스트로 확인합니다. 테스트나 게이트 스크립트, CI 워크플로가 이 규칙을 가리키고, 아래 파일 가운데 하나라도 규칙을 더는 가리키지 않으면 추적 검사가 실패합니다.
컴파일러가 이 규칙을 적용하는 곳을 규칙이 직접 적은 내용입니다.
scripts/bake-common-modules.ts, which bakes face.ts, view.ts and index.ts of each module from its index.shade.ts, and src/common-modules.test.ts, which holds the baked files to the bake, each function to its contract on the CPU tier, fillUniform to generator(seed), and the facts of each face to the planner’s grouping; scripts/gpu-differential.ts, whose common-module arm runs every function of both modules on WebGPU and on WebGL2 against the f32 oracle; scripts/bundle-boundary.ts, which holds each host face to src/runtime/ and src/core/ and to its budget in scripts/bundle-budget.json; src/api-surface.test.ts and src/api-doc-coverage.test.ts, which read the two subpaths.
커밋 91c2fe31에서 이 규칙을 확인하는 파일입니다. 파일마다 규칙을 처음 가리키는 줄로 연결했습니다.
설명하는 절
커밋 91c2fe31의 언어 문서에서 이 규칙을 설명하는 절입니다.
함께 보기
소스
커밋 91c2fe31의 규칙 원문:
docs/language-design.md:1401(설계 문서)reqs/rules/RULE-1120.md(추적 항목)