규칙 11.7
이 페이지에서

규칙 11.7

11장, 대상과 오라클 테스트

The CPU tier, which runs a host call of a module’s function and, where there is no GPU tier, the invocations of an entry a host calls and the pixels of a fragment entry a host draws (Rule 8.24), is the oracle’s generated code (generateModuleJs) at f32 precision, written into the module the bundler reads as module code, with no new Function, over the op library alone, typeshade/runtime/internal.

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

근거

a host call computes what the GPU would, so it rounds as f32 does, which the default f64 algebra oracle is blind to by construction. The generated code computes each operation as the interpreter’s runtime helper does: a vector operation of a known width, on operands nothing can leave missing, is written one component at a time, each the scalar operation the helper applies to it (dot, length, distance, normalize and cross summed in the order their entries sum), and every other operation, one on an operand that may be missing (a helper’s discard, an element read past an array’s end) among them, calls the helper itself; src/core/cpu-codegen.test.ts holds the two to each other bit for bit in both precisions, so the tier is the oracle and not a fourth implementation (Rule 11.1). Building it with new Function at run time would need unsafe-eval, which a strict content security policy forbids, and would ship the IR and the generator; as module code it is minified with the application, and the application ships the op library only.

출처

change 0009 in changes/ (“The CPU tier’s precision”); src/core/oracle.ts (the 'f32' mode, “a correctly-rounding f32 machine over the same IR”); Rule 11.1.

검증 방식

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

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

hostFace in src/compiler/ts/host-face.ts, which generates at precision: 'f32', and src/core/host-runtime.ts, what a generated module imports through typeshade/runtime/internal; pinned by src/compiler/ts/host-face.test.ts, where every call equals compileModule(m, { precision: 'f32' }) on inputs chosen so the f32 and f64 answers part, and the generated module holds no new Function.

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

설명하는 절

커밋 c66579bf의 표면 문서에서 이 규칙을 설명하는 절입니다.

함께 보기

소스

커밋 c66579bf의 규칙 원문:

이 페이지 편집 문제 보고