C.4 (#1505) — per-graph adopter opt-in for batched-flush mode.

Passed via createCausl({ batchedFlush }) (auto-backend path) or loadWasmBackend({ batchedFlush }) (direct path). Per-graph, NOT global (option-c doc §2.3) — multi-graph adopters (@causl/sync, embedded use-cases) opt in per graph without cross-graph coupling.

Omitting batchedFlush entirely is byte-identical to dev b15069fa (the load-bearing C.4 acceptance property): no queue is installed, the pre-C.3 per-commit shadow path runs unchanged, and adopter commit() / read() / subscribe() results are exactly what they were before this cascade. Zero codemod, zero deprecation, zero behavioural change unless the adopter explicitly passes this option.

No adopter-visible perf change at v1.x even when opted in — the JS engine remains SSOT; only the WASM-side wire crossing batches. Scaffolding for a future v2.x Rust-SSOT cutover, not a perf win.

interface BatchedFlushOptions {
    afterN?: number;
    intervalMs?: number;
}

Properties

Properties

afterN?: number

Count-based flush threshold. Default 1 — flush every commit, byte-identical to the pre-C.3 per-commit shadow path (option-c doc §2.3). Adopters who want wire amortisation set afterN: 100 (production-grade per §1.2) or 312 (the #1484 §3 kill-threshold — meets the floor on every contract-bearing cell). Must be an integer ≥ 1.

intervalMs?: number

Time-based flush threshold (ms). Default 16 — one 60 Hz frame (option-c doc §2.2). Bounds flush latency when the commit rate is below afterN / intervalMs. 0 disables the time trigger (count / manual / implicit only). Must be a finite number ≥ 0.