Skip to content

Add active state value updates - #164

Merged
SandroMaglione merged 1 commit into
mainfrom
codex/state-value-update
Aug 22, 2026
Merged

Add active state value updates#164
SandroMaglione merged 1 commit into
mainfrom
codex/state-value-update

Conversation

@SandroMaglione

Copy link
Copy Markdown
Member

Summary

  • add typed to.local.update and active-ancestor .update selections
  • preserve topology and state-owned work while supporting eventless stabilization, inspection, verification, and visualization
  • implement matching generic and indexed planner semantics with differential coverage

Changeset

  • Added or updated a changeset for public or package-facing changes
  • Not required because this pull request only changes tests, documentation, CI, or internal tooling

Validation

  • pnpm check
  • Automated type-performance measurement passed or was not required
  • Automated runtime- and memory-performance measurement passed or was not required

@github-actions

Copy link
Copy Markdown
Contributor

Type performance

Measured with TypeScript 6.0.3 and skipLibCheck=true.

Scenario Base PR Difference
Effect only 55 55 0 (0.0%)
Import effect-machine 55 55 0 (0.0%)
Machine.states (3 states) 3,039 3,039 0 (0.0%)
Machine.make (3 states, 2 events) 10,759 10,759 0 (0.0%)
machine.handle (3 states, 2 transitions) 28,192 28,191 -1 (-0.0%)
fluent transition (10 named branches) 106,025 112,798 +6,773 (+6.4%)
fluent invocation (state-dependent Effect) 92,756 99,552 +6,796 (+7.3%)
machine.handle (depth 24) 192,607 199,402 +6,795 (+3.5%)
machine.handle (wide depth 16) 220,969 227,764 +6,795 (+3.1%)
machine.handle (parallel/history/choice) 128,412 135,182 +6,770 (+5.3%)
machine definition (3 independent implementations) 127,365 134,256 +6,891 (+5.4%)
machine exact input/output/error/services 113,943 120,715 +6,772 (+5.9%)
execution adapter readiness 120,605 127,375 +6,770 (+5.6%)

Marginal instantiations are measured against the matching setup without that API call:

Scenario Base PR Difference
Import effect-machine 0 0 0
Machine.states (3 states) 2,984 2,984 0 (0.0%)
Machine.make (3 states, 2 events) 7,712 7,712 0 (0.0%)
machine.handle (3 states, 2 transitions) 17,433 17,432 -1 (-0.0%)
fluent transition (10 named branches) 95,776 102,549 +6,773 (+7.1%)
fluent invocation (state-dependent Effect) 83,491 90,287 +6,796 (+8.1%)
machine.handle (depth 24) 171,911 178,706 +6,795 (+4.0%)
machine.handle (wide depth 16) 201,480 208,275 +6,795 (+3.4%)
machine.handle (parallel/history/choice) 108,149 114,919 +6,770 (+6.3%)
machine definition (3 independent implementations) 111,396 118,287 +6,891 (+6.2%)
machine exact input/output/error/services 99,432 106,204 +6,772 (+6.8%)
execution adapter readiness 90,789 97,562 +6,773 (+7.5%)
Check times (informational)
Scenario Base PR
Effect only 0.04s 0.03s
Import effect-machine 0.03s 0.03s
Machine.states (3 states) 0.10s 0.10s
Machine.make (3 states, 2 events) 0.16s 0.18s
machine.handle (3 states, 2 transitions) 0.26s 0.29s
fluent transition (10 named branches) 0.51s 0.56s
fluent invocation (state-dependent Effect) 0.50s 0.50s
machine.handle (depth 24) 0.80s 0.81s
machine.handle (wide depth 16) 0.81s 0.85s
machine.handle (parallel/history/choice) 0.63s 0.67s
machine definition (3 independent implementations) 0.64s 0.69s
machine exact input/output/error/services 0.59s 0.62s
execution adapter readiness 0.58s 0.60s

Type instantiations are the comparison metric. Check time varies with runner load and is informational only.

@github-actions

Copy link
Copy Markdown
Contributor

Runtime performance

Median of 5 independent benchmark processes on AMD EPYC 9V74 80-Core Processor with Node v24.19.0.

Pull request baseline

