FE-1237: Add optional per-place token capacity - #9177
Draft
kube wants to merge 2 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This was referenced Aug 8, 2026
kube
force-pushed
the
cf/fe-1237-place-token-capacity
branch
from
August 13, 2026 08:20
6a7dd72 to
367c694
Compare
kube
force-pushed
the
cf/fe-1237-place-token-capacity
branch
from
August 14, 2026 23:53
367c694 to
f78b501
Compare
A place can declare a maximum token count, which participates in transition enablement the standard way: a transition cannot fire if it would take an output place above capacity. Output tokens apply at the end of a frame, so the check folds in what earlier transitions this frame already committed. Deadlock detection uses the same check, so a net blocked only by full output places is reported as deadlocked rather than stepping to maxTime doing nothing. Nets without capacities keep empty constraint tables and skip the check.
Replaces em dashes with full stops. No content change.
kube
force-pushed
the
cf/fe-1237-place-token-capacity
branch
from
August 15, 2026 00:51
f78b501 to
03a799f
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌟 What is the purpose of this PR?
Adds an optional per-place token capacity, set from the place properties panel.
Requested for supply-chain modelling with finite storage. It also converts frames from growable to fixed-size, which the GPU backend (#9179) requires.
🔗 Related links
🚫 Blocked by
🔍 What does this change?
A transition cannot fire if firing would take an output place above its capacity. This is the standard Petri-net capacity constraint.
maxTimePre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
An initial marking that already exceeds a capacity is not rejected. Enablement blocks transitions; it does not repair state.
🐾 Next steps
The fixed-size frame layout (SoA, WASM linear memory) is not built here. The runtime still uses growable frames.
🛡 What tests cover this?
engine/capacity.test.ts(constraint tables, headroom check),monte-carlo/capacity.test.ts(end-of-frame accumulation across several transitions feeding one place, deadlock reporting).❓ How to test this?