anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Simulates how agents that share mutable state collide, under five isolation modes, in your browser, so you can watch overselling, lost updates and write skew.
StatePact Concurrency Playground is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install -U huggingface_hub hf download Mithun-2714/StatePact-Concurrency-Playground --repo-type space --local-dir StatePact-Concurrency-Playground cd StatePact-Concurrency-Playground
StatePact Concurrency Playground is a hand-written browser simulation of StatePact, which brings database-style transactions to state shared between several AI agents. Each agent reads a value, thinks it over and then writes a new one. You choose a workload and the page replays it in each of five isolation modes, which lets you compare the outcomes. It is a JavaScript simulation, not the Python engine.
Developers who build multi-agent systems and want to see what happens when agents write to the same state.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software | Agent developers | Watch concurrent agents collide on shared state | Seeing overselling in the inventory workload |
| Databases | Engineers who study transactions | Compare isolation modes on one workload | Comparing snapshot and serializable on write skew |
| Education | Students of concurrency | Learn lost updates and write skew by experiment | Running the counter workload in each mode |
If you want to run the real engine or its tests, you can skip this page, because it only simulates the protocol.
| Use case | Who | What they get back |
|---|---|---|
| See overselling | Developers | An inventory run where concurrent reservations exceed the stock |
| See lost updates | Students | A counter run where increments get lost |
| See write skew | Engineers | Two agents that each pass a check and together break a rule |
Online, nothing needs installing. A local copy needs a browser and a little Python for the download.
pip install -U huggingface_hub hf download Mithun-2714/StatePact-Concurrency-Playground --repo-type space --local-dir StatePact-Concurrency-Playground cd StatePact-Concurrency-Playground
The real Python engine lives in the separate StatePact repository. After you clone that repository, these are its own commands for the demo.
cd StatePact uv sync --extra demo uv run python demo/app.py
Open the page, pick one of the three workloads and one of the five isolation modes, and run it. Then switch the mode and run the same workload again to compare the outcomes.
| Tool | What it does |
|---|---|
| Inventory workload | Reserves limited stock concurrently, so you can see overselling |
| Counter workload | Increments a counter concurrently, so you can see lost updates |
| Write skew workload | Has two agents check a rule and write, so the pair can break it |
| none mode | Does no validation and is intentionally unsafe, as a baseline |
| optimistic mode | Validates every read and write base version, and is the default |
| snapshot mode | Validates write base versions only, so write skew is possible |
| serializable mode | Adds a serialization-graph audit to optimistic |
| pessimistic mode | Uses strict two-phase locking and waits instead of retrying |
You run the counter workload in none mode and see increments go missing. You switch to optimistic mode and run it again. Every increment now lands. You then run the write skew workload in snapshot mode and see the rule broken.
When several agents read a value, think and write it back at once, some writes overwrite others. To start, run the counter workload in none mode, then in optimistic mode.
In the author's benchmark, which ran on the Python engine and not on this page, the none mode lost between 376 and 390 of 400 increments, and the optimistic mode kept all 400. It also reports write skew in 20 of 20 trials under snapshot and in 0 of 20 under serializable.
Simulates how agents that share mutable state collide, under five isolation modes, in your browser, so you can watch overselling, lost updates and write skew.
Made by Mithun-2714 on Hugging Face. These notes are Mindket's, written from its Space page and README; the app's own files and license are on Hugging Face.
What it is: StatePact Concurrency Playground is a hand-written browser simulation of StatePact, which brings database-style transactions to state shared between several AI agents. Each agent reads a value, thinks it over and then writes a new one. You choose a workload and the page replays it in each of five isolation modes, which lets you compare the outcomes. It is a JavaScript simulation, not the Python engine.
Who it suits: Developers who build multi-agent systems and want to see what happens when agents write to the same state.
Industry | Who uses it | How they use it | Example
Software | Agent developers | Watch concurrent agents collide on shared state | Seeing overselling in the inventory workload
Databases | Engineers who study transactions | Compare isolation modes on one workload | Comparing snapshot and serializable on write skew
Education | Students of concurrency | Learn lost updates and write skew by experiment | Running the counter workload in each mode
If you want to run the real engine or its tests, you can skip this page, because it only simulates the protocol.
Where to use it:
Use case | Who | What they get back
See overselling | Developers | An inventory run where concurrent reservations exceed the stock
See lost updates | Students | A counter run where increments get lost
See write skew | Engineers | Two agents that each pass a check and together break a rule
How to set it up: Online, nothing needs installing. A local copy needs a browser and a little Python for the download.
pip install -U huggingface_hub
hf download Mithun-2714/StatePact-Concurrency-Playground --repo-type space --local-dir StatePact-Concurrency-Playground
cd StatePact-Concurrency-Playground
The real Python engine lives in the separate StatePact repository. After you clone that repository, these are its own commands for the demo.
cd StatePact
uv sync --extra demo
uv run python demo/app.py
How to use it: Open the page, pick one of the three workloads and one of the five isolation modes, and run it. Then switch the mode and run the same workload again to compare the outcomes.
Tool | What it does
Inventory workload | Reserves limited stock concurrently, so you can see overselling
Counter workload | Increments a counter concurrently, so you can see lost updates
Write skew workload | Has two agents check a rule and write, so the pair can break it
none mode | Does no validation and is intentionally unsafe, as a baseline
optimistic mode | Validates every read and write base version, and is the default
snapshot mode | Validates write base versions only, so write skew is possible
serializable mode | Adds a serialization-graph audit to optimistic
pessimistic mode | Uses strict two-phase locking and waits instead of retrying
Example: You run the counter workload in none mode and see increments go missing. You switch to optimistic mode and run it again. Every increment now lands. You then run the write skew workload in snapshot mode and see the rule broken.
For newcomers and experts: When several agents read a value, think and write it back at once, some writes overwrite others. To start, run the counter workload in none mode, then in optimistic mode.
In the author's benchmark, which ran on the Python engine and not on this page, the none mode lost between 376 and 390 of 400 increments, and the optimistic mode kept all 400. It also reports write skew in 20 of 20 trials under snapshot and in 0 of 20 under serializable.
Pick a workload and an isolation mode
Simulated agents read, reason and write
Commit validation accepts or rejects writes
You see the outcome and compare modes
Good to know:
Open the Space in your browser, or copy it to your own Hugging Face account from its page. Nothing in this kit runs by itself.
README.md 5 KB
Listed Hugging Face Spaces in the same category that share the most tags with this one.
| Product | Likes | Built with | License | Last change |
|---|---|---|---|---|
| StatePact Concurrency Playground This page | 2 | static | apache-2.0 | |
| InferenceSupportShares static | 764 | static | afl-3.0 | |
| HuggyShares static | 463 | static | cc-by-nc-sa-4.0 | |
| Z-Image Lookalike LoRA IndexShares static | 189 | static | apache-2.0 | |
| Granite Docling 258M WebGPUShares static | 163 | static | apache-2.0 | |
| DINOv3 WebShares static | 162 | static | apache-2.0 |
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.