aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 19:14:08 +0100
committereunhhu <[email protected]>2026-10-05 19:14:08 +0100
commitb5c275f6b908aad08b98bc0cc643f8602ebfb157 (patch)
tree39e1e1e29321d7425154bdc10bade15cc519f1da /docs
parent8c0c409ec5032a39bf9181198a24f25cca90d5fb (diff)
downloadpure-b5c275f6b908aad08b98bc0cc643f8602ebfb157.tar.gz
pure-b5c275f6b908aad08b98bc0cc643f8602ebfb157.zip
Pointer induction (023): an inner count's access by a key affine in its round, in range for every round (its opening found it) and in a full list, reads its cell through a pointer, a phi at the loop's head: the column (read from the list) plus the key at round 0 times four where the loop opens, its key's step a round times four added at its latch. The key's nodes, in range, give up nowhere (no snapshot kept), so a key read by such accesses alone is not made; a list found by key alone with such an access is full where the tier begins (else the generic code runs the nest). matmul 23.0 to 14.2 ms (3.1x to 1.9x C)
module_tier's programs sweep lists by keys stepping with a round (in range or not, a list full or not)
Diffstat (limited to 'docs')
-rw-r--r--docs/design/023-optimizing-tier.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/design/023-optimizing-tier.md b/docs/design/023-optimizing-tier.md
index 6a4c23d..fa8065e 100644
--- a/docs/design/023-optimizing-tier.md
+++ b/docs/design/023-optimizing-tier.md
@@ -148,6 +148,14 @@ roots와 BFS만 기계어로 돈다. 나머지는 JIT의 값 모형이 거르거
거의 공짜다. 그래서 순서는 **포인터 귀납 변수**(아핀 키의 칸 주소를 루프의 φ로) 다음에, 그래도 비트의 분기가 남으면 **꽉 찬
경우의 사본**(키로만 찾는 리스트가 모두 꽉 찬 DENSE일 때의 루프 본문을 하나 더 내고 루프를 열 때 고른다). 같은 배열을 정적으로
둔 C는 3.8 ms(바깥 루프를 벡터로 묶는다), `natural.h`의 C는 7.5.
+- **포인터 귀납 변수**(했다): 안쪽 셈 루프가 여는 곳에서 범위가 증명된 접근 중, 키가 그 루프의 회차와 함께 아핀으로 움직이고
+ 리스트가 꽉 찬 것은 칸의 포인터를 루프 머리의 φ로 둔다. 시작은 루프를 열 때 열의 주소(리스트에서 읽는다: 열을 레지스터에 두지
+ 않게) 더하기 회차 0의 키 곱하기 4, 보폭은 키를 회차로 미분한 값 곱하기 4(합과 차는 양쪽의, 곱은 움직이는 쪽의 것에 다른 쪽을
+ 곱한다)이고, 래치에서 더한다. 접근은 키를 읽지 않으므로 키의 계산이 다른 곳에서 안 읽히면 죽는다(범위가 증명된 키의 노드는
+ 스냅숏도 없다). 키로만 찾는 리스트에 이런 접근이 있으면 계층은 그 리스트를 꽉 찬 것으로 받는다: 꽉 차지 않았거나 HASHED면
+ 계층이 시작하는 곳에서 일반 코드가 그 묶음을 돈다(읽는 키가 모두 있어도 다른 곳이 비면 그렇다: 그때는 느려진다. 루프를 열 때
+ 읽을 키들만 있는지 보는 것이 다음이다). 행렬곱 23.0 ms에서
+ 14.2(C의 1.9배), 안쪽 루프의 명령 14개.
### 6. 표현 (바닥이 가정한 것)