aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-18 23:29:42 +0100
committereunhhu <[email protected]>2026-10-18 23:29:42 +0100
commitff2e0823e97d10477341192d72f5d9e61d9d5bad (patch)
treea882cce6e799ab2096ed3d3722e01ec357764e9b /docs
parent1d255b735e92c2d6b360ed5ea150a1e42f6dd535 (diff)
downloadpure-ff2e0823e97d10477341192d72f5d9e61d9d5bad.tar.gz
pure-ff2e0823e97d10477341192d72f5d9e61d9d5bad.zip
027's 4f-2: no fixed count of states: the header's u16 alone (PURE_MODULE_STATES gone); a module's transient and counted states are flags of each, the lists views and functions change or name sets of states (state_words words, a bit each), the verifier's walked lists a list with its length, duplicate names found by sorting them; an app's eighteen arrays of each state (values, texts, lists, the stored lists' slots, the last save's and the burst's, a reader's, an event's values and marks) in one block sized to its module, a replace laying the new module's apart and taking it once nothing can fail; the runtime's lists placed past any state (PURE_LIST_HEARD 0x10000), their slots after the states'; a snapshot's arrays sized so too; pure_app_read false without room (pure-serve then shows none); a save's drafts, values and the tree's revisions on the stack for 64 states, else on the heap; the JIT compiles modules of 32 states at most (its sets a word), the app's lists read through a pointer; a view reads the app's values as they are (no state changes in one), no copy of 32 a evaluation; unit test: 300 states loaded and the last counted; a hole closed: pure_app_stop read the arrays a failed start never laid; PureApp 4,256 bytes, not 8,504; counts: b39b against b38 with batches within 0.06%, without batches knapsack +0.49%, join +0.23%, the rest within 0.17%; the bank's queries (s38 and s39b in turns, three each) field -1.99%, found -1.18%, in_credit -1.10%, large -0.99%, the rest -0.58% to +0.11% (the first build, s39, copied a view's values at run time's size: in_credit +2.4%); 008 and 027
Diffstat (limited to 'docs')
-rw-r--r--docs/design/008-module-format.md8
-rw-r--r--docs/design/027-computation-core.md18
2 files changed, 23 insertions, 3 deletions
diff --git a/docs/design/008-module-format.md b/docs/design/008-module-format.md
index f67cc37..816d835 100644
--- a/docs/design/008-module-format.md
+++ b/docs/design/008-module-format.md
@@ -189,9 +189,11 @@ bool은 실행 중에 수의 칸에 든 0이나 1이고, i64는 같은 8바이�
## 로드할 때 검증하는 것
-- 머리말, 예약 바이트, 명령 패딩이 0인지. 한도(상태 32, 입력 32, 보기 64(열 포함), 핸들러 64, 명령 65,535,
- text 상수 4,096개·1 MiB, 메시지 필드 64, 이름 문자열 32 KiB)와 정확한 파일 크기. 명령과 상수는 모듈 크기에 맞춘
- 블록 하나에 담긴다(`PureModule`의 다른 표는 고정 크기로 13 KiB). 그래서 한도를 올려도 작은 앱의 메모리는 그대로다.
+- 머리말, 예약 바이트, 명령 패딩이 0인지. 한도(입력 32, 보기 64(열 포함), 핸들러 64, 명령 65,535,
+ text 상수 4,096개·1 MiB, 메시지 필드 64, 이름 문자열 32 KiB)와 정확한 파일 크기. 상태의 수는 머리말의 u16이 정할 뿐이다
+ (027의 4f-2). 명령과 상수, 그리고 상태·입력·보기·레코드 따위의 표는 모듈 크기에 맞춘 블록에 담긴다(4f-1). 앱이 상태마다
+ 가지는 배열도 모듈의 상태 수에 맞춘다. JIT은 상태가 32개까지인 모듈만 컴파일한다(그 집합이 한 단어의 비트다). 넘는 모듈은
+ 실행기가 모두 돈다. 걷기와 집계의 인자는 리스트를 8비트에 적으므로(아래 표) 그것이 도는 리스트는 상태 번호 256 아래다.
호스트는 모듈 파일을 크기대로 읽는다(`pure_module_read`).
- 이름은 ASCII 식별자 1–31바이트이고, 상태·레코드·입력·보기가 한 이름공간을 쓴다. 필드 이름은 메시지나
레코드 안에서 유일하다. 메시지 필드의 이름은 식별자를 점으로 이은 경로일 수 있고(그룹 `user` 안의 `user.name`), 한
diff --git a/docs/design/027-computation-core.md b/docs/design/027-computation-core.md
index 5951f1f..1d41488 100644
--- a/docs/design/027-computation-core.md
+++ b/docs/design/027-computation-core.md
@@ -435,6 +435,24 @@
- 명령 수(b38 대 b37): 묶음과 함께 BFS −0.24%, matmul −0.21%, 나머지 ±0.1% 안이다. 실행기만은 matmul −0.45%, join +0.36%,
knapsack +0.28%, BFS −0.25%, roots 0.00%다. 은행 질의(s37과 s38, 같은 aup 모듈을 한 번에 번갈아 세 번의 중앙값)는 field −0.68%,
found −0.51%, large −0.47%, none −0.20%, in_credit −0.19%, ranks −0.12%, per_branch −0.11%다.
+ - **4f-2 만듦(2026-10-18).** 상태의 수는 머리말의 u16이 정할 뿐이다(`PURE_MODULE_STATES`가 없어졌다).
+ - 모듈: transient와 앱이 세는 상태(memory 예산의 것)는 상태마다의 표시이고, 보기와 함수가 바꾸거나 이름하는 리스트는 상태의
+ 집합(`state_words` 단어, 한 상태가 한 비트)이다. 검증기의 걷는 리스트는 길이를 가진 목록이다(걷기 하나가 그 리스트를 덧붙인다).
+ 이름공간의 겹침은 이름을 정렬해 찾는다(전에는 짝마다 견주었다).
+ - 앱: 상태마다의 배열 열여덟(값, text, 리스트, 저장 리스트의 슬롯 셋, 마지막 저장과 묶음의 것, 읽는 쪽의 것, 이벤트가 일하는
+ 값과 표시)이 모듈의 상태 수로 놓은 한 블록에 있다. 교체는 새 모듈의 블록을 따로 짓고, 실패할 수 없게 된 뒤 갈아 끼운다.
+ 런타임의 리스트(들은 번호, 보낼 것)의 자리는 상태의 번호 밖(`PURE_LIST_HEARD` = 0x10000)이고, 배열의 슬롯은 상태 뒤의 둘이다.
+ 스냅숏의 배열도 그 수다. `pure_app_read`는 그 수의 배열을 짓지 못하면 false다(serve는 그때 보이지 않는다).
+ - 저장: 커밋의 draft 목록, 값의 인코딩, 트리 커밋의 리비전은 몇(64) 상태까지 스택에, 넘으면 힙에 둔다.
+ - JIT: 그 집합이 한 단어의 비트라 상태가 32개까지인 모듈만 컴파일한다(넘으면 실행기). 리스트의 표를 앱 안의 배열이 아닌
+ 포인터로 읽는다.
+ - 보기의 평가는 앱의 값을 베끼지 않고 그대로 읽는다(보기는 상태를 바꾸지 못한다). 전에는 평가마다 32칸을 베꼈다.
+ - 시험: 단위 시험이 300개의 상태(집합 다섯 단어)를 가진 모듈을 로드하고 마지막 상태를 센다(JIT 없이). 실패한 시작이 놓지 않은
+ 배열을 `pure_app_stop`이 읽던 것을 고쳤다. `PureApp`은 8,504바이트에서 4,256바이트가 되었다. 코어 22,456 → 22,621줄.
+ - 명령 수(b39b 대 b38): 묶음과 함께 BFS +0.06%, 나머지 ±0.01% 안이다. 실행기만은 knapsack +0.49%, join +0.23%, BFS +0.16%,
+ roots −0.16%, matmul +0.11%다. 은행 질의(s38과 s39b를 한 번에 번갈아 세 번)는 field −1.99%, found −1.18%, in_credit −1.10%,
+ large −0.99%, per_branch −0.58%, ranks −0.43%, none +0.11%다. 첫 빌드(s39)는 in_credit +2.4%, per_branch +1.4%였다(보기의
+ 평가가 실행 시 크기로 상태 값을 베꼈다). 그 베끼기를 없앤 것이 위다.
- **차례의 까닭.**
- 4a는 작고, 3단계의 끝을 맺는다.
- 4b는 가장 많이 지운다. 키 있는 메시지와 기준 리비전이 사라지면 4d가 단순해진다.