Spaces:
Running
Running
Clarify the product card and link the runnable example
Browse files- README.md +18 -12
- art/share.png +0 -0
README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
title: SinceKit
|
| 3 |
emoji: 🧭
|
| 4 |
-
colorFrom: green
|
| 5 |
-
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
license: mit
|
| 8 |
tags:
|
|
@@ -10,23 +8,31 @@ tags:
|
|
| 10 |
- multi-agent
|
| 11 |
- simulation
|
| 12 |
- change-data-capture
|
|
|
|
| 13 |
app_file: index.html
|
| 14 |
-
short_description:
|
|
|
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
# SinceKit
|
| 18 |
|
| 19 |
Prepare one exact state delta for thousands of readers at different checkpoints. Each reader takes a prefix of the same array. Two C++17 headers, no third-party dependencies.
|
| 20 |
|
|
|
|
|
|
|
| 21 |
Use this inside a simulation server, agent blackboard, or fleet monitor when each reader needs the **latest state of the keys that changed**. An agent that slept through a million updates to one key can catch up on that key in one row. Deletes survive as tombstones, and readers keep a single 64-bit cursor.
|
| 22 |
|
| 23 |
-
On a held-out synthetic burst workload with 2,048 readers, the native planner took **17.04 µs**, versus **31.23 µs** for the fastest of three alternative shared-plan implementations. In a replay of observed agent traffic the best alternatives were close, and a sorted sweep won at 2,048 simulated readers. [Workloads, losing cases and raw timings](docs/performance.md)
|
| 24 |
|
| 25 |
## Try it
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
```sh
|
|
|
|
|
|
|
| 30 |
make demo
|
| 31 |
```
|
| 32 |
|
|
@@ -38,7 +44,7 @@ The example writes slot 7, writes slot 3, updates slot 7 and erases slot 3. Thre
|
|
| 38 |
|
| 39 |
Each row contains a slot ID, its last revision and a deletion flag. Both lagging readers receive rows 0 and 1. The current reader receives zero rows. Decimal strings preserve 64-bit revisions in JavaScript. Feed a custom trace into `build/sincekit CAPACITY` with one `touch ID`, `erase ID`, `plan CURSOR ...` or `revision` command per line.
|
| 40 |
|
| 41 |
-
[
|
| 42 |
|
| 43 |
## Embed in a tick loop
|
| 44 |
|
|
@@ -57,7 +63,7 @@ auto batch = sincekit::since_many(changes, {0, 1, 3});
|
|
| 57 |
// batch.prefix_lengths is [2, 2, 0].
|
| 58 |
```
|
| 59 |
|
| 60 |
-
For one consumer, `changes.since(cursor, callback)` visits changed slots in descending revision order without allocating. Its callback receives `(id, revision, deleted)`. It returns the revision covered. A completed batch owns its row metadata. If the writer will resume before delivery, copy the corresponding payloads under the same synchronization. Publish the cursor only after the whole prefix has been applied. The [replication example](examples/replicate.cpp) handles a lagging consumer, retry, and world restart.
|
| 61 |
|
| 62 |
## Why a prefix is enough
|
| 63 |
|
|
@@ -76,7 +82,7 @@ A contiguous revision window gives prefix lengths by subtraction. For dense wind
|
|
| 76 |
|
| 77 |
## Choosing a native index
|
| 78 |
|
| 79 |
-
`Index` moves changed slots to the head of a list. It is a good candidate for repeated writes to a hot subset or short output-sensitive pulls. The optional `sincekit::CompactIndex` in [sincekit_compact.h](include/sincekit_compact.h) trades occasional O(capacity) compactions for contiguous journal traversal. It exposes the same C++ methods and works with `since_many`. Its writes are amortized O(1) and a poll scans at most two journal generations. The benchmarks include a million-slot mixed replay where the linked index loses. Choose using measured tick latency and your tolerance for compaction pauses.
|
| 80 |
|
| 81 |
Both native indexes use approximately 16 bytes per configured slot plus a deletion bit on the tested ABI, excluding vector and allocator overhead. Applications that have a compatible newest-first source can also call the templated batch planner with that source.
|
| 82 |
|
|
@@ -92,11 +98,11 @@ Run `make check` for the native, command-protocol, and replication checks. Run `
|
|
| 92 |
|
| 93 |
## License
|
| 94 |
|
| 95 |
-
SinceKit code and original documentation use the [MIT license](LICENSE). The derived FreeInference trace keeps its original CC BY 4.0 license. See the [trace attribution and transformation](trace/README.md).
|
| 96 |
|
| 97 |
## Python
|
| 98 |
|
| 99 |
-
Install the native extension from this checkout with `python3 -m pip install --no-build-isolation --no-deps ./python` in an environment with setuptools and a compiler. The [Python guide](python/README.md) shows atomic batch writes and how to consume reader prefixes without copying them.
|
| 100 |
|
| 101 |
```python
|
| 102 |
from sincekit import Index
|
|
@@ -107,4 +113,4 @@ batch = world.since_many([0, 2, 3])
|
|
| 107 |
assert batch.prefix_lengths == (2, 1, 0)
|
| 108 |
```
|
| 109 |
|
| 110 |
-
[Clone and evaluate SinceKit](docs/quickstart.md) · [Run the SimPy warehouse integration](integrations/simpy/README.md) · [Choose between SinceKit and other synchronization models](docs/fit.md)
|
|
|
|
| 1 |
---
|
| 2 |
+
title: SinceKit · Batched state sync
|
| 3 |
emoji: 🧭
|
|
|
|
|
|
|
| 4 |
sdk: static
|
| 5 |
license: mit
|
| 6 |
tags:
|
|
|
|
| 8 |
- multi-agent
|
| 9 |
- simulation
|
| 10 |
- change-data-capture
|
| 11 |
+
- state-synchronization
|
| 12 |
app_file: index.html
|
| 13 |
+
short_description: Build one change list for readers at different revisions
|
| 14 |
+
colorFrom: gray
|
| 15 |
+
colorTo: gray
|
| 16 |
+
thumbnail: https://huggingface.co/spaces/pgg-engineering/sincekit/resolve/main/art/share.png
|
| 17 |
---
|
| 18 |
|
| 19 |
# SinceKit
|
| 20 |
|
| 21 |
Prepare one exact state delta for thousands of readers at different checkpoints. Each reader takes a prefix of the same array. Two C++17 headers, no third-party dependencies.
|
| 22 |
|
| 23 |
+

|
| 24 |
+
|
| 25 |
Use this inside a simulation server, agent blackboard, or fleet monitor when each reader needs the **latest state of the keys that changed**. An agent that slept through a million updates to one key can catch up on that key in one row. Deletes survive as tombstones, and readers keep a single 64-bit cursor.
|
| 26 |
|
| 27 |
+
On a held-out synthetic burst workload with 2,048 readers, the native planner took **17.04 µs**, versus **31.23 µs** for the fastest of three alternative shared-plan implementations. In a replay of observed agent traffic the best alternatives were close, and a sorted sweep won at 2,048 simulated readers. [Workloads, losing cases and raw timings](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/docs/performance.md)
|
| 28 |
|
| 29 |
## Try it
|
| 30 |
|
| 31 |
+
Clone this Space and run the example with a C++17 compiler and Make.
|
| 32 |
|
| 33 |
```sh
|
| 34 |
+
git clone --depth 1 https://huggingface.co/spaces/pgg-engineering/sincekit
|
| 35 |
+
cd sincekit
|
| 36 |
make demo
|
| 37 |
```
|
| 38 |
|
|
|
|
| 44 |
|
| 45 |
Each row contains a slot ID, its last revision and a deletion flag. Both lagging readers receive rows 0 and 1. The current reader receives zero rows. Decimal strings preserve 64-bit revisions in JavaScript. Feed a custom trace into `build/sincekit CAPACITY` with one `touch ID`, `erase ID`, `plan CURSOR ...` or `revision` command per line.
|
| 46 |
|
| 47 |
+
[Replay the three readers in the browser](https://pgg-engineering-sincekit.static.hf.space/index.html) · [Read the workload selection guide](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/llms.txt) · [See measurements and reproduction commands](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/docs/performance.md)
|
| 48 |
|
| 49 |
## Embed in a tick loop
|
| 50 |
|
|
|
|
| 63 |
// batch.prefix_lengths is [2, 2, 0].
|
| 64 |
```
|
| 65 |
|
| 66 |
+
For one consumer, `changes.since(cursor, callback)` visits changed slots in descending revision order without allocating. Its callback receives `(id, revision, deleted)`. It returns the revision covered. A completed batch owns its row metadata. If the writer will resume before delivery, copy the corresponding payloads under the same synchronization. Publish the cursor only after the whole prefix has been applied. The [replication example](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/examples/replicate.cpp) handles a lagging consumer, retry, and world restart.
|
| 67 |
|
| 68 |
## Why a prefix is enough
|
| 69 |
|
|
|
|
| 82 |
|
| 83 |
## Choosing a native index
|
| 84 |
|
| 85 |
+
`Index` moves changed slots to the head of a list. It is a good candidate for repeated writes to a hot subset or short output-sensitive pulls. The optional `sincekit::CompactIndex` in [sincekit_compact.h](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/include/sincekit_compact.h) trades occasional O(capacity) compactions for contiguous journal traversal. It exposes the same C++ methods and works with `since_many`. Its writes are amortized O(1) and a poll scans at most two journal generations. The benchmarks include a million-slot mixed replay where the linked index loses. Choose using measured tick latency and your tolerance for compaction pauses.
|
| 86 |
|
| 87 |
Both native indexes use approximately 16 bytes per configured slot plus a deletion bit on the tested ABI, excluding vector and allocator overhead. Applications that have a compatible newest-first source can also call the templated batch planner with that source.
|
| 88 |
|
|
|
|
| 98 |
|
| 99 |
## License
|
| 100 |
|
| 101 |
+
SinceKit code and original documentation use the [MIT license](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/LICENSE). The derived FreeInference trace keeps its original CC BY 4.0 license. See the [trace attribution and transformation](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/trace/README.md).
|
| 102 |
|
| 103 |
## Python
|
| 104 |
|
| 105 |
+
Install the native extension from this checkout with `python3 -m pip install --no-build-isolation --no-deps ./python` in an environment with setuptools and a compiler. The [Python guide](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/python/README.md) shows atomic batch writes and how to consume reader prefixes without copying them.
|
| 106 |
|
| 107 |
```python
|
| 108 |
from sincekit import Index
|
|
|
|
| 113 |
assert batch.prefix_lengths == (2, 1, 0)
|
| 114 |
```
|
| 115 |
|
| 116 |
+
[Clone and evaluate SinceKit](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/docs/quickstart.md) · [Run the SimPy warehouse integration](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/integrations/simpy/README.md) · [Choose between SinceKit and other synchronization models](https://huggingface.co/spaces/pgg-engineering/sincekit/blob/main/docs/fit.md)
|
art/share.png
ADDED
|