| … | … | @@ -3600,6 +3600,43 @@ injected per layer: |
| 3600 | 3600 | - **Order:** R4b-1 streamx generalized (gates unchanged + object mode) → R4b-2 rt completion |
| 3601 | 3601 | FIFO + State / batches / sessions / snapshots / CFs → R4b-3 Iterator, `keys`, `peek` → |
| 3602 | 3602 | R4b-4 gate + drill. L2 keeps its synchronous Db until R4c. |
| 3603 | - **R4b-1 DONE 2026-10-06** (keetd c613b42 on `r4`). `ss::BasicDuplex<T>` (hc/basic_duplex.h): the |
| 3604 | streamx core over any element type, with `defaultByteLength` (a typed array's length, else |
| 3605 | 1024), `map` / `mapReadable` / `mapWritable` (a readable map returning null skips; `unshift` |
| 3606 | maps, then `push` maps the last pending again — streamx's own code), the byteLength options, |
| 3607 | `setReadableMap`, and streamx's Readable (`ReadableOnly`: WRITE_DONE from the start, no |
| 3608 | writable side). The byte stream is its Buf instantiation, names unchanged. Duplex gate +21 |
| 3609 | scripts; drills r4b1 9/9 (two first-run survivors were script gaps: a Readable's lone 'drain' |
| 3610 | listener; a `_read` that ends synchronously during the open callback), m5g4e3b 20/20 on the |
| 3611 | moved code. ctest 83/83. |
| 3612 | - **R4b-2 DONE 2026-10-06** (keetd fb50896). rn: rocksdb-native 3.17.4 in full (above), plus |
| 3613 | `rt::complete` (parked completions: Real = a `uv_async`, referenced only while pending; Virtual |
| 3614 | = the poll phase; one native callback each, a pass delivers what was queued before it began) |
| 3615 | and `js::asyncFn`. Gate `tools/rn`: Bare at `UV_THREADPOOL_SIZE=1` vs rn on rt real AND virtual, |
| 3616 | identical traces then identical stores (dumped by rocksdb-native: the on-disk bytes are |
| 3617 | cross-checked). Drill r4b2 17/17. ctest 84/84. |
| 3618 | - MEASURED (the gate's traces): a read batch's per-op promises settle in index order and its |
| 3619 | flush promise one tick later; separate `get`s are separate completions; an un-destroyed batch |
| 3620 | blocks close forever (its handle ref), and Bare exits with that promise pending. |
| 3621 | - **R4b-3 (iterators, peek, keys).** |
| 3622 | - `js::AsyncGenerator<T>`: ECMA-262 §27.9 step for step (the five states, the request queue, |
| 3623 | next / return / throw, `co_yield` = Await then AsyncGeneratorYield, a return at a yield |
| 3624 | unwrapped by Await then unwound with `js::GeneratorReturn` so the body's destructors run as |
| 3625 | its finally). Port rule: an async generator's `return x` is `co_return co_await |
| 3626 | js::resolve(x)` (JS awaits the operand BEFORE the finally blocks; C++ destroys locals at |
| 3627 | co_return). `js::resolve(MaybePromise)` = PromiseResolve. Measured on Bare first: the body |
| 3628 | starts inside the first next(); a yield costs one hop, then queued requests resume the body |
| 3629 | in that job; return() at a yield awaits, runs the finally, resolves. |
| 3630 | - `RocksDB::keys` on it; AsyncIteratorClose inside: an abrupt exit at the yield closes the |
| 3631 | inner iterator (a throw wins over return()'s own error, a return lets it through). |
| 3632 | - Gates: the js gate +14 generator scripts; the rn gate +11 (every range bound, reverse, |
| 3633 | keys-only, limit 3 / 8 / 0 / negative over 20 entries, 40 entries, a snapshot, before ready, |
| 3634 | while suspended, empty, an early break, peek with a diagnostics snapshot at its settlement, |
| 3635 | keys with ranges / reverse / limit / break, gets deferred around an iterator's open). New |
| 3636 | runner ops: `diagOn`, `defer`. |
| 3637 | - Drills: r4a-gen 10/10 (survivor "drain treats a return as a next" → script genQueuedReturn), |
| 3638 | r4b3 12/12 (survivors → scripts: a negative limit over 20 entries; peek's close seen by |
| 3639 | `diagOn`; an inline open seen by gets deferred past the open's submission). |
| 3603 | 3640 | - **Then 4e-4** (`createProtocolStream` / `replicate`): the first gate that composes the stack |
| 3604 | 3641 | is a COMPOSED trace against JS (secret-stream + protomux + replicator), now meaningful. |
| 3605 | 3642 | |