Mindket

StatePact Concurrency Playground

Newversion 1 · updated

Overview

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.

At a glance

You need
  • A web browser
  • Python and the pip tool, only for the download step
Runs in
  • A web browser, on the Space's page at Hugging Face
  • A browser on Windows, macOS or Linux, by opening a downloaded copy of index.html
Start with
pip install -U huggingface_hub
hf download Mithun-2714/StatePact-Concurrency-Playground --repo-type space --local-dir StatePact-Concurrency-Playground
cd StatePact-Concurrency-Playground

Platform

WindowsOperating system
macOSOperating system
LinuxOperating system

About

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.

IndustryWho uses itHow they use itExample
SoftwareAgent developersWatch concurrent agents collide on shared stateSeeing overselling in the inventory workload
DatabasesEngineers who study transactionsCompare isolation modes on one workloadComparing snapshot and serializable on write skew
EducationStudents of concurrencyLearn lost updates and write skew by experimentRunning 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

  • A web browser, on the Space's page at Hugging Face
  • A browser on Windows, macOS or Linux, by opening a downloaded copy of index.html
Use caseWhoWhat they get back
See oversellingDevelopersAn inventory run where concurrent reservations exceed the stock
See lost updatesStudentsA counter run where increments get lost
See write skewEngineersTwo 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.

  • A web browser
  • Python and the pip tool, only for the download step
  1. Install the Hugging Face hub package with pip.
  2. Download the Space's files into a folder.
  3. Move into that folder.
  4. Open index.html in a web browser.
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.

ToolWhat it does
Inventory workloadReserves limited stock concurrently, so you can see overselling
Counter workloadIncrements a counter concurrently, so you can see lost updates
Write skew workloadHas two agents check a rule and write, so the pair can break it
none modeDoes no validation and is intentionally unsafe, as a baseline
optimistic modeValidates every read and write base version, and is the default
snapshot modeValidates write base versions only, so write skew is possible
serializable modeAdds a serialization-graph audit to optimistic
pessimistic modeUses 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.

  1. Pick a workload and an isolation mode
  2. Simulated agents read, reason and write
  3. Commit validation accepts or rejects writes
  4. You see the outcome and compare modes

Good to know

  • Limits: this page simulates the protocol in JavaScript, so its behavior is not the Python engine's measured behavior
  • License: Apache 2.0
  • Cost to run: none named
  • Data it reaches: only the page's own scripts and a benchmark-latest.json file in the repository
  • Not for: testing real databases or the real engine, since the page is a simulation

README and files

README

StatePact Concurrency Playground

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.

About

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:

  • A web browser, on the Space's page at Hugging Face
  • A browser on Windows, macOS or Linux, by opening a downloaded copy of index.html
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.

  • A web browser
  • Python and the pip tool, only for the download step
  1. Install the Hugging Face hub package with pip.
  2. Download the Space's files into a folder.
  3. Move into that folder.
  4. Open index.html in a web browser.
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:

  • Limits: this page simulates the protocol in JavaScript, so its behavior is not the Python engine's measured behavior
  • License: Apache 2.0
  • Cost to run: none named
  • Data it reaches: only the page's own scripts and a benchmark-latest.json file in the repository
  • Not for: testing real databases or the real engine, since the page is a simulation

On Hugging Face, 13 November 2026

  • Likes: 2
  • Built with: static
  • License: apache-2.0

Links

Try it

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.

Files
README.md  5 KB

1 file, 5 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Compare with similar

Listed Hugging Face Spaces in the same category that share the most tags with this one.

ProductLikesBuilt withLicenseLast change
StatePact Concurrency Playground This page2staticapache-2.0
InferenceSupportShares static764staticafl-3.0
HuggyShares static463staticcc-by-nc-sa-4.0
Z-Image Lookalike LoRA IndexShares static189staticapache-2.0
Granite Docling 258M WebGPUShares static163staticapache-2.0
DINOv3 WebShares static162staticapache-2.0
Numbers as Mindket last read them, on 2026-11-12.

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

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…

New

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…

New

ACE-Step 1.5 XL SFT

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…

New

Similar in Developer

See all in Developer

Claude Code Skills & Plugins

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…

New29.8k

buzz

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…

New37.3k

plannotator

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.

New10.5k