Scenario Effect Machine
Plan counter transitions 113,011 transitions/s
Drain burst with terminal fence 331,673 increments/s
Drain burst with a change observer 312,369 increments/s
Lookup and send to one child 284,066 increments/s
Start and stop a machine 140,430 machines/s
Start and stop a parent with one child 40,972 families/s
Plan transitions through a compound state 98,342 transitions/s
Plan transitions through parallel regions 81,544 transitions/s
Drain burst through a compound state 271,362 events/s
Drain burst through two parallel regions 277,054 events/s
Drain a compound-state burst with a change observer 258,158 events/s

Process runtime reference points

Scenario Effect Machine
Start and stop a raw generic process 25,472 processes/s
Start and stop a raw compiled process 65,690 processes/s
Memory profile Effect Machine
Idle machine 1.8 KiB
Raw generic managed process 13.9 KiB
Raw compiled process 3.2 KiB
Two independent idle machines 3.4 KiB
Idle parent with one child 5.8 KiB
Parent with observed child registry 10.0 KiB
Parent with observed invoked child snapshots 6.4 KiB

Effect Machine change from base

Metric Base Base variability PR PR variability Difference
Plan counter transitions 113,682 transitions/s 2.2% MAD 113,011 transitions/s 0.8% MAD -0.6%
Drain burst with terminal fence 334,629 increments/s 1.1% MAD 331,673 increments/s 0.5% MAD -0.9%
Drain burst with a change observer 313,719 increments/s 0.7% MAD 312,369 increments/s 0.4% MAD -0.4%
Lookup and send to one child 286,266 increments/s 0.6% MAD 284,066 increments/s 0.1% MAD -0.8%
Start and stop a machine 139,645 machines/s 1.0% MAD 140,430 machines/s 0.4% MAD +0.6%
Start and stop a parent with one child 41,413 families/s 2.3% MAD 40,972 families/s 0.9% MAD -1.1%
Plan transitions through a compound state 100,310 transitions/s 1.0% MAD 98,342 transitions/s 0.5% MAD -2.0%
Plan transitions through parallel regions 82,627 transitions/s 1.9% MAD 81,544 transitions/s 0.8% MAD -1.3%
Drain burst through a compound state 277,418 events/s 0.5% MAD 271,362 events/s 1.1% MAD -2.2%
Drain burst through two parallel regions 282,319 events/s 0.9% MAD 277,054 events/s 1.3% MAD -1.9%
Drain a compound-state burst with a change observer 260,992 events/s 1.0% MAD 258,158 events/s 1.6% MAD -1.1%
Idle machine heap per unit 1.8 KiB 0.1% MAD 1.8 KiB 0.2% MAD +0.2%
Raw generic managed process heap per unit 13.9 KiB 0.0% MAD 13.9 KiB 0.0% MAD +0.0%
Raw compiled process heap per unit 3.1 KiB 0.4% MAD 3.2 KiB 0.0% MAD +0.4%
Two independent idle machines heap per unit 3.4 KiB 0.0% MAD 3.4 KiB 0.0% MAD -0.6%
Idle parent with one child heap per unit 5.8 KiB 0.0% MAD 5.8 KiB 0.0% MAD 0.0%
Parent with observed child registry heap per unit 10.0 KiB 0.0% MAD 10.0 KiB 0.0% MAD 0.0%
Parent with observed invoked child snapshots heap per unit 6.3 KiB 0.0% MAD 6.4 KiB 0.0% MAD +0.2%

Process runtime reference change from base

Metric Base Base variability PR PR variability Difference
Start and stop a raw generic process 26,153 processes/s 2.7% MAD 25,472 processes/s 1.3% MAD -2.6%
Start and stop a raw compiled process 66,085 processes/s 0.3% MAD 65,690 processes/s 0.7% MAD -0.6%

Regression guard

No large, noise-adjusted throughput or heap regressions detected.

Versions and interpretation
  • Effect Machine: 0.20.0

Higher throughput is better; lower heap is better. Variability is the median absolute deviation across independent processes, relative to their median. Small differences on shared GitHub-hosted hardware remain informational; the required guard rejects only large changes beyond the measured noise allowance.

@SandroMaglione
SandroMaglione merged commit 473aa78 into main Aug 22, 2026
8 checks passed
@SandroMaglione
SandroMaglione deleted the codex/state-value-update branch August 22, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant