flatsql 2.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +76 -64
- package/dist/artifacts/index.d.ts +1 -3
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +1 -3
- package/dist/artifacts/index.js.map +1 -1
- package/dist/response/artifact.d.ts +1 -2
- package/dist/response/artifact.d.ts.map +1 -1
- package/dist/response/artifact.js.map +1 -1
- package/dist/response/types.d.ts +6 -0
- package/dist/response/types.d.ts.map +1 -1
- package/dist/stress/index.d.ts +0 -1
- package/dist/stress/index.d.ts.map +1 -1
- package/dist/stress/index.js +0 -1
- package/dist/stress/index.js.map +1 -1
- package/dist/stress/native-publish-event-workload.d.ts.map +1 -1
- package/dist/stress/native-publish-event-workload.js +14 -4
- package/dist/stress/native-publish-event-workload.js.map +1 -1
- package/dist/stress/smoke-runner.d.ts.map +1 -1
- package/dist/stress/smoke-runner.js +6 -5
- package/dist/stress/smoke-runner.js.map +1 -1
- package/docs/PARTITION-STORE-WASM.md +241 -0
- package/docs/PARTITION-STORE.md +635 -0
- package/package.json +61 -22
- package/wasm/flatsql-io.js +4 -1
- package/wasm/flatsql-ps-threads.wasm +0 -0
- package/wasm/flatsql-wasi-noeh.wasm +0 -0
- package/wasm/flatsql-wasi.wasm +0 -0
- package/wasm/flatsql.js +1 -1
- package/wasm/flatsql.wasm +0 -0
- package/wasm/index.d.ts +2 -0
- package/wasm/index.js +16 -1
- package/wasm/integrity.json +28 -0
- package/wasm/ps-node-fault.d.mts +23 -0
- package/wasm/ps-node-fault.mjs +381 -0
- package/wasm/ps-node-guest.mjs +156 -0
- package/wasm/ps-node-host.d.mts +86 -0
- package/wasm/ps-node-host.mjs +431 -0
- package/wasm/ps-node-imports.mjs +847 -0
- package/wasm/ps.d.ts +21 -0
- package/wasm/ps.js +75 -0
- package/dist/artifacts/builder.d.ts +0 -31
- package/dist/artifacts/builder.d.ts.map +0 -1
- package/dist/artifacts/builder.js +0 -514
- package/dist/artifacts/builder.js.map +0 -1
- package/dist/artifacts/demo-extractors.d.ts +0 -15
- package/dist/artifacts/demo-extractors.d.ts.map +0 -1
- package/dist/artifacts/demo-extractors.js +0 -238
- package/dist/artifacts/demo-extractors.js.map +0 -1
- package/dist/artifacts/standalone-builder.d.ts +0 -62
- package/dist/artifacts/standalone-builder.d.ts.map +0 -1
- package/dist/artifacts/standalone-builder.js +0 -144
- package/dist/artifacts/standalone-builder.js.map +0 -1
- package/dist/artifacts/worker-client.d.ts +0 -32
- package/dist/artifacts/worker-client.d.ts.map +0 -1
- package/dist/artifacts/worker-client.js +0 -415
- package/dist/artifacts/worker-client.js.map +0 -1
- package/dist/core/database.d.ts +0 -86
- package/dist/core/database.d.ts.map +0 -1
- package/dist/core/database.js +0 -900
- package/dist/core/database.js.map +0 -1
- package/dist/core/index.d.ts +0 -3
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -3
- package/dist/core/index.js.map +0 -1
- package/dist/core/table-store.d.ts +0 -30
- package/dist/core/table-store.d.ts.map +0 -1
- package/dist/core/table-store.js +0 -187
- package/dist/core/table-store.js.map +0 -1
- package/dist/flatbuffer-accessor.d.ts +0 -35
- package/dist/flatbuffer-accessor.d.ts.map +0 -1
- package/dist/flatbuffer-accessor.js +0 -114
- package/dist/flatbuffer-accessor.js.map +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/stress/publish-event-workload.d.ts +0 -3
- package/dist/stress/publish-event-workload.d.ts.map +0 -1
- package/dist/stress/publish-event-workload.js +0 -467
- package/dist/stress/publish-event-workload.js.map +0 -1
- package/wasm/flatsql-artifact.worker.js +0 -847
- package/wasm/standalone.d.ts +0 -122
- package/wasm/standalone.js +0 -914
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# FlatSQL partition store: the wasm artifact and the Node host (T4)
|
|
2
|
+
|
|
3
|
+
The partition store engine (docs/PARTITION-STORE.md, T1 and T2) built as one
|
|
4
|
+
`wasm32-wasip1-threads` artifact, `wasm/flatsql-ps-threads.wasm`, and the
|
|
5
|
+
Node host that runs it and the engine's test suites with real threads. The
|
|
6
|
+
design is the stack's `docs/architecture/flatsql-partition-store.md`: §5.5,
|
|
7
|
+
§5.6, §18 T4 and the §22 amendments naming T4 (A1, A34, 22.3a-6/7). This file
|
|
8
|
+
records what was built, how to run it, the measured acceptance, and every
|
|
9
|
+
departure from the design.
|
|
10
|
+
|
|
11
|
+
## 1. The artifact
|
|
12
|
+
|
|
13
|
+
| | |
|
|
14
|
+
|---|---|
|
|
15
|
+
| Build | `bash scripts/build-wasm.sh --ps` (artifact) or `--ps-tests` (plus the test commands). CMake: `cpp/cmake/wasi-threads-toolchain.cmake` and `cpp/cmake/flatsql_ps_wasm.cmake`, included from `cpp/CMakeLists.txt` only under the WASI toolchain. Engine and test sources are globbed (`src/ps/*.cpp`, `test/ps/*_test.cpp`), so files other tasks add build here unchanged. |
|
|
16
|
+
| Toolchain | wasi-sdk 30.0 (clang 21.1.4), target `wasm32-wasip1-threads`, `-pthread -matomics -mbulk-memory -fno-exceptions`, Release (`-O3 -DNDEBUG`), `-ffile-prefix-map` for the source, flatbuffers and SDK paths, `--strip-debug`. The build script refuses any other wasi-sdk version. |
|
|
17
|
+
| Bytes | The released artifact is the Linux wasi-sdk 30 build: Linux arm64 (Docker) and the x86_64 CI runner produce the same sha256 from different checkout paths. The macOS wasi-sdk 30 tarball ships a different sysroot (libc, libc++), compiler-rt and clang build and links different (equivalent) bytes; on macOS `bash scripts/build-wasm.sh --ps --linux` builds the released bytes in Docker (the Linux tarball, sha256-pinned). `npm-publish.yml` rebuilds and refuses to publish unless the build equals the committed file; CI warns when it differs. `wasm/integrity.json` holds the sha256, sha384 SRI and size of every shipped wasm (`scripts/write-integrity.mjs`, `npm run check:integrity`). |
|
|
18
|
+
| Shape | A reactor (`-mexec-model=reactor`). A host instantiates one instance per writer or reader instance; every guest thread is a new instance of the same module over the same shared memory. |
|
|
19
|
+
| Imports | `wasi_snapshot_preview1`: `clock_time_get fd_close fd_prestat_dir_name fd_prestat_get fd_seek fd_write proc_exit random_get sched_yield` (all provided by the SDK's browser and Node pool hosts); `wasi.thread-spawn`; `env.memory` (shared, 512 initial, 32768 maximum pages); the seven `env.flatsql_io_*`. Nothing else: `scripts/check-wasm-imports.mjs` and `test/standalone-wasm-imports.test.ts` fail on any change. |
|
|
20
|
+
| Exports | `flatsql_ps_init start stop pump wake layout reader_layout stats register_type register_partition ring` (docs/PARTITION-STORE.md §6), `flatsql_ps_alloc`/`flatsql_ps_free` (host-owned buffers for config TLVs and paths), `wasi_thread_start`, `_initialize`, `memory`. |
|
|
21
|
+
| SQLite | The lanes' SQL layer (ruling 1): `SQLITE_THREADSAFE=2`, `DEFAULT_MEMSTATUS=0`, `OMIT_WAL`, `TEMP_STORE=3`, `SQLITE_OS_OTHER`. No unix VFS (it would import WASI file calls): `src/ps/capi_wasm.cpp` registers a default VFS that opens no file, and installs pthread mutexes, because `SQLITE_OS_OTHER` compiles only no-op ones. The lanes open `:memory:` on `flatsql_ps_null` as natively. |
|
|
22
|
+
| Threads | `std::thread` defaults to 1 MiB stacks (wasi-libc's default is 128 KiB and a shadow stack has no guard page); lanes set their own (`ReaderConfig::stackBytes`). `sleepNs` is a timed `memory.atomic.wait32`, so the artifact never imports `poll_oneoff`. |
|
|
23
|
+
| Guard | `assertPthreadArtifact` (space-data-module-sdk 0.8.24) passes: shared memory, 1,636 atomic instructions, the wasi-threads contract, no emscripten thread hooks. |
|
|
24
|
+
|
|
25
|
+
### Host obligations
|
|
26
|
+
|
|
27
|
+
- Create `env.memory` shared, with a maximum no larger than the import's
|
|
28
|
+
(browser writer 256 MiB, reader 128 MiB, design §5.5).
|
|
29
|
+
- Grow the heap before `flatsql_ps_start` when threads will allocate (alloc
|
|
30
|
+
then free a large block through `flatsql_ps_alloc`/`flatsql_ps_free`): V8
|
|
31
|
+
(Node 20–25, and browsers) refreshes each thread's view of a shared memory's
|
|
32
|
+
size lazily, so a thread touching memory another thread has just grown can
|
|
33
|
+
trap. WasmEdge is not affected.
|
|
34
|
+
- Give every guest thread a distinct `tid` below 2^29 (wasi-libc keeps it in
|
|
35
|
+
mutex words).
|
|
36
|
+
|
|
37
|
+
## 2. The Node host (design §5.6)
|
|
38
|
+
|
|
39
|
+
`wasm/ps-node-host.mjs` (types `ps-node-host.d.mts`), with
|
|
40
|
+
`ps-node-guest.mjs`, `ps-node-imports.mjs` and `ps-node-fault.mjs`. Node 24+,
|
|
41
|
+
optional peer dependency `space-data-module-sdk` ≥ 0.8.24.
|
|
42
|
+
|
|
43
|
+
- **Supervisor.** The main thread never runs guest code. The guest's own
|
|
44
|
+
thread (`_start` for a command, the exec thread for a reactor instance) is a
|
|
45
|
+
worker; so is every guest thread.
|
|
46
|
+
- **wasi.thread-spawn** claims a pre-started worker from a pool the supervisor
|
|
47
|
+
keeps (16 warm, grown on demand to a cap of 512). The claim is a CAS on the
|
|
48
|
+
pool's SharedArrayBuffer and needs no event loop, so any guest thread can
|
|
49
|
+
spawn, and workers are reused: a crash harness that starts and stops engines
|
|
50
|
+
12,000 times runs on 17 workers. Tids come from one shared counter.
|
|
51
|
+
- **flatsql_io** is the SDK's Node sync-fs provider (`createNodeSyncFsIo`: a
|
|
52
|
+
virtual-handle table in a SharedArrayBuffer, lazily opened fds per worker,
|
|
53
|
+
`fdatasync`/`F_FULLFSYNC`, `CREATE_PARENTS`, `UNLINK_IF_UNUSED`, A23
|
|
54
|
+
revocation) over the host root.
|
|
55
|
+
- **WASI preview1** is the host's own: a descriptor table in a
|
|
56
|
+
SharedArrayBuffer (a descriptor opened on one thread works on all, as in a
|
|
57
|
+
process), preopens, process-wide clocks (`process.hrtime`; a worker's
|
|
58
|
+
`performance.now()` has its own origin, which would break the engine's
|
|
59
|
+
cross-thread time comparisons), seeded `random_get` in deterministic mode,
|
|
60
|
+
`poll_oneoff` clock waits, `proc_exit` from any thread ending the guest.
|
|
61
|
+
- **File system.** `root` is the guest's "/" for WASI and for flatsql_io;
|
|
62
|
+
`mounts` preopen more host directories (the CLI mounts the checkout at its
|
|
63
|
+
own path so the test commands find their vectors). Default: a private
|
|
64
|
+
temporary root, removed afterwards.
|
|
65
|
+
- **Faults.** A guest thread that traps writes the trap to stderr from its own
|
|
66
|
+
worker and sets a shared fault word; the supervisor ends the run (the thread
|
|
67
|
+
that would join the dead one may be blocked forever).
|
|
68
|
+
- **API.** `runPsCommand(wasm, options)` (commands: exit code, kill, timeout,
|
|
69
|
+
thread report); `createPsNodeInstance(wasm, options)` (one artifact instance:
|
|
70
|
+
`call`, `write`, `read`, `threads`, `close`); CLI `node wasm/ps-node-host.mjs
|
|
71
|
+
<command.wasm> [args]`.
|
|
72
|
+
|
|
73
|
+
### Fault overlay (§19, 22.3a-7)
|
|
74
|
+
|
|
75
|
+
`wasm/ps-node-fault.mjs`: a SharedArrayBuffer page table every worker
|
|
76
|
+
consults, interposed under the SDK provider's syscalls. It records the
|
|
77
|
+
pre-image of every 4 KiB page written since the file's last sync (pages wholly
|
|
78
|
+
past the synced size need none), the synced size, and files created since
|
|
79
|
+
their parent directory's last sync. The supervisor freezes it (later mutating
|
|
80
|
+
calls fail with EIO), stops the guest, and applies a crash: `dropAll` (every
|
|
81
|
+
unsynced page and size change undone, unsynced directory entries gone),
|
|
82
|
+
`pageSubset` (each unsynced page survives or not, in any order; the size is
|
|
83
|
+
the synced or the current one), `keepAll` (kill -9). Overflowing its page
|
|
84
|
+
budget fails the crash instead of making it partial.
|
|
85
|
+
|
|
86
|
+
## 3. Test commands
|
|
87
|
+
|
|
88
|
+
| Command | Contents |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `cpp/build-ps-wasm/flatsql-ps-test.wasm` | `flatsql_ps_test` (every test in `cpp/test/ps`) as a wasi-threads command; host I/O through the seven imports. `--list` prints the tests. |
|
|
91
|
+
| `cpp/build-ps-wasm/flatsql-ps-test-memio.wasm` | The same command with the seven functions defined in the guest (`test/ps/wasm_io_stub.cpp`, all ACCESS): imports only WASI, thread-spawn and memory, so a WASI-only host (the SDK WasmEdge C runner) runs every in-memory test. |
|
|
92
|
+
|
|
93
|
+
Added tests (`PS_SLOW_TEST`, run only when named): `parity_canonical_dump`,
|
|
94
|
+
`parity_deterministic_bytes` (`cpp/test/ps/parity_test.cpp`) and
|
|
95
|
+
`host_crash_ingest` / `host_crash_verify` (`host_crash_test.cpp`). The wasm
|
|
96
|
+
test main grows the heap by 1,536 MiB before any thread starts
|
|
97
|
+
(`PS_WASM_HEAP_MB`).
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
npm run build:wasm:ps-tests # artifact + test commands
|
|
101
|
+
node wasm/ps-node-host.mjs cpp/build-ps-wasm/flatsql-ps-test.wasm --test=lane_
|
|
102
|
+
npm run test:ps-wasm # scripts/ps-wasm-suite.mjs: every default test + 1,000 crashes
|
|
103
|
+
FLATSQL_PS_WASM_SUITE=1 npm test -- test/ps-node-threads.test.ts
|
|
104
|
+
npm test -- test/ps-host-fault.test.ts test/ps-parity-vectors.test.ts
|
|
105
|
+
FLATSQL_PS_WASMEDGE=1 npm test -- test/ps-parity-vectors.test.ts # + the C runner lane
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 4. Acceptance (§18 T4 as amended)
|
|
109
|
+
|
|
110
|
+
Machine: the owner's Mac Studio (Darwin 25.3.0, arm64, 28 hardware threads,
|
|
111
|
+
APFS), Node 25.4.0, shared with other lanes: 1-minute load average 18–25
|
|
112
|
+
during these runs. Native builds RelWithDebInfo; wasm builds as §1.
|
|
113
|
+
|
|
114
|
+
| # | Acceptance | Result |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| 1 | Imports exactly WASI p1 + `wasi.thread-spawn` + shared `env.memory` (≤ 32768 pages) + the 7 `env.flatsql_io_*`; exports `wasi_thread_start`; 0 emscripten imports; passes `assertPthreadArtifact` | **Pass.** §1 table; `scripts/check-wasm-imports.mjs`, `test/standalone-wasm-imports.test.ts` (the SDK guard runs in a child process). |
|
|
117
|
+
| 2 | The T1 and T2 suites, including 1,000 fault crashes, pass under the Node host with distinct OS thread ids ≥ writers + lanes | **Pass.** `scripts/ps-wasm-suite.mjs`: all 53 default-suite tests, each in its own guest process, plus `crash_faults_T1_1 --crash-trials=1000` (1,000 trials over the five modes, 298,923 acked records verified, 41.8 s). `readers_under_saturating_writers_T2_1` (8 writers, 16 lanes) ran 54 guest threads at once on 54 distinct worker (OS) threads. `test/ps-node-threads.test.ts`: the shipped artifact as a writer instance (4 writers) and a reader instance (4 lanes), each running thread on its own worker. `writer_backpressure_flood_T1_5` runs with `--bp-samples=40` (deviation 3). `crash_faults_T1_1_full` (10,000 trials, 64 types, 256 partitions): §4.1. |
|
|
118
|
+
| 3 | Parity: canonical dumps (by (pid, pseq)) and query results identical native vs Node; deterministic mode byte-identical across native, Node and the SDK WasmEdge C runner (patched 0.16.4) | **Pass.** Canonical dump, 4 writers, 11,313 lines (rows, counters, lane counters and six queries, partition and type level): sha256 `f3b419a2…` natively and under Node, three runs each. Deterministic mode, 122 files: in memory `e7ab8592…` natively, under Node and under the C runner (18.7 s, interpreted); on the host's files `c7e34c55…` natively and under Node. `test/ps-parity-vectors.test.ts`. |
|
|
119
|
+
| 4 | A published npm version with provenance; the wasm sha256 in `integrity.json`; `npm ls sql.js` empty; the package root exports only the wasm bindings | See §6 and the release record in §4.2. |
|
|
120
|
+
|
|
121
|
+
Host-level crashes (the overlay, §2): `test/ps-host-fault.test.ts` kills the
|
|
122
|
+
guest mid-ingest at a random 0.4–2.0 s, crashes the store in the three modes
|
|
123
|
+
in turn and verifies every acked record (bytes by CID), gap-free pseqs,
|
|
124
|
+
counters and 0 `d-*` bytes read at open; 9 cycles, half of them with the A8
|
|
125
|
+
journal. A negative control (half a data segment cut off) fails the verifier.
|
|
126
|
+
|
|
127
|
+
### 4.1 Slow runs
|
|
128
|
+
|
|
129
|
+
- `crash_faults_T1_1_full` under the Node host (10,000 trials, 64 types, 256
|
|
130
|
+
partitions, the five crash modes, an A4 second crash every other trial, half
|
|
131
|
+
the stores journaled): pass in 377 s; 2,122,844 acked records verified,
|
|
132
|
+
410,159 merges, 1,167,880 journal records replayed, 125,016 guest threads
|
|
133
|
+
spawned on 10 pooled workers. Mac, load 24 rising to 35 during the run
|
|
134
|
+
(natively 243 s).
|
|
135
|
+
- The whole default suite under the host, one guest process per test:
|
|
136
|
+
155 s of test time; the most concurrent guest threads was 54
|
|
137
|
+
(`readers_under_saturating_writers_T2_1`), each on its own worker thread;
|
|
138
|
+
the largest guest memory 1,902 MiB (the 1,536 MiB pre-grown heap included).
|
|
139
|
+
- Deterministic vector under the C runner: 18.7 s interpreted (0.12 s natively).
|
|
140
|
+
|
|
141
|
+
### 4.2 Release
|
|
142
|
+
|
|
143
|
+
Filled in when the release is published.
|
|
144
|
+
|
|
145
|
+
## 5. Design deviations
|
|
146
|
+
|
|
147
|
+
1. **The Node host's thread spawn is its own pool, not the SDK's Node
|
|
148
|
+
branch** (§5.6: "The SDK's Node branch (lazy worker_threads) runs the guest
|
|
149
|
+
threads"). `createWasiThreadSpawn` (0.8.24) removes a finished worker only on
|
|
150
|
+
its `exit` event, which runs on the spawning thread's event loop; that
|
|
151
|
+
thread is inside the guest, blocked, for the whole command. After `poolSize`
|
|
152
|
+
spawns every later spawn is declined, and without a pool the finished
|
|
153
|
+
threads are never joined. The crash harness spawns more than 12,000 guest
|
|
154
|
+
threads per run. The host keeps a pool whose idle/assign handshake is a
|
|
155
|
+
SharedArrayBuffer CAS, so no event loop is involved and any thread can
|
|
156
|
+
spawn. Reported to the module-sdk lane (SDK 0.8.25); the SDK's Node sync-fs
|
|
157
|
+
flatsql_io provider is used as designed.
|
|
158
|
+
2. **WASI is the host's own**, not the SDK shim: the shim keeps descriptors
|
|
159
|
+
and clocks per worker (a worker's `performance.now()` has its own origin),
|
|
160
|
+
has no preopens and no `poll_oneoff`. The artifact itself imports only names
|
|
161
|
+
the SDK shim provides (§1), so browser hosts are unaffected.
|
|
162
|
+
3. **The flood test runs 40 samples under wasm32** (`--bp-samples=40`, default
|
|
163
|
+
150): its in-memory host keeps every flooded byte twice for as long as the
|
|
164
|
+
timed measurement lasts (12 GB resident natively with 150 samples), past
|
|
165
|
+
wasm32's 4 GiB. Its ring, credit, pool and zero-loss checks are unchanged;
|
|
166
|
+
the ack-p99 ratio is reported (1.066) and, as on any box with fewer than 8
|
|
167
|
+
hardware threads, not enforced: WASI reports one CPU. The same holds for the
|
|
168
|
+
T2 latency bounds (`latencyBoxQuiet` is false under wasm): they are native
|
|
169
|
+
Linux-8 acceptance numbers. `lane_needs_bulk_under_1ms_zero_rows_T2_4`
|
|
170
|
+
enforced its 1 ms p99 on every machine; it now follows the same rule
|
|
171
|
+
(enforced on a quiet box, reported elsewhere) after a Debug build on the
|
|
172
|
+
loaded 3-vCPU macOS CI runner and the Node host on the Linux runner
|
|
173
|
+
measured past it. Its status, rows and examined counts are enforced
|
|
174
|
+
everywhere. `type_arrivals_segments_and_fence_A15` caps type commits at 40
|
|
175
|
+
rows: a slow type owner labeled more than 40 rows in one commit and filled
|
|
176
|
+
an empty arrivals segment past its 40-entry seal (a batch never splits
|
|
177
|
+
across segments), which failed on the macOS runner (main 8aea463) and
|
|
178
|
+
under the Node host.
|
|
179
|
+
4. **The C runner lane runs the memio command.** The SDK's WasmEdge
|
|
180
|
+
wasi-threads C runner provides WASI and thread-spawn only, so the byte
|
|
181
|
+
vectors there use the in-memory host, which is also compared natively and
|
|
182
|
+
under Node; the host-file vector is compared natively and under Node.
|
|
183
|
+
Adding flatsql_io to the runner (as the SDN C host module does) is an SDK
|
|
184
|
+
change.
|
|
185
|
+
5. **Parity inputs are built deterministically.** A fixture expression such
|
|
186
|
+
as `a + b * c` is contracted to a fused multiply-add on arm64 and not in
|
|
187
|
+
wasm, which changes the input bytes (1 ULP), not the engine's output; the
|
|
188
|
+
parity workload builds its frames from exact doubles. `buildRecordAttr`
|
|
189
|
+
(`src/ps/writer_pool.cpp`) creates its strings inside one call's argument
|
|
190
|
+
list, whose evaluation order C++ leaves unspecified: GCC on x86_64 builds
|
|
191
|
+
them in the opposite order from clang and from GCC on arm64, so the same
|
|
192
|
+
attributes serialize to different bytes (measured on the CI runner and under
|
|
193
|
+
x86_64 emulation). The parity workload builds its attributes in a fixed
|
|
194
|
+
order; the helper itself belongs to the writer files T3 holds (reported). The canonical dump masks
|
|
195
|
+
`kRowAttrInM` (where attributes are stored until a merge moves them, like
|
|
196
|
+
offsets) and injects the engine's wall clock (TOMB arrival times).
|
|
197
|
+
6. **Deterministic mode injects both clocks in the guest** (`setTestClock`,
|
|
198
|
+
`src/ps/platform.cpp`): the store UUID hashes the monotonic clock, and a
|
|
199
|
+
frozen clock keeps every time-based trigger out of the byte stream. A host
|
|
200
|
+
running the artifact deterministically injects `clock_time_get` and
|
|
201
|
+
`random_get` instead (the Node host's `deterministic` option seeds
|
|
202
|
+
`random_get`).
|
|
203
|
+
7. **A wasm32 defect fixed in the lane arena**: the 256 GiB request bound was
|
|
204
|
+
`size_t(1) << 38`, undefined where `size_t` is 32 bits; every lane
|
|
205
|
+
allocation failed and every lane died at `sqlite3_open`.
|
|
206
|
+
|
|
207
|
+
## 6. Package 3.0.0 (A1, A34)
|
|
208
|
+
|
|
209
|
+
Semver-major (A34). The package root is the wasm bindings: `wasm/index.js`
|
|
210
|
+
(the SQLite engine, as `flatsql/wasm`) plus the partition store locator
|
|
211
|
+
(`getFlatSQLPsThreadsURL`, `loadFlatSQLPsThreads`,
|
|
212
|
+
`FLATSQL_PS_THREADS_SHA256`). New subpaths: `flatsql/ps-threads.wasm`,
|
|
213
|
+
`flatsql/ps/node-host`, `flatsql/ps/fault`, `flatsql/integrity.json`.
|
|
214
|
+
|
|
215
|
+
Removed (A1 ledger row T4):
|
|
216
|
+
|
|
217
|
+
| Removed | Replaced by |
|
|
218
|
+
|---|---|
|
|
219
|
+
| `src/core/` (the TS engine) and the root exports `FlatSQLDatabase`, `DirectAccessor`, `FlatcAccessor`, `TableStore` | the wasm engines |
|
|
220
|
+
| the `node:sqlite` artifact builder (`FlatSQLArtifactBuilder`, its worker) and the `flatsql/artifacts/standalone` builder | — |
|
|
221
|
+
| `wasm/standalone.js` and `flatsql/standalone` | `flatsql/ps/node-host` for the partition store. The legacy WASI engine's own tests keep a test-only copy (`test/support/legacy-standalone.js`, not shipped) until T8 retires that engine. |
|
|
222
|
+
| `sql.js`, and the npm `flatbuffers` package (its only user was the deleted TS workload) | — |
|
|
223
|
+
|
|
224
|
+
The BTree, stacked store, schema parser and cluster detection stay, as
|
|
225
|
+
`flatsql/btree`, `flatsql/storage`, `flatsql/schema` and `flatsql/cluster`.
|
|
226
|
+
|
|
227
|
+
**A1 parity check (the receipt).** A1 allows the deletion when each consumer's
|
|
228
|
+
suite passes on the new bindings or the consumer pins the last pre-T4 major.
|
|
229
|
+
Every consumer pins an earlier major, so none resolves 3.0.0:
|
|
230
|
+
|
|
231
|
+
| Consumer (stack pin) | flatsql |
|
|
232
|
+
|---|---|
|
|
233
|
+
| space-data-module-sdk 0.8.24 (450aa78; `src/runtime-host/flatsqlRuntimeStore.js`) | `^2.0.0` |
|
|
234
|
+
| OrbPro (216083d024; `packages/wasm-engine`, root) | `^1.4.4` |
|
|
235
|
+
| OrbPro `packages/space-data-module-sdk` 0.8.23 | `^2.0.0` |
|
|
236
|
+
| spacedatastandards.org 1.228.0 (cd86467de5; `test-flatsql*.js`) | `^1.3.0` |
|
|
237
|
+
| spacedatastandards `packages/standards-explorer` | `^0.3.9` |
|
|
238
|
+
| sdn-js 3.1.0 (space-data-network f20dbc35d) | `2.0.3` |
|
|
239
|
+
|
|
240
|
+
Moving each consumer to 3.x (or recording that it stays on 2.x) is a ripple
|
|
241
|
+
task per repository (A1, A34).
|