<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Simmis Blog</title><description>Writing on programming organizations that improve themselves, measured agent work, and the technical foundations behind Simmis.</description><link>https://simm.is/</link><item><title>Make the next marketing euro count</title><link>https://simm.is/blog/make-the-next-marketing-euro-count/</link><guid isPermaLink="true">https://simm.is/blog/make-the-next-marketing-euro-count/</guid><description>Follow a retailer from channel measurement to campaign planning, using Bayesian models and application simulation to find where its next advertising euro can do the most good.</description><pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Kettle &amp;#x26; Pine, our fictional online homeware shop, has EUR 20,000 for its next campaign.  The marketing lead wants that budget to bring in customers the business can serve profitably.  Search, social and video all have a place in the plan, and their past results give the team a starting point.  Where would another euro do the most good?&lt;/p&gt;
&lt;p&gt;To answer that, we need to understand how spending produces sales.  The channels can help one another: advertising in one place may create demand that another channel converts.  So we look at the whole history of spending, promotions, seasonality and sales together, and ask what each channel adds beyond what might have happened anyway.  Marketing mix modelling estimates those contributions, which marketers call incrementality.&lt;/p&gt;
&lt;p&gt;We use a Bayesian model because several explanations can fit that history.  We keep a range of plausible effects and ask how a spending plan performs across them.  Marketing and finance can then compare the expected gain with the uncertainty and agree on a plan with the same evidence in view.  In our example, an experiment helps them improve the channel mix, and a simulation of fulfilment helps them choose how much demand to acquire.&lt;/p&gt;
&lt;h2 id=&quot;who-already-budgets-this-way&quot;&gt;Who already budgets this way&lt;/h2&gt;
&lt;p&gt;Bayesian marketing mix modelling is no longer a research project.  &lt;a href=&quot;https://www.pymc-marketing.io/en/stable/&quot;&gt;PyMC-Marketing&lt;/a&gt; is the open-source Python library behind much of this practice, and we contribute to it.  &lt;a href=&quot;https://bolt.eu/en/blog/budgeting-with-bayesian-models-pymc-marketing/&quot;&gt;Bolt describes using it for budgeting&lt;/a&gt;, for example, and PyMC Labs documents an &lt;a href=&quot;https://www.pymc-labs.com/case-studies/nurnberger&quot;&gt;engagement with Nürnberger Versicherung&lt;/a&gt; in which upper-funnel advertising creates demand that paid search later converts.  After adopting a model of that funnel, Nürnberger reports a reduction in cost per lead of more than 27% over six months.&lt;/p&gt;
&lt;p&gt;Those results belong to those teams.  What we’d carry into an engagement of our own is the way the model becomes part of the team’s work.  The next budget comes round, someone questions an assumption, and the people making the decision can inspect and adapt the model.  We want Kettle &amp;#x26; Pine’s example to make that process concrete.&lt;/p&gt;
&lt;h2 id=&quot;eur-20000-four-weeks-three-channels&quot;&gt;EUR 20,000, four weeks, three channels&lt;/h2&gt;
&lt;p&gt;We gave the shop 156 weeks of revenue, spending on search, social and video, and the demand, promotions and seasonality that move sales alongside advertising.  Making up the business lets us check something we couldn’t check in a real shop: what every other budget would have earned.  We know the true advertising effects, so we can compare each recommendation with the plan that would have worked best.  The model doesn’t get to see that truth.&lt;/p&gt;
&lt;p&gt;The decision comes in week 130, with four campaign weeks ahead.  We fit the model to those first 130 weeks and keep the remaining 26 weeks’ revenue hidden, so we can later compare its forecasts with what happened.  Before asking it to recommend a budget, we want to know whether it can predict sales it hasn’t seen.&lt;/p&gt;
&lt;p&gt;Each channel manager has limits: search must receive EUR 1,000–2,600 per week, social EUR 500–3,000 and video up to EUR 2,500.  Today the shop spends EUR 2,000, 1,800 and 1,200 respectively.  PyMC-Marketing lets the analyst compare allocations within those limits, with uncertainty about what each change would earn.&lt;/p&gt;
&lt;p&gt;Suppose search has earned a good return so far.  Does that make it the best place for another euro?  Only if it still has room to grow.  As an audience saturates, each additional euro buys a little less, so the return on the next euro can differ from the average return on all the money spent before it.  That next-euro return is the marginal return on ad spend, or marginal ROAS.&lt;/p&gt;
&lt;p&gt;We also need to follow what happens after the spending stops.  An ad can keep working for a few weeks, an effect practitioners call adstock or carryover.  The model combines carryover and saturation into a response curve for each channel.  We use those curves to compare what a budget would earn during the campaign and afterwards.&lt;/p&gt;
&lt;figure&gt;
  &lt;picture&gt;
    &lt;source media=&quot;(max-width: 600px)&quot; srcset=&quot;/assets/posts/dont-buy-demand-you-cant-ship/campaign-timeline-mobile.svg&quot; width=&quot;360&quot; height=&quot;860&quot;&gt;
    &lt;img src=&quot;https://simm.is/assets/posts/dont-buy-demand-you-cant-ship/campaign-timeline.svg&quot; width=&quot;700&quot; height=&quot;740&quot; alt=&quot;Two versions of Kettle &amp;#x26; Pine&amp;#x27;s 156-week history. Each shows weekly revenue above weekly ad spend on search, social and video. In the first, social and video flights take turns; in the second, they run in the same weeks. In the final 26 shaded weeks, the model&amp;#x27;s forecast band follows the revenue that actually happened.&quot; loading=&quot;lazy&quot;&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;Two versions of Kettle &amp;#x26; Pine&apos;s history.  In the shaded weeks, the dots show the revenue that actually happened and the orange band shows what PyMC-Marketing forecast without seeing it.  Foerster Marketing&apos;s forecast is practically identical.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Now consider two versions of the shop’s history.  Search runs all year in both.  Social and video run in flights, as marketers call bursts of a few weeks followed by a pause, but in the first history they take turns and in the second they overlap.  Both versions forecast the hidden weeks well: the actual revenue falls inside the 90% band in 23 of 26 weeks when the flights take turns, and in 22 of 26 when they overlap.  We can now examine what each model recommends doing with the money.&lt;/p&gt;
&lt;p&gt;Start with the history in which the flights take turns.  Each channel has weeks of its own, so the model has evidence for telling their effects apart.  At current spend, it estimates that the next euro earns more in social and video than in search.  The optimiser therefore moves roughly EUR 600 per week out of search and into the other two.  Across the campaign and its carryover, that change is worth an expected EUR 1,300 in additional revenue.&lt;/p&gt;
&lt;p&gt;PyMC-Marketing’s recommended weekly spending, in EUR:&lt;/p&gt;























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Plan&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Search&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Social&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Video&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Current&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;2,000&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,800&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,200&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Recommended&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,403&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;2,005&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,592&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;We’d take the uncertainty to the budget review alongside that gain.  The 90% interval runs from about &lt;strong&gt;EUR −800 to EUR +3,200&lt;/strong&gt;, so in some plausible versions of Kettle &amp;#x26; Pine the change would do slightly worse.  With both the expected EUR 1,300 gain and its downside in view, marketing and finance can decide whether the change is worth making.&lt;/p&gt;
&lt;figure&gt;
  &lt;picture&gt;
    &lt;source media=&quot;(max-width: 600px)&quot; srcset=&quot;/assets/posts/dont-buy-demand-you-cant-ship/staggered-gain-histogram-mobile.svg&quot; width=&quot;360&quot; height=&quot;340&quot;&gt;
    &lt;img src=&quot;https://simm.is/assets/posts/dont-buy-demand-you-cant-ship/staggered-gain-histogram.svg&quot; width=&quot;700&quot; height=&quot;300&quot; alt=&quot;Two overlaid histograms of the revenue gain of Foerster Marketing&amp;#x27;s closely matching plan, one from PyMC-Marketing and one from Foerster Marketing. They almost coincide, peak around EUR 1,500, and 86 percent of the distribution lies above zero.&quot; loading=&quot;lazy&quot;&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;As a cross-check, each histogram evaluates Foerster Marketing&apos;s closely matching plan under one implementation of the model.  The two implementations were built independently and agree so closely that their bars blend into one shape.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;when-two-channels-always-move-together&quot;&gt;When two channels always move together&lt;/h2&gt;
&lt;p&gt;Now switch to the history in which social and video run together.  If sales rise after every joint campaign, how much credit should each channel get?  One explanation gives most of it to social, another to video, and both can reproduce the sales we saw.  That is why forecasting sales well doesn’t settle where to spend the next euro.  We need to know what happens when we change one channel without the other.&lt;/p&gt;
&lt;p&gt;Statisticians call this an identifiability problem.  For the marketing lead, it means the data leave an important budget question open.  In this version, the recommendation shifts towards social and keeps video near its current level, while the 90% interval for the gain widens to roughly &lt;strong&gt;EUR −1,100 to EUR +4,300&lt;/strong&gt;.  We’d want to understand what supports that shift before acting on it.&lt;/p&gt;
&lt;figure&gt;
  &lt;picture&gt;
    &lt;source media=&quot;(max-width: 600px)&quot; srcset=&quot;/assets/posts/dont-buy-demand-you-cant-ship/co-scheduled-gain-histogram-mobile.svg&quot; width=&quot;360&quot; height=&quot;340&quot;&gt;
    &lt;img src=&quot;https://simm.is/assets/posts/dont-buy-demand-you-cant-ship/co-scheduled-gain-histogram.svg&quot; width=&quot;700&quot; height=&quot;300&quot; alt=&quot;Two overlaid histograms of the revenue gain of Foerster Marketing&amp;#x27;s plan for the overlapping history. They coincide, are wider than in the staggered case, and range from about EUR minus 4,000 to plus 6,000.&quot; loading=&quot;lazy&quot;&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;The same cross-check of Foerster Marketing&apos;s plan for the history in which social and video run together.  The plan differs from the one above, and its spread of outcomes is wider.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This gives us a purpose for an experiment.  A geo-holdout or similar lift test measures what one channel does when only that channel changes, for instance by pausing it in some regions and comparing them with the rest.  The model can then use that evidence to distinguish explanations the spending history couldn’t separate.  This is known as &lt;a href=&quot;https://www.pymc-labs.com/blog-posts/mmm_roas_lift&quot;&gt;calibrating the MMM with lift tests&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the third version of our study, we add one independent video experiment to the overlapping history.  Because its effect also carries over, we give the model the experiment’s whole time path, the weeks before, during and after the treatment.  A single before-and-after contrast would leave out part of the process we’re trying to learn from.&lt;/p&gt;
&lt;p&gt;Since we generated the data, we can score each recommendation against the plan that would truly have been best.  With overlapping flights alone, the model moves money into social and leaves video where it is, and that plan realises only about EUR 1,700 of a possible EUR 3,100 gain.  With the lift test, the recommendation moves back to EUR 1,355 / 2,000 / 1,645 for search, social and video, close to what the model chose when the flights took turns, and it realises about EUR 2,800.  The experiment improves this campaign’s allocation by roughly EUR 1,100 under the hidden truth.  The marketing lead has a reason to change the plan that the overlapping spending history alone could not supply.&lt;/p&gt;
&lt;p&gt;Notice that the experiment barely narrows the uncertainty interval, which still runs from about EUR −1,100 to EUR +4,000.  If we judged it only by the width of that interval, we’d miss its value.  It helps the team put the money in a better place.  As a cross-check, Foerster Marketing fitted the calibrated model independently and agrees: its own optimiser lands within about EUR 30 a week of PyMC’s plan on every channel, and both libraries put the expected gain of PyMC’s plan at about EUR 1,560.&lt;/p&gt;
&lt;p&gt;Weekly spending and true campaign-plus-carryover gains in EUR, using PyMC-Marketing’s recommendations:&lt;/p&gt;

































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Plan&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Search&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Social&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Video&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;True gain&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Overlapping flights&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,375&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;2,402&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,223&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,739&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Overlapping flights + lift test&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,355&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;2,000&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,645&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;2,836&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Best possible (hidden truth)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,098&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;2,085&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,817&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;3,114&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Before using an experiment this way in a real engagement, we’d also ask whether its market resembles the rest of the business and whether the benefit justifies the cost of the study.  Our example doesn’t price that cost.&lt;/p&gt;
&lt;h2 id=&quot;a-budget-for-the-business-you-have-today&quot;&gt;A budget for the business you have today&lt;/h2&gt;
&lt;p&gt;The marketing lead now has an allocation to take to finance.  The model has been checked, the experiment gives the team a reason to improve the channel mix, and the uncertainty is there to inspect.  Operations can help refine the plan further.  Nearly 700 orders are waiting to ship, and the team expects capacity to recover in three weeks.  How much demand is worth acquiring while those orders move through fulfilment?&lt;/p&gt;
&lt;p&gt;In this extension of our fictional business, a staffing shortage cut fulfilment capacity three weeks ago.  Delayed orders create compensation and support costs, and some customers cancel.  Those costs affect what the campaign can earn.  By including them in the planning, the team can choose a spending level that makes better use of the capacity available now and revisit it as fulfilment recovers.&lt;/p&gt;
&lt;p&gt;To answer that, we need an estimate of capacity.  Imagine two warehouses that both shipped 550 orders last week.  The first had only 550 orders available.  The second still has hundreds waiting.  Would you draw the same conclusion about how much they could ship next week?  In the first warehouse, the report tells us little about spare capacity.  In the second, it gives us evidence of a bottleneck.  So the backlog changes what the shipment count can tell us.&lt;/p&gt;
&lt;p&gt;A shipment count is the end of a process.  Orders arrive, the warehouse ships up to its capacity, some waiting orders cancel, and the rest carry into the next week.  We use Foerster to run those rules under alternative capacity assumptions and compare the resulting shipments with the reports.  Each hypothesis has to explain what happened from the state the warehouse was in when the disruption began.&lt;/p&gt;
&lt;p&gt;From three weeks of shipment reports, Foerster estimates reduced capacity at about 550 orders a week, give or take 20, compared with the usual 900.  The true figure, which we hid from the inference, is 560.  We then call the same warehouse function to simulate the next nine weeks from today’s backlog, pairing draws from the marketing and capacity estimates.  It counts orders shipped, delayed and cancelled, and we use margin, delay costs and advertising spend to calculate profit.&lt;/p&gt;
&lt;figure&gt;
  &lt;picture&gt;
    &lt;source media=&quot;(max-width: 600px)&quot; srcset=&quot;/assets/posts/dont-buy-demand-you-cant-ship/profit-by-budget-mobile.svg&quot; width=&quot;360&quot; height=&quot;400&quot;&gt;
    &lt;img src=&quot;https://simm.is/assets/posts/dont-buy-demand-you-cant-ship/profit-by-budget.svg&quot; width=&quot;700&quot; height=&quot;360&quot; alt=&quot;Campaign profit at weekly budgets from EUR 0 to 7,500, compared with keeping EUR 5,000 per week. With a clear warehouse, profit peaks at EUR 3,750 and is practically level up to EUR 5,000. With the backlog, it peaks at EUR 2,500, about EUR 4,300 above the EUR 5,000 plan, and falls steeply at higher budgets.&quot; loading=&quot;lazy&quot;&gt;
  &lt;/picture&gt;
  &lt;figcaption&gt;Profit over the four campaign weeks and five weeks of carryover, compared with keeping EUR 5,000 per week.  Lines are posterior means and bands are 90% intervals.  Blue starts from an empty warehouse at normal capacity, orange from today&apos;s backlog of 681 orders and the reduced capacity inferred from the shipment reports.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;With an empty warehouse, any budget between EUR 3,750 and 5,000 a week earns about the same, within EUR 250 over the whole campaign.  With today’s backlog, EUR 2,500 a week makes the best use of the campaign budget.  Compared with keeping EUR 5,000, it earns about EUR 4,300 more, and the 90% interval of that difference, EUR 3,000 to 5,400, stays well above zero.  The larger EUR 7,500 plan earns about EUR 6,800 less than keeping EUR 5,000.  And since we wrote the warehouse too, we can check against the truth once more: with the hidden capacity and the true advertising effects, EUR 2,500 is indeed the most profitable budget, beating the EUR 5,000 plan by EUR 4,400.&lt;/p&gt;
&lt;p&gt;We’ve kept the marketing evidence the same.  Bringing fulfilment into the decision helps the team choose how much demand to buy today.  Once capacity recovers, the same models would recommend spending more again.  Marketing and operations now have a shared reason to bring the next shipment report back to the budget review: it helps them recognise when more advertising becomes worthwhile.&lt;/p&gt;
&lt;p&gt;This is the kind of recurring decision we want simulation to help with.  Our &lt;a href=&quot;https://simm.is/blog/stuttgart-in-a-posterior&quot;&gt;Stuttgart demonstrator&lt;/a&gt; simulated a whole city to ask what would happen to its shops if a shopping centre moved.  Kettle &amp;#x26; Pine needs a much smaller simulation, but it has a question that comes back every budget cycle.  Following demand through fulfilment lets the team connect its campaign investment to the profit it can earn.&lt;/p&gt;
&lt;h2 id=&quot;inference-that-runs-where-the-business-runs&quot;&gt;Inference that runs where the business runs&lt;/h2&gt;
&lt;p&gt;For a Python analytics team, PyMC-Marketing is a practical starting point for measurement and allocation.  Its budget optimiser already accepts custom constraints and objectives, and an operational model can be built alongside it.  We can help the team check whether its records support the allocation it wants to make, fit and validate the model, and bring experiments into the next budget review.&lt;/p&gt;
&lt;p&gt;We kept the &lt;a href=&quot;https://github.com/replikativ/foerster-marketing/blob/main/examples/kettle_and_pine/warehouse.clj&quot;&gt;warehouse example&lt;/a&gt; small enough to check independently.  It has a backlog, capacity and fixed rules for cancellations and delay costs, and we could have written a separate analytical model of it.  We checked the capacity estimate against an independent numerical calculation, and a separate Python implementation reproduced the profit calculation.&lt;/p&gt;
&lt;p&gt;What we want to carry further is the connection to the application.  Suppose yours already decides which orders get stock first, whether to split a shipment and when to offer compensation.  Those rules affect both what the shipment reports tell you and what another campaign would earn.  We’d like inference and forecasts to run that code too, because every rule change otherwise gives you two implementations to keep in step.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/replikativ/foerster&quot;&gt;Foerster&lt;/a&gt; is our probabilistic programming library for Clojure on the JVM.  &lt;a href=&quot;https://clojure.org/reference/data_structures&quot;&gt;Clojure’s immutable, persistent data structures&lt;/a&gt; let different versions share unchanged data while keeping their updates separate.  That is a useful foundation for exploring several possible futures of an application.  Spindel, the runtime beneath Foerster, manages the execution state and its forks.&lt;/p&gt;
&lt;p&gt;Foerster’s particle methods can start from the application’s managed state, execute compatible application logic in separate forks under uncertain assumptions, and compare the resulting histories with observations.  The same logic can then evaluate proposed plans.  In our synthetic warehouse, both steps call the same fulfilment function and leave the caller’s state unchanged.  We haven’t integrated the example with a retailer’s production application.&lt;/p&gt;
&lt;p&gt;A separate &lt;a href=&quot;https://github.com/replikativ/foerster/blob/v0.1.137/notebooks/foerster/queue.clj&quot;&gt;queue demonstration&lt;/a&gt; shows why the starting state matters.  Hypotheses about service speed run through the application’s scheduling function, and including work already in flight changes which hypothesis the completion reports support.  A future run can explore a different queue without changing the parent’s managed state.  External actions such as issuing an actual refund still need to be kept out of speculative runs.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/replikativ/foerster-marketing&quot;&gt;Foerster Marketing&lt;/a&gt; supplies the demand model in this JVM setting.  We implemented Kettle &amp;#x26; Pine’s model in both libraries and checked that they agree, with identical data and priors, independently verified densities and gradients, matching posterior estimates and closely matching recommended plans.  PyMC still fits this model faster.  We’d use Foerster where we want that model to work with the application’s logic and managed state.&lt;/p&gt;
&lt;p&gt;Running the application’s code still leaves us modelling choices to check.  In this study, we fit demand and capacity separately and treat them as independent, and we supply the cancellation and cost assumptions.  At each candidate budget, we choose the channel mix for revenue, then use the warehouse simulation to compare budget levels.  We’d need a further step to optimise channel mix and profit jointly.  More application detail would earn its place when it changed the decision or exposed a failure in the simpler model.&lt;/p&gt;
&lt;h2 id=&quot;bring-us-a-decision&quot;&gt;Bring us a decision&lt;/h2&gt;
&lt;p&gt;We start with the investment your team wants to make and the decision it keeps coming back to.  Then we look at the spending and outcome history, campaign changes, promotions and any lift experiments.  Before fitting a model, we ask what those records can tell us and where another experiment would help.  The aim is a review your team can repeat, with a documented model, checks against held-out data, feasible plans and the uncertainty about their differences.  Agreeing on how to evaluate the recommendation in practice is part of that work.&lt;/p&gt;
&lt;p&gt;To connect the campaign to its business outcome, we work with the people who own fulfilment or other relevant processes to identify the state and rules that affect the decision.  A first simulation may be small, like Kettle &amp;#x26; Pine’s warehouse.  Where compatible application logic already exists, we can help it participate directly in inference and plan evaluation, and check the results against observed operations.&lt;/p&gt;
&lt;p&gt;If your team is preparing its next budget, &lt;a href=&quot;mailto:info@simm.is&quot;&gt;get in touch&lt;/a&gt; with the decision, the history you have and the constraints that matter.  We can help with PyMC-Marketing in Python, or with Foerster where the analysis needs to run inside your business processes on the JVM.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;All data in this article are synthetic.  The PyMC-Marketing results use version 1.3.0 with PyMC’s default NUTS sampler and four chains of 4,000 draws.  The executable study, its validation records and the performance measurements are in the &lt;a href=&quot;https://github.com/replikativ/foerster-marketing&quot;&gt;Foerster Marketing repository&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title>Lean on the JVM: proved functions for Java and Clojure</title><link>https://simm.is/blog/lean-on-the-jvm/</link><guid isPermaLink="true">https://simm.is/blog/lean-on-the-jvm/</guid><description>Prove properties of a Lean function, call it from a Java or Clojure service, let Lean call back into the application, and deploy a prepared artifact with the Ansatz Lean/JVM SDK.</description><pubDate>Wed, 04 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Imagine a pricing service written in Java.  Customers request a discount, and the business has two firm rules: a discount may never exceed the order subtotal, and it may never exceed the policy cap.  Unit tests check a few dozen combinations of amounts, but the rules speak about every order.  Sooner or later, a refactoring or a new promotion meets an input nobody tested.&lt;/p&gt;
&lt;p&gt;Lean, a programming language and proof assistant, lets you state such a rule as a theorem and have the computer check a proof that it holds for every input.  But adopting it usually means leaving the JVM.  Lean compiles to native code, and connecting that code to a Java service is a project of its own.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://github.com/replikativ/ansatz/tree/0.2.615/modules/lean-jvm&quot;&gt;Ansatz Lean/JVM SDK&lt;/a&gt; removes that step.  You write the function and its proofs in Lean, prepare the compiled code during your build, and call it from Java or Clojure like any other library.  The deployed service needs no Lean installation.  We are introducing this workflow with &lt;a href=&quot;https://github.com/replikativ/ansatz/releases/tag/0.2.615&quot;&gt;release 0.2.615&lt;/a&gt;, and this post follows the pricing rule from proof to production, then shows how Lean code can call back into the application.&lt;/p&gt;
&lt;h2 id=&quot;write-the-rule-down-then-prove-it&quot;&gt;Write the rule down, then prove it&lt;/h2&gt;
&lt;p&gt;First, the rule itself.  Amounts are whole numbers in the currency’s smallest unit, such as cents.  Save this as &lt;code&gt;Pricing.lean&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;lean&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Pricing&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; discount&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (subtotal requested cap : Nat) : Nat :=&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  min subtotal (min requested cap)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;theorem&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; discount_le_subtotal&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (subtotal requested cap : Nat) :&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    discount subtotal requested cap ≤ subtotal :=&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  Nat.min_le_left _ _&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;theorem&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; discount_le_cap&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (subtotal requested cap : Nat) :&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    discount subtotal requested cap ≤ cap :=&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  Nat.le_trans (Nat.min_le_right _ _) (Nat.min_le_right _ _)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;theorem&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; discount_eq_requested&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {subtotal requested cap : Nat}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    (h₁ : requested ≤ subtotal) (h₂ : requested ≤ cap) :&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    discount subtotal requested cap = requested := &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;by&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  simp only [discount, Nat.min_eq_left h₂, Nat.min_eq_right h₁]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Pricing&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The definition takes one line: the discount is the smallest of the subtotal, the requested amount and the cap.  The theorems are the interesting part.  The first says that the discount never exceeds the subtotal, and the second that it never exceeds the cap.  But a function that always returns zero would satisfy both bounds, so the third theorem adds that a request within both limits is granted unchanged.  Lean checks all three for every possible input when it builds the file.&lt;/p&gt;
&lt;p&gt;Of course, a proof is only as good as its statement.  Lean guarantees that this definition has these properties; whether they are the right properties remains a business question.  The guarantee also covers the Lean code only.  The compiler, the JVM runtime and the integration that carry the result into Java are trusted rather than proved.  Proofs are erased from the compiled code, so the service never runs a theorem prover on a request.&lt;/p&gt;
&lt;p&gt;The example is small on purpose.  A team can start with one rule like this, keep its database, HTTP handlers and deployment in Java or Clojure, and move more logic into Lean only where proofs pay off.&lt;/p&gt;
&lt;h2 id=&quot;prepare-the-code-once-during-the-build&quot;&gt;Prepare the code once, during the build&lt;/h2&gt;
&lt;p&gt;Next, add the SDK to an existing Maven project:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;repositories&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;clojars&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;https://repo.clojars.org/&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;repositories&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;dependencies&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;dependency&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;groupId&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;org.replikativ&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;groupId&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;artifactId&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;ansatz-lean-jvm&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;artifactId&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;0.2.615&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;version&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;dependency&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;color:#85E89D&quot;&gt;dependencies&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It runs on JDK 17 or later and brings Clojure and a JSON library along as ordinary Maven dependencies.  It does not need the core Ansatz kernel or a Mathlib store.  For the commands below, write the resolved classpath to a file:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;mvn&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; dependency:build-classpath&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; -Dmdep.outputFile=target/lean-classpath&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; SDK_CLASSPATH&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;$(&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;cat&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; target/lean-classpath)&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Preparation is the only step that needs native tools.  It uses the official Lean 4.33.1 toolchain and a &lt;a href=&quot;https://github.com/replikativ/ansatz/blob/0.2.615/modules/lean-jvm/producer/README.md#host-binding-producer&quot;&gt;published bundle of helper programs&lt;/a&gt; that export what the JVM needs.  For now, it runs on Linux x86-64 with &lt;code&gt;prlimit&lt;/code&gt; available.  Set &lt;code&gt;LEAN_SYSROOT&lt;/code&gt;, &lt;code&gt;PRODUCER_BUNDLE&lt;/code&gt; and &lt;code&gt;COMPILER_CACHE&lt;/code&gt; to the toolchain, the extracted bundle and a cache directory.  Then place &lt;code&gt;Pricing.lean&lt;/code&gt; in a directory named &lt;code&gt;pricing&lt;/code&gt; and prepare the function:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;java&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; -cp&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$SDK_CLASSPATH&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; ansatz.lean.jvm.LeanPreparation&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  --source&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; ./pricing&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  --sysroot&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$LEAN_SYSROOT&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  --producer-bundle&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$PRODUCER_BUNDLE&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  --cache&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$COMPILER_CACHE&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  --root-module&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; Pricing&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  --entry&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; Pricing.discount&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;  --output&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; ./pricing.leanjvm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The result is a single file, &lt;code&gt;pricing.leanjvm&lt;/code&gt;.  It contains Lean’s compiled intermediate code, together with the function types, data layouts and initialisation steps that the JVM needs.  The command also prints two fingerprints, which are SHA-256 hashes.  Keep the manifest hash in your application’s configuration.  When the service loads the artifact, it checks the file against that fingerprint, so a changed or swapped file is rejected.  One caveat applies to proprietary code: the artifact also contains the Lean source files and compiled modules, so treat it like the source itself.  The &lt;a href=&quot;https://github.com/replikativ/ansatz/blob/0.2.615/modules/lean-jvm/PREPARATION.md&quot;&gt;preparation guide&lt;/a&gt; covers the details.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 300 380&quot; style=&quot;display:block;width:100%;max-width:26rem;height:auto;margin-inline:auto&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-labelledby=&quot;lean-jvm-architecture-title&quot;&gt;
  &lt;title id=&quot;lean-jvm-architecture-title&quot;&gt;The native Lean build prepares an artifact. A JVM application loads it and calls the Java interpreter without a native Lean toolchain.&lt;/title&gt;
  &lt;g font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;14&quot; fill=&quot;var(--ink)&quot;&gt;
    &lt;rect x=&quot;8&quot; y=&quot;8&quot; width=&quot;284&quot; height=&quot;76&quot; fill=&quot;var(--paper)&quot; stroke=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;
    &lt;rect x=&quot;8&quot; y=&quot;8&quot; width=&quot;6&quot; height=&quot;76&quot; fill=&quot;var(--runtime-amber)&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;20&quot; y=&quot;36&quot;&gt;Lean source + dependencies&lt;/text&gt;
    &lt;text x=&quot;20&quot; y=&quot;61&quot;&gt;Official native Lean build&lt;/text&gt;
    &lt;path d=&quot;M150 84V108&quot; stroke=&quot;var(--ink)&quot; stroke-width=&quot;2&quot;&gt;&lt;/path&gt;
    &lt;rect x=&quot;8&quot; y=&quot;108&quot; width=&quot;284&quot; height=&quot;64&quot; fill=&quot;var(--paper)&quot; stroke=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;20&quot; y=&quot;135&quot;&gt;Prepared artifact + hash&lt;/text&gt;
    &lt;text x=&quot;20&quot; y=&quot;158&quot;&gt;IR, types, initialization&lt;/text&gt;
    &lt;path d=&quot;M150 172V196&quot; stroke=&quot;var(--ink)&quot; stroke-width=&quot;2&quot;&gt;&lt;/path&gt;
    &lt;rect x=&quot;8&quot; y=&quot;196&quot; width=&quot;284&quot; height=&quot;76&quot; fill=&quot;var(--paper)&quot; stroke=&quot;var(--ink)&quot; stroke-width=&quot;2&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;20&quot; y=&quot;224&quot;&gt;Java IR interpreter&lt;/text&gt;
    &lt;text x=&quot;20&quot; y=&quot;249&quot;&gt;SDK + Maven dependencies&lt;/text&gt;
    &lt;path d=&quot;M150 272V296&quot; stroke=&quot;var(--ink)&quot; stroke-width=&quot;2&quot;&gt;&lt;/path&gt;
    &lt;rect x=&quot;8&quot; y=&quot;296&quot; width=&quot;284&quot; height=&quot;76&quot; fill=&quot;var(--paper)&quot; stroke=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;20&quot; y=&quot;324&quot;&gt;Java / Clojure application&lt;/text&gt;
    &lt;text x=&quot;20&quot; y=&quot;349&quot;&gt;Calls, values, host services&lt;/text&gt;
  &lt;/g&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Native tooling belongs to preparation.  The deployed artifact runs with the SDK and its ordinary JVM dependencies.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;call-it-like-any-other-java-method&quot;&gt;Call it like any other Java method&lt;/h2&gt;
&lt;p&gt;Then, in the deployed application, load the artifact and ask for the function by name.  Save this as &lt;code&gt;PricingApp.java&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; ansatz.lean.jvm.&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; java.math.BigInteger;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; java.nio.file.Files;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; java.nio.file.Path;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; PricingApp&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;    public&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; static&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt; void&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;throws&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Exception {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;        try&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (Lean runtime &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Lean.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;             var&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; input &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Files.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;newInputStream&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(Path.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(args[&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;]));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;             LeanProject project &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; runtime.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;loadArtifact&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(input, args[&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;])) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;            LeanFunction discount &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; project.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Pricing.discount&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;            BigInteger amount &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (BigInteger) discount.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;10_000&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;1_500&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;1_000&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;            System.out.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(amount);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;java&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; --class-path&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$SDK_CLASSPATH&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; PricingApp.java&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; \&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;  pricing.leanjvm&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;$EXPECTED_MANIFEST_SHA256&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It prints &lt;code&gt;1000&lt;/code&gt;, because the requested 1,500 is capped at 1,000.  Behind the call, the SDK checks the arguments against the Lean signature and converts the result into a &lt;code&gt;BigInteger&lt;/code&gt;.  The same works for booleans, strings, lists, arrays, pairs, optional values and success-or-error results, and Lean records and recursive datatypes arrive as immutable Java objects.&lt;/p&gt;
&lt;p&gt;Clojure developers resolve the same release:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;{:deps {org.replikativ/ansatz-lean-jvm {:mvn/version &quot;0.2.615&quot;}}}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;{:deps {org.replikativ/ansatz-lean-jvm {:mvn/version &quot;0.2.615&quot;}}}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and can call the function from the REPL:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;require(&apos;[ansatz.lean.jvm :as lean], &apos;[clojure.java.io :as io])

with-open [runtime lean/open(),
           input io/input-stream(&quot;pricing.leanjvm&quot;),
           project lean/load-artifact(runtime,
                     input,
                     System/getenv(&quot;EXPECTED_MANIFEST_SHA256&quot;))]:
  discount := lean/function(project, &quot;Pricing.discount&quot;)
  [discount(10000, 1500, 1000) discount(200, 1500, 1000)]
end
;; =&gt; [1000 200]&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(require &apos;[ansatz.lean.jvm :as lean]
         &apos;[clojure.java.io :as io])

(with-open [runtime (lean/open)
            input (io/input-stream &quot;pricing.leanjvm&quot;)
            project (lean/load-artifact runtime input
                      (System/getenv &quot;EXPECTED_MANIFEST_SHA256&quot;))]
  (let [discount (lean/function project &quot;Pricing.discount&quot;)]
    [(discount 10000 1500 1000)
     (discount 200 1500 1000)]))
;; =&gt; [1000 200]&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The Superficie tab shows the same Clojure forms in another notation.  Both run on the same runtime.&lt;/p&gt;
&lt;h2 id=&quot;let-lean-call-the-application&quot;&gt;Let Lean call the application&lt;/h2&gt;
&lt;p&gt;So far, information has flowed in one direction, from Java into Lean.  Real business logic, however, also needs the application: a configuration value, a database lookup or an exchange rate.  This is where running Lean inside the JVM pays off most.  If you compile Lean natively instead, you load a platform-specific library through JNI or Panama, start Lean’s runtime and convert every value by hand, as the &lt;a href=&quot;https://github.com/saviorand/lean-android-compose&quot;&gt;lean-android-compose&lt;/a&gt; demonstration does for an Android app.  Calling back into Java then needs C glue code as well.  The harder part is memory.  Lean frees its objects by reference counting, while the JVM uses a garbage collector, and neither sees the other’s references.  A Java object that holds a Lean value must release it when the collector reclaims the Java object, a Lean value that holds a Java object must keep a JNI reference until Lean frees it, and a cycle across the boundary is reclaimed by neither side.  With the SDK, both directions use ordinary Java and Clojure values, and the garbage collector manages all of them.&lt;/p&gt;
&lt;p&gt;Suppose the cap depends on the customer’s segment and lives in the application’s configuration.  Add a declaration without a body to &lt;code&gt;Pricing.lean&lt;/code&gt;, together with a function that uses it:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;lean&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Pricing&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;extern&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt; &quot;ansatz_jvm_policy_cap&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;] &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;opaque&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; policyCap : String → IO Nat&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; quote&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (subtotal requested : Nat) (segment : String) : IO Nat := &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;do&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  pure (discount subtotal requested (← policyCap segment))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Pricing&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Prepare it with &lt;code&gt;--entry Pricing.quote --entry Pricing.policyCap&lt;/code&gt;.  When the application loads the artifact, it supplies the implementation under the declaration’s name:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;java&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;HostBindings bindings &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; HostBindings.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;builder&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    .&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;io&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Pricing.policyCap&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;config/1&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, arguments &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;        Long cap &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; caps.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;((String) arguments.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;        if&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (cap &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt; null&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;throw&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; LeanIOError.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;userError&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Unknown segment&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; BigInteger.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;valueOf&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(cap);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    })&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;    .&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;LeanProject project &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; runtime.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;loadArtifact&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(input, expectedManifestSHA256, bindings);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;IOResult&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;&gt; result &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (IOResult&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;&amp;#x3C;?&gt;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;) project.&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt;call&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Pricing.quote&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;10_000&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;1_500&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;retail&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With caps of 1,000 for &lt;code&gt;retail&lt;/code&gt; and 2,500 for &lt;code&gt;partner&lt;/code&gt;, the two quotes are &lt;code&gt;1000&lt;/code&gt; and &lt;code&gt;1500&lt;/code&gt;.  An unknown segment reaches Lean as an ordinary &lt;code&gt;IO&lt;/code&gt; error and comes back to Java as a &lt;code&gt;LeanException&lt;/code&gt; with its message.  In Clojure, the binding is a map entry, &lt;code&gt;{&quot;Pricing.policyCap&quot; {:implementation-id &quot;config/1&quot; :effect :io :fn (fn [segment] (get caps segment))}}&lt;/code&gt;, passed to &lt;code&gt;lean/load-artifact&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Notice what happens to the proof.  &lt;code&gt;discount_le_cap&lt;/code&gt; holds for every cap, so it also covers whatever value the configuration returns, and the quote can never exceed the configured cap.  A trust boundary appears only when host code &lt;em&gt;replaces&lt;/em&gt; a Lean definition, because type checking a binding does not prove that it behaves like the code it replaces.  For now, bindings are first-order and synchronous, so they cannot take functions as arguments or run asynchronously.  The &lt;a href=&quot;https://github.com/replikativ/ansatz/blob/0.2.615/modules/lean-jvm/FFI.md&quot;&gt;host-binding guide&lt;/a&gt; covers pure bindings, replacements with a Lean fallback and custom result types.&lt;/p&gt;
&lt;h2 id=&quot;run-it-in-a-service&quot;&gt;Run it in a service&lt;/h2&gt;
&lt;p&gt;In production, a few more questions come up.  The first is lifetime.  Open the Project, as the SDK calls a loaded artifact, once and reuse its function handles.  Calls share its code and initialised globals and run one at a time, so use several Projects for parallel work.  A new version of the code means loading a new Project; state migration and public execution forks are separate work.&lt;/p&gt;
&lt;p&gt;The second is runaway computation.  Each call runs under a budget, by default two million interpreter instructions and five seconds.  When a workload needs more, raise the budget per call with &lt;code&gt;InvocationOptions.empty().withBudget(instructions, duration)&lt;/code&gt; and &lt;code&gt;invokeWith&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The third is failure.  Invalid arguments are rejected before anything runs, and an &lt;code&gt;IO&lt;/code&gt; function that returns an error reports it as a &lt;code&gt;LeanException&lt;/code&gt;.  In both cases, the Project stays usable.  But when a call fails halfway, for example because it exhausted its budget, the SDK cannot know what state the Lean code left behind.  It therefore refuses further calls with &lt;code&gt;ProjectFailed&lt;/code&gt; until you call &lt;code&gt;project.restart()&lt;/code&gt;.  The restart builds a fresh engine from the same verified artifact and keeps your function handles.  Module initialisers run again, so globals start over.&lt;/p&gt;
&lt;p&gt;Finally, panics behave as in native Lean.  &lt;code&gt;panic!&lt;/code&gt; and an out-of-bounds &lt;code&gt;xs[i]!&lt;/code&gt; print a message to stderr and continue with a default value.  If you prefer a hard stop, an option turns a reached panic into a failure instead.  The &lt;a href=&quot;https://github.com/replikativ/ansatz/blob/0.2.615/modules/lean-jvm/README.md#running-in-a-service&quot;&gt;SDK guide&lt;/a&gt; covers all four questions.&lt;/p&gt;
&lt;h2 id=&quot;bring-an-existing-lean-project&quot;&gt;Bring an existing Lean project&lt;/h2&gt;
&lt;p&gt;Most teams will not start from a blank file, so we also tried real library code.  The &lt;a href=&quot;https://github.com/leanprover/fp-lean/blob/0abeea545d560a324e2561f7210fbd6ed154fa02/examples/Examples/ProgramsProofs/InstrumentedInsertionSort.lean&quot;&gt;insertion-sort module from Functional Programming in Lean&lt;/a&gt; uses polymorphic arrays, typeclass comparison, proofs about array size and a termination argument.  We load the unchanged module as a dependency of a small Lake project and add one function for the JVM to call:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;lean&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; Examples.ProgramsProofs.InstrumentedInsertionSort&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;namespace&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; LakeTutorial&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#B392F0&quot;&gt; sortAndOriginal&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; (xs : Array Nat) : IO (Array Nat × Array Nat) :=&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;  pure (insertionSort xs, xs)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; LakeTutorial&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The caller’s &lt;a href=&quot;https://github.com/replikativ/ansatz/tree/0.2.615/modules/lean-jvm/test/fixtures/lake-corpus/fp-sort&quot;&gt;Lake configuration&lt;/a&gt; requires the pinned fp-lean examples package, which Lake builds first.  The SDK’s &lt;code&gt;builtLakeWorkspace()&lt;/code&gt; option, or the CLI flag &lt;code&gt;--source-mode built-lake&lt;/code&gt;, then takes the built workspace as it is, without fetching or building anything itself.  A Java call with &lt;code&gt;List.of(3, 1, 2)&lt;/code&gt; returns &lt;code&gt;[[1, 2, 3], [3, 1, 2]]&lt;/code&gt; as &lt;code&gt;BigInteger&lt;/code&gt; values, and Clojure receives the same pair of vectors.  Keeping the original array next to the sorted one also exercises the runtime’s copy-on-write behaviour.  Because insertion sort is quadratic, a few hundred elements fit the default budget, while larger inputs need a raised one.&lt;/p&gt;
&lt;p&gt;The module proves that sorting preserves the array’s size and terminates, although it does not prove that the result is sorted.  It is the work of David Thrane Christiansen and the Functional Programming in Lean contributors.  Our &lt;a href=&quot;https://github.com/replikativ/ansatz/tree/0.2.615/modules/lean-jvm/test/fixtures/lake-corpus&quot;&gt;corpus&lt;/a&gt; pins the revision, and the &lt;a href=&quot;https://github.com/replikativ/ansatz/blob/0.2.615/modules/lean-jvm/examples/fp-lean-sort/README.md#attribution-and-source-license&quot;&gt;attribution and CC BY 4.0 source licence&lt;/a&gt; document the original work.  The &lt;a href=&quot;https://github.com/replikativ/ansatz/blob/0.2.615/modules/lean-jvm/LAKE.md&quot;&gt;Lake guide&lt;/a&gt; explains this path, and our native CI also runs selected argument-parsing functions from the unchanged &lt;code&gt;lean4-cli&lt;/code&gt; library.&lt;/p&gt;
&lt;h2 id=&quot;why-the-interpreter-can-fork&quot;&gt;Why the interpreter can fork&lt;/h2&gt;
&lt;p&gt;Why interpret Lean at all, instead of only calling native code?  The answer comes from our own product.  Simmis is designed so that people and agents can try a change in a separate branch before anyone accepts it, and that branching should reach running computations as well as stored data.  For Clojure, we have already &lt;a href=&quot;https://simm.is/blog/a-repl-you-can-fork&quot;&gt;extended SCI, a Clojure interpreter, so that a session can fork into independent histories&lt;/a&gt;.  Simulations need the same ability.  In our &lt;a href=&quot;https://simm.is/blog/stuttgart-in-a-posterior&quot;&gt;Stuttgart city model&lt;/a&gt;, a policy question is an intervention evaluated with the same random draws as the baseline, which is easiest when the what-if continues from the very same state.&lt;/p&gt;
&lt;p&gt;We are not the first to run Lean’s compiled code on the JVM.  &lt;a href=&quot;https://github.com/chitoge/lean4j&quot;&gt;Lean4J&lt;/a&gt; exports it as JSON and interprets it on GraalVM’s Truffle framework, which compiles hot code to machine code and lets Java, JavaScript and Python pass callbacks in.  Its focus is speed and polyglot tooling such as debugging and profiling, it requires GraalVM, and its README states that it is not meant as a faithful drop-in for native Lean.  Our SDK makes different trade-offs.  It runs on any JDK 17, loads only artifacts that match a trusted fingerprint, takes its Java and Clojure types from Lean’s checked signatures, and refuses unsupported operations before a program starts.  It also keeps the whole execution state forkable, which matters most for Simmis.  Truffle-style compilation remains a promising route to speed, and we see it as a possible later backend rather than a competing design.&lt;/p&gt;
&lt;p&gt;Because the SDK keeps Lean’s entire execution state as JVM objects, it can copy that state.  Its engine can already fork a paused computation, at any point in its execution, into two engines that continue independently, and the engine tests check that control state, ownership and output stay separate.  The public SDK does not expose forks yet, so this is groundwork rather than a feature of this release.&lt;/p&gt;
&lt;p&gt;Internally, we also write most of our verified code in Clojure rather than in Lean’s own syntax.  &lt;a href=&quot;https://github.com/replikativ/ansatz&quot;&gt;Core Ansatz&lt;/a&gt; implements Lean 4’s kernel in Java and offers the same type theory as Clojure forms, so definitions and theorems written in Clojure are checked against the same libraries, such as Mathlib.  That lets us add types and proofs to existing Clojure code gradually, one function at a time, and call the results as ordinary Clojure.  The SDK described here complements it for code that already exists in Lean.  The two can run in the same application, although loading executable code with the SDK does not import its theorems into the Ansatz kernel.&lt;/p&gt;
&lt;h2 id=&quot;what-comes-next&quot;&gt;What comes next&lt;/h2&gt;
&lt;p&gt;This release is a starting point, and two goals guide the next ones.  The first is speed.  Today the SDK interprets Lean’s compiled code, and the JVM’s just-in-time compiler optimises that interpreter.  Our near-term aim is to be competitive with Lean’s own interpreter, &lt;code&gt;lean --run&lt;/code&gt;.  For workloads that need more, the direction is to compile and specialise Lean code for the JVM, aiming at compiled Lean performance for selected workloads.  We have not yet published representative benchmarks.  Startup is already cheaper: the SDK’s own Clojure layer ships precompiled, so a fresh JVM pays Clojure’s startup cost but does not compile the SDK.&lt;/p&gt;
&lt;p&gt;The second goal is coverage of Lean’s language, standard libraries and runtime services.  The current release supports common application types, custom datatypes, explicit IO services and Lean’s Nat, Int and unsigned fixed-width arithmetic.  A program that needs an operation outside this profile is refused before it starts, not partway through.  Public entry points use closed first-order signatures, and tasks, public forks and Mathlib-heavy projects remain outside this release.  A prepared project may contain at most 128 modules besides Lean’s core library, Init.  The &lt;a href=&quot;https://github.com/replikativ/ansatz/blob/0.2.615/modules/lean-jvm/COMPATIBILITY.md&quot;&gt;compatibility ledger&lt;/a&gt; records the details.&lt;/p&gt;
&lt;p&gt;Lean libraries written partly in C need more work still.  Java’s &lt;a href=&quot;https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/foreign/package-summary.html&quot;&gt;Foreign Function and Memory API&lt;/a&gt;, available in JDK 22 and later, offers a route to native libraries.  However, Lean’s &lt;a href=&quot;https://lean-lang.org/doc/reference/latest/Run-Time-Code/Foreign-Function-Interface/&quot;&gt;object representation and ownership rules&lt;/a&gt; still need explicit bridges, and this release includes none.&lt;/p&gt;
&lt;p&gt;The next useful compatibility target may be your application.  &lt;a href=&quot;https://github.com/replikativ/ansatz/issues&quot;&gt;Bring us the Lean project and the functions you want to run&lt;/a&gt;, together with the JVM environment and workload that matter to you.  That tells us which language features, runtime operations and performance requirements to prioritise.&lt;/p&gt;</content:encoded></item><item><title>Probabilistic programming for Clojure programmers: write the model once, choose the inference later</title><link>https://simm.is/blog/write-the-model-once/</link><guid isPermaLink="true">https://simm.is/blog/write-the-model-once/</guid><description>Probabilistic programming explained as constraint programming with soft constraints, then one forecasting model run under several inference methods with Foerster, an MIT-licensed Clojure library, each result checked against an exact answer.</description><pubDate>Fri, 16 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;If you have used core.logic, you already know half of probabilistic programming.  A logic program states constraints and lets the system search for the values that satisfy them.  A probabilistic program does the same, except that a constraint can be soft: a value that fits the data poorly is not ruled out, only made less likely.  Two dice show the idea below.  A small forecasting model then runs under several inference methods in &lt;a href=&quot;https://github.com/replikativ/foerster&quot;&gt;Foerster&lt;/a&gt;, an MIT-licensed probabilistic programming library for Clojure, and every result is checked against an exact answer.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Foerster continues the &lt;a href=&quot;https://github.com/probprog/anglican&quot;&gt;Anglican&lt;/a&gt; line of probabilistic programming in Clojure.  Christian Weilbach, who wrote it, did his PhD in &lt;a href=&quot;https://plai.cs.ubc.ca/&quot;&gt;Frank Wood’s group&lt;/a&gt; at the University of British Columbia, where Anglican was built.&lt;/p&gt;
&lt;h2 id=&quot;what-is-a-probabilistic-program&quot;&gt;What is a probabilistic program?&lt;/h2&gt;
&lt;p&gt;Take two dice and the constraint that they sum to 7.  Without any library, the plainest way to find the pairs that meet it is to generate pairs at random and keep the ones that pass:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;defn roll []:
  inc(rand-int(6))
end

defn generate-and-test [n]:
  loop [kept []]:
    if n = count(kept):
      kept
    else:
      a := roll()
      b := roll()
      recur(if 7 = a + b:
              conj(kept, [a b])
            else:
              kept
            end)
    end
  end
end

frequencies(generate-and-test(6000))
;; each of [1 6] [2 5] [3 4] [4 3] [5 2] [6 1] about 1000 times&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(defn roll [] (inc (rand-int 6)))

(defn generate-and-test [n]
  (loop [kept []]
    (if (= n (count kept))
      kept
      (let [a (roll) b (roll)]
        (recur (if (= 7 (+ a b)) (conj kept [a b]) kept))))))

(frequencies (generate-and-test 6000))
;; each of [1 6] [2 5] [3 4] [4 3] [5 2] [6 1] about 1000 times&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The random choices form a generative model, a small simulator of two dice.  The test conditions the simulator on what we know.  What survives is the posterior: the pairs that are still possible, and how often each occurs.&lt;/p&gt;
&lt;p&gt;A probabilistic program states the same model without fixing how to search it:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;defn dice []:
  sp/spin:
    a := sample(dist/uniform-discrete(1, 7), :id, :a)
    b := sample(dist/uniform-discrete(1, 7), :id, :b)
    factor(if 7 = a + b:
      0.0
    else:
      ##-Inf
    end)
    [a b]
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(defn dice []
  (sp/spin
   (let [a (sample (dist/uniform-discrete 1 7) :id :a)
         b (sample (dist/uniform-discrete 1 7) :id :b)]
     (factor (if (= 7 (+ a b)) 0.0 ##-Inf))
     [a b])))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;sample&lt;/code&gt; introduces an unknown, as a fresh logic variable does in core.logic, but with a probability on each value: here a die whose six faces are equally likely.  &lt;code&gt;factor&lt;/code&gt; adds to the run’s log weight.  Zero leaves the run unchanged, and minus infinity makes it impossible, as a failing goal does.  &lt;code&gt;sp/spin&lt;/code&gt; turns the body into a program that an inference method can pause, copy and resume at each &lt;code&gt;sample&lt;/code&gt; and &lt;code&gt;factor&lt;/code&gt;.  With &lt;code&gt;{:method :enumerate}&lt;/code&gt;, Foerster runs all 36 pairs and returns the six that hold, each with probability 1/6.  That is the answer &lt;code&gt;run*&lt;/code&gt; gives, with weights.&lt;/p&gt;
&lt;p&gt;Now soften the constraint.  We do not know the sum, but a sensor that measures it with noise of about one showed 7:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;observe(dist/normal(a + b, 1.0), 7.0, :id, :reading)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(observe (dist/normal (+ a b) 1.0) 7.0 :id :reading)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;observe&lt;/code&gt; weights each run by how likely the reading is under it, here a normal density centred on the run’s sum.  No pair is ruled out, and the arithmetic can be done by hand.  Each of the six pairs that sum to 7 gets weight e⁰ = 1, each of the five pairs that sum to 6 or to 8 gets e^−½ ≈ 0.61, and the weights keep falling with the distance from 7.  Normalized, a sum of 7 has probability 0.45, sums of 6 and 8 have 0.23 each, sums of 5 and 9 have 0.04 each, and the rest almost nothing.  Foerster’s enumeration gives the same numbers.&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;core.logic&lt;/th&gt;&lt;th&gt;Foerster&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;a fresh logic variable&lt;/td&gt;&lt;td&gt;&lt;code&gt;sample&lt;/code&gt;, an unknown with a probability on each value&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;a goal such as &lt;code&gt;==&lt;/code&gt;, which holds or fails&lt;/td&gt;&lt;td&gt;&lt;code&gt;observe&lt;/code&gt; or &lt;code&gt;factor&lt;/code&gt;, a weight; failing is weight zero&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;conde&lt;/code&gt;, a choice between branches&lt;/td&gt;&lt;td&gt;a discrete &lt;code&gt;sample&lt;/code&gt;, with a probability on each branch&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;run*&lt;/code&gt;, the set of answers&lt;/td&gt;&lt;td&gt;the posterior, the answers with their weights&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;the search strategy&lt;/td&gt;&lt;td&gt;the inference method&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Two more ideas carry over.  The total weight before normalizing, called the evidence, says how well the model as a whole explains the data.  A hard constraint that no run meets leaves nothing, and a soft one leaves a number that can be compared between models.  And as core.logic leaves the search to the system, a probabilistic program leaves the inference method open.  &lt;a href=&quot;https://dtai.cs.kuleuven.be/problog/&quot;&gt;ProbLog&lt;/a&gt; joins the two traditions as probabilistic logic programming.&lt;/p&gt;
&lt;h2 id=&quot;how-does-the-system-find-the-answer&quot;&gt;How does the system find the answer?&lt;/h2&gt;
&lt;p&gt;Enumeration works for 36 pairs.  It fails for many choices, or for continuous ones, because no list of all runs exists.  The other methods search the space of runs, and each resembles a familiar strategy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Importance sampling&lt;/strong&gt; runs the program many times and weights each run instead of discarding it.  It is generate and test with soft scores, and it fails when good runs are rare.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sequential Monte Carlo&lt;/strong&gt; (SMC) runs many copies side by side.  At each observation it copies the runs that fit and drops the ones that do not, like a search that prunes partial solutions as soon as a constraint can be checked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Markov chain Monte Carlo&lt;/strong&gt; (MCMC) changes one choice of a single run at a time and keeps the change by a rule that sometimes accepts a worse run.  This local search visits runs in proportion to their weight.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;does-the-choice-of-method-matter&quot;&gt;Does the choice of method matter?&lt;/h2&gt;
&lt;p&gt;A shop sells around a hundred units of a product each week.  The weekly figure is noisy, and the underlying demand drifts.  How high is demand now, and how certain is that?  The model says that demand starts near 100, moves by a random amount each week, and that each week’s figure is demand plus noise:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;defn demand [weeks drift]:
  sp/spin:
    loop [t 0, level sample(dist/normal(100.0, 20.0), :id, [:level 0])]:
      observe(dist/normal(level, 8.0), nth(weeks, t), :id, [:y t])
      if inc(t) = count(weeks):
        level
      else:
        recur(inc(t), sample(dist/normal(level, drift), :id, [:level inc(t)]))
      end
    end
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(defn demand [weeks drift]
  (sp/spin
   (loop [t 0
          level (sample (dist/normal 100.0 20.0) :id [:level 0])]
     (observe (dist/normal level 8.0) (nth weeks t) :id [:y t])
     (if (= (inc t) (count weeks))
       level
       (recur (inc t)
              (sample (dist/normal level drift) :id [:level (inc t)]))))))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As with the dice, &lt;code&gt;sample&lt;/code&gt; marks the unknowns, here twenty-one weekly demand levels, and &lt;code&gt;observe&lt;/code&gt; scores each run against the twenty sales figures.  The data are an ordinary argument, &lt;code&gt;weeks&lt;/code&gt;.  The &lt;code&gt;:id&lt;/code&gt; names each choice, so a method can refer to the level in week 7 across runs.  &lt;a href=&quot;https://simm.is/blog/bayesian-inference-in-pictures&quot;&gt;The pictures article&lt;/a&gt; explains priors and posteriors if those terms are new.  Each method is one option of the same call:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;infer/infer(demand(weeks, 4.0), {:method :smc, :particles 1000})
infer/infer(demand(weeks, 4.0), {:method :importance, :particles 1000})
infer/infer(demand(weeks, 4.0),
  {:method :mh, :iterations 4000, :chains 4, :burn 1000})
infer/infer(demand(weeks, 4.0),
  {:method :pgibbs, :particles 50, :iterations 600})&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(infer/infer (demand weeks 4.0) {:method :smc :particles 1000})
(infer/infer (demand weeks 4.0) {:method :importance :particles 1000})
(infer/infer (demand weeks 4.0) {:method :mh :iterations 4000 :chains 4 :burn 1000})
(infer/infer (demand weeks 4.0) {:method :pgibbs :particles 50 :iterations 600})&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The model is linear and Gaussian, so a Kalman filter computes the exact answer, which makes it a fair test.  The data are twenty simulated weeks, with a true drift of 4 per week and observation noise of 8.  Each particle method ran ten times with different seeds, so the table shows how much an answer varies from run to run.  All numbers come from Foerster’s main branch on 15 October 2026.&lt;/p&gt;









































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Method&lt;/th&gt;&lt;th&gt;Final level (mean)&lt;/th&gt;&lt;th&gt;Log evidence&lt;/th&gt;&lt;th&gt;Check&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Exact (Kalman filter)&lt;/td&gt;&lt;td&gt;102.89&lt;/td&gt;&lt;td&gt;−77.49&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Sequential Monte Carlo, 1000 particles&lt;/td&gt;&lt;td&gt;102.92 ± 0.23&lt;/td&gt;&lt;td&gt;−77.44 ± 0.14&lt;/td&gt;&lt;td&gt;about 120 histories survive to week 0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Importance sampling, 1000 samples&lt;/td&gt;&lt;td&gt;102.9 ± 1.8&lt;/td&gt;&lt;td&gt;−77.7 ± 0.5&lt;/td&gt;&lt;td&gt;2 to 10 effective samples&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Metropolis–Hastings, 4 chains&lt;/td&gt;&lt;td&gt;103.4&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;R-hat 1.03, 114 effective draws&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Particle Gibbs, 4 chains&lt;/td&gt;&lt;td&gt;102.93&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;R-hat 1.002, about 1500 effective draws&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;SMC lands within 0.36 of the exact final level in every run, and its log evidence averages −77.44 against the exact −77.49.  It pays for its pruning on the early weeks: of a thousand particles at the end, only 114 to 134 still descend from different starting points.  Importance sampling never prunes, so after twenty weeks a handful of runs carry nearly all the weight, and the estimate moves by almost two units between runs.&lt;/p&gt;
&lt;p&gt;Metropolis–Hastings (MH), the simplest MCMC, fails here, and its diagnostics say so before any exact answer is consulted.  Its four chains disagree: their rank-normalized R-hat is 1.03, above the usual threshold of 1.01, and their 12,000 draws are worth about 114 independent ones.  Foerster computes these numbers as &lt;a href=&quot;https://mc-stan.org/&quot;&gt;Stan&lt;/a&gt; and &lt;a href=&quot;https://www.arviz.org/&quot;&gt;ArviZ&lt;/a&gt; do.  The cause lies in the model.  Neighbouring weeks are strongly tied, so changing one week’s level at a time barely moves the run.  Andrew Gelman’s folk theorem of statistical computing, restated in the &lt;a href=&quot;https://arxiv.org/abs/2011.01808&quot;&gt;Bayesian workflow&lt;/a&gt; paper, says as much: when the computation struggles, look at the model.&lt;/p&gt;
&lt;p&gt;The fix is a method that changes all weeks together.  Particle Gibbs runs a whole SMC through the twenty weeks at every step, holding one surviving run fixed, and so redraws all twenty-one levels at once.  Four chains of 500 steps after warm-up, with 50 particles each, reached an R-hat of 1.002 and about 1500 effective draws of the final level, counting each step’s weighted average as one draw.  Their mean was 102.93 against the exact 102.89.  The first week’s level, which SMC sees through only a few surviving histories, reached an R-hat of 1.002 and about 660 effective draws.  Particle Gibbs took four minutes against half a minute for MH, but produced about twice as many effective draws per second.  Nothing in the model changed, only the search.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 270&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-labelledby=&quot;demand-title&quot;&gt;
  &lt;title id=&quot;demand-title&quot;&gt;Twenty weeks of observed demand with the inferred demand level: the exact filtered mean and the 95% band from sequential Monte Carlo.&lt;/title&gt;
  &lt;rect width=&quot;600&quot; height=&quot;270&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;210.9&quot; x2=&quot;575&quot; y2=&quot;210.9&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.15&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;52&quot; y=&quot;214.9&quot; text-anchor=&quot;end&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;90&lt;/text&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;172.7&quot; x2=&quot;575&quot; y2=&quot;172.7&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.15&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;52&quot; y=&quot;176.7&quot; text-anchor=&quot;end&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;100&lt;/text&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;134.5&quot; x2=&quot;575&quot; y2=&quot;134.5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.15&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;52&quot; y=&quot;138.5&quot; text-anchor=&quot;end&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;110&lt;/text&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;96.4&quot; x2=&quot;575&quot; y2=&quot;96.4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.15&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;52&quot; y=&quot;100.4&quot; text-anchor=&quot;end&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;120&lt;/text&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;58.2&quot; x2=&quot;575&quot; y2=&quot;58.2&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.15&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;52&quot; y=&quot;62.2&quot; text-anchor=&quot;end&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;130&lt;/text&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;20.0&quot; x2=&quot;575&quot; y2=&quot;20.0&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.15&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;52&quot; y=&quot;24.0&quot; text-anchor=&quot;end&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;140&lt;/text&gt;
  &lt;text x=&quot;70.0&quot; y=&quot;250&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;1&lt;/text&gt;
  &lt;text x=&quot;175.3&quot; y=&quot;250&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;5&lt;/text&gt;
  &lt;text x=&quot;306.8&quot; y=&quot;250&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;10&lt;/text&gt;
  &lt;text x=&quot;438.4&quot; y=&quot;250&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;15&lt;/text&gt;
  &lt;text x=&quot;570.0&quot; y=&quot;250&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;20&lt;/text&gt;
  &lt;text x=&quot;317&quot; y=&quot;266&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;week&lt;/text&gt;
  &lt;polygon points=&quot;70.0,80.0 96.3,97.7 122.6,105.8 148.9,94.0 175.3,89.4 201.6,112.5 227.9,98.4 254.2,112.0 280.5,72.7 306.8,73.8 333.2,90.7 359.5,67.9 385.8,86.1 412.1,101.8 438.4,104.4 464.7,95.9 491.1,92.5 517.4,103.3 543.7,112.8 570.0,122.6 570.0,199.9 543.7,188.9 517.4,180.3 491.1,168.4 464.7,169.0 438.4,179.0 412.1,177.2 385.8,161.2 359.5,141.4 333.2,167.7 306.8,148.1 280.5,147.4 254.2,190.4 227.9,169.3 201.6,191.4 175.3,166.4 148.9,170.7 122.6,185.4 96.3,183.0 70.0,194.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.12&quot;&gt;&lt;/polygon&gt;
  &lt;polyline points=&quot;70.0,137.5 96.3,140.5 122.6,146.0 148.9,133.2 175.3,128.0 201.6,151.0 227.9,132.1 254.2,152.3 280.5,110.1 306.8,110.6 333.2,129.0 359.5,105.1 385.8,122.3 412.1,139.8 438.4,143.1 464.7,131.3 491.1,130.6 517.4,142.4 543.7,149.4 570.0,161.3&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2.5&quot; fill=&quot;none&quot;&gt;&lt;/polyline&gt;
  &lt;polyline points=&quot;70.0,139.8 96.3,141.0 122.6,144.8 148.9,132.9 175.3,127.4 201.6,149.7 227.9,131.8 254.2,152.3 280.5,108.0 306.8,112.4 333.2,128.5 359.5,104.0 385.8,123.4 412.1,141.1 438.4,143.0 464.7,132.2 491.1,130.1 517.4,142.3 543.7,149.7 570.0,161.6&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.5&quot; stroke-dasharray=&quot;5 3&quot; fill=&quot;none&quot;&gt;&lt;/polyline&gt;
  &lt;circle cx=&quot;70.0&quot; cy=&quot;134.5&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;96.3&quot; cy=&quot;142.2&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;122.6&quot; cy=&quot;149.8&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;148.9&quot; cy=&quot;115.5&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;175.3&quot; cy=&quot;119.3&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;201.6&quot; cy=&quot;184.2&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;227.9&quot; cy=&quot;104.0&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;254.2&quot; cy=&quot;184.2&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;280.5&quot; cy=&quot;39.1&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;306.8&quot; cy=&quot;119.3&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;333.2&quot; cy=&quot;153.6&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;359.5&quot; cy=&quot;65.8&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;385.8&quot; cy=&quot;153.6&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;412.1&quot; cy=&quot;168.9&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;438.4&quot; cy=&quot;146.0&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;464.7&quot; cy=&quot;115.5&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;491.1&quot; cy=&quot;126.9&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;517.4&quot; cy=&quot;161.3&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;543.7&quot; cy=&quot;161.3&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;570.0&quot; cy=&quot;180.4&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;80&quot; cy=&quot;20&quot; r=&quot;3.5&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/circle&gt;&lt;text x=&quot;90&quot; y=&quot;24&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;observed&lt;/text&gt;
  &lt;line x1=&quot;170&quot; y1=&quot;20&quot; x2=&quot;195&quot; y2=&quot;20&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2.5&quot;&gt;&lt;/line&gt;&lt;text x=&quot;202&quot; y=&quot;24&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;SMC level, 95% band&lt;/text&gt;
  &lt;line x1=&quot;350&quot; y1=&quot;20&quot; x2=&quot;375&quot; y2=&quot;20&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.5&quot; stroke-dasharray=&quot;5 3&quot;&gt;&lt;/line&gt;&lt;text x=&quot;382&quot; y=&quot;24&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;exact (Kalman filter)&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Each point is one week&apos;s observed demand.  The shaded band is where sequential Monte Carlo puts the hidden demand level with 95% probability after that week, and the dashed line is the exact answer, which this simple model happens to allow.  The two lines nearly coincide.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;what-if-a-parameter-is-unknown-too&quot;&gt;What if a parameter is unknown too?&lt;/h2&gt;
&lt;p&gt;So far the drift was given as 4.  In practice nobody measures how fast demand moves, so the drift becomes one more unknown with a prior:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;defn demand-unknown [weeks]:
  sp/spin:
    drift := sample(dist/gamma(2.0, 2.5), :id, :drift)
    loop [t 0, level sample(dist/normal(100.0, 20.0), :id, [:level 0])]:
      observe(dist/normal(level, 8.0), nth(weeks, t), :id, [:y t])
      if inc(t) = count(weeks):
        drift
      else:
        recur(inc(t), sample(dist/normal(level, drift), :id, [:level inc(t)]))
      end
    end
  end
end

infer/infer(demand-unknown(weeks),
  {:method :pmmh, :particles 100, :iterations 2000, :params #{:drift},
   :scale 3.0, :burn 200})&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(defn demand-unknown [weeks]
  (sp/spin
   (let [drift (sample (dist/gamma 2.0 2.5) :id :drift)]
     (loop [t 0
            level (sample (dist/normal 100.0 20.0) :id [:level 0])]
       (observe (dist/normal level 8.0) (nth weeks t) :id [:y t])
       (if (= (inc t) (count weeks))
         drift
         (recur (inc t)
                (sample (dist/normal level drift) :id [:level (inc t)])))))))

(infer/infer (demand-unknown weeks)
             {:method :pmmh :particles 100 :iterations 2000
              :params #{:drift} :scale 3.0 :burn 200})&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Particle marginal Metropolis–Hastings (PMMH) searches over the drift alone.  For each proposed drift it runs SMC over the weekly levels and accepts or rejects the drift by the evidence that SMC reports.  That evidence estimate is unbiased, so the chain targets the exact posterior of the drift even though every step uses an estimate.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 260&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-labelledby=&quot;drift-title&quot;&gt;
  &lt;title id=&quot;drift-title&quot;&gt;The posterior distribution of the weekly drift: a histogram of PMMH draws over the exact density computed by quadrature.&lt;/title&gt;
  &lt;rect width=&quot;600&quot; height=&quot;260&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;220&quot; x2=&quot;575&quot; y2=&quot;220&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;60.0&quot; y=&quot;236&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;0&lt;/text&gt;
  &lt;text x=&quot;145.0&quot; y=&quot;236&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;2&lt;/text&gt;
  &lt;text x=&quot;230.0&quot; y=&quot;236&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;4&lt;/text&gt;
  &lt;text x=&quot;315.0&quot; y=&quot;236&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;6&lt;/text&gt;
  &lt;text x=&quot;400.0&quot; y=&quot;236&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;8&lt;/text&gt;
  &lt;text x=&quot;485.0&quot; y=&quot;236&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;10&lt;/text&gt;
  &lt;text x=&quot;570.0&quot; y=&quot;236&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;12&lt;/text&gt;
  &lt;text x=&quot;317&quot; y=&quot;254&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;weekly drift (sd of the level change)&lt;/text&gt;
  &lt;rect x=&quot;61.0&quot; y=&quot;184.0&quot; width=&quot;19.2&quot; height=&quot;36.0&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;82.2&quot; y=&quot;92.7&quot; width=&quot;19.2&quot; height=&quot;127.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;103.5&quot; y=&quot;102.7&quot; width=&quot;19.2&quot; height=&quot;117.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;124.8&quot; y=&quot;69.3&quot; width=&quot;19.2&quot; height=&quot;150.7&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;146.0&quot; y=&quot;58.7&quot; width=&quot;19.2&quot; height=&quot;161.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;167.2&quot; y=&quot;87.3&quot; width=&quot;19.2&quot; height=&quot;132.7&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;188.5&quot; y=&quot;90.7&quot; width=&quot;19.2&quot; height=&quot;129.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;209.8&quot; y=&quot;150.0&quot; width=&quot;19.2&quot; height=&quot;70.0&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;231.0&quot; y=&quot;129.3&quot; width=&quot;19.2&quot; height=&quot;90.7&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;252.2&quot; y=&quot;161.3&quot; width=&quot;19.2&quot; height=&quot;58.7&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;273.5&quot; y=&quot;180.7&quot; width=&quot;19.2&quot; height=&quot;39.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;294.8&quot; y=&quot;198.7&quot; width=&quot;19.2&quot; height=&quot;21.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;316.0&quot; y=&quot;198.7&quot; width=&quot;19.2&quot; height=&quot;21.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;337.2&quot; y=&quot;200.0&quot; width=&quot;19.2&quot; height=&quot;20.0&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;358.5&quot; y=&quot;212.0&quot; width=&quot;19.2&quot; height=&quot;8.0&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;379.8&quot; y=&quot;212.0&quot; width=&quot;19.2&quot; height=&quot;8.0&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;401.0&quot; y=&quot;216.0&quot; width=&quot;19.2&quot; height=&quot;4.0&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;422.2&quot; y=&quot;218.7&quot; width=&quot;19.2&quot; height=&quot;1.3&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;549.8&quot; y=&quot;217.3&quot; width=&quot;19.2&quot; height=&quot;2.7&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;
  &lt;polyline points=&quot;62.1,210.7 79.1,148.3 96.1,103.4 113.1,75.2 130.1,62.8 147.1,63.5 164.1,73.7 181.1,89.5 198.1,107.7 215.1,125.9 232.1,142.8 249.1,157.7 266.1,170.4 283.1,180.9 300.1,189.4 317.1,196.2 334.1,201.6 351.1,205.9 368.1,209.2 385.1,211.8 402.1,213.8 419.1,215.3 436.1,216.5 453.1,217.4 470.1,218.0 487.1,218.5 504.1,218.9 521.1,219.2 538.1,219.4 555.1,219.6&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2.5&quot; fill=&quot;none&quot;&gt;&lt;/polyline&gt;
  &lt;line x1=&quot;230.0&quot; y1=&quot;30&quot; x2=&quot;230.0&quot; y2=&quot;220&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1&quot; stroke-dasharray=&quot;4 3&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;236.0&quot; y=&quot;40&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;simulated with 4&lt;/text&gt;
  &lt;rect x=&quot;380&quot; y=&quot;58&quot; width=&quot;14&quot; height=&quot;10&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.25&quot;&gt;&lt;/rect&gt;&lt;text x=&quot;400&quot; y=&quot;67&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;PMMH draws&lt;/text&gt;
  &lt;line x1=&quot;380&quot; y1=&quot;82&quot; x2=&quot;394&quot; y2=&quot;82&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2.5&quot;&gt;&lt;/line&gt;&lt;text x=&quot;400&quot; y=&quot;86&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;exact posterior&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Twenty weeks of data narrow the drift only partly: values from below 1 to about 6 remain plausible.  The histogram of PMMH draws follows the exact density, which quadrature over the Kalman filter&apos;s evidence provides for this model.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The chain’s mean drift is 2.82 against an exact 2.85, and its 90% interval runs from 0.61 to 6.09 against an exact 0.61 to 6.28.  The data were simulated with a drift of 4, inside the interval but not at its centre, because twenty noisy weeks cannot pin the drift down.  A forecast with one fitted drift would hide that width.  The 2000 iterations took five and a half minutes on a laptop.  For this linear Gaussian model, Stan or a Kalman filter inside a one-parameter chain would take seconds.  PMMH is for models without a gradient to follow, models that branch, count or call a simulator.&lt;/p&gt;
&lt;h2 id=&quot;how-do-i-run-it&quot;&gt;How do I run it?&lt;/h2&gt;
&lt;p&gt;Foerster is on &lt;a href=&quot;https://clojars.org/org.replikativ/foerster&quot;&gt;Clojars&lt;/a&gt;.  With the Clojure CLI:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{:deps {org.replikativ/foerster {:mvn/version &quot;0.1.113&quot;}}}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A model runs inside a &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt; world, an execution context, and inference returns a spin that the REPL dereferences:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;require(&apos;[org.replikativ.foerster.core :as infer :refer [sample observe factor]],
  &apos;[org.replikativ.foerster.dist :as dist],
  &apos;[org.replikativ.spindel.core :as sp])

def world: sp/create-execution-context()

sp/with-context world:
  @infer/infer(demand(weeks, 4.0), {:method :smc, :particles 1000})
end&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(require &apos;[org.replikativ.foerster.core :as infer :refer [sample observe factor]]
         &apos;[org.replikativ.foerster.dist :as dist]
         &apos;[org.replikativ.spindel.core :as sp])

(def world (sp/create-execution-context))

(sp/with-context world
  @(infer/infer (demand weeks 4.0) {:method :smc :particles 1000}))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Build the model inside &lt;code&gt;with-context&lt;/code&gt;, as here: outside a world, the program has nowhere to run.  The &lt;a href=&quot;https://github.com/replikativ/foerster/tree/main/experiments/blog&quot;&gt;scripts that produced every number above&lt;/a&gt; are in the Foerster repository.&lt;/p&gt;
&lt;h2 id=&quot;what-can-foerster-not-do-yet&quot;&gt;What can Foerster not do yet?&lt;/h2&gt;
&lt;p&gt;Foerster is beta software.  Beyond the methods shown here, it implements tempered and waste-free SMC, SMC², involutive MCMC with reversible jump, parallel tempering, the No-U-Turn sampler on numerical blocks, MAP estimation, the Laplace approximation, Pathfinder, and variational inference.  The &lt;a href=&quot;https://replikativ.github.io/foerster/foerster.methods.html&quot;&gt;methods notebook&lt;/a&gt; describes each one with its papers, and the &lt;a href=&quot;https://replikativ.github.io/foerster/foerster.gallery.html&quot;&gt;gallery&lt;/a&gt; works through classic models against exact answers.&lt;/p&gt;
&lt;p&gt;For a static model with continuous parameters, Stan, PyMC and NumPyro remain the mature choice.  Foerster’s No-U-Turn sampler works on numerical blocks whose gradient the model supplies or &lt;a href=&quot;https://github.com/replikativ/raster&quot;&gt;Raster&lt;/a&gt; compiles.  On one hierarchical model with 89 parameters, it matched PyMC’s warm run with a gradient compiled by Raster, and ran 1.5 times faster with a hand-written one.  Its general methods over program traces are slower: single-site MH takes about twelve times as long per move as &lt;a href=&quot;https://www.gen.dev/&quot;&gt;Gen&lt;/a&gt;, because each move replays the rest of the program, and its particle filter is about four and a half times slower than Gen’s &lt;code&gt;Unfold&lt;/code&gt; combinator.  The &lt;a href=&quot;https://github.com/replikativ/foerster/tree/main/experiments/comparison&quot;&gt;comparison&lt;/a&gt; has the details, and &lt;a href=&quot;https://github.com/replikativ/foerster/blob/main/doc/coming-from.md&quot;&gt;coming from other systems&lt;/a&gt; maps Stan, PyMC, Turing, Gen, Anglican and WebPPL concepts onto Foerster, including what is missing.&lt;/p&gt;
&lt;h2 id=&quot;what-comes-next&quot;&gt;What comes next?&lt;/h2&gt;
&lt;p&gt;Every model so far is a pure function.  Useful models often are not: a forecast that reads current stock, a simulation that writes into a scenario database, an agent that calls tools.  If a thousand particles write to the same database, inference corrupts the state it reasons about, which is why Gen requires that a model change no external state.&lt;/p&gt;
&lt;p&gt;Foerster runs each particle in a Spindel world, whose state can be copied cheaply, as &lt;a href=&quot;https://simm.is/blog/copy-on-write-branching&quot;&gt;the copy-on-write article&lt;/a&gt; describes.  When SMC copies a particle, it copies the particle’s world, and when it drops a particle, it discards the world.  With &lt;code&gt;:world-policy :fork&lt;/code&gt;, every particle starts from a copy of the caller’s world, so a model can read and change the systems registered there, and nothing a particle writes reaches the caller.  This costs about three times as much as running in fresh worlds.  Systems that cannot be copied safely, such as live network handles, are refused before the model runs, and Markov chains run in fresh worlds only.  The same mechanism makes counterfactuals direct: intervene on one choice in the world where the posterior was computed (Pearl’s do operator, as in &lt;a href=&quot;https://simm.is/blog/reading-a-causal-graph&quot;&gt;the causal graph article&lt;/a&gt;) and replay the program with everything else held to what was inferred.  The &lt;a href=&quot;https://github.com/replikativ/foerster/blob/main/doc/worlds.md&quot;&gt;worlds guide&lt;/a&gt; covers both, and a later article shows them on a model that books orders into a forked database.&lt;/p&gt;
&lt;p&gt;The same machinery steers processes that are not statistical models.  Foerster’s &lt;code&gt;steer&lt;/code&gt; namespace runs SMC over the steps of an agent working on a task, following twisted SMC (&lt;a href=&quot;https://arxiv.org/abs/2404.17546&quot;&gt;Zhao et al., 2024&lt;/a&gt;) and the SMC steering of language models (&lt;a href=&quot;https://arxiv.org/abs/2306.03081&quot;&gt;Lew et al., 2023&lt;/a&gt;).  On short spreadsheet tasks it matched picking the best of four attempts with 17% fewer tokens, but solved nothing more.  It should pay on long tasks whose steps can be checked cheaply.&lt;/p&gt;
&lt;p&gt;For Simmis, inference over forked worlds is research rather than a product feature.  It is how a governed organizational record could later answer a question such as “what happens to our cash if this order slips” with a distribution instead of a single number.&lt;/p&gt;</content:encoded></item><item><title>Before deploying an AI agent, benchmark the whole workflow</title><link>https://simm.is/blog/measuring-agent-workflows/</link><guid isPermaLink="true">https://simm.is/blog/measuring-agent-workflows/</guid><description>Benchmark AI agent workflows before rollout. See how Dvergr compares prompts, tools, models and checkers, and how Simmis reviews proposed changes.</description><pubDate>Sun, 11 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Updated 15 October 2026: Claude Sonnet 5.5 and Opus 5.5 added to the BIRD comparison, and a &lt;a href=&quot;#check-whether-the-models-have-seen-the-answers&quot;&gt;recall test&lt;/a&gt; with a renamed copy of the questions: the models know many of BIRD’s recorded answers but barely rely on them, and the ranking holds.  The method table lists what changed.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A finance team wants an agent to answer database questions and edit workbooks.  Which version should it deploy?  In our BIRD tests, one database answer had the right rows but extra columns, breaking the required format.  Another returned no rows because the agent trusted a hint with the wrong letter case.  Should the team clarify instructions, let the agent inspect results, or pay for a stronger model?&lt;/p&gt;
&lt;p&gt;We tested database workflow changes on &lt;a href=&quot;https://bird-bench.github.io/&quot;&gt;BIRD&lt;/a&gt; and compared workbook agents on &lt;a href=&quot;https://spreadsheetbench.github.io/&quot;&gt;SpreadsheetBench&lt;/a&gt;.  Public cases make the comparisons inspectable.  They can also be learned by heart: on BIRD, the strongest models reproduced most recorded answers without seeing the database, though a renamed copy showed that they barely relied on it.  Only the team’s own cases can show its likely repair work and cost.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/replikativ/dvergr&quot;&gt;Dvergr&lt;/a&gt; compares complete workflows on the same cases: model, instructions, tools, data route and checker.  It records failures, cost and time.  &lt;a href=&quot;https://simm.is/architecture#work-lifecycle&quot;&gt;Simmis&lt;/a&gt; supports reviewing proposed changes to accepted managed state.  Connecting benchmark evidence directly to that adoption path remains in progress.&lt;/p&gt;
&lt;h2 id=&quot;fix-instructions-before-buying-a-stronger-model&quot;&gt;Fix instructions before buying a stronger model&lt;/h2&gt;
&lt;p&gt;First, test whether a clearer instruction fixes the output.  BIRD gives an agent a database schema, a question and a hint, then asks for one SQL query.  We compared its published prompt with the same prompt plus one instruction: &lt;em&gt;return exactly the columns the question asks for&lt;/em&gt;.  A third workflow let the agent run SQL, inspect results or errors, and retry for up to twenty turns.  BIRD graded all three on the same 100 questions:&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Workflow&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;GPT-5.6 Luna&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Claude Haiku 5.5&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Tokens per question (Luna)&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;BIRD’s prompt, one reply&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;51&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;53&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,200&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;BIRD’s prompt plus the column instruction&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;61&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;64&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;1,200&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dvergr: run queries, see results and errors, then submit&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;65&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;69&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;8,200&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;One instruction raised Luna from 51 to 61 and Haiku from 53 to 64 correct answers, without extra tokens (p = 0.013 and 0.003).  On question 781, Luna returned the right heights plus names, so BIRD marked it wrong.  The instruction fixed that answer.  Extra columns accounted for seven of fifteen cases Luna solved with Dvergr but missed with BIRD’s original prompt.  Fixed report columns could spare staff a repair step, though BIRD does not measure staff time.&lt;/p&gt;
&lt;p&gt;Question 817 needed a different fix.  Its hint used ‘blue’ and ‘male’, but the database stored ‘Blue’ and ‘Male’.  A one-reply query found nothing.  In Dvergr, Luna saw that empty result, retried without case sensitivity and found three matching heroes.  Checking the result recovered an answer that the first query missed.&lt;/p&gt;
&lt;p&gt;Retries solved four or five more questions but used roughly seven times the tokens.  Dvergr’s workflow already included the column instruction, so those answers isolate what exploration added.  The gain remains uncertain on 100 cases (p = 0.34 and 0.30).  The improved one-reply workflow cost about one third as much per correct answer as Dvergr’s retry workflow.  Whether retries earn their cost depends on the damage an empty answer causes.&lt;/p&gt;
&lt;h2 id=&quot;compare-candidates-without-changing-the-starting-line&quot;&gt;Compare candidates without changing the starting line&lt;/h2&gt;
&lt;p&gt;Next, candidates need the same starting conditions.  Otherwise a score may reflect different cases or data changed by another attempt.  Dvergr records those conditions and isolates each comparison:&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 640 250&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-label=&quot;The measurement pipeline.  Cases are certified into a case pack; the experiment room runs every candidate on every case, each attempt in its own fork; a checker gives each attempt a verdict, or marks a fault to run again; the forks are discarded and the report collects success with intervals, failures, cost and time.&quot;&gt;
  &lt;defs&gt;
    &lt;marker id=&quot;wf-ah&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;&lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;&lt;/marker&gt;
    &lt;marker id=&quot;wf-ah-v&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;&lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.8&quot;&gt;&lt;/path&gt;&lt;/marker&gt;
  &lt;/defs&gt;
  &lt;g font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot;&gt;
    &lt;rect x=&quot;20&quot; y=&quot;30&quot; width=&quot;120&quot; height=&quot;54&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;30&quot; y=&quot;52&quot; fill=&quot;var(--c-learn)&quot;&gt;benchmark cases&lt;/text&gt;
    &lt;text x=&quot;30&quot; y=&quot;68&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;one row per case&lt;/text&gt;
    &lt;text x=&quot;30&quot; y=&quot;78&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;+ recorded outcome&lt;/text&gt;
    &lt;rect x=&quot;170&quot; y=&quot;30&quot; width=&quot;120&quot; height=&quot;54&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;180&quot; y=&quot;52&quot; fill=&quot;var(--c-model)&quot;&gt;certify&lt;/text&gt;
    &lt;text x=&quot;180&quot; y=&quot;68&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;ungradable cases&lt;/text&gt;
    &lt;text x=&quot;180&quot; y=&quot;78&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;excluded, with reasons&lt;/text&gt;
    &lt;rect x=&quot;320&quot; y=&quot;30&quot; width=&quot;140&quot; height=&quot;54&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;330&quot; y=&quot;52&quot; fill=&quot;var(--c-verify)&quot;&gt;experiment room&lt;/text&gt;
    &lt;text x=&quot;330&quot; y=&quot;68&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;every candidate on&lt;/text&gt;
    &lt;text x=&quot;330&quot; y=&quot;78&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;every case&lt;/text&gt;
    &lt;rect x=&quot;490&quot; y=&quot;30&quot; width=&quot;130&quot; height=&quot;54&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;500&quot; y=&quot;52&quot; fill=&quot;var(--c-collaborate)&quot;&gt;report&lt;/text&gt;
    &lt;text x=&quot;500&quot; y=&quot;68&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;intervals, failures,&lt;/text&gt;
    &lt;text x=&quot;500&quot; y=&quot;78&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;cost and time&lt;/text&gt;
    &lt;rect x=&quot;300&quot; y=&quot;122&quot; width=&quot;80&quot; height=&quot;40&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.2&quot; stroke-dasharray=&quot;4 3&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;310&quot; y=&quot;139&quot; fill=&quot;var(--c-verify)&quot;&gt;fork&lt;/text&gt;
    &lt;text x=&quot;310&quot; y=&quot;153&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;A × case 1&lt;/text&gt;
    &lt;rect x=&quot;390&quot; y=&quot;122&quot; width=&quot;80&quot; height=&quot;40&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.2&quot; stroke-dasharray=&quot;4 3&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;400&quot; y=&quot;139&quot; fill=&quot;var(--c-verify)&quot;&gt;fork&lt;/text&gt;
    &lt;text x=&quot;400&quot; y=&quot;153&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;B × case 1&lt;/text&gt;
    &lt;rect x=&quot;480&quot; y=&quot;122&quot; width=&quot;80&quot; height=&quot;40&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.2&quot; stroke-dasharray=&quot;4 3&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;490&quot; y=&quot;139&quot; fill=&quot;var(--c-verify)&quot;&gt;fork&lt;/text&gt;
    &lt;text x=&quot;490&quot; y=&quot;153&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;A × case 2 …&lt;/text&gt;
    &lt;rect x=&quot;300&quot; y=&quot;196&quot; width=&quot;260&quot; height=&quot;40&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.4&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;310&quot; y=&quot;213&quot; fill=&quot;var(--text-dim)&quot;&gt;checker&lt;/text&gt;
    &lt;text x=&quot;310&quot; y=&quot;227&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;verdict, or fault to run again&lt;/text&gt;
    &lt;path d=&quot;M 140,57 L 168,57&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#wf-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 290,57 L 318,57&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#wf-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 390,84 L 342,120&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.7&quot; marker-end=&quot;url(#wf-ah-v)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 390,84 L 430,120&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.7&quot; marker-end=&quot;url(#wf-ah-v)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 390,84 L 518,120&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.7&quot; marker-end=&quot;url(#wf-ah-v)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 340,162 L 340,194&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#wf-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 430,162 L 430,194&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#wf-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 520,162 L 520,194&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#wf-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 560,216 C 615,216 615,120 580,86&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#wf-ah)&quot;&gt;&lt;/path&gt;
  &lt;/g&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Certified cases enter an experiment room.  Each attempt runs and receives a verdict in its own fork; the fork is then discarded.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A Dvergr &lt;em&gt;case pack&lt;/em&gt; holds cases, recorded answers and a checker.  Certification rejects duplicate ids, conflicting outcomes and answers the checker rejects.  It kept 390 of 400 SpreadsheetBench tasks before model runs.  Excluding ungradable tasks saves spend and prevents bad cases from shaping the choice.&lt;/p&gt;
&lt;p&gt;Runs take place in a Dvergr &lt;em&gt;room&lt;/em&gt; holding files, database state and history.  Each candidate gets a separate &lt;em&gt;fork&lt;/em&gt; for each case.  Unchanged state is shared, while workbook and file edits stay inside that attempt.  Database reads use a fresh read-only connection or immutable snapshot.  The checker records a verdict, then Dvergr discards the fork, so one attempt cannot change another’s starting conditions.  A fork takes a fraction of a second, against ten to seventy seconds for a model answer.&lt;/p&gt;
&lt;p&gt;Dvergr runs the comparison.  &lt;a href=&quot;https://github.com/replikativ/yggdrasil&quot;&gt;Yggdrasil&lt;/a&gt; supplies &lt;a href=&quot;https://simm.is/blog/copy-on-write-branching&quot;&gt;copy-on-write branches&lt;/a&gt; across Git and &lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt;.  &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt; supports forkable execution.  Datahike retains queryable history.  Together, these layers preserve the starting state and basis for each verdict.  Simmis supports proposal review and authorized adoption of supported managed changes.  A direct path from benchmark report to that decision is still in progress.&lt;/p&gt;
&lt;p&gt;When a model or instruction changes, the recorded setup makes another comparison possible:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Same cases.&lt;/strong&gt;  Every candidate answers every case, so the team can compare their disagreements.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Failures distinguished.&lt;/strong&gt;  A provider outage or timeout triggers a rerun; a wrong answer or no answer receives a verdict.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Comparable price.&lt;/strong&gt;  Costs use public token list prices, including lower cached-input rates, whether a subscription or the organization’s own key paid.  They exclude staff repair time, delays and self-hosted hardware.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;New setup, new experiment.&lt;/strong&gt;  Interrupted runs resume, but changing cases, candidates, instructions, checker or software versions starts another experiment.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;check-the-score-before-trusting-it&quot;&gt;Check the score before trusting it&lt;/h2&gt;
&lt;p&gt;The checker must judge work as staff would use it.  Otherwise a score can favour the wrong workflow.  SpreadsheetBench exposed that risk with workbook formulas.&lt;/p&gt;
&lt;p&gt;SpreadsheetBench shows each sheet’s first five rows and asks for a Python program that edits the workbook.  Its multi-round version returns program output or errors for up to five turns.  We ran both with GPT-5.6 Luna on 59 tasks.  Programs ran in Docker with access limited to their input file; the benchmark graded results.  Dvergr’s agent instead read and wrote cells through its sandboxed spreadsheet engine, then inspected computed values.&lt;/p&gt;
&lt;p&gt;SpreadsheetBench’s grader reads stored formula values without calculating them.  Its instructions say to reopen workbooks in LibreOffice or Excel before grading.  We used LibreOffice on Linux, and that choice changed the comparison.&lt;/p&gt;
&lt;p&gt;Task 56563 asks for a sum of monthly amounts despite an error in one cell.  Both workflows wrote =AGGREGATE(9,6,C2:C13), which skips the error and should produce 77,772.6.  Two calculation paths gave that same cell opposite verdicts:&lt;/p&gt;




















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Graded by&lt;/th&gt;&lt;th&gt;What it found in the cell&lt;/th&gt;&lt;th&gt;Verdict&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;LibreOffice, following benchmark instructions&lt;/td&gt;&lt;td&gt;&lt;code&gt;#NAME?&lt;/code&gt;: neither workflow wrote the &lt;code&gt;_xlfn.AGGREGATE&lt;/code&gt; prefix LibreOffice needs to recognise this newer Excel function&lt;/td&gt;&lt;td&gt;wrong&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dvergr’s spreadsheet engine&lt;/td&gt;&lt;td&gt;77,772.6; LibreOffice agrees once the prefix is written&lt;/td&gt;&lt;td&gt;right&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Across all 59 tasks:&lt;/p&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Workflow&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Recalculated by LibreOffice (the benchmark’s instructions)&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Tokens per task (median)&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Median time&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;SpreadsheetBench, one reply with code&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;34&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;2,200&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;15 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SpreadsheetBench, up to five turns with execution&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;41&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;4,300&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;17 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dvergr: read and write cells, see what they compute, submit&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;41 as written, 48 as Excel stores them&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;5,700&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;24 s&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Under LibreOffice grading, the multi-round reference and Dvergr each score 41, though they solve eight different tasks.  Adding Excel’s function prefix raises Dvergr to 48; its &lt;a href=&quot;https://github.com/replikativ/rechentafel&quot;&gt;Rechentafel&lt;/a&gt; engine scores 51.  Rechentafel matches Excel’s saved values on 390 of 400 recorded answers.  If staff use Excel, grading with another program could lead the team to buy the wrong workflow.  The checker must match staff’s software or use an engine verified against it.&lt;/p&gt;
&lt;h2 id=&quot;check-the-answer-key-too&quot;&gt;Check the answer key too&lt;/h2&gt;
&lt;p&gt;Even a consistent checker can follow a wrong answer key.  A team may then blame its model and pay more when the benchmark is wrong.  Both case sets contained such problems.&lt;/p&gt;
&lt;p&gt;On BIRD, four initial models all missed the same twenty of 100 questions in both SQL and Datalog.  For many of those questions, models agreed with each other but differed from the recorded answer:&lt;/p&gt;








































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Question (BIRD id)&lt;/th&gt;&lt;th&gt;Recorded answer&lt;/th&gt;&lt;th&gt;What the models answered&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;atoms of molecule TR346 and its bond types (309)&lt;/td&gt;&lt;td&gt;a query for molecule TR000&lt;/td&gt;&lt;td&gt;molecule TR346&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;the German type of a card (482)&lt;/td&gt;&lt;td&gt;the English type&lt;/td&gt;&lt;td&gt;the German type&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;patients with abnormal CRP and no recorded data (1256)&lt;/td&gt;&lt;td&gt;208, the number of lab rows&lt;/td&gt;&lt;td&gt;25 patients; the only answer graded right, GPT-6 Luna’s in Datalog, repeated the mistake&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;expenses of the budget with the lowest remaining (1365)&lt;/td&gt;&lt;td&gt;one row, cut off by &lt;code&gt;LIMIT 1&lt;/code&gt;&lt;/td&gt;&lt;td&gt;both expenses of that budget&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;difference of two percentages (1458)&lt;/td&gt;&lt;td&gt;12.12&lt;/td&gt;&lt;td&gt;0.1212, following the hint’s formula, which has no ×100&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;eye colours of Marvel heroes by popularity (728)&lt;/td&gt;&lt;td&gt;colour, count and a rank column&lt;/td&gt;&lt;td&gt;colour and count&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;We found about ten questions with a wrong recorded answer and four more with a contradictory hint.  Other disputes concern requested columns or wording, and a careful model can win those: Claude Opus, measured later, answered seven of the twenty in SQL or Datalog, and all four of its SQL answers held on a renamed copy of the questions, where recall cannot help (see the recall test below).  The wrong recorded answers are another matter.  On two of them Opus was graded right only for repeating the recorded mistake, in Datalog.  On question 185 its Datalog query counted clients by their home district, as the recorded query does, instead of by their accounts’ branch; on 951 it returned the number of races for each constructor instead of the number of constructors.  Its SQL answers to both questions did what was asked, and were graded wrong.  On this sample, wrong recorded answers cap the attainable score near 90 rather than 100.  Paired comparisons remain useful when candidates lose the same flawed cases.  Still, flawed cases shrink visible differences and can deny credit for answering the question as asked.  Our grader matched BIRD’s official grader on all 200 SQL answers we checked.  Every BIRD score here follows BIRD’s rules, including their defects.&lt;/p&gt;
&lt;p&gt;On SpreadsheetBench:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The published evaluation script cannot score the published tasks.&lt;/strong&gt;  On the repository’s main branch it compares each task’s &lt;em&gt;input&lt;/em&gt; workbook with the recorded answer (the line that reads the model’s output is commented out), and its file names are those of an earlier release.  Every published score on the 400 verified tasks comes from a modified script that is not part of the benchmark.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Formulas are graded as empty&lt;/strong&gt; unless the workbook is recalculated first, as described above.  The benchmark’s instructions include that step, but the program that recalculates changes the score, and the step also recalculates the recorded answers, so after it they are that program’s results too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One task can never pass.&lt;/strong&gt;  The answer position of task 45944 contains spaces, and the checker fails on it whatever the answer.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Some recorded answers are wrong or misfiled.&lt;/strong&gt;  Task 118-50’s answer misses a pair its own rule finds in the input, and the two strongest models were graded wrong for finding it.  Task 42930’s answer file carries another task’s number.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Certification set aside ten of 400 spreadsheet tasks before model runs.  Those exclusions avoid spending tokens on known defects and keep those defects from selecting a workflow.&lt;/p&gt;
&lt;h3 id=&quot;check-the-benchmark-runner-itself&quot;&gt;Check the benchmark runner itself&lt;/h3&gt;
&lt;p&gt;Our runner also needed correction before its scores could guide a decision.  Four AI review agents checked execution, fork isolation, documentation and reported numbers.  They found nine problems, including a provider outage counted as a model failure and cached input priced at the full rate.  We added failing tests, fixed the problems, then repeated or withdrew affected runs.  Otherwise both quality and cost comparisons could have misled a buyer.&lt;/p&gt;
&lt;h2 id=&quot;check-whether-the-models-have-seen-the-answers&quot;&gt;Check whether the models have seen the answers&lt;/h2&gt;
&lt;p&gt;A public benchmark publishes its questions and its recorded answers.  A model trained after publication may have read both.  Its score could then measure memory as well as the skill a team would deploy.&lt;/p&gt;
&lt;p&gt;BIRD’s development questions and recorded queries have been public since 2023.  Claude Opus 5.5 said so itself while it worked: &lt;em&gt;“Known BIRD question; expected answer: SELECT T1.bond_id, T2.atom_id, T2.atom_id2 FROM bond T1 INNER JOIN connected T2 …”&lt;/em&gt;, before it had looked at the data.  So we tested every model for recall.  Each received only a question’s text and the name of its database, with no schema, no hint and no data, and was asked for BIRD’s recorded query.  We ran the reply on the database and compared its rows with the recorded answer’s.&lt;/p&gt;
&lt;p&gt;We then checked whether the models rely on that memory.  We built a renamed copy of the same 100 questions: every database, table and column has a new name, each recorded query was rewritten to the new names and verified to return the same rows, and every question and hint was reworded, the meaning checked by a second model, and three of them by hand.  The data and the recorded answers are unchanged, so only recall is taken away:&lt;/p&gt;











































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Correct without the database (of 100)&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Recorded query reproduced, ignoring spacing and case&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;With the database, BIRD, SQL&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;With the database, renamed copy, SQL&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Claude Opus 5.5&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;86&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;68&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;82&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;80&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Sonnet 5.5&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;73&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;38&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;75&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;72&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6.1 Sol&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;60&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;20&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;74&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;69&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6 Astra&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;58&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;18&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;75&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;71&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Haiku 5.5&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;58&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;20&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;69&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;67&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeepSeek V4.1 Flash (open weights)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;43&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;9&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;66&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;66&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GLM 5.3 Flash (open weights)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;33&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;7&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;64&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;69&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-5.6 Luna&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;26&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;5&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;65&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6 Luna&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;25&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;3&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;68&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;63&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Without seeing a single table, Opus produced the recorded answer to 86 questions, more than the 82 it reached with the database, and wrote 68 of the recorded queries word for word, 63 of them character for character.  Sonnet, Sol, Astra and Haiku produced 58 to 73.  Some correct answers without the database are guesses on well-known schemas; the exact copies are not.  On the renamed copy a recalled query no longer runs: without the database, no model answered more than two of the 100.  Several still recognised the reworded questions: for 43 of them Opus wrote out BIRD’s original query, with the old names.&lt;/p&gt;
&lt;p&gt;With the database, recall barely mattered.  On the renamed copy, Opus answered 80 questions instead of 82.  The other models answered between six fewer and five more; none of these changes is larger than chance.  Seven of the nine scored slightly lower on the copy; that could be a little reliance on memory or rewordings that are slightly harder, and these runs cannot tell which.  Of the 86 questions Opus could reproduce from memory, it still answered 73 on the renamed copy, against 75 on BIRD.  The models read the data and answer from it, even when they know the recorded query.  The ranking held as well: on the renamed copy Opus beat every other model, counted among its eight comparisons, including GPT-6 Astra (nine questions to none) and Claude Sonnet (nine to one).  Counted among all 36 pairs of models, its margins over Sonnet, Astra and GLM fall short.&lt;/p&gt;
&lt;p&gt;The recall test alone would have led us to the wrong conclusion.  It shows what a model can reproduce, not what it relies on; only a control on cases the model cannot have memorised shows that.  A team’s own cases have never been published, so they need no such control.  For public benchmarks, we will run comparisons on a renamed copy beside the original.  We have not yet tested SpreadsheetBench this way.&lt;/p&gt;
&lt;h2 id=&quot;what-does-each-usable-result-cost&quot;&gt;What does each usable result cost?&lt;/h2&gt;
&lt;p&gt;Token price alone misses failures and waiting time.  We compared success, list-price cost per correct result and time under the same stated rules.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 640 262&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-label=&quot;Correctness against cost per correct answer, with 95 % intervals. On BIRD, in SQL, nine models answer 64 to 82 of 100 questions; Claude Opus is highest at 82, then GPT-6 Astra, Claude Sonnet and GPT-6.1 Sol at 74 and 75. On SpreadsheetBench, eight models pass 46 to 55 of 59 tasks with overlapping intervals, at costs per passing task from under a tenth of a cent to 33 cents.&quot;&gt;
  &lt;g font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot;&gt;
    &lt;text x=&quot;60&quot; y=&quot;22&quot; fill=&quot;var(--text-dim)&quot; font-size=&quot;10&quot;&gt;BIRD, 100 questions, SQL&lt;/text&gt;
    &lt;text x=&quot;380&quot; y=&quot;22&quot; fill=&quot;var(--text-dim)&quot; font-size=&quot;10&quot;&gt;SpreadsheetBench, 59 tasks&lt;/text&gt;
    &lt;g stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;0.8&quot; opacity=&quot;0.5&quot;&gt;
      &lt;line x1=&quot;60&quot; y1=&quot;200&quot; x2=&quot;300&quot; y2=&quot;200&quot;&gt;&lt;/line&gt;&lt;line x1=&quot;60&quot; y1=&quot;40&quot; x2=&quot;60&quot; y2=&quot;200&quot;&gt;&lt;/line&gt;
      &lt;line x1=&quot;380&quot; y1=&quot;200&quot; x2=&quot;620&quot; y2=&quot;200&quot;&gt;&lt;/line&gt;&lt;line x1=&quot;380&quot; y1=&quot;40&quot; x2=&quot;380&quot; y2=&quot;200&quot;&gt;&lt;/line&gt;
    &lt;/g&gt;
    &lt;g fill=&quot;var(--text-faint)&quot;&gt;
      &lt;text x=&quot;40&quot; y=&quot;203&quot;&gt;40&lt;/text&gt;&lt;text x=&quot;40&quot; y=&quot;149&quot;&gt;60&lt;/text&gt;&lt;text x=&quot;40&quot; y=&quot;96&quot;&gt;80&lt;/text&gt;&lt;text x=&quot;34&quot; y=&quot;43&quot;&gt;100&lt;/text&gt;
      &lt;text x=&quot;360&quot; y=&quot;203&quot;&gt;40&lt;/text&gt;&lt;text x=&quot;360&quot; y=&quot;149&quot;&gt;60&lt;/text&gt;&lt;text x=&quot;360&quot; y=&quot;96&quot;&gt;80&lt;/text&gt;&lt;text x=&quot;354&quot; y=&quot;43&quot;&gt;100&lt;/text&gt;
      &lt;text x=&quot;79&quot; y=&quot;214&quot;&gt;$0.001&lt;/text&gt;&lt;text x=&quot;184&quot; y=&quot;214&quot;&gt;$0.01&lt;/text&gt;&lt;text x=&quot;288&quot; y=&quot;214&quot;&gt;$0.1&lt;/text&gt;
      &lt;text x=&quot;390&quot; y=&quot;214&quot;&gt;$0.001&lt;/text&gt;&lt;text x=&quot;463&quot; y=&quot;214&quot;&gt;$0.01&lt;/text&gt;&lt;text x=&quot;535&quot; y=&quot;214&quot;&gt;$0.1&lt;/text&gt;&lt;text x=&quot;608&quot; y=&quot;214&quot;&gt;$1&lt;/text&gt;
      &lt;text x=&quot;110&quot; y=&quot;236&quot; font-size=&quot;9&quot;&gt;cost per correct answer (log scale)&lt;/text&gt;
      &lt;text x=&quot;430&quot; y=&quot;236&quot; font-size=&quot;9&quot;&gt;cost per passing task (log scale)&lt;/text&gt;
      &lt;text x=&quot;8&quot; y=&quot;120&quot; font-size=&quot;9&quot; transform=&quot;rotate(-90 14 120)&quot;&gt;% correct&lt;/text&gt;
    &lt;/g&gt;
    &lt;g stroke-width=&quot;1.4&quot;&gt;
      &lt;line x1=&quot;129&quot; y1=&quot;159&quot; x2=&quot;129&quot; y2=&quot;110&quot; stroke=&quot;var(--c-verify)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;129&quot; cy=&quot;133&quot; r=&quot;3.5&quot; fill=&quot;var(--c-verify)&quot; stroke=&quot;var(--c-verify)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;135&quot; y1=&quot;148&quot; x2=&quot;135&quot; y2=&quot;100&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;135&quot; cy=&quot;123&quot; r=&quot;3.5&quot; fill=&quot;var(--c-model)&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;182&quot; y1=&quot;156&quot; x2=&quot;182&quot; y2=&quot;107&quot; stroke=&quot;var(--c-learn)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;182&quot; cy=&quot;131&quot; r=&quot;3.5&quot; fill=&quot;var(--c-learn)&quot; stroke=&quot;var(--c-learn)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;156&quot; y1=&quot;162&quot; x2=&quot;156&quot; y2=&quot;112&quot; stroke=&quot;var(--c-learn)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;156&quot; cy=&quot;136&quot; r=&quot;3.5&quot; fill=&quot;var(--c-learn)&quot; stroke=&quot;var(--c-learn)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;87&quot; y1=&quot;151&quot; x2=&quot;87&quot; y2=&quot;103&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;87&quot; cy=&quot;125&quot; r=&quot;3.5&quot; fill=&quot;var(--c-collaborate)&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;213&quot; y1=&quot;134&quot; x2=&quot;213&quot; y2=&quot;88&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;213&quot; cy=&quot;109&quot; r=&quot;3.5&quot; fill=&quot;var(--c-collaborate)&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;282&quot; y1=&quot;131&quot; x2=&quot;282&quot; y2=&quot;86&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;282&quot; cy=&quot;107&quot; r=&quot;3.5&quot; fill=&quot;var(--c-collaborate)&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;265&quot; y1=&quot;131&quot; x2=&quot;265&quot; y2=&quot;85&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;265&quot; cy=&quot;107&quot; r=&quot;3.5&quot; fill=&quot;var(--c-model)&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;273&quot; y1=&quot;109&quot; x2=&quot;273&quot; y2=&quot;69&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;273&quot; cy=&quot;88&quot; r=&quot;3.5&quot; fill=&quot;var(--c-model)&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/circle&gt;
      &lt;line x1=&quot;432&quot; y1=&quot;104&quot; x2=&quot;432&quot; y2=&quot;58&quot; stroke=&quot;var(--c-verify)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;432&quot; cy=&quot;76&quot; r=&quot;3.5&quot; fill=&quot;var(--c-verify)&quot; stroke=&quot;var(--c-verify)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;512&quot; y1=&quot;98&quot; x2=&quot;512&quot; y2=&quot;55&quot; stroke=&quot;var(--c-verify)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;512&quot; cy=&quot;72&quot; r=&quot;3.5&quot; fill=&quot;var(--c-verify)&quot; stroke=&quot;var(--c-verify)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;532&quot; y1=&quot;98&quot; x2=&quot;532&quot; y2=&quot;55&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;532&quot; cy=&quot;72&quot; r=&quot;3.5&quot; fill=&quot;var(--c-model)&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;450&quot; y1=&quot;125&quot; x2=&quot;450&quot; y2=&quot;71&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;450&quot; cy=&quot;94&quot; r=&quot;3.5&quot; fill=&quot;var(--c-model)&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;585&quot; y1=&quot;130&quot; x2=&quot;585&quot; y2=&quot;75&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;585&quot; cy=&quot;99&quot; r=&quot;3.5&quot; fill=&quot;var(--c-model)&quot; stroke=&quot;var(--c-model)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;395&quot; y1=&quot;120&quot; x2=&quot;395&quot; y2=&quot;68&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;395&quot; cy=&quot;90&quot; r=&quot;3.5&quot; fill=&quot;var(--c-collaborate)&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;476&quot; y1=&quot;81&quot; x2=&quot;476&quot; y2=&quot;46&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;476&quot; cy=&quot;58&quot; r=&quot;3.5&quot; fill=&quot;var(--c-collaborate)&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/circle&gt;&lt;line x1=&quot;525&quot; y1=&quot;81&quot; x2=&quot;525&quot; y2=&quot;46&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/line&gt;&lt;circle cx=&quot;525&quot; cy=&quot;58&quot; r=&quot;3.5&quot; fill=&quot;var(--c-collaborate)&quot; stroke=&quot;var(--c-collaborate)&quot;&gt;&lt;/circle&gt;
    &lt;/g&gt;
    &lt;text x=&quot;123&quot; y=&quot;151&quot; fill=&quot;var(--c-verify)&quot; text-anchor=&quot;end&quot;&gt;Luna 5.6&lt;/text&gt;&lt;text x=&quot;141&quot; y=&quot;117&quot; fill=&quot;var(--c-model)&quot;&gt;Haiku&lt;/text&gt;&lt;text x=&quot;188&quot; y=&quot;147&quot; fill=&quot;var(--c-learn)&quot;&gt;DeepSeek&lt;/text&gt;&lt;text x=&quot;162&quot; y=&quot;150&quot; fill=&quot;var(--c-learn)&quot;&gt;GLM&lt;/text&gt;&lt;text x=&quot;77&quot; y=&quot;113&quot; fill=&quot;var(--c-collaborate)&quot; text-anchor=&quot;end&quot;&gt;Luna 6&lt;/text&gt;&lt;text x=&quot;219&quot; y=&quot;113&quot; fill=&quot;var(--c-collaborate)&quot;&gt;Sol 6.1&lt;/text&gt;&lt;text x=&quot;288&quot; y=&quot;120&quot; fill=&quot;var(--c-collaborate)&quot;&gt;Astra 6&lt;/text&gt;&lt;text x=&quot;267&quot; y=&quot;72&quot; fill=&quot;var(--c-model)&quot; text-anchor=&quot;end&quot;&gt;Opus&lt;/text&gt;&lt;text x=&quot;259&quot; y=&quot;128&quot; fill=&quot;var(--c-model)&quot; text-anchor=&quot;end&quot;&gt;Sonnet&lt;/text&gt;
    &lt;text x=&quot;426&quot; y=&quot;66&quot; fill=&quot;var(--c-verify)&quot; text-anchor=&quot;end&quot;&gt;Luna 5.6&lt;/text&gt;&lt;text x=&quot;506&quot; y=&quot;92&quot; fill=&quot;var(--c-verify)&quot; text-anchor=&quot;end&quot;&gt;Sol 5.6&lt;/text&gt;&lt;text x=&quot;538&quot; y=&quot;84&quot; fill=&quot;var(--c-model)&quot;&gt;Opus&lt;/text&gt;&lt;text x=&quot;456&quot; y=&quot;104&quot; fill=&quot;var(--c-model)&quot;&gt;Haiku&lt;/text&gt;&lt;text x=&quot;569&quot; y=&quot;115&quot; fill=&quot;var(--c-model)&quot; text-anchor=&quot;end&quot;&gt;Sonnet&lt;/text&gt;&lt;text x=&quot;387&quot; y=&quot;108&quot; fill=&quot;var(--c-collaborate)&quot; text-anchor=&quot;end&quot;&gt;Luna 6&lt;/text&gt;&lt;text x=&quot;462&quot; y=&quot;46&quot; fill=&quot;var(--c-collaborate)&quot; text-anchor=&quot;end&quot;&gt;Sol 6.1&lt;/text&gt;&lt;text x=&quot;531&quot; y=&quot;52&quot; fill=&quot;var(--c-collaborate)&quot;&gt;Astra 6&lt;/text&gt;
    &lt;g font-size=&quot;8&quot;&gt;
      &lt;circle cx=&quot;64&quot; cy=&quot;252&quot; r=&quot;3&quot; fill=&quot;var(--c-verify)&quot;&gt;&lt;/circle&gt;&lt;text x=&quot;70&quot; y=&quot;255&quot; fill=&quot;var(--c-verify)&quot;&gt;GPT-5.6&lt;/text&gt;
      &lt;circle cx=&quot;134&quot; cy=&quot;252&quot; r=&quot;3&quot; fill=&quot;var(--c-collaborate)&quot;&gt;&lt;/circle&gt;&lt;text x=&quot;140&quot; y=&quot;255&quot; fill=&quot;var(--c-collaborate)&quot;&gt;GPT-6&lt;/text&gt;
      &lt;circle cx=&quot;196&quot; cy=&quot;252&quot; r=&quot;3&quot; fill=&quot;var(--c-model)&quot;&gt;&lt;/circle&gt;&lt;text x=&quot;202&quot; y=&quot;255&quot; fill=&quot;var(--c-model)&quot;&gt;Claude 5.5&lt;/text&gt;
      &lt;circle cx=&quot;280&quot; cy=&quot;252&quot; r=&quot;3&quot; fill=&quot;var(--c-learn)&quot;&gt;&lt;/circle&gt;&lt;text x=&quot;286&quot; y=&quot;255&quot; fill=&quot;var(--c-learn)&quot;&gt;open weights (Fireworks)&lt;/text&gt;
    &lt;/g&gt;
  &lt;/g&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Correctness with 95 % intervals against list-price cost per correct answer, measured 2026-10-01 to 2026-10-15.  BIRD: nine models writing SQL for SQLite on the same 100 questions.  SpreadsheetBench: eight models on the same 59 tasks.  Overlapping bars alone do not settle a paired comparison.  Claude Opus has the highest BIRD score here, and on a renamed copy of the questions too (see the recall test above), while the SpreadsheetBench models have overlapping estimates at costs that differ by more than a hundredfold.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Each dot represents a model; each bar shows uncertainty from sampled cases, not repeated runs.  Around two thirds correct on 100 questions, the interval spans roughly nine points either way.  Those wide intervals make a small apparent lead weak evidence for a purchase.&lt;/p&gt;
&lt;p&gt;On the same cases, twelve wins against two losses say more than six against five.  We report a &lt;em&gt;p-value&lt;/em&gt; for how surprising each split would be under equal performance.  Values below 0.05 merit attention, but the more comparisons we run, the more such values arise by chance.  Dvergr reports intervals; we calculated paired counts and p-values from recorded verdicts.&lt;/p&gt;
&lt;p&gt;Provider load changes, so timing comparisons are strongest when candidates run together.&lt;/p&gt;
&lt;h3 id=&quot;spreadsheet-work-price-varied-more-than-quality&quot;&gt;Spreadsheet work: price varied more than quality&lt;/h3&gt;
&lt;p&gt;For workbook edits, compare cost per passing task before comparing token prices.  We held Dvergr’s workflow and spreadsheet engine constant across 59 of the 390 certified tasks.  The public SpreadsheetBench leaderboard uses other tools, so its results are not directly comparable:&lt;/p&gt;













































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Tasks&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Passed&lt;/th&gt;&lt;th&gt;95 % interval&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Cost per pass&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Median time&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;GPT-5.6 Luna&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;51&lt;/td&gt;&lt;td&gt;76–93 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.0026&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;24 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-5.6 Sol&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;52&lt;/td&gt;&lt;td&gt;78–95 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.033&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;27 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Opus 5.5 (Claude Code subscription)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;52&lt;/td&gt;&lt;td&gt;78–95 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.062&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;17 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Haiku 5.5 (Claude Code subscription)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;47&lt;/td&gt;&lt;td&gt;68–88 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.0046&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;22 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Sonnet 5.5 (Claude Code subscription)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;46&lt;/td&gt;&lt;td&gt;66–87 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.33&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;19 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6 Luna&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;48&lt;/td&gt;&lt;td&gt;70–90 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.0008&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;10 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6.1 Sol&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;55&lt;/td&gt;&lt;td&gt;85–98 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.010&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;9 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6 Astra&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;55&lt;/td&gt;&lt;td&gt;85–98 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.050&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;9 s&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Against GPT-5.6 Luna, none of the GPT-5.6 or Claude models showed a clear quality gain on these cases.  Opus won six cases and lost five; Sol won three and lost two; Haiku won four and lost eight; Sonnet won three and lost nine (the closest comparison, p = 0.15).  Cost per passing task differed sharply: Haiku cost roughly twice as much as Luna, Sol thirteen times, Opus twenty-four times and Sonnet more than a hundred times.  Sonnet’s slowest tenth of tasks took over nine minutes.  That delay matters when staff wait for a workbook before continuing.&lt;/p&gt;
&lt;p&gt;GPT-6.1 Sol and GPT-6 Astra each passed 55 tasks.  They disagreed on four, split two each way, while Astra cost five times as much per pass.  Sol 6.1 beat GPT-6 Luna on eight cases and lost one (p = 0.039), but a split that uneven can arise somewhere among the 28 pairs of eight models by chance.  Against GPT-5.6 Luna the split was five to one (p = 0.22).  The newer models ran about three times faster.  They were tested a few days later, so provider conditions may explain part of that difference.&lt;/p&gt;
&lt;p&gt;At least one model solved every task but one.  Most failures therefore identify candidate weaknesses, not tasks no model could solve.&lt;/p&gt;
&lt;h3 id=&quot;database-routes-similar-answers-different-bills&quot;&gt;Database routes: similar answers, different bills&lt;/h3&gt;
&lt;p&gt;Database access can change an agent’s cost even when accuracy barely moves.  BIRD covers 11 databases.  We compared SQL on SQLite, SQL on Datahike through &lt;a href=&quot;https://github.com/replikativ/pg-datahike&quot;&gt;pg-datahike&lt;/a&gt;, and Datalog on Datahike.  Before involving a model, we checked that pg-datahike returned exactly SQLite’s rows for 1372 of BIRD’s 1534 reference queries.  That check helps separate engine differences from agent differences.&lt;/p&gt;
&lt;p&gt;GPT-5.6 Luna then answered 100 fresh questions held out from tuning:&lt;/p&gt;





































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Engine&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Correct (of 100)&lt;/th&gt;&lt;th&gt;95 % interval&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Cost per correct answer&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Input tokens per question&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Median / slowest tenth&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;SQL on SQLite&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;65&lt;/td&gt;&lt;td&gt;55–74 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.0023&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;7,839&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;10 s / 23 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SQL on Datahike (pg-datahike)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;65&lt;/td&gt;&lt;td&gt;55–74 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.0026&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;10,136&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;10 s / 41 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Datalog on Datahike&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;64&lt;/td&gt;&lt;td&gt;54–73 %&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;$0.0044&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;15,061&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;13 s / 42 s&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;All three routes scored similarly.  Each pair disagreed on seven to ten questions, nearly evenly split.  Datalog used more input tokens while the model examined the schema, roughly doubling list-price cost per correct answer against SQL.  A team could pay nearly twice as much per correct answer without gaining accuracy.&lt;/p&gt;
&lt;p&gt;We also ran nine models on the same 100 questions:&lt;/p&gt;





















































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Model&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;SQL on SQLite (of 100)&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Datalog (of 100)&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;SQL, renamed copy&lt;/th&gt;&lt;th&gt;Cost per correct answer, SQL / Datalog&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Median time, SQL&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;GPT-5.6 Luna&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;65&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;64&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td&gt;$0.0023 / $0.0044&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;10 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Haiku 5.5&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;69&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;68&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;67&lt;/td&gt;&lt;td&gt;$0.0026 / $0.0047&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;9 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DeepSeek V4.1 Flash (open weights)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;66&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;64&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;66&lt;/td&gt;&lt;td&gt;$0.0074 / $0.0195&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;8 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GLM 5.3 Flash (open weights)&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;64&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;58&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;69&lt;/td&gt;&lt;td&gt;$0.0042 / $0.0106&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;6 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6 Luna&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;68&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;60&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;63&lt;/td&gt;&lt;td&gt;$0.0009 / $0.0014&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;5 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6.1 Sol&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;74&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;71&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;69&lt;/td&gt;&lt;td&gt;$0.015 / $0.019&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;8 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPT-6 Astra&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;75&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;70&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;71&lt;/td&gt;&lt;td&gt;$0.067 / $0.091&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;6 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Sonnet 5.5&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;75&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;72&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;72&lt;/td&gt;&lt;td&gt;$0.046 / $0.038&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;7 s&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Claude Opus 5.5&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;82&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;81&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;80&lt;/td&gt;&lt;td&gt;$0.054 / $0.073&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;8 s&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Among the first four models, no pair showed a reliable advantage after considering all comparisons.  Pairs disagreed on 10 to 18 questions.  Even the most uneven split, GLM against Haiku in Datalog (p = 0.013), can arise somewhere among 28 comparisons by chance.  One favourable split is weak evidence for buying a model.&lt;/p&gt;
&lt;p&gt;GPT-6.1 Sol and GPT-6 Astra answered 74 and 75 SQL questions, against Luna 5.6’s 65; their paired wins and losses against Luna were eleven to two and twelve to two.  Claude Opus 5.5, measured a few days later, answered 82 SQL and 81 Datalog questions, the most of any model here.  It beat every other model in paired comparisons except Astra in SQL (nine to two, p = 0.065), and on the renamed copy it beat Astra too, counted among its own comparisons.  Claude Sonnet answered 75, level with Sol and Astra.  Per correct SQL answer, Opus cost less than Astra and about three and a half times as much as Sol.&lt;/p&gt;
&lt;p&gt;The two open-weight models, served here by &lt;a href=&quot;https://fireworks.ai/&quot;&gt;Fireworks&lt;/a&gt;, answered about as many questions as GPT-5.6 Luna and Claude Haiku.  Their list-price cost per correct answer was two to three times higher because they used more tokens and received no cached-input discount.  An organization could run those weights on its own machines to keep data there.  We did not measure that option’s hardware and operating costs.&lt;/p&gt;
&lt;h2 id=&quot;test-the-proposed-change-on-new-cases&quot;&gt;Test the proposed change on new cases&lt;/h2&gt;
&lt;p&gt;A promising candidate still needs a fresh test before rollout.  Cases used to improve it cannot show whether that improvement carries over to unseen work.&lt;/p&gt;
&lt;p&gt;Dvergr keeps the task, instructions, checker, cases and sandbox code in its room.  A person or agent can propose another instruction, step or model.  Each candidate runs in separate forks on tuning cases, then unseen cases.  Checker promotion requires a host administrator’s connection outside the room, beyond an agent’s write access.&lt;/p&gt;
&lt;p&gt;We tried this by hand with a Datalog workflow using &lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt; to answer BIRD questions.  After inspecting failures, we added two sentences explaining Datalog, then measured the revision on 100 unseen questions:&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Workflow&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Correct (of 100)&lt;/th&gt;&lt;th align=&quot;right&quot;&gt;Input tokens per question&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;SQL on SQLite&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;59&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;8,880&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Datalog, revised description&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;63&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;14,042&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Datalog, previous description&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;58&lt;/td&gt;&lt;td align=&quot;right&quot;&gt;16,684&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The revision answered five more questions with fewer input tokens, but chance remains plausible (p = 0.23).  Dvergr measures variants proposed by people or agents today.  We are building toward agents running that propose-and-measure loop before handing candidates to owners.  Fresh cases must still catch regressions before a team changes a production workflow.&lt;/p&gt;
&lt;h2 id=&quot;what-these-tests-cannot-decide-for-your-team&quot;&gt;What these tests cannot decide for your team&lt;/h2&gt;
&lt;p&gt;Each model answered each case once, so these runs do not measure variation across repeats.  Intervals concern sampled cases.  A tie on 59 tasks does not prove equality, and 100 cases can miss a small regression.  Providers can also change a model behind a familiar name, and a model may have learned a public benchmark’s answers, as most did on BIRD.  Public cases show how instructions, tools, engines and checkers affect results.  They cannot estimate the finance team’s repair cost, acceptable failure rate or next month’s case mix.  For that, the team needs checked cases from its own history and reruns after workflow or model changes.&lt;/p&gt;
&lt;h3 id=&quot;method-and-scope&quot;&gt;Method and scope&lt;/h3&gt;

















































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Models&lt;/td&gt;&lt;td&gt;GPT-5.6 Luna and Sol, GPT-6 Luna, GPT-6.1 Sol and GPT-6 Astra (Codex subscription); Claude Haiku 5.5, Sonnet 5.5 and Opus 5.5 (Claude Code subscription, each pinned to its exact version); GLM 5.3 Flash and DeepSeek V4.1 Flash (Fireworks).  Each answers every case once.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Cases&lt;/td&gt;&lt;td&gt;BIRD dev, the held-out third of each database’s questions, fresh samples of 100; SpreadsheetBench verified, held-out tasks among the 390 certified&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Grading&lt;/td&gt;&lt;td&gt;BIRD: the returned rows equal the recorded query’s rows; SpreadsheetBench: the answer cells equal the recorded workbook’s values&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Statistics&lt;/td&gt;&lt;td&gt;Jeffreys 95 % intervals for success rates, as Dvergr’s report gives them; exact McNemar test on the cases two candidates disagree on, computed from the recorded per-case verdicts&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Cost&lt;/td&gt;&lt;td&gt;list price per million tokens on the day of measurement, cached input at the cache rate&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Reference setups&lt;/td&gt;&lt;td&gt;BIRD’s prompt from its published &lt;code&gt;gpt_request.py&lt;/code&gt; and its evaluation script; SpreadsheetBench’s single- and multi-round drivers and its comparison code, the generated programs run in a Docker container; both reach the model through Dvergr’s model connection: &lt;a href=&quot;https://github.com/replikativ/dvergr/tree/main/benchmarks/reference&quot;&gt;&lt;code&gt;benchmarks/reference/&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Code and data&lt;/td&gt;&lt;td&gt;BIRD and SpreadsheetBench are public; Dvergr and both benchmark adapters are open source: &lt;a href=&quot;https://github.com/replikativ/dvergr&quot;&gt;github.com/replikativ/dvergr&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Recall test&lt;/td&gt;&lt;td&gt;each model received a BIRD question’s text and its database’s name only, and was asked for BIRD’s recorded query; the reply was run and its rows compared with the recorded answer’s, as in grading&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Renamed copy&lt;/td&gt;&lt;td&gt;the same 100 questions with every database, table and column renamed, the recorded queries rewritten and verified to return the same rows, the questions and hints reworded (checked by Claude Sonnet 5.5, three by hand); data and recorded answers unchanged; SQL on SQLite only&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Updated&lt;/td&gt;&lt;td&gt;2026-10-15: Claude Sonnet 5.5 and Opus 5.5 added to the BIRD comparison; a recall test and a renamed copy of the BIRD questions added; the estimate of what BIRD’s recorded answers allow revised&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;decide-on-your-own-cases&quot;&gt;Decide on your own cases&lt;/h2&gt;
&lt;p&gt;The finance team’s decision rests on its own checked history: past bookings, coded invoices or workbook edits with recorded outcomes.  Those cases show which failures staff must repair, what a usable result costs and whether a change improves its work.&lt;/p&gt;
&lt;p&gt;Dvergr can run that comparison today on the organization’s own machine.  Start with one workflow and checked historical cases.  Export each input, recorded outcome and grading rule.  Dvergr certifies the case pack, naming records it cannot grade before model runs.  It then compares candidates on the same cases and reports failures, success intervals, list-price cost and time.  Technical teams can follow &lt;a href=&quot;https://github.com/replikativ/dvergr/blob/main/doc/running-benchmarks.md&quot;&gt;running benchmarks&lt;/a&gt; and &lt;a href=&quot;https://github.com/replikativ/dvergr/blob/main/doc/room-workflows.md#case-packs-a-benchmark-from-your-own-history&quot;&gt;case-pack setup&lt;/a&gt;.  For a managed deployment, &lt;a href=&quot;https://simm.is/early-access&quot;&gt;join the Simmis Cloud waitlist&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Revised in November 2026 for precision.&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title>Superficie: Clojure you can read without learning Lisp</title><link>https://simm.is/blog/superficie-clojure-you-can-read/</link><guid isPermaLink="true">https://simm.is/blog/superficie-clojure-you-can-read/</guid><description>Why every Clojure example on this site has a second, block-and-infix view, how that view stays exactly the same program, and how libraries teach it to show numerical kernels and proofs.</description><pubDate>Mon, 28 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;Syntactic sugar causes cancer of the semicolon.&lt;/p&gt;
&lt;p&gt;Alan Perlis, &lt;a href=&quot;https://www.cs.yale.edu/homes/perlis-alan/quotes.html&quot;&gt;Epigrams on Programming&lt;/a&gt;, 1982&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Every Clojure example on this site opens in a tab called Superficie, with the original Clojure one click away.  Perlis warned that syntactic sugar causes cancer of the semicolon, and Superficie is a lot of sugar, taken on one condition, that the two tabs show exactly the same program.  This article explains why we built it, how that condition is kept, and how libraries teach it to write numerical kernels, proofs, and probabilistic models the way their fields do.&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&quot;a-few-days-is-too-long&quot;&gt;A few days is too long&lt;/h2&gt;
&lt;p&gt;Superficie began with a problem during a PhD in machine learning.  The research code was written in Clojure, and the colleagues, supervisors, and domain experts who needed to read it worked in Python.  Showing a function in a meeting, a paper, or a code review meant first explaining the parentheses.&lt;/p&gt;
&lt;p&gt;That unfamiliarity passes.  Most programmers read S-expressions comfortably after a few days.  A meeting, a blog post, or a review with someone outside the team does not last a few days, though.  The reader skips the code and trusts the prose around it, which defeats the purpose of showing code at all.&lt;/p&gt;
&lt;p&gt;Our stack makes the problem larger.  &lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt;, &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt;, &lt;a href=&quot;https://github.com/replikativ/yggdrasil&quot;&gt;Yggdrasil&lt;/a&gt;, &lt;a href=&quot;https://github.com/replikativ/raster&quot;&gt;Raster&lt;/a&gt;, and &lt;a href=&quot;https://github.com/replikativ/ansatz&quot;&gt;Ansatz&lt;/a&gt; are Clojure libraries, and most people who read about them do not write Clojure.  Simmis is meant to be usable without knowing Clojure, while deep work on the core stack still requires it.  &lt;a href=&quot;https://github.com/replikativ/superficie&quot;&gt;Superficie&lt;/a&gt; is the tool we use at that boundary.  We keep writing Clojure, and we show it in a notation that readers of Python, Julia, TypeScript, or Lean can follow on first sight.&lt;/p&gt;
&lt;h2 id=&quot;one-program-in-two-notations&quot;&gt;One program in two notations&lt;/h2&gt;
&lt;p&gt;Superficie is a bidirectional renderer.  It prints Clojure forms as text with ordinary calls, infix arithmetic, and blocks, and it reads that text back into the same forms.  Here is a function from our &lt;a href=&quot;https://github.com/replikativ/city-rstr&quot;&gt;Stuttgart retail simulation&lt;/a&gt; that compares two shop names by the words they share:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;defn jaccard [a b]:
  a := set(str/split(a, #&quot; &quot;))
  b := set(str/split(b, #&quot; &quot;))
  u := count(set/union(a, b))
  if zero?(u):
    0.0
  else:
    double(count(set/intersection(a, b))) / u
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(defn jaccard [a b]
  (let [a (set (str/split a #&quot; &quot;)) b (set (str/split b #&quot; &quot;))
        u (count (set/union a b))]
    (if (zero? u) 0.0 (/ (double (count (set/intersection a b))) u))))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A few rules cover most of what you see.  A call is &lt;code&gt;f(a, b)&lt;/code&gt;.  Arithmetic and comparisons are infix and need spaces around the operator, so &lt;code&gt;a-b&lt;/code&gt; stays a Clojure name and &lt;code&gt;a - b&lt;/code&gt; is subtraction.  A block starts with a head and a colon and ends with &lt;code&gt;end&lt;/code&gt;, which covers &lt;code&gt;defn&lt;/code&gt;, &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, &lt;code&gt;loop&lt;/code&gt;, and every other form with a body.  A &lt;code&gt;let&lt;/code&gt; that ends a body is written as &lt;code&gt;name := value&lt;/code&gt; statements, so a function reads from top to bottom instead of nesting one level deeper per binding.&lt;/p&gt;
&lt;p&gt;To try it, paste any Clojure into the &lt;a href=&quot;https://replikativ.github.io/superficie/examples/playground.html&quot;&gt;playground&lt;/a&gt;, which renders it live and includes a SCI REPL that evaluates Superficie in the browser.&lt;/p&gt;
&lt;p&gt;Superficie has no runtime of its own.  Any Clojure source prints as Superficie.  Superficie source can also be read and evaluated directly, on the JVM, in Babashka, or in the browser through a SCI REPL, and it works with every Clojure library because what runs is ordinary Clojure.  Macros and syntax-quote print as themselves rather than as their expansion, so a macro definition reads like the template its author wrote.&lt;/p&gt;
&lt;h2 id=&quot;the-same-program-or-it-is-a-bug&quot;&gt;The same program, or it is a bug&lt;/h2&gt;
&lt;p&gt;A rendering that is almost right is worse than none, because a reader cannot tell which part changed.  Superficie’s rule is exact roundtripping.  We print the forms, read the text back, and compare the result with the original forms for equality.  The comparison treats as equal only spellings that Clojure evaluates identically, such as the names Clojure’s reader invents for the parameters of &lt;code&gt;#()&lt;/code&gt; or &lt;code&gt;(new Foo x)&lt;/code&gt; against &lt;code&gt;(Foo. x)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We check the rule against real code rather than hand-picked samples.  In the current version, 421 of the 434 readable files in Raster and Ansatz roundtrip exactly, both in the compact form and in the width-aware layout used on this site.  Across 13 open source Clojure projects, among them Datahike, DataScript, Malli, SCI, Babashka, and core.async, 622 of the 670 files our checker could read do.  All 41 files of the Stuttgart simulation do.&lt;/p&gt;
&lt;p&gt;Most of the remaining files use one of Superficie’s block words, such as &lt;code&gt;match&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt;, &lt;code&gt;ns&lt;/code&gt;, or &lt;code&gt;end&lt;/code&gt;, as an ordinary name in a position where Superficie reads a block.  The printer avoids this where it can.  A local named &lt;code&gt;end&lt;/code&gt; keeps its &lt;code&gt;let&lt;/code&gt; block instead of becoming &lt;code&gt;end := now()&lt;/code&gt;, which would close the enclosing block, and a statement that starts with such a word is parenthesised.  Where the printer cannot avoid it, the constraint is documented, and code written in Superficie from the start does not run into it.&lt;/p&gt;
&lt;p&gt;The corpora keep finding cases that a design review misses.  A &lt;code&gt;proxy&lt;/code&gt; block followed by a vector on the next line read its closing &lt;code&gt;end&lt;/code&gt; as the name of a method.  In the JavaScript build that renders this site, &lt;code&gt;4.0&lt;/code&gt; printed as &lt;code&gt;4&lt;/code&gt;, because JavaScript has a single number type, and a reader of a numerical kernel would have seen integer arithmetic.  Both are fixed, and the checker found both in code nobody wrote to test it.&lt;/p&gt;
&lt;p&gt;The printer never fails, either.  A form it has no block for prints as a call, &lt;code&gt;f(a, b, c)&lt;/code&gt;, which always reads back.  That fallback is exact and hard to read, so most of the recent work went into making it rarer.&lt;/p&gt;
&lt;h2 id=&quot;where-the-notation-comes-from&quot;&gt;Where the notation comes from&lt;/h2&gt;
&lt;p&gt;Lisp was meant to have a second notation from the start.  John McCarthy’s 1960 paper on Lisp wrote programs as M-expressions, such as &lt;code&gt;f[x; y]&lt;/code&gt;, and used S-expressions to represent data.  In his &lt;a href=&quot;https://www-formal.stanford.edu/jmc/history/lisp/node3.html&quot;&gt;History of Lisp&lt;/a&gt;, he recalled that translating M-expressions into S-expressions “was neither finalized nor explicitly abandoned.  It just receded into the indefinite future, and a new generation of programmers appeared who preferred internal notation to any FORTRAN-like or ALGOL-like notation that could be devised.”  Later attempts include Dylan, which replaced its prefix syntax with an Algol-like one in the 1990s, and the readable project’s &lt;a href=&quot;https://srfi.schemers.org/srfi-105/&quot;&gt;SRFI 105&lt;/a&gt; and &lt;a href=&quot;https://srfi.schemers.org/srfi-110/&quot;&gt;SRFI 110&lt;/a&gt; for Scheme.  The most thorough recent one is &lt;a href=&quot;https://docs.racket-lang.org/rhombus/&quot;&gt;Rhombus&lt;/a&gt;, a language built on Racket and described by Matthew Flatt and colleagues at OOPSLA 2023.&lt;/p&gt;
&lt;p&gt;For a Clojure programmer, the interesting part is what a surface syntax has to rebuild.  In an S-expression the parentheses are the tree, so Clojure’s reader stays small and knows nothing about operators.  A notation with infix operators and blocks has to recover that tree in two steps, and Superficie takes both from existing work.  First, following Rhombus’s &lt;a href=&quot;https://docs.racket-lang.org/shrubbery/&quot;&gt;shrubbery notation&lt;/a&gt;, it groups the text by its brackets without knowing what any operator means.  A mismatched bracket becomes an error node in that tree while the rest of the file still parses, which is what makes useful error messages possible.  Second, it decides precedence with Vaughan Pratt’s 1973 technique: each operator has a binding power, and the parser keeps consuming operators while their power exceeds the current minimum, so &lt;code&gt;a + b * c&lt;/code&gt; groups correctly without a grammar rule per precedence level.&lt;/p&gt;
&lt;p&gt;The visible choices are borrowed where readers already know them.  A block header ends with a colon, as in Python, and a block closes with &lt;code&gt;end&lt;/code&gt;, as in Julia, so indentation carries no meaning and copying code through HTML, chat, or a diff cannot change it.  Arrow lambdas and indexing follow Julia, pattern-match arms and &lt;code&gt;:=&lt;/code&gt; follow Lean, and stores follow OCaml.  Operators need spaces around them because Clojure names may contain &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;?&lt;/code&gt;, and &lt;code&gt;&amp;#x3C;&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;libraries-decide-how-their-macros-read&quot;&gt;Libraries decide how their macros read&lt;/h2&gt;
&lt;p&gt;The Rhombus paper observes that “the message of macros has been difficult to detangle from Lisp’s minimalistic, parenthesis-oriented notation.”  Languages without parentheses answer it in two ways, and Superficie takes the second.&lt;/p&gt;
&lt;p&gt;In Rhombus, parsing is not finished before macros run.  The reader leaves a sequence such as &lt;code&gt;1 + 2 * 3&lt;/code&gt; flat, and the expander completes it while expanding macros, so a library can define a new operator together with its precedence.  In Julia, the grammar is fixed.  The parser builds the whole tree first, a macro call is marked with &lt;code&gt;@&lt;/code&gt;, and the macro receives that tree as data and returns a new one.&lt;/p&gt;
&lt;p&gt;Superficie parses first, as Julia does, but the data a macro receives is plain Clojure.  &lt;code&gt;a + b&lt;/code&gt; arrives as &lt;code&gt;(+ a b)&lt;/code&gt; and a block arrives as the list it stands for, so a macro written for Clojure works unchanged and never sees Superficie.  No &lt;code&gt;@&lt;/code&gt; is needed either.  A macro call is written like any other call, and Clojure decides at expansion time that it names a macro.  Superficie gives up Rhombus’s user-defined operators and gets every existing Clojure library in exchange.  A macro can be written in Superficie too, with syntax-quote as its template:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;defmacro unless [test &amp;#x26; body]:
  `if not(~test):
     do(~@body)
   end
end

unless(ready?(job), log(&quot;waiting&quot;), retry(job))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(defmacro unless [test &amp;#x26; body]
  `(if (not ~test) (do ~@body)))

(unless (ready? job) (log &quot;waiting&quot;) (retry job))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Most of our interesting code lives inside library macros.  Raster’s &lt;code&gt;deftm&lt;/code&gt; defines a typed function that Raster can compile into a GPU kernel, Ansatz’s &lt;code&gt;a/theorem&lt;/code&gt; states and proves a theorem, and Spindel’s &lt;code&gt;spin&lt;/code&gt; wraps a program such as the probabilistic model of the Stuttgart simulation.  Without more information, Superficie can print a macro only as a call, &lt;code&gt;deftm(weight, [att :- Double], :-, Double, ...)&lt;/code&gt;, which is exact and unreadable.&lt;/p&gt;
&lt;p&gt;A shape tells Superficie how a macro’s arguments split into a block header and a body.  For &lt;code&gt;unless&lt;/code&gt;, the shape &lt;code&gt;[:form :body]&lt;/code&gt; lets &lt;code&gt;unless(ready?(job), log(&quot;waiting&quot;), retry(job))&lt;/code&gt; read as &lt;code&gt;unless ready?(job):&lt;/code&gt; followed by its body and &lt;code&gt;end&lt;/code&gt;, and the macro still receives the same list.  The shape changes the notation, never what the macro sees.  Shapes for Raster, Ansatz, and Spindel ship with Superficie.  A library can declare its own, in a resource file, in the macro’s metadata, or at runtime.  The printer uses a shape only after checking that the block reads back to the original form, so a wrong shape can cost readability but not correctness.&lt;/p&gt;
&lt;p&gt;A shape can also change how a block’s body is written.  This kernel from the Stuttgart simulation computes, for every 100 m cell, the normaliser of the shop choice distribution:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;deftm cell-totals!
    &quot;Z_c for every cell: the normaliser of the choice distribution.&quot;
    [cell-lon :- Array(double),
     cell-lat :- Array(double),
     cand-lon :- Array(double),
     cand-lat :- Array(double),
     cand-att :- Array(double),
     params :- Array(double),
     totals :- Array(double),
     n-cells :- Long,
     nc :- Long] :- Void:
  alpha := params[0]
  beta := params[1]
  d0 := params[2]
  par/map-void! c n-cells:
    lon := cell-lon[c]
    lat := cell-lat[c]
    loop [q int(0), z 0.0]:
      if q &amp;#x3C; nc:
        recur(unchecked-add-int(q, 1),
          z + weight(cand-att[q],
                haversine-m(lon, lat, cand-lon[q], cand-lat[q]), alpha, beta, d0))
      else:
        totals[c] &amp;#x3C;- z
      end
    end
  end
end&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(deftm cell-totals!
  &quot;Z_c for every cell: the normaliser of the choice distribution.&quot;
  [cell-lon :- (Array double), cell-lat :- (Array double),
   cand-lon :- (Array double), cand-lat :- (Array double), cand-att :- (Array double),
   params :- (Array double), totals :- (Array double),
   n-cells :- Long, nc :- Long] :- Void
  (let [alpha (aget params 0) beta (aget params 1) d0 (aget params 2)]
    (par/map-void! c n-cells
      (let [lon (aget cell-lon c) lat (aget cell-lat c)]
        (loop [q (int 0) z 0.0]
          (if (&amp;#x3C; q nc)
            (recur (unchecked-add-int q 1)
                   (+ z (weight (aget cand-att q) (haversine-m lon lat (aget cand-lon q) (aget cand-lat q)) alpha beta d0)))
            (aset totals c z)))))))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Raster declares that inside its kernels &lt;code&gt;x[i]&lt;/code&gt; means &lt;code&gt;aget&lt;/code&gt; and &lt;code&gt;x[i] &amp;#x3C;- v&lt;/code&gt; means &lt;code&gt;aset&lt;/code&gt;.  That declaration names functions; it does not fix what indexing means.  Raster’s &lt;code&gt;aget&lt;/code&gt; and &lt;code&gt;aset&lt;/code&gt; dispatch on the array’s element type, much as Julia’s &lt;code&gt;getindex&lt;/code&gt; and &lt;code&gt;setindex!&lt;/code&gt; do, so the brackets are as polymorphic as the functions behind them.  Outside a block that declares indexing, &lt;code&gt;aget(U, i)&lt;/code&gt; stays a call, and in a block header &lt;code&gt;name[x]&lt;/code&gt; is never read as an index.&lt;/p&gt;
&lt;p&gt;Ansatz uses the same mechanism for a different field.  Its terms follow Lean, so inside &lt;code&gt;a/defn&lt;/code&gt; and &lt;code&gt;a/theorem&lt;/code&gt; a name like &lt;code&gt;Nat.succ(n)&lt;/code&gt; is a call to a dotted name rather than a Java method call, and a pattern match prints as Lean-style arms:&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;a/defn rb-size [t :- RBTree(Nat)] Nat:
  match t:
    | leaf =&gt; 0
    | node(color, left, key, right) =&gt; 1 + (rb-size(left) + rb-size(right))
  end
end

a/theorem map-preserves-len [f :- arrow(Nat, Nat) l :- List(Nat)] (llen(lmap(f, l)) = llen(l)):
  induction(l)
  all_goals(grind(&quot;lmap&quot;, &quot;llen&quot;))
end&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(a/defn rb-size [t :- (RBTree Nat)] Nat
  (match t
    [leaf 0]
    [(node color left key right) (+ 1 (+ (rb-size left) (rb-size right)))]))

(a/theorem map-preserves-len [f :- (arrow Nat Nat), l :- (List Nat)]
  (= (llen (lmap f l)) (llen l))
  (induction l) (all_goals (grind &quot;lmap&quot; &quot;llen&quot;)))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;choosing-the-notation&quot;&gt;Choosing the notation&lt;/h2&gt;
&lt;p&gt;Each shorthand had to meet two conditions.  A reader who has never seen Superficie should recognise it, and it must read back as exactly one form.  Several candidates met the first condition and failed the second, and those failures shaped the syntax.&lt;/p&gt;
&lt;p&gt;Anonymous functions have two spellings.  A one-line function passed as an argument prints as an arrow, &lt;code&gt;map(x -&gt; x * x, xs)&lt;/code&gt;, and its body runs to the next comma or closing bracket.  The arrow needs a space on each side.  Without them, &lt;code&gt;a-&gt;b&lt;/code&gt; is one Clojure name, and &lt;code&gt;base -&gt;(raw, f())&lt;/code&gt; is a name followed by a call to Clojure’s thread-first macro, which is how it appears in a &lt;code&gt;let&lt;/code&gt; binding.  Clojure’s &lt;code&gt;#()&lt;/code&gt; literal keeps its own syntax with &lt;code&gt;%&lt;/code&gt; parameters.  By the time Superficie sees Clojure source, the reader has already expanded &lt;code&gt;#(inc %)&lt;/code&gt; into a function whose parameter is called something like &lt;code&gt;p1__123#&lt;/code&gt;.  Only the &lt;code&gt;#()&lt;/code&gt; reader produces names of that pattern, so Superficie can recognise them exactly and print &lt;code&gt;#(inc(%))&lt;/code&gt; again instead of the expansion.&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;defn summarize [xs]:
  {:squares map(x -&gt; x * x, xs),
   :total reduce((acc, x) -&gt; acc + x, 0, xs),
   :labels map(#(str(&quot;item-&quot;, %)), xs)}
end&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(defn summarize [xs]
  {:squares (map (fn [x] (* x x)) xs)
   :total (reduce (fn [acc x] (+ acc x)) 0 xs)
   :labels (map #(str &quot;item-&quot; %) xs)})&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Indexing was the harder decision.  Brackets for Clojure’s general &lt;code&gt;get&lt;/code&gt; would read naturally in data code, but &lt;code&gt;x[i]&lt;/code&gt; would then have two meanings depending on where it appears, and &lt;code&gt;get&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; for a missing index where &lt;code&gt;aget&lt;/code&gt; fails.  Keyword lookup such as &lt;code&gt;(:name user)&lt;/code&gt; is also several times more common than &lt;code&gt;get&lt;/code&gt; in a rough count over the projects above, so a global index syntax would mostly dress up a less common idiom.  Indexing therefore stays with the libraries that declare it.&lt;/p&gt;
&lt;p&gt;Stores needed an operator that nothing else could be mistaken for.  &lt;code&gt;=&lt;/code&gt; is equality in Superficie, as in Clojure, and &lt;code&gt;:=&lt;/code&gt; introduces a binding.  A store is neither, so it is written &lt;code&gt;&amp;#x3C;-&lt;/code&gt;, as OCaml writes &lt;code&gt;a.(i) &amp;#x3C;- v&lt;/code&gt;.  Binding, comparison, and mutation each have one spelling.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;:=&lt;/code&gt; statements are the newest rule.  A &lt;code&gt;let&lt;/code&gt; in the last position of a body prints as statements, consecutive statements read back as one &lt;code&gt;let&lt;/code&gt;, and a &lt;code&gt;let&lt;/code&gt; used as a value keeps its block.  The printer declines to flatten when flattening would change the form.  When a &lt;code&gt;let&lt;/code&gt;’s only body is another &lt;code&gt;let&lt;/code&gt;, the two would read back as one, so the inner one stays a block.&lt;/p&gt;
&lt;h2 id=&quot;where-we-use-it&quot;&gt;Where we use it&lt;/h2&gt;
&lt;p&gt;In Simmis, a Code View setting shows code in Superficie instead of Clojure, read-only.  It applies in chat, in documents, and in the run inspector, where a person reviews the code an agent ran.  Simmis is meant to be usable without knowing Clojure, and this is how someone who does not read Clojure can still check what an agent did.&lt;/p&gt;
&lt;p&gt;On this site, Superficie renders every Clojure example at build time through its npm package, and the Superficie tab is shown first.  An article can name the requires its snippets assume, so an excerpt without its namespace form still shows Raster kernels and Ansatz theorems as blocks.  &lt;a href=&quot;https://datahike.io/&quot;&gt;datahike.io&lt;/a&gt; uses the same package for its documentation.  The project is on &lt;a href=&quot;https://github.com/replikativ/superficie&quot;&gt;GitHub&lt;/a&gt; under the Apache 2.0 licence.&lt;/p&gt;
&lt;h2 id=&quot;from-reading-code-to-changing-it&quot;&gt;From reading code to changing it&lt;/h2&gt;
&lt;p&gt;Everything above concerns reading.  Two open questions concern changing code, and we have not answered either.&lt;/p&gt;
&lt;p&gt;The first is editing.  Superficie reads back exactly the forms it printed, but not the comments and line breaks the author chose, because Clojure’s reader discards comments before Superficie sees the code.  Editing a Clojure file in Superficie and writing Clojure back would need both preserved, so that a Clojure programmer still recognises the result as their own file.  Until then, Superficie is a way to show existing code and to write new code, not to edit existing Clojure files.&lt;/p&gt;
&lt;p&gt;The second is review.  Simmis already shows the code an agent ran in Superficie.  A proposed change is harder to show, because a line diff of the Clojure text does not map line by line onto Superficie.  A diff over forms could, and it raises its own questions, such as how to show a changed argument inside an unchanged block and how to recognise a definition that moved.  Both questions matter for the reason this project exists.  More of the people who decide whether a code change should be adopted will not read Clojure.&lt;/p&gt;
&lt;p&gt;Whatever the answers, the rule the rest of this article depends on stays.  Superficie reserves its block words, a snippet without its namespace needs the requires it assumes, and a rendering that does not read back as the same forms counts as a bug.&lt;/p&gt;</content:encoded></item><item><title>Stuttgart in a posterior: a city simulation you can question</title><link>https://simm.is/blog/stuttgart-in-a-posterior/</link><guid isPermaLink="true">https://simm.is/blog/stuttgart-in-a-posterior/</guid><description>A research demonstrator: 936,597 simulated people, shops chosen by size and distance, nine parameters inferred from the city&apos;s published retail turnover, and a policy question answered with its uncertainty attached.</description><pubDate>Sat, 26 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;What would happen to Stuttgart’s shops if the Milaneo shopping centre near the main station closed?  What if the same floor space stood in Zuffenhausen instead?  A simulation of the whole city, fitted to published data, answers with its uncertainty attached.  If the Milaneo closed, about half of the 93 M€ a year that residents spend there would move to other shops in Mitte.  A centre of the same size in Zuffenhausen would capture 59 % of that money, somewhere between 27 and 97 M€.  This article describes the research demonstrator behind those numbers, and you can &lt;a href=&quot;https://simm.is/city/&quot;&gt;open the explorer&lt;/a&gt; and follow along.  The model is a prototype, and its numbers are results under stated assumptions, not forecasts.&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;
&lt;a href=&quot;https://simm.is/city/?scenario=move-milaneo&quot;&gt;&lt;img src=&quot;https://simm.is/assets/posts/stuttgart-in-a-posterior/scenario-move-1600.png&quot; alt=&quot;The city explorer.  Districts in the north are coloured green where simulated retail revenue rises after the Milaneo&amp;#x27;s floor space moves to Zuffenhausen; the centre is coloured red where it falls.  Rings mark individual venues.  A strip at the bottom reports revenue removed, the share captured in Zuffenhausen and the change in the expected clothing trip.&quot; width=&quot;1600&quot; height=&quot;1250&quot; loading=&quot;lazy&quot;&gt;&lt;/a&gt;
&lt;figcaption&gt;The explorer with the Milaneo&apos;s floor space moved to Zuffenhausen.  Green districts and rings gain resident spending, red ones lose it.  Each number at the bottom comes with a 90 % band over the fitted parameters.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A city is a good test for a simulation because everyone has intuitions about it and some of those intuitions are measured.  Stuttgart publishes how many people live in every 100 m square, how much floor space its shops have, and how much they sell by district and by kind of goods.  A model that claims to explain the city’s retail has to reproduce those numbers, and where it cannot, the gap is information.&lt;/p&gt;
&lt;p&gt;The demonstrator is built so that three things can be checked.  Its inputs are measured, and each names its source.  Its parameters are inferred from published figures, with the uncertainty those figures leave.  A policy question is an explicit intervention on the model, evaluated with the same random draws as the baseline.  The next three sections take them in turn.&lt;/p&gt;
&lt;h2 id=&quot;a-weekday-for-936597-people&quot;&gt;A weekday for 936,597 people&lt;/h2&gt;
&lt;p&gt;The simulation builds a synthetic Stuttgart from published data.  Residents are drawn cell by cell from the Zensus 2022 grid and in-commuters from the employment agency’s commuter statistics.  The 3,637 shops come from Overture Maps and OpenStreetMap, with floor areas taken from building footprints and scaled to the city’s retail survey.  The &lt;a href=&quot;https://simm.is/city/model.html&quot;&gt;model page&lt;/a&gt; lists every input with its source.&lt;/p&gt;
&lt;p&gt;Each person then lives a weekday from an activity diary that says when they leave home, go to work, shop or eat.  German diary microdata is available only through a research data centre, so the diaries come from the Statistics Canada Time Use Survey 2022, reweighted to Stuttgart’s measured trip rate.  That transfer is the model’s largest assumption.&lt;/p&gt;
&lt;p&gt;When a diary says &lt;em&gt;shop&lt;/em&gt;, the person picks a shop.  The choice follows Huff’s gravity model, in which a shop’s pull grows with its floor area and falls with distance:&lt;/p&gt;
&lt;p&gt;&lt;math display=&quot;block&quot; style=&quot;font-size: 1.3em&quot;&gt;&lt;mrow&gt;&lt;mi&gt;P&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;mo&gt;∣&lt;/mo&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;∝&lt;/mo&gt;&lt;msubsup&gt;&lt;mi&gt;A&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;mi&gt;α&lt;/mi&gt;&lt;/msubsup&gt;&lt;mo&gt;⁢&lt;/mo&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;j&lt;/mi&gt;&lt;/mrow&gt;&lt;/msub&gt;&lt;mo&gt;/&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mi&gt;β&lt;/mi&gt;&lt;/mrow&gt;&lt;/msup&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;Here &lt;em&gt;j&lt;/em&gt; is a shop, &lt;em&gt;c&lt;/em&gt; the 100 m cell the person is in, &lt;em&gt;A&lt;/em&gt;&lt;sub&gt;&lt;em&gt;j&lt;/em&gt;&lt;/sub&gt; the shop’s floor area and &lt;em&gt;d&lt;/em&gt;&lt;sub&gt;&lt;em&gt;cj&lt;/em&gt;&lt;/sub&gt; the distance between them.  The exponent &lt;em&gt;α&lt;/em&gt; sets how much size matters, &lt;em&gt;β&lt;/em&gt; how quickly distance puts people off, and &lt;em&gt;d&lt;/em&gt;&lt;sub&gt;0&lt;/sub&gt; the radius within which distance hardly matters.  The probabilities are normalised over all 3,637 shops.  Nobody in this model optimises over the city.  People weigh size against distance, which is bounded rationality in Herbert Simon’s sense, and the data have to decide how.&lt;/p&gt;
&lt;p&gt;Shopping comes in three demand classes, because one kernel cannot fit Stuttgart: a kernel flat enough to fill the centre with clothing turnover makes grocery trips implausibly long.  Food and daily needs, clothing and shoes, and long-lived goods such as furniture each get their own α, β and d&lt;sub&gt;0&lt;/sub&gt;, their own share of every household’s purchasing power, and their own floor area per shop.  That makes nine numbers.&lt;/p&gt;
&lt;p&gt;Each shopping trip is decided once: its class, whether the purchase leaves the city, and the shop.  The trips drawn on the map, the visits counted at each shop and the money those visits carry all come from that one decision, so the explorer shows a single simulated day rather than separate layers that merely agree on average.&lt;/p&gt;
&lt;h2 id=&quot;nine-numbers-the-data-has-to-decide&quot;&gt;Nine numbers the data has to decide&lt;/h2&gt;
&lt;p&gt;The city’s retail concept publishes turnover for each of 23 districts in each of the three classes, 69 observations in all.  The model predicts the same 69 numbers by sending every resident’s spending through the choice kernel and summing where it lands.  The prediction is an exact expectation rather than a sampled day, so it carries no Monte Carlo noise, and a likelihood compares it with the published values on a log scale.&lt;/p&gt;
&lt;p&gt;Inference asks which values of the nine numbers make the published turnover plausible.  The answer is a posterior distribution, a set of possible cities rather than one best fit, which &lt;a href=&quot;https://simm.is/blog/bayesian-inference-in-pictures&quot;&gt;the Bayesian inference article&lt;/a&gt; illustrates.  Here it is computed with Spindel, the probabilistic programming runtime of the replikativ stack, as two independent runs of 48 Metropolis–Hastings chains, each of which runs the whole-city simulator at every step.  The likelihood is evaluated on a GPU in about half a second per step, so a chain can take 200 steps in an hour.  The 96 posterior draws are the final states of the 96 chains.  Started from different random points, the two runs end in the same distribution: for every parameter, the Gelman–Rubin statistic (R-hat) between them, computed on those final states, lies between 0.99 and 1.01.  That compares where the chains end, not how well each one explored, so it is a necessary test of convergence but not a proof.  We have not measured mixing within the chains or an effective sample size.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 640 176&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-label=&quot;Posterior draws of the nine kernel parameters, three demand classes by three parameters, each on the range its prior allowed.  The size exponent of long-lived goods clusters near 1; the distance decay and flat zone of every class spread over most of their range.&quot;&gt;
  &lt;g font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot;&gt;
    &lt;text x=&quot;140&quot; y=&quot;20&quot; fill=&quot;var(--text-dim)&quot;&gt;size exponent α&lt;/text&gt;
    &lt;text x=&quot;306&quot; y=&quot;20&quot; fill=&quot;var(--text-dim)&quot;&gt;distance decay β&lt;/text&gt;
    &lt;text x=&quot;472&quot; y=&quot;20&quot; fill=&quot;var(--text-dim)&quot;&gt;flat zone d₀&lt;/text&gt;
    &lt;text x=&quot;16&quot; y=&quot;56&quot; fill=&quot;var(--text-dim)&quot;&gt;short&lt;/text&gt;
    &lt;text x=&quot;16&quot; y=&quot;68&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot;&gt;food, daily needs&lt;/text&gt;
    &lt;path d=&quot;M 140 62 H 284&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M245.7 48v14M268.4 48v14M230.4 48v14M199.3 48v14M195.5 48v14M153.3 48v14M149.1 48v14M144.0 48v14M240.0 48v14M213.3 48v14M150.8 48v14M226.1 48v14M220.5 48v14M211.3 48v14M283.2 48v14M239.0 48v14M224.2 48v14M205.2 48v14M192.8 48v14M188.4 48v14M255.8 48v14M208.5 48v14M141.9 48v14M212.5 48v14M275.4 48v14M188.7 48v14M174.9 48v14M197.5 48v14M236.3 48v14M248.0 48v14M223.9 48v14M279.5 48v14M233.9 48v14M274.9 48v14M183.5 48v14M268.5 48v14M227.1 48v14M189.7 48v14M208.8 48v14M264.7 48v14M177.1 48v14M257.9 48v14M203.7 48v14M219.3 48v14M238.4 48v14M222.2 48v14M209.2 48v14M209.9 48v14M213.6 48v14M160.8 48v14M274.4 48v14M189.0 48v14M224.2 48v14M266.0 48v14M211.3 48v14M246.9 48v14M197.7 48v14M177.1 48v14M159.3 48v14M163.6 48v14M223.2 48v14M173.7 48v14M146.0 48v14M216.3 48v14M201.5 48v14M178.2 48v14M228.7 48v14M266.9 48v14M222.4 48v14M188.6 48v14M243.9 48v14M156.3 48v14M221.9 48v14M240.5 48v14M196.9 48v14M149.8 48v14M238.6 48v14M155.9 48v14M246.7 48v14M168.4 48v14M268.5 48v14M271.7 48v14M237.3 48v14M228.6 48v14M180.1 48v14M157.1 48v14M266.5 48v14M194.6 48v14M231.6 48v14M199.0 48v14M207.1 48v14M264.3 48v14M219.1 48v14M235.3 48v14M234.3 48v14M234.7 48v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 306 62 H 450&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M406.9 48v14M331.0 48v14M314.0 48v14M325.4 48v14M412.6 48v14M316.9 48v14M338.5 48v14M448.5 48v14M374.0 48v14M408.6 48v14M429.6 48v14M336.2 48v14M345.2 48v14M363.2 48v14M423.4 48v14M442.4 48v14M372.2 48v14M328.1 48v14M314.6 48v14M403.5 48v14M330.9 48v14M406.7 48v14M359.8 48v14M440.4 48v14M350.9 48v14M378.3 48v14M341.7 48v14M319.4 48v14M388.8 48v14M335.4 48v14M328.9 48v14M367.1 48v14M310.2 48v14M402.7 48v14M397.5 48v14M331.4 48v14M382.0 48v14M368.0 48v14M392.7 48v14M427.9 48v14M406.7 48v14M349.9 48v14M366.8 48v14M350.5 48v14M371.8 48v14M398.1 48v14M373.2 48v14M413.1 48v14M343.4 48v14M397.8 48v14M321.5 48v14M306.7 48v14M426.4 48v14M330.7 48v14M366.2 48v14M421.5 48v14M445.4 48v14M326.7 48v14M410.9 48v14M366.0 48v14M365.1 48v14M327.1 48v14M408.6 48v14M313.8 48v14M367.9 48v14M392.7 48v14M384.4 48v14M389.7 48v14M358.2 48v14M373.8 48v14M322.1 48v14M338.8 48v14M365.6 48v14M366.6 48v14M366.8 48v14M413.6 48v14M407.4 48v14M391.6 48v14M397.8 48v14M396.8 48v14M436.2 48v14M379.0 48v14M352.0 48v14M316.1 48v14M412.1 48v14M345.7 48v14M418.2 48v14M385.9 48v14M364.6 48v14M328.1 48v14M358.2 48v14M428.8 48v14M405.7 48v14M350.5 48v14M323.9 48v14M368.2 48v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 472 62 H 616&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M505.2 48v14M479.0 48v14M483.0 48v14M600.9 48v14M507.2 48v14M569.8 48v14M538.2 48v14M506.0 48v14M559.3 48v14M508.3 48v14M580.4 48v14M592.2 48v14M479.6 48v14M597.9 48v14M610.5 48v14M582.3 48v14M541.3 48v14M611.6 48v14M607.9 48v14M483.0 48v14M529.7 48v14M527.1 48v14M476.7 48v14M501.0 48v14M579.4 48v14M481.8 48v14M539.8 48v14M502.8 48v14M492.6 48v14M522.5 48v14M489.3 48v14M492.0 48v14M504.1 48v14M587.7 48v14M501.1 48v14M485.0 48v14M555.0 48v14M606.5 48v14M615.1 48v14M562.3 48v14M528.4 48v14M510.7 48v14M539.3 48v14M587.1 48v14M472.3 48v14M577.7 48v14M525.8 48v14M585.9 48v14M477.1 48v14M512.1 48v14M604.4 48v14M571.3 48v14M592.9 48v14M484.4 48v14M513.6 48v14M528.5 48v14M609.4 48v14M587.8 48v14M587.6 48v14M564.4 48v14M589.2 48v14M555.7 48v14M597.4 48v14M504.6 48v14M480.6 48v14M528.6 48v14M516.4 48v14M518.9 48v14M533.2 48v14M552.8 48v14M539.1 48v14M610.0 48v14M583.0 48v14M593.6 48v14M582.2 48v14M560.6 48v14M514.6 48v14M536.5 48v14M521.6 48v14M566.8 48v14M589.9 48v14M558.6 48v14M511.4 48v14M508.1 48v14M614.6 48v14M479.8 48v14M581.0 48v14M554.1 48v14M549.8 48v14M585.2 48v14M581.4 48v14M579.9 48v14M592.7 48v14M538.3 48v14M566.9 48v14M543.9 48v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;text x=&quot;16&quot; y=&quot;100&quot; fill=&quot;var(--text-dim)&quot;&gt;medium&lt;/text&gt;
    &lt;text x=&quot;16&quot; y=&quot;112&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot;&gt;clothing, shoes&lt;/text&gt;
    &lt;path d=&quot;M 140 106 H 284&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M205.4 92v14M226.9 92v14M176.8 92v14M195.8 92v14M243.3 92v14M275.8 92v14M232.2 92v14M267.2 92v14M227.3 92v14M182.9 92v14M178.6 92v14M277.0 92v14M204.0 92v14M264.2 92v14M206.6 92v14M243.6 92v14M263.7 92v14M242.1 92v14M198.1 92v14M218.5 92v14M183.9 92v14M209.3 92v14M219.7 92v14M210.2 92v14M234.9 92v14M201.9 92v14M248.5 92v14M217.8 92v14M219.1 92v14M212.5 92v14M228.6 92v14M211.0 92v14M226.9 92v14M214.3 92v14M219.7 92v14M196.9 92v14M234.8 92v14M216.3 92v14M212.2 92v14M231.7 92v14M228.5 92v14M213.2 92v14M225.9 92v14M200.9 92v14M205.3 92v14M217.8 92v14M206.4 92v14M210.3 92v14M249.1 92v14M278.2 92v14M163.8 92v14M185.3 92v14M265.5 92v14M239.8 92v14M230.1 92v14M173.1 92v14M184.2 92v14M222.5 92v14M196.6 92v14M205.7 92v14M202.3 92v14M208.7 92v14M218.9 92v14M222.3 92v14M213.7 92v14M212.1 92v14M238.3 92v14M255.7 92v14M206.1 92v14M258.3 92v14M217.9 92v14M222.8 92v14M236.8 92v14M244.1 92v14M194.4 92v14M240.8 92v14M205.7 92v14M213.4 92v14M227.3 92v14M220.9 92v14M214.4 92v14M224.0 92v14M197.1 92v14M204.1 92v14M210.7 92v14M219.1 92v14M220.3 92v14M212.0 92v14M232.0 92v14M204.3 92v14M213.8 92v14M211.3 92v14M225.9 92v14M212.4 92v14M209.1 92v14M218.3 92v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 306 106 H 450&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M350.8 92v14M447.2 92v14M404.5 92v14M321.2 92v14M309.7 92v14M400.1 92v14M432.7 92v14M414.4 92v14M394.2 92v14M385.0 92v14M325.3 92v14M426.9 92v14M324.8 92v14M436.4 92v14M337.3 92v14M387.0 92v14M394.7 92v14M426.8 92v14M313.8 92v14M429.6 92v14M325.8 92v14M343.7 92v14M344.5 92v14M342.4 92v14M394.4 92v14M350.9 92v14M373.8 92v14M317.2 92v14M378.0 92v14M418.1 92v14M379.6 92v14M310.1 92v14M409.4 92v14M369.0 92v14M389.1 92v14M330.4 92v14M409.5 92v14M337.8 92v14M337.0 92v14M350.0 92v14M419.5 92v14M371.8 92v14M347.3 92v14M327.7 92v14M375.1 92v14M381.7 92v14M327.1 92v14M346.2 92v14M328.8 92v14M417.2 92v14M425.4 92v14M431.2 92v14M421.5 92v14M350.5 92v14M382.0 92v14M349.5 92v14M327.3 92v14M382.6 92v14M307.8 92v14M336.3 92v14M345.2 92v14M358.9 92v14M353.1 92v14M367.6 92v14M370.3 92v14M427.0 92v14M386.4 92v14M399.1 92v14M358.5 92v14M384.3 92v14M425.2 92v14M426.2 92v14M362.2 92v14M395.6 92v14M339.9 92v14M439.9 92v14M309.9 92v14M386.6 92v14M364.6 92v14M386.1 92v14M357.3 92v14M358.9 92v14M330.0 92v14M321.8 92v14M349.2 92v14M343.6 92v14M340.9 92v14M362.9 92v14M419.5 92v14M340.1 92v14M356.5 92v14M339.0 92v14M368.6 92v14M329.9 92v14M343.4 92v14M342.7 92v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 472 106 H 616&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M585.8 92v14M528.1 92v14M541.0 92v14M520.9 92v14M518.2 92v14M474.8 92v14M572.1 92v14M501.2 92v14M575.3 92v14M612.0 92v14M552.6 92v14M544.4 92v14M521.1 92v14M569.2 92v14M503.3 92v14M538.1 92v14M504.5 92v14M564.4 92v14M548.2 92v14M608.6 92v14M563.8 92v14M530.4 92v14M489.2 92v14M528.1 92v14M535.1 92v14M568.0 92v14M482.2 92v14M568.1 92v14M613.5 92v14M603.4 92v14M522.1 92v14M515.9 92v14M570.1 92v14M542.5 92v14M592.9 92v14M526.7 92v14M577.8 92v14M507.2 92v14M500.0 92v14M474.8 92v14M600.7 92v14M613.2 92v14M487.7 92v14M538.0 92v14M599.5 92v14M570.8 92v14M481.6 92v14M544.8 92v14M576.7 92v14M503.1 92v14M590.1 92v14M586.1 92v14M494.0 92v14M501.7 92v14M573.4 92v14M568.9 92v14M548.8 92v14M523.1 92v14M607.3 92v14M554.6 92v14M608.0 92v14M551.5 92v14M513.5 92v14M577.9 92v14M546.0 92v14M598.2 92v14M545.0 92v14M516.5 92v14M608.3 92v14M489.2 92v14M591.7 92v14M602.1 92v14M473.6 92v14M540.2 92v14M548.4 92v14M604.6 92v14M518.8 92v14M603.7 92v14M540.3 92v14M562.3 92v14M551.9 92v14M525.8 92v14M586.4 92v14M497.7 92v14M523.3 92v14M483.0 92v14M516.4 92v14M568.7 92v14M611.0 92v14M519.3 92v14M557.1 92v14M549.8 92v14M533.0 92v14M490.9 92v14M548.9 92v14M479.7 92v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;text x=&quot;16&quot; y=&quot;144&quot; fill=&quot;var(--text-dim)&quot;&gt;long&lt;/text&gt;
    &lt;text x=&quot;16&quot; y=&quot;156&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot;&gt;long-lived goods&lt;/text&gt;
    &lt;path d=&quot;M 140 150 H 284&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M184.5 136v14M249.0 136v14M232.4 136v14M186.2 136v14M243.7 136v14M256.9 136v14M257.6 136v14M237.5 136v14M275.4 136v14M223.9 136v14M213.5 136v14M257.1 136v14M206.4 136v14M230.4 136v14M231.7 136v14M259.6 136v14M251.6 136v14M248.9 136v14M261.4 136v14M237.9 136v14M247.9 136v14M247.1 136v14M254.8 136v14M243.8 136v14M246.3 136v14M238.9 136v14M238.9 136v14M239.4 136v14M247.8 136v14M245.9 136v14M252.7 136v14M240.3 136v14M231.4 136v14M244.4 136v14M237.3 136v14M237.0 136v14M254.0 136v14M239.9 136v14M247.3 136v14M249.0 136v14M241.9 136v14M244.1 136v14M254.2 136v14M237.6 136v14M241.2 136v14M249.3 136v14M243.7 136v14M242.2 136v14M277.3 136v14M185.1 136v14M237.6 136v14M222.7 136v14M259.1 136v14M269.2 136v14M204.1 136v14M255.0 136v14M252.8 136v14M214.0 136v14M268.7 136v14M263.4 136v14M249.0 136v14M241.7 136v14M256.5 136v14M244.2 136v14M244.2 136v14M241.5 136v14M260.5 136v14M240.6 136v14M260.2 136v14M239.6 136v14M235.5 136v14M228.7 136v14M248.5 136v14M245.9 136v14M244.0 136v14M242.5 136v14M246.1 136v14M242.1 136v14M251.6 136v14M243.4 136v14M229.7 136v14M249.6 136v14M247.4 136v14M235.3 136v14M239.7 136v14M242.0 136v14M242.9 136v14M244.1 136v14M242.0 136v14M239.5 136v14M250.5 136v14M241.8 136v14M236.1 136v14M240.3 136v14M235.3 136v14M237.1 136v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 306 150 H 450&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M418.5 136v14M390.9 136v14M331.2 136v14M327.3 136v14M392.5 136v14M434.3 136v14M401.9 136v14M340.8 136v14M402.9 136v14M352.5 136v14M337.0 136v14M395.4 136v14M359.6 136v14M342.5 136v14M440.0 136v14M408.7 136v14M350.2 136v14M365.1 136v14M408.5 136v14M343.1 136v14M345.7 136v14M425.7 136v14M383.6 136v14M334.0 136v14M319.3 136v14M332.7 136v14M326.1 136v14M356.4 136v14M324.9 136v14M376.0 136v14M350.6 136v14M402.2 136v14M335.2 136v14M378.8 136v14M359.2 136v14M335.3 136v14M362.2 136v14M406.9 136v14M375.9 136v14M324.4 136v14M358.5 136v14M356.3 136v14M342.4 136v14M314.2 136v14M320.2 136v14M332.4 136v14M374.7 136v14M314.1 136v14M365.1 136v14M328.1 136v14M381.6 136v14M324.7 136v14M359.0 136v14M425.3 136v14M330.6 136v14M306.2 136v14M407.2 136v14M392.1 136v14M359.5 136v14M434.2 136v14M443.7 136v14M394.8 136v14M360.9 136v14M359.5 136v14M442.8 136v14M357.4 136v14M341.1 136v14M331.9 136v14M377.4 136v14M337.0 136v14M410.9 136v14M366.5 136v14M378.4 136v14M344.3 136v14M359.9 136v14M358.1 136v14M325.8 136v14M406.4 136v14M338.5 136v14M357.8 136v14M317.8 136v14M392.4 136v14M325.1 136v14M392.5 136v14M380.7 136v14M312.1 136v14M324.8 136v14M330.2 136v14M333.8 136v14M310.7 136v14M378.3 136v14M344.8 136v14M311.1 136v14M375.6 136v14M326.2 136v14M363.5 136v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 472 150 H 616&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M474.7 136v14M521.0 136v14M495.6 136v14M503.5 136v14M608.3 136v14M581.5 136v14M527.5 136v14M510.7 136v14M489.9 136v14M521.3 136v14M603.5 136v14M592.5 136v14M569.4 136v14M524.1 136v14M602.2 136v14M559.4 136v14M501.5 136v14M527.8 136v14M581.9 136v14M486.1 136v14M498.3 136v14M596.2 136v14M548.5 136v14M604.1 136v14M541.1 136v14M475.8 136v14M542.5 136v14M602.4 136v14M482.8 136v14M553.9 136v14M513.8 136v14M608.0 136v14M559.0 136v14M566.3 136v14M581.9 136v14M539.0 136v14M590.9 136v14M610.1 136v14M564.7 136v14M474.4 136v14M614.1 136v14M550.0 136v14M571.6 136v14M570.3 136v14M580.0 136v14M489.0 136v14M604.5 136v14M485.0 136v14M567.8 136v14M557.6 136v14M536.7 136v14M494.5 136v14M501.7 136v14M542.7 136v14M478.3 136v14M484.2 136v14M549.7 136v14M615.4 136v14M612.1 136v14M581.5 136v14M593.8 136v14M561.6 136v14M480.4 136v14M484.9 136v14M610.3 136v14M540.7 136v14M496.0 136v14M581.9 136v14M548.3 136v14M577.2 136v14M613.6 136v14M614.1 136v14M545.0 136v14M496.1 136v14M538.5 136v14M583.1 136v14M606.5 136v14M612.4 136v14M503.7 136v14M547.1 136v14M516.0 136v14M590.0 136v14M519.2 136v14M615.7 136v14M597.2 136v14M507.8 136v14M493.3 136v14M485.9 136v14M556.8 136v14M556.8 136v14M603.2 136v14M572.1 136v14M503.3 136v14M597.5 136v14M595.1 136v14M611.3 136v14&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
    &lt;text x=&quot;140&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;start&quot; fill=&quot;var(--text-faint)&quot;&gt;0&lt;/text&gt;
    &lt;text x=&quot;212&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;middle&quot; fill=&quot;var(--text-faint)&quot;&gt;0.75&lt;/text&gt;
    &lt;text x=&quot;284&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;end&quot; fill=&quot;var(--text-faint)&quot;&gt;1.5&lt;/text&gt;
    &lt;text x=&quot;306&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;start&quot; fill=&quot;var(--text-faint)&quot;&gt;1&lt;/text&gt;
    &lt;text x=&quot;378&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;middle&quot; fill=&quot;var(--text-faint)&quot;&gt;2.25&lt;/text&gt;
    &lt;text x=&quot;450&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;end&quot; fill=&quot;var(--text-faint)&quot;&gt;3.5&lt;/text&gt;
    &lt;text x=&quot;472&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;start&quot; fill=&quot;var(--text-faint)&quot;&gt;200 m&lt;/text&gt;
    &lt;text x=&quot;544&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;middle&quot; fill=&quot;var(--text-faint)&quot;&gt;630 m&lt;/text&gt;
    &lt;text x=&quot;616&quot; y=&quot;166&quot; font-size=&quot;8&quot; text-anchor=&quot;end&quot; fill=&quot;var(--text-faint)&quot;&gt;2 km&lt;/text&gt;
  &lt;/g&gt;
&lt;/svg&gt;
&lt;figcaption&gt;The 96 posterior draws of the nine parameters, each placed on the range the prior allowed.  The published turnovers pin down the size exponent of long-lived goods and part of the clothing one.  The distance parameters of every class stay spread over most of their range.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The figure shows what district totals can and cannot decide.  They fix how strongly floor area attracts spending on long-lived goods.  They leave the distance decay close to where the prior put it, because a steeper decay with a wider flat zone near home produces much the same district totals as a shallower one.&lt;/p&gt;
&lt;p&gt;That points to what would sharpen the model.  Measured shopping trip distances, such as those in the Mobilität in Deutschland survey, would constrain the distance decay directly.  Visit counts per shop, anonymised card spending or pedestrian counts at a few dozen points would each separate kernels that district totals cannot.  A simulation with an explicit likelihood can say which measurement would be worth collecting before anyone collects it.&lt;/p&gt;
&lt;h2 id=&quot;closing-a-shopping-centre-on-paper&quot;&gt;Closing a shopping centre on paper&lt;/h2&gt;
&lt;p&gt;A policy question is an intervention.  In the terms of &lt;a href=&quot;https://simm.is/blog/reading-a-causal-graph&quot;&gt;the causal graph article&lt;/a&gt;, closing the Milaneo sets the venue set to a new value, do(venues := venues without the Milaneo), cuts nothing upstream, and recomputes every choice downstream.  The residents and their money stay the same.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 640 230&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-label=&quot;Causal structure of the model: measured population, money and floor area, the inferred kernel parameters, and the venue set as the node an intervention changes, all feeding the shop choice, which produces district turnover compared with the published values.&quot;&gt;
  &lt;defs&gt;
    &lt;marker id=&quot;city-ah&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;&lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;&lt;/marker&gt;
    &lt;marker id=&quot;city-ah-g&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;&lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.8&quot;&gt;&lt;/path&gt;&lt;/marker&gt;
  &lt;/defs&gt;
  &lt;g font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot;&gt;
    &lt;rect x=&quot;20&quot; y=&quot;20&quot; width=&quot;150&quot; height=&quot;44&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;30&quot; y=&quot;38&quot; fill=&quot;var(--c-learn)&quot;&gt;people, homes, money&lt;/text&gt;
    &lt;text x=&quot;30&quot; y=&quot;52&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;Zensus, employment, IFH&lt;/text&gt;
    &lt;rect x=&quot;20&quot; y=&quot;92&quot; width=&quot;150&quot; height=&quot;44&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;30&quot; y=&quot;110&quot; fill=&quot;var(--c-learn)&quot;&gt;shop floor area A&lt;/text&gt;
    &lt;text x=&quot;30&quot; y=&quot;124&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;OSM, retail survey&lt;/text&gt;
    &lt;rect x=&quot;20&quot; y=&quot;164&quot; width=&quot;150&quot; height=&quot;44&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;30&quot; y=&quot;182&quot; fill=&quot;var(--c-model)&quot;&gt;kernel θ, 9 numbers&lt;/text&gt;
    &lt;text x=&quot;30&quot; y=&quot;196&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;inferred&lt;/text&gt;
    &lt;rect x=&quot;240&quot; y=&quot;164&quot; width=&quot;150&quot; height=&quot;44&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;250&quot; y=&quot;182&quot; fill=&quot;var(--c-collaborate)&quot;&gt;venue set&lt;/text&gt;
    &lt;text x=&quot;250&quot; y=&quot;196&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;do(venues := …)&lt;/text&gt;
    &lt;rect x=&quot;240&quot; y=&quot;80&quot; width=&quot;150&quot; height=&quot;56&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.4&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;250&quot; y=&quot;102&quot; fill=&quot;var(--text-dim)&quot;&gt;shop choice&lt;/text&gt;
    &lt;text x=&quot;250&quot; y=&quot;116&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;every trip, every person&lt;/text&gt;
    &lt;rect x=&quot;460&quot; y=&quot;80&quot; width=&quot;160&quot; height=&quot;56&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
    &lt;text x=&quot;470&quot; y=&quot;102&quot; fill=&quot;var(--c-learn)&quot;&gt;turnover by district&lt;/text&gt;
    &lt;text x=&quot;470&quot; y=&quot;116&quot; font-size=&quot;8&quot; fill=&quot;var(--text-dim)&quot;&gt;compared with published&lt;/text&gt;
    &lt;path d=&quot;M 170,42 C 210,42 215,90 238,98&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#city-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 170,114 L 238,110&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#city-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 170,186 C 210,186 215,130 238,124&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#city-ah)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 315,164 L 315,138&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.6&quot; opacity=&quot;0.8&quot; marker-end=&quot;url(#city-ah-g)&quot;&gt;&lt;/path&gt;
    &lt;path d=&quot;M 390,108 L 458,108&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#city-ah)&quot;&gt;&lt;/path&gt;
  &lt;/g&gt;
&lt;/svg&gt;
&lt;figcaption&gt;The model&apos;s causal structure, simplified.  Measured inputs and the inferred kernel feed every shop choice; a scenario changes only the venue set.  The model page draws the full graph with its plates.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The simulator evaluates the change under every one of the 96 posterior draws and reports the difference per draw, so the spread is the uncertainty about the effect itself rather than two uncertainties added together.  For the Milaneo, whose 103 shops within 170 m of Mailänder Platz hold about 24,000 m² of floor space:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Closing it&lt;/strong&gt; removes about 93 M€ a year of resident spending from those shops.  About half is spent elsewhere in Mitte and half in other districts.  Mitte’s net loss is 47 M€, with a 90 % band from 35 to 62 M€.  The expected straight-line trip for clothing gets 27 m shorter, because the centre had been pulling people past nearer shops.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Moving the same floor space to Zuffenhausen’s population centre&lt;/strong&gt; captures about 59 % of that money there, 55 M€ with a band from 27 to 97 M€, and Mitte keeps 29 %.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Zuffenhausen band is wide because how much a large new centre would draw depends on the parameters the district totals leave open, above all how steeply distance deters shoppers.&lt;/p&gt;
&lt;p&gt;These are results of the model, and the model lacks things that would change them.  It has no agglomeration: a centre on Königstraße benefits from the shops around it, and a box in Zuffenhausen would not.  Only resident money moves in the scenario, while commuters and visitors keep spending where the baseline put them.  Prices, opening hours and the competitors’ response are fixed.  Read the Zuffenhausen figure as the capture under a model of size and distance alone.&lt;/p&gt;
&lt;p&gt;Because every random draw in the simulator is a pure function of a seed, a person and a purpose, the same weekday can also be replayed under the changed venue set with the same draws for every person.  The explorer’s visit-change layer shows that paired day hour by hour.  It is not a minimal counterfactual: removing one shop shifts the choice intervals of others, so some people whose shop stayed open move too.&lt;/p&gt;
&lt;h2 id=&quot;what-the-model-cannot-tell-you&quot;&gt;What the model cannot tell you&lt;/h2&gt;
&lt;p&gt;The model’s main limits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Transferred behaviour.&lt;/strong&gt;  Daily rhythms come from urban Canada.  Only the trip rate is Stuttgart’s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assumed shares.&lt;/strong&gt;  How shopping trips split between the three classes is a placeholder (65 %, 20 %, 15 %), and so is how leakage and commuter spending are attributed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A static economy.&lt;/strong&gt;  Shops do not open, close or change prices in response.  There is one representative weekday.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A posterior fitted to 69 district totals&lt;/strong&gt;, which leave the distance decay close to its prior.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The model page lists every input as measured, assumed or fitted, and every derived data file carries a receipt naming its source.  That table is the part of the project most worth arguing with.&lt;/p&gt;
&lt;h2 id=&quot;why-build-it-this-way&quot;&gt;Why build it this way&lt;/h2&gt;
&lt;p&gt;The Milaneo number matters less than the model behind it.  Its assumptions sit in one place, its parameters are fitted to named evidence, and its answer to a policy question comes with the spread the evidence leaves, so people can disagree with it productively.  Someone who thinks the centre has agglomeration effects can add them on a branch, refit, and compare.  Someone with pedestrian counts can add an observation and see which parameters it narrows.  That is the shared modelling practice we are interested in, for businesses asking what-if questions of their own operations, for city administrations and residents discussing a plan, and for language model agents that collect data, propose model changes and run the checks.&lt;/p&gt;
&lt;p&gt;Later articles in this series will take the pieces apart: how the simulator runs and why one decision serves every layer, what the data can decide and which measurement would help most, how the evidence behind each input is kept, and how agents can take part in the work.&lt;/p&gt;
&lt;h2 id=&quot;try-it-and-read-further&quot;&gt;Try it and read further&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://simm.is/city/&quot;&gt;The explorer&lt;/a&gt;: the two scenarios, the posterior, and the calibration against every published turnover.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://simm.is/city/model.html&quot;&gt;The model&lt;/a&gt;: every equation, the full causal graph and the measured, assumed and fitted table.&lt;/li&gt;
&lt;li&gt;The code: &lt;a href=&quot;https://github.com/replikativ/city-rstr&quot;&gt;replikativ/city-rstr&lt;/a&gt;, a research prototype rather than a library.  The simulator and the explorer are written in Clojure, on &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt; for inference, &lt;a href=&quot;https://github.com/replikativ/raster&quot;&gt;raster&lt;/a&gt; for the kernels that also run on a GPU, and &lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt; for the evidence store.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Data: Zensus 2022 (© Statistisches Bundesamt), Landeshauptstadt Stuttgart (retail concept 2024, district boundaries), Statistik der Bundesagentur für Arbeit, Statistics Canada Time Use Survey 2022, Mobilität in Deutschland, © OpenStreetMap contributors, Overture Maps Foundation.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Revised in November 2026 for precision.&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title>A KV cache you can fork</title><link>https://simm.is/blog/a-kv-cache-you-can-fork/</link><guid isPermaLink="true">https://simm.is/blog/a-kv-cache-you-can-fork/</guid><description>How pretrained-rstr gives a language model&apos;s KV cache an identity, a durable home, and a copy-on-write fork, so exact context can be reused across restarts, workers, and parallel attempts.</description><pubDate>Mon, 21 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Suppose five agent attempts branch from the same twenty thousand token context.  Each attempt then sends the shared context again, and a conventional inference server has to process it again.  The work is identical every time.  This article describes how &lt;a href=&quot;https://github.com/replikativ/pretrained-rstr&quot;&gt;pretrained-rstr&lt;/a&gt;, an MIT licensed inference component from &lt;a href=&quot;https://github.com/replikativ&quot;&gt;replikativ&lt;/a&gt;, turns that state into a value with an identity, so it can be stored, found, restored, and forked instead of recomputed.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In a typical decoder language model, processing the prompt writes one key and one value vector per layer per token.  That memory is the &lt;strong&gt;KV cache&lt;/strong&gt;, and every later token is produced by attending over it.  Filling it, called prefill, pushes every prompt token through every layer in parallel.  Producing each answer token afterwards pushes one token through those layers, conditioned on the prefilled cache.  A long prompt therefore dominates the cost of a short answer, and this cache is the most expensive memory in the system.&lt;/p&gt;
&lt;p&gt;Existing serving engines have treated that memory as an internal optimization.  vLLM and SGLang keep a prefix cache so a repeated prompt within one process is cheaper.  A newer layer of systems, led by &lt;a href=&quot;https://github.com/LMCache/LMCache&quot;&gt;LMCache&lt;/a&gt;, moves KV chunks across GPU, CPU, disk, and remote tiers so they outlive a process and can be pulled by another machine.  What none of them hand the caller is the cache as a value: something with a name that can be looked up, restored on a different worker, forked, and reasoned about alongside the rest of an organization’s state.  LMCache was the starting point for this work.&lt;/p&gt;
&lt;h2 id=&quot;the-design-in-one-picture&quot;&gt;The design in one picture&lt;/h2&gt;
&lt;p&gt;pretrained-rstr separates three questions that a process-local cache never has to answer, and gives each one to the layer that can answer it durably.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 300&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-labelledby=&quot;kv-arch-title&quot;&gt;
  &lt;title id=&quot;kv-arch-title&quot;&gt;Three layers of the pretrained-rstr memory architecture: a Raster page pool on a worker, immutable Konserve chunks, and a Datahike catalog, connected by publish and restore.&lt;/title&gt;
  &lt;rect width=&quot;600&quot; height=&quot;300&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;20&quot; y=&quot;16&quot; width=&quot;560&quot; height=&quot;118&quot; rx=&quot;6&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.5&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.85&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;32&quot; y=&quot;34&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot; letter-spacing=&quot;0.5&quot;&gt;RASTER PAGE POOL · WORKER A&lt;/text&gt;
  &lt;text x=&quot;40&quot; y=&quot;72&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-dim)&quot;&gt;base&lt;/text&gt;
  &lt;rect x=&quot;90&quot; y=&quot;54&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;115&quot; y=&quot;72&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-dim)&quot;&gt;p0&lt;/text&gt;
  &lt;rect x=&quot;150&quot; y=&quot;54&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;175&quot; y=&quot;72&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-dim)&quot;&gt;p1&lt;/text&gt;
  &lt;rect x=&quot;210&quot; y=&quot;54&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;235&quot; y=&quot;72&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-dim)&quot;&gt;p2&lt;/text&gt;
  &lt;rect x=&quot;270&quot; y=&quot;54&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;295&quot; y=&quot;72&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-dim)&quot;&gt;p3&lt;/text&gt;
  &lt;text x=&quot;40&quot; y=&quot;110&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--c-compute)&quot;&gt;fork&lt;/text&gt;
  &lt;rect x=&quot;90&quot; y=&quot;92&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; stroke-dasharray=&quot;3 3&quot; fill=&quot;none&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;115&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-faint)&quot;&gt;p0&lt;/text&gt;
  &lt;rect x=&quot;150&quot; y=&quot;92&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; stroke-dasharray=&quot;3 3&quot; fill=&quot;none&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;175&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-faint)&quot;&gt;p1&lt;/text&gt;
  &lt;rect x=&quot;210&quot; y=&quot;92&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; stroke-dasharray=&quot;3 3&quot; fill=&quot;none&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;235&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-faint)&quot;&gt;p2&lt;/text&gt;
  &lt;rect x=&quot;270&quot; y=&quot;92&quot; width=&quot;50&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--c-compute)&quot; stroke-width=&quot;1.5&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;295&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--c-compute)&quot;&gt;p3′&lt;/text&gt;
  &lt;text x=&quot;345&quot; y=&quot;68&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;dashed pages are references,&lt;/text&gt;
  &lt;text x=&quot;345&quot; y=&quot;80&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;not copies&lt;/text&gt;
  &lt;text x=&quot;345&quot; y=&quot;106&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-compute)&quot;&gt;p3′ is copied before the&lt;/text&gt;
  &lt;text x=&quot;345&quot; y=&quot;118&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-compute)&quot;&gt;fork&apos;s first write&lt;/text&gt;
  &lt;line x1=&quot;150&quot; y1=&quot;134&quot; x2=&quot;150&quot; y2=&quot;170&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot;&gt;&lt;/line&gt;
  &lt;polygon points=&quot;145,170 155,170 150,178&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/polygon&gt;
  &lt;text x=&quot;160&quot; y=&quot;158&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;publish&lt;/text&gt;
  &lt;line x1=&quot;450&quot; y1=&quot;178&quot; x2=&quot;450&quot; y2=&quot;142&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot;&gt;&lt;/line&gt;
  &lt;polygon points=&quot;445,142 455,142 450,134&quot; fill=&quot;var(--text-dim)&quot;&gt;&lt;/polygon&gt;
  &lt;text x=&quot;460&quot; y=&quot;162&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;restore&lt;/text&gt;
  &lt;rect x=&quot;20&quot; y=&quot;178&quot; width=&quot;270&quot; height=&quot;106&quot; rx=&quot;6&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;32&quot; y=&quot;196&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot; letter-spacing=&quot;0.5&quot;&gt;KONSERVE · IMMUTABLE CHUNKS&lt;/text&gt;
  &lt;rect x=&quot;32&quot; y=&quot;208&quot; width=&quot;246&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;44&quot; y=&quot;226&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;h1 · tokens 0–255 · bytes&lt;/text&gt;
  &lt;rect x=&quot;32&quot; y=&quot;244&quot; width=&quot;246&quot; height=&quot;28&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;44&quot; y=&quot;262&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;h2 · tokens 256–511 · bytes&lt;/text&gt;
  &lt;line x1=&quot;290&quot; y1=&quot;231&quot; x2=&quot;304&quot; y2=&quot;231&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot;&gt;&lt;/line&gt;
  &lt;polygon points=&quot;304,227 304,235 310,231&quot; fill=&quot;var(--text-faint)&quot;&gt;&lt;/polygon&gt;
  &lt;rect x=&quot;310&quot; y=&quot;178&quot; width=&quot;270&quot; height=&quot;106&quot; rx=&quot;6&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;322&quot; y=&quot;196&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot; letter-spacing=&quot;0.5&quot;&gt;DATAHIKE · CATALOG&lt;/text&gt;
  &lt;text x=&quot;322&quot; y=&quot;218&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;h1  parent ∅   fingerprint f&lt;/text&gt;
  &lt;text x=&quot;322&quot; y=&quot;236&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;h2  parent h1  fingerprint f&lt;/text&gt;
  &lt;text x=&quot;322&quot; y=&quot;254&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;h2  replica ready on worker a&lt;/text&gt;
  &lt;text x=&quot;322&quot; y=&quot;274&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;facts and lineage, never tensor bytes&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Three layers, two movements.  Publish captures resident pages into immutable chunks and records their identity only after the bytes are durable.  Restore looks a prefix up, verifies its chunks, and maps them into pages.  A fork touches only the page layer.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;What is this state?&lt;/strong&gt;  &lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt; holds the answer: each chunk’s content hash, its parent in the token prefix, the model fingerprint it is compatible with, and where a ready replica lives.  These are facts, queryable with Datalog, and they never include tensor bytes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Where are the bytes?&lt;/strong&gt;  &lt;a href=&quot;https://github.com/replikativ/konserve&quot;&gt;Konserve&lt;/a&gt; holds the immutable, content addressed chunks, over a local memory-mapped store or an S3-compatible backend.  A chunk is written once and never modified.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Who is computing on it right now?&lt;/strong&gt;  &lt;a href=&quot;https://github.com/replikativ/raster&quot;&gt;Raster&lt;/a&gt;, the typed tensor compiler for Clojure underneath, owns the resident page pool on each worker: allocation, sharing between continuations, copy on write, eviction, and the compiled attention graphs that read the pages.&lt;/p&gt;
&lt;p&gt;Two movements connect the layers.  Publish flows down, from pages to chunks to catalog.  Restore flows up, from a catalog lookup to verified chunks to resident pages.  The rest of this article follows those movements.&lt;/p&gt;
&lt;h2 id=&quot;a-continuation-is-a-value&quot;&gt;A continuation is a value&lt;/h2&gt;
&lt;p&gt;The unit being published and restored is a &lt;strong&gt;continuation&lt;/strong&gt;, and it has one exact definition.  For a continuation with &lt;code&gt;processed-count = n&lt;/code&gt;, the attention state covers positions &lt;code&gt;[0, n)&lt;/code&gt;, the pending token is evaluated at position &lt;code&gt;n&lt;/code&gt;, and the token history includes that pending token.  No logits and no transient activations are part of it.&lt;/p&gt;
&lt;p&gt;That definition is deliberately small, and smallness is what makes it portable.  It holds for CPU execution, contiguous GPU execution, and paged GPU execution alike, so a continuation captured on one path resumes the same causal computation on another.  Replaying a transcript instead would rebuild an approximation of that computation from text.  The &lt;a href=&quot;https://github.com/replikativ/pretrained-rstr/blob/main/doc/continuation-model.md&quot;&gt;continuation model&lt;/a&gt; states the invariants in full.&lt;/p&gt;
&lt;h2 id=&quot;identity-is-causal-not-textual&quot;&gt;Identity is causal, not textual&lt;/h2&gt;
&lt;p&gt;Reuse is only safe if two caches that claim to be the same prefix really are.  A chunk’s identity is a &lt;a href=&quot;https://github.com/replikativ/hasch&quot;&gt;Hasch&lt;/a&gt; content hash that commits to both its token ids and its parent chunk’s hash.  Identical suffix text under two different prefixes therefore produces two different identities.  A lookup walks the chain from the root and stops at the first missing or incompatible node, which is exactly the longest reusable prefix.&lt;/p&gt;
&lt;p&gt;A second identity covers the executor rather than the tokens.  A compatibility fingerprint hashes the weights, the architecture descriptor, the model configuration, the attention-state layout, and a named execution variant into one value.  A Q4 packed run and a Q8 packed run of the same checkpoint produce different numbers, so they carry different fingerprints, and state from one cannot be restored into the other.&lt;/p&gt;
&lt;p&gt;Neither identity is needed inside a single process, because nothing outside the process ever sees the cache.  Both are needed the moment the cache is meant to outlive the process or move between machines.&lt;/p&gt;
&lt;h2 id=&quot;chunks-for-storage-pages-for-execution&quot;&gt;Chunks for storage, pages for execution&lt;/h2&gt;
&lt;p&gt;Storage and execution want different granularities.&lt;/p&gt;























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Unit&lt;/th&gt;&lt;th&gt;Typical size&lt;/th&gt;&lt;th&gt;Owned by&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Durable chunk&lt;/td&gt;&lt;td&gt;128 to 512 tokens&lt;/td&gt;&lt;td&gt;Konserve and Datahike&lt;/td&gt;&lt;td&gt;hashing, transfer, catalog publication&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;GPU page&lt;/td&gt;&lt;td&gt;16 to 32 tokens&lt;/td&gt;&lt;td&gt;Raster page pool&lt;/td&gt;&lt;td&gt;allocation, sharing, copy on write, eviction&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;A 256 token chunk scatters into sixteen 16 token pages on restore.  Changing the page size does not change a chunk’s identity, and changing the chunk size does not change the attention result.  The store can therefore optimize for object count and sequential transfer while the executor optimizes for allocation and prefix sharing.&lt;/p&gt;
&lt;h2 id=&quot;why-owning-the-runtime-matters&quot;&gt;Why owning the runtime matters&lt;/h2&gt;
&lt;p&gt;The operations above are cheap because pretrained-rstr owns the memory they act on.  &lt;a href=&quot;https://github.com/replikativ/raster&quot;&gt;Raster&lt;/a&gt; allocates the page pool, and the attention kernels read pages through resident buffer views bound straight into the compiled graph.  A lease pins pages while a graph holds a view.  A generation counter stops a late transfer from completing into a page that has since been reused.  A checkpoint is a retained device-to-host event on pages the pool already governs, and a restore retains the memory-mapped chunk inside the upload event until the device has consumed it.  Forking is a page-table edit under the same refcounts.&lt;/p&gt;
&lt;p&gt;A cache layer that sits beside an engine cannot do this.  LMCache must first detect which of several physical KV layouts vLLM, FlashInfer, or an MLA model handed it, then copy through per-vendor kernels into its own buffers at the engine’s connector points, because the engine’s block manager owns the pages and does not share that authority.  That is the right design for a layer that serves vLLM, SGLang, and Dynamo alike, and it is why it cannot offer a fork.&lt;/p&gt;
&lt;p&gt;This trade is not free.  Owning the runtime means writing the kernels and losing the PyTorch ecosystem and its attention libraries.  Raster currently reaches Intel GPUs through Level Zero and Intel, NVIDIA, and AMD GPUs through compatible OpenCL drivers; native CUDA copy streams remain engineering work.  pretrained-rstr accepts that in exchange for one memory model that covers kernels, transfers, durability, and branching, on the models it targets.&lt;/p&gt;
&lt;h2 id=&quot;forking-is-copy-on-write&quot;&gt;Forking is copy on write&lt;/h2&gt;
&lt;p&gt;Pages are immutable until written, so two continuations can share every page of a common prefix.  A fork allocates nothing.  When one branch appends a token into a partially filled page, that page alone is copied, and from then on the two page lists differ in one entry.  The diagram above shows that state: the fork references &lt;code&gt;p0&lt;/code&gt; through &lt;code&gt;p2&lt;/code&gt; and owns its own &lt;code&gt;p3′&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is the same copy on write argument that &lt;a href=&quot;https://simm.is/blog/copy-on-write-branching&quot;&gt;cheap isolated branches&lt;/a&gt; make for structured data and that &lt;a href=&quot;https://simm.is/blog/a-repl-you-can-fork&quot;&gt;a forkable REPL&lt;/a&gt; makes for interpreter state, applied to GPU memory.  It also has the same shape of limit.  Two branches can advance independently from a shared prefix, but there is no semantic merge for divergent attention state.  Choosing which branch matters is a decision the application makes, not one the cache prescribes.&lt;/p&gt;
&lt;h2 id=&quot;the-catalog-never-runs-ahead-of-the-bytes&quot;&gt;The catalog never runs ahead of the bytes&lt;/h2&gt;
&lt;p&gt;Publish is ordered so that the catalog cannot advertise state that does not exist.  A checkpoint captures immutable tensor ranges from the page pool, makes the local chunk durable, waits for the authoritative backend’s receipt when write-behind is configured, and only then transacts the chunk identity into Datahike.  A chunk that exists solely in a failed worker-local write is never visible to a lookup.&lt;/p&gt;
&lt;p&gt;Restore applies the same discipline in reverse.  It verifies each chunk’s content identity and fingerprint before marking the replica ready, and a continuation becomes runnable only after every required page has landed.  Datahike is consulted for the lookup and for placement, not per token.  Workers keep their hot scheduling state locally, so Datalog queries and network round trips stay off the decode loop.&lt;/p&gt;
&lt;h2 id=&quot;route-the-request-to-the-state&quot;&gt;Route the request to the state&lt;/h2&gt;
&lt;p&gt;Once state has an identity, a request can be sent to the worker that already holds its prefix rather than moving tensors to the request.  The cluster router ranks candidates by exact prefix and predicted time to first token, but its decision is advisory.  The selected worker remains the authority for its own device memory: it revalidates the offer against current page state and reserves the projected prompt-plus-generation capacity atomically before accepting.  &lt;a href=&quot;https://github.com/replikativ/kabel&quot;&gt;Kabel&lt;/a&gt; carries only control messages and token results between them.  Tensor bytes stay on the Konserve path.&lt;/p&gt;
&lt;p&gt;Clients can access this through an OpenAI-compatible ingress.  It accepts a small tested subset of &lt;code&gt;POST /v1/chat/completions&lt;/code&gt;, translates HTTP, JSON, chat templates, and tokenization into an ordinary continuation request at the edge, and streams tokens back over server-sent events.  From a client, only the base URL changes:&lt;/p&gt;
&lt;pre class=&quot;astro-code github-dark&quot; style=&quot;background-color:#24292e;color:#e1e4e8; overflow-x: auto;&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; openai &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; OpenAI&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;client &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; OpenAI(&lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;base_url&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;http://127.0.0.1:8080/v1&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;api_key&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;local&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;result &lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt; client.chat.completions.create(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    model&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;gemma-3-270m-it&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    messages&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;[{&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;role&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;content&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;Explain KV caching briefly.&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;}],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    stream&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#FFAB70&quot;&gt;    stream_options&lt;/span&gt;&lt;span style=&quot;color:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#9ECBFF&quot;&gt;&quot;include_usage&quot;&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#79B8FF&quot;&gt;True&lt;/span&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The response reports what the routing achieved.  &lt;code&gt;usage.prompt_tokens_details.cached_tokens&lt;/code&gt; carries the count the worker’s restore returned, not the router’s estimate of what should have been resident.  Tool calls, structured outputs, and multimodal content are later slices; the &lt;a href=&quot;https://github.com/replikativ/pretrained-rstr/blob/main/doc/openai-api.md&quot;&gt;serving boundary&lt;/a&gt; lists exactly which fields are accepted today.&lt;/p&gt;
&lt;h2 id=&quot;how-this-compares&quot;&gt;How this compares&lt;/h2&gt;
&lt;p&gt;Two ideas here are shared with the field.  Chaining each chunk’s hash through its parent prefix is now standard: vLLM’s &lt;a href=&quot;https://docs.vllm.ai/en/stable/design/prefix_caching/&quot;&gt;automatic prefix caching&lt;/a&gt;, SGLang’s RadixAttention, LMCache’s &lt;a href=&quot;https://github.com/LMCache/LMCache/blob/dev/lmcache/v1/token_database.py&quot;&gt;chunked token database&lt;/a&gt;, NVIDIA Dynamo’s &lt;a href=&quot;https://github.com/ai-dynamo/dynamo&quot;&gt;KV indexer&lt;/a&gt;, TensorRT-LLM, and llm-d all do it.  Persistence beyond a process is also no longer rare: LMCache’s remote backends, vLLM’s &lt;a href=&quot;https://github.com/vllm-project/vllm/blob/main/docs/features/kv_offloading_usage.md&quot;&gt;tiered offloading&lt;/a&gt; to a filesystem or S3, and llm-d’s use of that tier all survive a restart, while Dynamo deliberately treats KV as transient and recomputable.&lt;/p&gt;
&lt;p&gt;The differences are in what is treated as identity and what is handed to the caller.&lt;/p&gt;









































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;System&lt;/th&gt;&lt;th&gt;Compatibility key&lt;/th&gt;&lt;th&gt;Lineage and placement&lt;/th&gt;&lt;th&gt;Fork exposed to caller&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;LMCache&lt;/td&gt;&lt;td&gt;model name, parallel layout, dtype&lt;/td&gt;&lt;td&gt;internal index and controller API&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;vLLM tiering&lt;/td&gt;&lt;td&gt;digest of run config: model, block size, parallelism, dtype&lt;/td&gt;&lt;td&gt;on-disk layout&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SGLang&lt;/td&gt;&lt;td&gt;model name suffix on the storage key&lt;/td&gt;&lt;td&gt;radix tree, in process&lt;/td&gt;&lt;td&gt;client-side DSL branch over shared prefixes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Dynamo&lt;/td&gt;&lt;td&gt;geometry only&lt;/td&gt;&lt;td&gt;global radix tree fed by worker events&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;pretrained-rstr&lt;/td&gt;&lt;td&gt;hash of weights, descriptor, attention layout, execution variant&lt;/td&gt;&lt;td&gt;Datahike facts, queryable with Datalog&lt;/td&gt;&lt;td&gt;copy on write on resident pages&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Keying on a model &lt;em&gt;name&lt;/em&gt; is enough inside one deployment where the operator controls what that name means.  It is not enough once state is shared across deployments or kept for months, and the vLLM project has an &lt;a href=&quot;https://github.com/vllm-project/vllm/pull/56971&quot;&gt;open proposal&lt;/a&gt; to add a quantization and dtype digest to shared-store keys for exactly that reason.  Hashing the weights themselves, and naming the execution variant, closes that gap at the cost of one pass over the checkpoint at load time.&lt;/p&gt;
&lt;p&gt;Recording lineage and placement in a general database rather than a purpose-built index is the other choice.  LMCache’s controller offers lookup, pin, move, and compress, and its coordinator tracks fleet-wide placement, which is more operational machinery than pretrained-rstr has.  What a Datahike catalog offers instead is that a continuation’s parent chain, fingerprint, and replica placement are ordinary facts that can be joined with whatever else the organization records about the attempt that produced them.&lt;/p&gt;
&lt;p&gt;No system in the comparison exposes copy-on-write forking of a resident cache as an operation the caller performs.  Engines share prefix blocks internally, and SGLang’s frontend can branch a program over shared prefixes, but the branch is not a durable, named continuation.  That gap is what our approach fills.  LMCache also does things pretrained-rstr does not attempt: non-prefix reuse through CacheBlend, compression through CacheGen, prefill and decode disaggregation over RDMA, and breadth across datacenter hardware.  The two are complementary; the identity and catalog layer here does not assume a particular storage tier underneath it.&lt;/p&gt;
&lt;h2 id=&quot;what-is-tested&quot;&gt;What is tested&lt;/h2&gt;
&lt;p&gt;Current model anchors cover token-exact paged decode, copy-on-write forks, and continuation resume on the supported development hardware.  Model-free tests cover content-addressed prefix lookup, catalog and replica state, durable publication, page sharing, admission, eviction, and routed scheduling.  Mixed prefill and decode packing, native CUDA copy streams, and production cluster policy remain engineering work.&lt;/p&gt;
&lt;h2 id=&quot;what-it-is-for&quot;&gt;What it is for&lt;/h2&gt;
&lt;p&gt;pretrained-rstr supports a growing set of instruction, embedding, and speech models that an organization can run on its own hardware.  When inference and storage are configured locally, prompts, continuations, and provenance do not need to leave the operator’s environment.  The state behind an answer can be named, stored, and reused with the same discipline as any other durable value in &lt;a href=&quot;https://datahike.io&quot;&gt;Datahike&lt;/a&gt;.  The library is experimental and pre-1.0, and feedback is welcome.  It is a replikativ component, not yet a shipped Simmis integration.&lt;/p&gt;
&lt;p&gt;The branching property is what makes it more than a cache.  When an attempt can begin from an exact prefix another attempt already paid for, the marginal cost of a second attempt is the tokens it adds instead of the context it inherits, and abandoning it costs only the pages it dirtied.  The same reasoning already governs &lt;a href=&quot;https://simm.is/blog/copy-on-write-branching&quot;&gt;structured organizational state&lt;/a&gt; in this stack.  Applied to attention state, it means the cost of exploring several options no longer scales with context size if they share most of their context window.&lt;/p&gt;
&lt;p&gt;If you are interested in running pretrained-rstr, &lt;a href=&quot;mailto:info@simm.is&quot;&gt;contact us&lt;/a&gt; and we will help you get started.&lt;/p&gt;</content:encoded></item><item><title>A REPL you can fork</title><link>https://simm.is/blog/a-repl-you-can-fork/</link><guid isPermaLink="true">https://simm.is/blog/a-repl-you-can-fork/</guid><description>Fork a live SCI interpreter in the browser, compare independent runtime worlds, and see where branching stops at continuations, host objects, and external effects.</description><pubDate>Sat, 12 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p class=&quot;post-lede&quot;&gt;A REPL session accumulates definitions, values, and mutable objects as you work.  We have extended &lt;a href=&quot;https://github.com/babashka/sci&quot;&gt;SCI&lt;/a&gt;, Michiel Borkent&apos;s Clojure interpreter, so that a session can fork into independent histories.  Each branch starts with the program&apos;s existing state and can evolve from there.&lt;/p&gt; &lt;p&gt;We need this in &lt;a href=&quot;https://github.com/replikativ/dvergr&quot;&gt;Dvergr&lt;/a&gt;, the agent runtime behind the current Simmis prototype.  Agents work in rooms that can branch so different approaches can be explored independently.  They also use REPLs to write functions, inspect data, and keep intermediate results.  Forking a room&apos;s conversation and storage leaves out that computational state.  Its running REPL needs to branch with it, so each attempt can continue without rebuilding the session or changing another attempt&apos;s working state.&lt;/p&gt; &lt;p&gt;For example, suppose an agent has loaded a dataset and written some analysis functions.  We want to try two ways of investigating an anomaly.  Both branches inherit the prepared session without repeating the setup, then develop their own functions and results without touching each other&apos;s REPL state.  We can inspect both and choose which line of investigation to continue.&lt;/p&gt; &lt;h2&gt;Fork one prompt into two live interpreters&lt;/h2&gt; &lt;p&gt;The two prompts in this demo stand in for those two lines of investigation.  The original REPL below has already defined a function, a Var, an atom, and a second name for that atom.  Fork it, run the prepared mutation in the child, then return to the original.  The child reports the new values; the original reports the earlier ones.  Either history can fork again.  The optional stress test retains 1,024 sibling interpreters for inspection and reports how long the forks took in your browser.  On a laptop (Intel Core Ultra 7 258V, Node.js 24, the demo&apos;s interpreter bundle), the 1,024 forks took about 0.35 s, a third of a millisecond each, and each retained interpreter added about 13 KiB of heap.&lt;/p&gt; &lt;p&gt;The demo offers &lt;a href=&quot;https://github.com/replikativ/superficie&quot;&gt;Superficie&lt;/a&gt; and Clojure syntax; both tabs operate on the same interpreter state.&lt;/p&gt;  &lt;div class=&quot;callout&quot;&gt; &lt;strong&gt;INTERACTIVE VERSION&lt;/strong&gt;
The live branching REPL is available in the article at &lt;a href=&quot;https://simm.is/blog/a-repl-you-can-fork&quot;&gt;simm.is&lt;/a&gt;.
&lt;/div&gt;  &lt;h2&gt;How live state branches&lt;/h2&gt; &lt;p&gt;The function &lt;code&gt;state&lt;/code&gt; was compiled before the fork.  When either world calls it, &lt;code&gt;label&lt;/code&gt;, &lt;code&gt;counter&lt;/code&gt;, and &lt;code&gt;alias&lt;/code&gt; resolve to that world&apos;s values.  Both atom names still refer to one atom within each world, while its value can change independently in the parent and child.  Later definitions, Var metadata, atom watches and validators, and volatiles follow the same model.&lt;/p&gt; &lt;p&gt;SCI creates the child by snapshotting its registered runtime cells and attaching them to a new evaluation context.  The child continues from that state without rerunning earlier prompts.&lt;/p&gt; &lt;p&gt;SCI separates the identity of each Var or mutable primitive from its current state.  Its stable handle selects state in the world where the function is running, so the child can change &lt;code&gt;label&lt;/code&gt; while the parent continues to read &lt;code&gt;:root&lt;/code&gt;.&lt;/p&gt; &lt;figure class=&quot;world-realization&quot; aria-labelledby=&quot;world-realization-caption&quot;&gt; &lt;div class=&quot;world-realization-read&quot;&gt; &lt;small&gt;ANALYSED VAR READ&lt;/small&gt; &lt;code&gt;label → slot 12&lt;/code&gt; &lt;/div&gt; &lt;div class=&quot;world-realization-handle&quot;&gt; &lt;small&gt;STABLE IDENTITY&lt;/small&gt; &lt;strong&gt;one Var handle&lt;/strong&gt; &lt;/div&gt; &lt;div class=&quot;world-realization-branches&quot;&gt; &lt;div class=&quot;world-realization-world&quot; data-world=&quot;source&quot;&gt; &lt;small&gt;SOURCE WORLD&lt;/small&gt; &lt;code&gt;cells[12] = :root&lt;/code&gt; &lt;/div&gt; &lt;div class=&quot;world-realization-world&quot; data-world=&quot;child&quot;&gt; &lt;small&gt;CHILD WORLD&lt;/small&gt; &lt;code&gt;cells[12] = :experiment&lt;/code&gt; &lt;/div&gt; &lt;/div&gt; &lt;figcaption id=&quot;world-realization-caption&quot;&gt;The handle remains stable.  Evaluation selects one world-local realization of its slot.&lt;/figcaption&gt; &lt;/figure&gt; &lt;p&gt;A lineage registry assigns integer slots to Vars and SCI-owned mutable objects.  Each world realizes those slots in a dense array.  When SCI analyses a Var read, it records the slot number at that read site; entering an evaluation installs the selected world&apos;s array.  Descendant reads can therefore use an indexed slot path centred on &lt;code&gt;cells[slot]&lt;/code&gt; instead of looking up the Var in the registry each time.&lt;/p&gt; &lt;p&gt;The atom named by &lt;code&gt;counter&lt;/code&gt; and &lt;code&gt;alias&lt;/code&gt; uses the same arrangement.  Its handle carries the value-slot number directly, plus a separate slot for less frequently accessed metadata, its validator, and its watches.  A mutation compares and sets only the selected atom&apos;s value slot, so concurrent changes to unrelated atoms do not make each other retry.&lt;/p&gt; &lt;h2&gt;Keeping reads cheap&lt;/h2&gt; &lt;p&gt;Every call to &lt;code&gt;state&lt;/code&gt; reads Vars and dereferences the atom, while a fork happens only when we ask for another history.  We expect that imbalance in applications too: many reads and mutations between comparatively rare forks.  The representation puts the copying work at the fork boundary and reduces ordinary access to an indexed slot read.  Forkable access still costs more than SCI&apos;s direct paths.  In the JVM measurements for the upstream pull request, interpreted Var reads took 2.5 times as long in forkable mode as in the default mode, and atom dereferences, atom swaps and function calls 2.6 to 3.9 times as long.  A host therefore opts in with &lt;code&gt;:runtime-mode :forkable&lt;/code&gt;, and SCI&apos;s default &lt;code&gt;:standard&lt;/code&gt; runtime keeps its existing direct paths.&lt;/p&gt; &lt;p&gt;Forkable mode has two additional fast paths.  The primary world continues to read Var roots directly.  On its first fork, SCI materializes those roots into slots and keeps the two representations synchronized.  Descendant worlds use the analysed slot reads described above.  The selected array holder is cached in execution-local state, avoiding a walk through the context on each access.&lt;/p&gt; &lt;p&gt;When you fork the demo, SCI copies the logical portion of the source world&apos;s slot array.  The browser worker serializes evaluation and fork requests.  On the JVM, a fork first waits for active evaluations of that world to finish.  The array holds references, so immutable and persistent values can remain shared while SCI-owned state and cooperating host values receive child realizations.  Fork time and retained memory are proportional to the lineage&apos;s allocated logical slots, including slots left by short-lived objects.  Spare backing-array capacity is not copied.&lt;/p&gt; &lt;p&gt;An O(1) branch could share a persistent tree or copy-on-write page table.  That would move more bookkeeping onto later reads or mutations.  A design with one persistent world root could also make unrelated state cells compete to replace that root.  Dense arrays keep reads indexed and atom updates local to one slot.  Page-level copy-on-write remains worth exploring for workloads with large worlds and frequent forks, where reducing the copy cost could justify the extra indirection.&lt;/p&gt; &lt;h2&gt;Dynamic bindings and suspended work&lt;/h2&gt; &lt;p&gt;The demo forks between prompts, after the previous evaluation has finished.  A Clojure &lt;code&gt;binding&lt;/code&gt; applies within an evaluation scope and unwinds when that scope exits, so its temporary values are already gone by the next prompt.  Each branch can enter new scopes using nested &lt;code&gt;binding&lt;/code&gt; and &lt;code&gt;set!&lt;/code&gt;, with the usual unwinding behaviour.&lt;/p&gt; &lt;p&gt;A runtime such as Spindel can also suspend a computation inside those scopes and resume it in a child world.  That requires the binding frames as well as the world&apos;s state.  The experimental SCI API can capture an opaque continuation context, retarget it to another context in the same lineage, and invoke a continuation with the selected world installed.&lt;/p&gt; &lt;p&gt;These bindings live outside the dense world array.  Each evaluation maintains persistent frame maps from Var identities to small mutable binding boxes.  Entering a world selects the effective frame once, while ordinary non-dynamic Var reads bypass it.  Retargeting copies the binding boxes for the child and preserves the frame chain needed to unwind nested scopes.&lt;/p&gt; &lt;h2&gt;From the REPL to Simmis&lt;/h2&gt; &lt;p&gt;We already use this implementation in &lt;a href=&quot;https://github.com/replikativ/dvergr&quot;&gt;Dvergr&lt;/a&gt; and the current Simmis prototype through our replikativ SCI build.  The browser demo is pinned to a build of the same work, which we proposed upstream as a &lt;a href=&quot;https://github.com/babashka/sci/pull/1084&quot;&gt;draft SCI pull request&lt;/a&gt;.  Michiel Borkent (borkdude), SCI&apos;s author, closed it in October 2026.  He is not sure the feature justifies the code it adds to SCI and points users who need it to the &lt;a href=&quot;https://github.com/replikativ/sci&quot;&gt;replikativ fork&lt;/a&gt;.  The work remains experimental and has not been released in upstream SCI.&lt;/p&gt; &lt;p&gt;SCI handles the mutable state of its own primitives.  If an application supplies other mutable objects, it needs to specify how their state should be copied or shared across a fork.  A random-number generator, for example, needs a policy for the streams each branch will use.&lt;/p&gt; &lt;p&gt;External effects require a different kind of bookkeeping.  Discarding a branch can release resources it owns, such as an open connection, but it cannot recall a request already sent to another service.  The application has to account for those actions and their costs even when it discards the computation that produced them.&lt;/p&gt; &lt;p&gt;&lt;em&gt;Revised in November 2026 for precision.&lt;/em&gt;&lt;/p&gt; </content:encoded></item><item><title>Agents can act. Who keeps the company coherent?</title><link>https://simm.is/blog/agents-can-act-who-keeps-the-company-coherent/</link><guid isPermaLink="true">https://simm.is/blog/agents-can-act-who-keeps-the-company-coherent/</guid><description>Where agent harnesses, worktrees, and human-in-the-loop controls stop, and why multi-agent work needs shared organizational state.</description><pubDate>Fri, 31 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p class=&quot;post-lede&quot;&gt;An agent can edit a repository in a worktree while another agent researches the same project in a sandbox.  Once both return useful work, someone still has to decide what the organization accepts.&lt;/p&gt; &lt;p&gt;Claude Cowork and Claude Code can operate inside isolated environments, work against files and repositories, and run parallel coding sessions.  ChatGPT and Codex combine project context, tools, approvals, and repository work.  OpenClaw and Hermes offer capable agent runtimes whose work an operator can inspect.  These products already perform useful work.&lt;/p&gt; &lt;p&gt;The complication appears when many capable workers can change records, files, workflows, and decisions faster than an organization can reconcile them. &lt;strong&gt;What did each worker begin from, which attempts may coexist, and which result did the organization accept?&lt;/strong&gt;&lt;/p&gt; &lt;div class=&quot;callout&quot;&gt; &lt;strong&gt;THE COMPARISON&lt;/strong&gt;
This comparison examines the control boundary that each product documents as a core part of its system.  It does not rank model intelligence.
&lt;/div&gt; &lt;h2&gt;Where an agent harness ends&lt;/h2&gt; &lt;p&gt;An agent harness gives a model tools, an execution environment, memory, and a way to pursue a task.  That worker layer is improving quickly.  For example, &lt;a href=&quot;https://code.claude.com/docs/en/worktrees&quot;&gt;Claude Code worktrees&lt;/a&gt; isolate parallel repository edits, while &lt;a href=&quot;https://support.claude.com/en/articles/14479288-claude-cowork-architecture-overview&quot;&gt;Claude Cowork&lt;/a&gt; runs code in isolated local or cloud environments with permission and network controls. &lt;a href=&quot;https://learn.chatgpt.com/docs/environments/git-worktrees&quot;&gt;Codex worktrees&lt;/a&gt; address the same repository collision problem.  These are meaningful controls.&lt;/p&gt; &lt;p&gt;Simmis starts with the organization around replaceable workers: the state they begin from, the separation between attempts, and the decision that turns proposed work into accepted history.&lt;/p&gt; &lt;p&gt;The distinction becomes clearest at the point of change.&lt;/p&gt; &lt;blockquote&gt;
Agent tools help workers act.  Simmis helps the organization control what their work changes.
&lt;/blockquote&gt; &lt;h2&gt;Where a repository branch stops&lt;/h2&gt; &lt;p&gt;A Git worktree provides an isolated checkout.  A sandbox limits the environment in which commands run.  Tool permissions constrain what an agent may call.  Each solves an important local problem.&lt;/p&gt; &lt;p&gt;Consequential organizational work often crosses those boundaries.  A single attempt may read structured knowledge, update managed records, edit files, and carry live execution context.  If only the repository branches, the database and workflow state can still move underneath it.  If every connected application remains independently authoritative, a reviewer must reconstruct the change across several histories.&lt;/p&gt; &lt;p&gt;The &lt;a href=&quot;https://simm.is/architecture#work-lifecycle&quot;&gt;Simmis work loop&lt;/a&gt; treats registered knowledge, files, and execution context as one managed attempt.  The accepted record stays unchanged while work proceeds.  The result returns as a proposal whose semantic changes and conflicts can be reviewed before merge or discard.&lt;/p&gt; &lt;h2&gt;The practical comparison&lt;/h2&gt; &lt;p&gt;The table below compares documented product scope rather than every workflow that someone might construct with integrations.  A dash means only that the product does not present the capability as part of its native organizational control model.&lt;/p&gt; &lt;div class=&quot;comparison-breakout&quot;&gt; &lt;div class=&quot;comparison&quot;&gt; &lt;p class=&quot;comparison-lede&quot;&gt;Most tools help agents act.  Simmis helps the organization control what becomes official.&lt;/p&gt; &lt;div class=&quot;matrix-wrap&quot; tabindex=&quot;0&quot; role=&quot;region&quot; aria-label=&quot;Simmis competitor capability comparison&quot;&gt; &lt;table class=&quot;matrix&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope=&quot;col&quot;&gt;VALUE / CAPABILITY&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt; &lt;span class=&quot;product-head product-head-single&quot; aria-label=&quot;Simmis&quot;&gt; &lt;a class=&quot;product-identity&quot; href=&quot;https://simm.is/architecture&quot;&gt; &lt;span class=&quot;product-mark-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;product-mark simmis&quot; src=&quot;https://simm.is/assets/brand/logo/mark-simmis-primary-light.png&quot; alt=&quot;&quot; width=&quot;28&quot; height=&quot;28&quot;&gt; &lt;/span&gt; &lt;span&gt;Simmis&lt;/span&gt; &lt;span class=&quot;product-link-slot&quot; aria-hidden=&quot;true&quot;&gt;  &lt;/span&gt; &lt;/a&gt; &lt;/span&gt; &lt;/th&gt;&lt;th scope=&quot;col&quot;&gt; &lt;span class=&quot;product-head&quot; aria-label=&quot;Claude Cowork + Claude Code&quot;&gt; &lt;a class=&quot;product-identity&quot; href=&quot;https://claude.com/product/cowork&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;product-mark-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;product-mark&quot; src=&quot;https://simm.is/assets/brand/competitors/claude-cowork.png&quot; alt=&quot;&quot; width=&quot;28&quot; height=&quot;28&quot;&gt; &lt;/span&gt; &lt;span&gt;Claude Cowork&lt;/span&gt; &lt;span class=&quot;product-link-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/span&gt; &lt;/a&gt;&lt;a class=&quot;product-identity&quot; href=&quot;https://claude.com/product/claude-code&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;product-mark-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;product-mark&quot; src=&quot;https://simm.is/assets/brand/competitors/claude-code.png&quot; alt=&quot;&quot; width=&quot;28&quot; height=&quot;28&quot;&gt; &lt;/span&gt; &lt;span&gt;Claude Code&lt;/span&gt; &lt;span class=&quot;product-link-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/span&gt; &lt;/a&gt; &lt;/span&gt; &lt;/th&gt;&lt;th scope=&quot;col&quot;&gt; &lt;span class=&quot;product-head&quot; aria-label=&quot;ChatGPT + Codex&quot;&gt; &lt;a class=&quot;product-identity&quot; href=&quot;https://chatgpt.com/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;product-mark-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;product-mark&quot; src=&quot;https://simm.is/assets/brand/competitors/chatgpt.png&quot; alt=&quot;&quot; width=&quot;28&quot; height=&quot;28&quot;&gt; &lt;/span&gt; &lt;span&gt;ChatGPT&lt;/span&gt; &lt;span class=&quot;product-link-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/span&gt; &lt;/a&gt;&lt;a class=&quot;product-identity&quot; href=&quot;https://openai.com/codex/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;product-mark-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;product-mark&quot; src=&quot;https://simm.is/assets/brand/competitors/codex.png&quot; alt=&quot;&quot; width=&quot;28&quot; height=&quot;28&quot;&gt; &lt;/span&gt; &lt;span&gt;Codex&lt;/span&gt; &lt;span class=&quot;product-link-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/span&gt; &lt;/a&gt; &lt;/span&gt; &lt;/th&gt;&lt;th scope=&quot;col&quot;&gt; &lt;span class=&quot;product-head&quot; aria-label=&quot;OpenClaw + Hermes&quot;&gt; &lt;a class=&quot;product-identity&quot; href=&quot;https://github.com/openclaw/openclaw&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;product-mark-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;product-mark&quot; src=&quot;https://simm.is/assets/brand/competitors/openclaw.png&quot; alt=&quot;&quot; width=&quot;28&quot; height=&quot;28&quot;&gt; &lt;/span&gt; &lt;span&gt;OpenClaw&lt;/span&gt; &lt;span class=&quot;product-link-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/span&gt; &lt;/a&gt;&lt;a class=&quot;product-identity&quot; href=&quot;https://github.com/nousresearch/hermes-agent&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;product-mark-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;product-mark&quot; src=&quot;https://simm.is/assets/brand/competitors/hermes.svg&quot; alt=&quot;&quot; width=&quot;28&quot; height=&quot;28&quot;&gt; &lt;/span&gt; &lt;span&gt;Hermes&lt;/span&gt; &lt;span class=&quot;product-link-slot&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/span&gt; &lt;/a&gt; &lt;/span&gt; &lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;running-module&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Run the company as one system&lt;/strong&gt;&lt;small&gt;One model controls managed state + workflow + interface&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: In progress. Integrated primitives work.  The unified operating interface and production deployment remain in progress.&quot;&gt; &lt;span class=&quot;matrix-mark wip&quot; title=&quot;Simmis: In progress. Integrated primitives work.  The unified operating interface and production deployment remain in progress.&quot; aria-hidden=&quot;true&quot;&gt;    &lt;span class=&quot;sb&quot; style=&quot;color:var(--runtime-amber);background:transparent;border:1px solid var(--runtime-amber);&quot;&gt;WIP&lt;/span&gt;  &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: In progress. Integrated primitives work.  The unified operating interface and production deployment remain in progress.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Not documented as a core capability. Not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;Claude Cowork + Claude Code: Not documented as a core capability. Not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Not documented as a core capability. Not documented as a core capability.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Not documented as a core capability. Not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;ChatGPT + Codex: Not documented as a core capability. Not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Not documented as a core capability. Not documented as a core capability.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Not documented as a core capability. Not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;OpenClaw + Hermes: Not documented as a core capability. Not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Not documented as a core capability. Not documented as a core capability.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;official-state&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Own one authoritative company record&lt;/strong&gt;&lt;small&gt;Built-in, versioned managed state&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: Native. Accepted managed state is built in and versioned.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Simmis: Native. Accepted managed state is built in and versioned.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: Native. Accepted managed state is built in and versioned.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Partial or narrower. Artifacts and selected files persist.  The product does not document one authoritative organizational record.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;Claude Cowork + Claude Code: Partial or narrower. Artifacts and selected files persist.  The product does not document one authoritative organizational record.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Partial or narrower. Artifacts and selected files persist.  The product does not document one authoritative organizational record.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Partial or narrower. Projects and Git retain scoped context and changes.  The product does not document one authoritative organizational record.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;ChatGPT + Codex: Partial or narrower. Projects and Git retain scoped context and changes.  The product does not document one authoritative organizational record.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Partial or narrower. Projects and Git retain scoped context and changes.  The product does not document one authoritative organizational record.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Partial or narrower. Memory and files persist for each agent or deployment.  The product does not document one authoritative organizational record.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;OpenClaw + Hermes: Partial or narrower. Memory and files persist for each agent or deployment.  The product does not document one authoritative organizational record.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Partial or narrower. Memory and files persist for each agent or deployment.  The product does not document one authoritative organizational record.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;fork&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Change without disrupting live operations&lt;/strong&gt;&lt;small&gt;Forks data + files + execution context together&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: Native. Registered knowledge, files, and execution context branch together.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Simmis: Native. Registered knowledge, files, and execution context branch together.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: Native. Registered knowledge, files, and execution context branch together.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Partial or narrower. Git worktrees isolate repository files, and Cowork tasks use isolated virtual machines.  Their scope is narrower than composite branching of managed state.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;Claude Cowork + Claude Code: Partial or narrower. Git worktrees isolate repository files, and Cowork tasks use isolated virtual machines.  Their scope is narrower than composite branching of managed state.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Partial or narrower. Git worktrees isolate repository files, and Cowork tasks use isolated virtual machines.  Their scope is narrower than composite branching of managed state.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Partial or narrower. Codex worktrees isolate repository files.  Their scope is narrower than composite branching of managed state.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;ChatGPT + Codex: Partial or narrower. Codex worktrees isolate repository files.  Their scope is narrower than composite branching of managed state.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Partial or narrower. Codex worktrees isolate repository files.  Their scope is narrower than composite branching of managed state.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Not documented as a core capability. Coordinated branching across data, files, and execution context is not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;OpenClaw + Hermes: Not documented as a core capability. Coordinated branching across data, files, and execution context is not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Not documented as a core capability. Coordinated branching across data, files, and execution context is not documented as a core capability.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;review-gate&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Make consequential change deliberate&lt;/strong&gt;&lt;small&gt;Review and adoption scope&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: Native. Proposals show semantic changes and conflicts for merge or discard.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Simmis: Native. Proposals show semantic changes and conflicts for merge or discard.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: Native. Proposals show semantic changes and conflicts for merge or discard.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Partial or narrower. Permission review, checkpoints, and code diffs cover a narrower scope than proposal adoption for managed state.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;Claude Cowork + Claude Code: Partial or narrower. Permission review, checkpoints, and code diffs cover a narrower scope than proposal adoption for managed state.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Partial or narrower. Permission review, checkpoints, and code diffs cover a narrower scope than proposal adoption for managed state.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Partial or narrower. Approvals and code review cover a narrower scope than proposal adoption for managed state.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;ChatGPT + Codex: Partial or narrower. Approvals and code review cover a narrower scope than proposal adoption for managed state.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Partial or narrower. Approvals and code review cover a narrower scope than proposal adoption for managed state.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Partial or narrower. Command approvals and controls defined by the operator cover a narrower scope than proposal adoption for managed state.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;OpenClaw + Hermes: Partial or narrower. Command approvals and controls defined by the operator cover a narrower scope than proposal adoption for managed state.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Partial or narrower. Command approvals and controls defined by the operator cover a narrower scope than proposal adoption for managed state.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;scope&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Give access without giving everything&lt;/strong&gt;&lt;small&gt;Fine-grained authorization&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: In progress. Room authorization works now.  Finer authorization is in progress.&quot;&gt; &lt;span class=&quot;matrix-mark wip&quot; title=&quot;Simmis: In progress. Room authorization works now.  Finer authorization is in progress.&quot; aria-hidden=&quot;true&quot;&gt;    &lt;span class=&quot;sb&quot; style=&quot;color:var(--runtime-amber);background:transparent;border:1px solid var(--runtime-amber);&quot;&gt;WIP&lt;/span&gt;  &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: In progress. Room authorization works now.  Finer authorization is in progress.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Native. Tool and file permission controls are documented.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Claude Cowork + Claude Code: Native. Tool and file permission controls are documented.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Native. Tool and file permission controls are documented.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Native. Roles, connected-app permissions, approvals, and sandbox controls are documented.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;ChatGPT + Codex: Native. Roles, connected-app permissions, approvals, and sandbox controls are documented.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Native. Roles, connected-app permissions, approvals, and sandbox controls are documented.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Partial or narrower. Operator, tool, and command controls vary by deployment.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;OpenClaw + Hermes: Partial or narrower. Operator, tool, and command controls vary by deployment.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Partial or narrower. Operator, tool, and command controls vary by deployment.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;snapshot&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Inspect what was known at any point&lt;/strong&gt;&lt;small&gt;Point-in-time structured queries&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: Native. Immutable, queryable history of managed state is built in.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Simmis: Native. Immutable, queryable history of managed state is built in.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: Native. Immutable, queryable history of managed state is built in.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;Claude Cowork + Claude Code: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;ChatGPT + Codex: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;OpenClaw + Hermes: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Not documented as a core capability. Point-in-time structured organizational queries are not documented as a core capability.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;budget-stop&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Keep agent costs inside hard bounds&lt;/strong&gt;&lt;small&gt;Hard spend limits&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: Native. Enforced room budgets are built in.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Simmis: Native. Enforced room budgets are built in.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: Native. Enforced room budgets are built in.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Native. Workspace spend limits and cost controls are documented.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Claude Cowork + Claude Code: Native. Workspace spend limits and cost controls are documented.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Native. Workspace spend limits and cost controls are documented.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Native. Seat, user, credit, and workspace spend controls are documented.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;ChatGPT + Codex: Native. Seat, user, credit, and workspace spend controls are documented.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Native. Seat, user, credit, and workspace spend controls are documented.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Not documented as a core capability. A built-in hard spend limit across the combined agent stack is not documented as a core capability.&quot;&gt; &lt;span class=&quot;matrix-mark no&quot; title=&quot;OpenClaw + Hermes: Not documented as a core capability. A built-in hard spend limit across the combined agent stack is not documented as a core capability.&quot; aria-hidden=&quot;true&quot;&gt;  &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;    &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Not documented as a core capability. A built-in hard spend limit across the combined agent stack is not documented as a core capability.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt; &lt;span class=&quot;feature-head&quot;&gt; &lt;span class=&quot;feature-icon&quot; data-px-part=&quot;team&quot; data-px-size=&quot;24&quot; data-px-bg=&quot;var(--paper)&quot; aria-hidden=&quot;true&quot;&gt;&lt;/span&gt; &lt;span class=&quot;feature-copy&quot;&gt;&lt;strong&gt;Coordinate people and agents live&lt;/strong&gt;&lt;small&gt;Persistent Teams for multiple people and agents&lt;/small&gt;&lt;/span&gt; &lt;/span&gt; &lt;/th&gt; &lt;td aria-label=&quot;Simmis: Native. Persistent Teams coordinate multiple people and agents around shared work.&quot;&gt; &lt;span class=&quot;matrix-mark yes&quot; title=&quot;Simmis: Native. Persistent Teams coordinate multiple people and agents around shared work.&quot; aria-hidden=&quot;true&quot;&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;     &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Simmis: Native. Persistent Teams coordinate multiple people and agents around shared work.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;Claude Cowork + Claude Code: Partial or narrower. Cowork provides task artifacts and collaboration around outputs.  Its scope is narrower than a persistent Team for multiple people and agents.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;Claude Cowork + Claude Code: Partial or narrower. Cowork provides task artifacts and collaboration around outputs.  Its scope is narrower than a persistent Team for multiple people and agents.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;Claude Cowork + Claude Code: Partial or narrower. Cowork provides task artifacts and collaboration around outputs.  Its scope is narrower than a persistent Team for multiple people and agents.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;ChatGPT + Codex: Partial or narrower. Shared projects and workspace controls provide shared context.  Their scope is narrower than a persistent Team for multiple people and agents.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;ChatGPT + Codex: Partial or narrower. Shared projects and workspace controls provide shared context.  Their scope is narrower than a persistent Team for multiple people and agents.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;ChatGPT + Codex: Partial or narrower. Shared projects and workspace controls provide shared context.  Their scope is narrower than a persistent Team for multiple people and agents.&lt;/span&gt; &lt;/td&gt;&lt;td aria-label=&quot;OpenClaw + Hermes: Partial or narrower. Channels and subagents coordinate around an operator or deployment.  Their scope is narrower than a shared organizational Team.&quot;&gt; &lt;span class=&quot;matrix-mark partial&quot; title=&quot;OpenClaw + Hermes: Partial or narrower. Channels and subagents coordinate around an operator or deployment.  Their scope is narrower than a shared organizational Team.&quot; aria-hidden=&quot;true&quot;&gt;   &lt;svg class=&quot;pixel-icon&quot; width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;   &lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;OpenClaw + Hermes: Partial or narrower. Channels and subagents coordinate around an operator or deployment.  Their scope is narrower than a shared organizational Team.&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;div class=&quot;matrix-key&quot; aria-label=&quot;Comparison key&quot;&gt; &lt;span&gt;&lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;3&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;6&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;4&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;2&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  native&lt;/span&gt; &lt;span&gt;&lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;5&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  partial / narrower&lt;/span&gt; &lt;span&gt;&lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;2&quot; y=&quot;5&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--steel)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  not documented as core&lt;/span&gt; &lt;span&gt;&lt;span class=&quot;sb&quot; style=&quot;color:var(--runtime-amber);background:transparent;border:1px solid var(--runtime-amber);&quot;&gt;WIP&lt;/span&gt;  in progress&lt;/span&gt; &lt;/div&gt; &lt;details class=&quot;source-ledger&quot;&gt; &lt;summary&gt;first-party sources&lt;/summary&gt; &lt;div class=&quot;source-groups&quot;&gt; &lt;section&gt; &lt;h3&gt;Simmis&lt;/h3&gt; &lt;p&gt; &lt;a href=&quot;https://simm.is/architecture&quot;&gt;architecture&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://simm.is/#category-hinge&quot;&gt;solution&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://simm.is/roadmap&quot;&gt;roadmap&lt;/a&gt;  &lt;/p&gt; &lt;/section&gt;&lt;section&gt; &lt;h3&gt;Claude Cowork + Claude Code&lt;/h3&gt; &lt;p&gt; &lt;a href=&quot;https://support.claude.com/en/articles/14479288-claude-cowork-architecture-overview&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;Cowork architecture&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://code.claude.com/docs/en/worktrees&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;worktrees&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://code.claude.com/docs/en/permissions&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;permissions&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://code.claude.com/docs/en/costs&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;cost controls&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt;  &lt;/p&gt; &lt;/section&gt;&lt;section&gt; &lt;h3&gt;ChatGPT + Codex&lt;/h3&gt; &lt;p&gt; &lt;a href=&quot;https://help.openai.com/en/articles/10169521-projects-in-chatgpt&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;projects&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://learn.chatgpt.com/docs/environments/git-worktrees&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;worktrees&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://learn.chatgpt.com/docs/agent-approvals-security&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;approvals&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://help.openai.com/en/articles/20001155-managing-credits-and-spend-controls-in-chatgpt-business&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;spend controls&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt;  &lt;/p&gt; &lt;/section&gt;&lt;section&gt; &lt;h3&gt;OpenClaw + Hermes&lt;/h3&gt; &lt;p&gt; &lt;a href=&quot;https://github.com/openclaw/openclaw&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;OpenClaw repository&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://docs.openclaw.ai/tools/exec-approvals&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;OpenClaw controls&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://docs.openclaw.ai/concepts/memory&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;OpenClaw memory&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://hermes-agent.nousresearch.com/docs/user-guide/features/overview/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;Hermes features&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt; &lt;span aria-hidden=&quot;true&quot;&gt; · &lt;/span&gt;&lt;a href=&quot;https://hermes-agent.nousresearch.com/docs/user-guide/security/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;Hermes security&lt;span aria-hidden=&quot;true&quot;&gt; ↗&lt;/span&gt;&lt;/a&gt;  &lt;/p&gt; &lt;/section&gt; &lt;/div&gt; &lt;/details&gt; &lt;/div&gt;  &lt;/div&gt; &lt;h2&gt;When a harness is enough&lt;/h2&gt; &lt;p&gt;A narrow task does not need an organizational control stack merely because an agent touches it.  A harness is often sufficient when one application already owns the result, the work is naturally isolated, and a person can inspect the final artifact without reconstructing changes across several systems.&lt;/p&gt; &lt;p&gt;That covers drafting, repository maintenance, bounded research, one time analysis, and workflows whose external system already supplies the authoritative state and approval boundary.&lt;/p&gt; &lt;h2&gt;When multi-agent work needs organizational control&lt;/h2&gt; &lt;p&gt;The problem changes when several people and agents operate from shared context, pursue competing approaches, and propose changes to state that should survive any particular model or vendor.  They then need a durable operating basis and a deliberate route from attempt to accepted change.&lt;/p&gt; &lt;p&gt;As agents improve, this need grows.  More of their work becomes worth accepting, which reduces the value of supervising every transcript and increases the value of reliable state, authority, history, and coordination.  Even locally correct actions can conflict when they begin from different facts or update adjacent systems without a shared decision boundary.&lt;/p&gt; &lt;p&gt;Simmis remains in development.  Its integrated primitives work, while the unified operating interface, fine-grained authority, and supported production deployment remain in progress.  We expect agent workers to remain diverse and replaceable.  The organization therefore needs accepted organizational state and retained history that persist when a worker changes.&lt;/p&gt; </content:encoded></item><item><title>Shared context for AI agents: five architectures compared</title><link>https://simm.is/blog/five-architectures-for-shared-human-agent-work/</link><guid isPermaLink="true">https://simm.is/blog/five-architectures-for-shared-human-agent-work/</guid><description>How Wato, PromptQL, Dust, Buzz, and Simmis use memory, connected data, workspaces, event logs, or versioned organizational state to coordinate AI agents.</description><pubDate>Fri, 24 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p class=&quot;post-lede&quot;&gt;A team may begin by connecting one agent to a database or repository.  Once several people and agents share memory, tools, permissions, and work, the team must decide what will hold that activity together.&lt;/p&gt; &lt;p&gt;Wato, PromptQL, Dust, Buzz, and Simmis increasingly occupy neighbouring territory.  All five treat agents as participants in durable organizational work instead of disposable prompt completions.  Each provides some combination of shared context, connectors, permissions, execution, collaboration, and history.&lt;/p&gt; &lt;p&gt;A feature checklist can obscure the architectural difference.  Each system chooses a primary object, and that choice determines what users can query, isolate, authorize, replay, or deliberately change.&lt;/p&gt; &lt;div class=&quot;callout&quot;&gt; &lt;strong&gt;THE TECHNICAL QUESTION&lt;/strong&gt;
When people and agents work together, is the primary substrate memory, connected data, a workspace, an event log, or versioned organizational state?
&lt;/div&gt; &lt;h2&gt;Wato uses MCP as the shared memory and tool layer&lt;/h2&gt; &lt;p&gt;&lt;a href=&quot;https://www.watolabs.com/&quot;&gt;Wato&lt;/a&gt; organizes its architecture around one Model Context Protocol (MCP) layer for memory, tools, workflows, agent sessions, and artifacts.  Existing agents connect to Wato, so each worker does not have to reconstruct company context and credentials independently.&lt;/p&gt; &lt;p&gt;Wato makes a strong technical bet on interoperability.  Versioned team memory and reusable skills remain available across Codex, Claude Code, Cursor, and other MCP clients.  Permissions can be scoped by organization, team, user, connector, and tool.  Cloud sessions add a collaborative execution environment with filesystem, browser, desktop, and environment access.&lt;/p&gt; &lt;p&gt;Wato and Simmis share a motivation.  Company context should outlive private chats and individual agents.  They differ in their primary control mechanism.  Wato presents a shared MCP workspace around agents.  Its public material does not describe composite branches that reconcile changes to accepted organizational state.&lt;/p&gt; &lt;h2&gt;PromptQL queries connected business data&lt;/h2&gt; &lt;p&gt;&lt;a href=&quot;https://promptql.io/en/docs&quot;&gt;PromptQL&lt;/a&gt; starts from connected operational data.  Its multiplayer AI combines shared threads and a context wiki with a virtual data layer that queries databases and SaaS systems where they already live.&lt;/p&gt; &lt;p&gt;PromptQL places its most distinctive architectural control below the agent.  PromptQL says queries execute with the requesting user’s permissions, while its virtual SQL and HTTP layers inject credentials and enforce data policies outside the model.  Its &lt;a href=&quot;https://promptql.io/security&quot;&gt;security architecture&lt;/a&gt; separates a customer owned data plane from a hosted control plane and sandboxes code execution.&lt;/p&gt; &lt;p&gt;The system can create artifacts, execute code, delegate coding work, and require approval for writes or external calls.  However, its centre of gravity remains secure access to live connected systems.  Its public architecture does not describe a new accepted state database with branch reconciliation.&lt;/p&gt; &lt;h2&gt;Dust organizes agents around company workspaces&lt;/h2&gt; &lt;p&gt;&lt;a href=&quot;https://dust.tt/&quot;&gt;Dust&lt;/a&gt; begins with an enterprise workspace.  Administrators connect company data, divide it into open or restricted spaces, and make agents available according to those boundaries.  Its permissions model ties agents and synchronized sources to workspace roles and space membership.&lt;/p&gt; &lt;p&gt;Dust’s newer &lt;a href=&quot;https://docs.dust.tt/changelog/pods-a-shared-workspace-for-your-team-and-your-agents&quot;&gt;Pods&lt;/a&gt; move beyond isolated agent conversations.  A Pod keeps conversations, files, tasks, and connected data around one shared initiative so later work can reuse earlier decisions and context.  Dust also offers structured extraction and action tools on top of its retrieval layer.&lt;/p&gt; &lt;p&gt;The primary object remains the workspace and its connected knowledge.  Isolation principally controls permissions and data visibility.  Dust does not publicly describe branches of organizational data and execution state that later reconcile through one proposal.&lt;/p&gt; &lt;h2&gt;Buzz coordinates work through rooms and events&lt;/h2&gt; &lt;p&gt;&lt;a href=&quot;https://github.com/block/buzz&quot;&gt;Buzz&lt;/a&gt; makes humans, agents, workflows, messages, and Git activity speak one event protocol.  Its self hostable relay stores signed events that share an identity model and become searchable through one workspace.&lt;/p&gt; &lt;p&gt;This produces a useful symmetry.  Agents join rooms as members, use the CLI designed for agents or Agent Client Protocol (ACP) harnesses, run YAML workflows, and leave evidence in the same event history as people.  A feature branch can become a room in which patches, continuous integration, discussion, and the merge decision coexist.&lt;/p&gt; &lt;p&gt;Buzz’s primary record is an append oriented communication and workflow log.  It offers unusually strong identity and provenance at that layer.  Its public status table says workflow approval gates are still being wired up.  Its Git branches do not amount to composite branching of arbitrary registered organizational state.&lt;/p&gt; &lt;h2&gt;Simmis makes organizational state branchable&lt;/h2&gt; &lt;p&gt;Simmis starts from accepted organizational state and the work that may change it.  Its stack keeps knowledge, files, and execution context aligned inside a separate attempt, then presents the result for merge or discard.&lt;/p&gt; &lt;p&gt;Simmis makes a more specific bet than durable company memory alone.  Consequential work should begin from an exact accepted basis, proceed on a composite branch, and become official through an explicit adoption decision.  Several people and agents can fork from the same basis or from another branch while the accepted record remains unchanged.&lt;/p&gt; &lt;p&gt;This wider control boundary also creates a harder engineering problem.  Simmis must coordinate state, files, execution, conflicts, proposals, history, and interface behaviour.  Its core primitives are working, but fine grained authority, the unified operating interface, and a supported production deployment remain in progress.&lt;/p&gt; &lt;h2&gt;The architecture map&lt;/h2&gt; &lt;p&gt;The table is intentionally descriptive.  “Not documented” means only that the public architecture does not make a capability part of its native control model.  Integrations may still reproduce narrower versions of it.&lt;/p&gt; &lt;div class=&quot;comparison-breakout emerging-comparison-breakout&quot;&gt; &lt;div class=&quot;architecture-comparison&quot;&gt; &lt;p class=&quot;architecture-comparison-lede&quot;&gt;
These systems increasingly share features.  Their deeper difference is the object each one makes authoritative.
&lt;/p&gt; &lt;div class=&quot;architecture-matrix-wrap&quot; tabindex=&quot;0&quot; role=&quot;region&quot; aria-label=&quot;Technical architecture comparison&quot;&gt; &lt;table class=&quot;architecture-matrix&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope=&quot;col&quot;&gt;ARCHITECTURAL AXIS&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt; &lt;a href=&quot;https://simm.is/architecture&quot;&gt; &lt;span class=&quot;architecture-product-mark&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;simmis simmis&quot; src=&quot;https://simm.is/assets/brand/logo/mark-simmis-primary-light.png&quot; alt=&quot;&quot; width=&quot;30&quot; height=&quot;30&quot;&gt; &lt;/span&gt; &lt;span&gt;Simmis&lt;/span&gt;  &lt;/a&gt; &lt;/th&gt;&lt;th scope=&quot;col&quot;&gt; &lt;a href=&quot;https://www.watolabs.com/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;architecture-product-mark&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;wato&quot; src=&quot;https://simm.is/assets/brand/competitors/wato.png&quot; alt=&quot;&quot; width=&quot;30&quot; height=&quot;30&quot;&gt; &lt;/span&gt; &lt;span&gt;Wato&lt;/span&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/a&gt; &lt;/th&gt;&lt;th scope=&quot;col&quot;&gt; &lt;a href=&quot;https://promptql.io/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;architecture-product-mark&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;promptql&quot; src=&quot;https://simm.is/assets/brand/competitors/promptql.svg&quot; alt=&quot;&quot; width=&quot;30&quot; height=&quot;30&quot;&gt; &lt;/span&gt; &lt;span&gt;PromptQL&lt;/span&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/a&gt; &lt;/th&gt;&lt;th scope=&quot;col&quot;&gt; &lt;a href=&quot;https://dust.tt/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;architecture-product-mark&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;dust&quot; src=&quot;https://simm.is/assets/brand/competitors/dust.png&quot; alt=&quot;&quot; width=&quot;30&quot; height=&quot;30&quot;&gt; &lt;/span&gt; &lt;span&gt;Dust&lt;/span&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/a&gt; &lt;/th&gt;&lt;th scope=&quot;col&quot;&gt; &lt;a href=&quot;https://github.com/block/buzz&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt; &lt;span class=&quot;architecture-product-mark&quot; aria-hidden=&quot;true&quot;&gt; &lt;img class=&quot;buzz&quot; src=&quot;https://simm.is/assets/brand/competitors/buzz.png&quot; alt=&quot;&quot; width=&quot;30&quot; height=&quot;30&quot;&gt; &lt;/span&gt; &lt;span&gt;Buzz&lt;/span&gt; &lt;svg class=&quot;pixel-icon&quot; width=&quot;12&quot; height=&quot;12&quot; viewBox=&quot;0 0 12 12&quot; aria-hidden=&quot;true&quot;&gt; &lt;rect x=&quot;1&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;8&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;1&quot; y=&quot;9&quot; width=&quot;8&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;8&quot; width=&quot;2&quot; height=&quot;3&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;5&quot; y=&quot;5&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;7&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;8&quot; y=&quot;1&quot; width=&quot;3&quot; height=&quot;2&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt;&lt;rect x=&quot;9&quot; y=&quot;3&quot; width=&quot;2&quot; height=&quot;1&quot; fill=&quot;var(--ink)&quot;&gt;&lt;/rect&gt; &lt;/svg&gt;  &lt;/a&gt; &lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;Primary substrate&lt;/th&gt; &lt;td&gt;Immutable, versioned managed state&lt;/td&gt;&lt;td&gt;One MCP layer for memory, tools, workflows, and sessions&lt;/td&gt;&lt;td&gt;Virtual data layer plus shared context wiki&lt;/td&gt;&lt;td&gt;Workspace, spaces, connected data, and Pods&lt;/td&gt;&lt;td&gt;Signed event log on a relay&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;Collaboration unit&lt;/th&gt; &lt;td&gt;A persistent Team backed by a Dvergr room&lt;/td&gt;&lt;td&gt;Shared workspace, team memory, and collaborative cloud sessions&lt;/td&gt;&lt;td&gt;Project and multiplayer thread&lt;/td&gt;&lt;td&gt;Workspace, space, conversation, or Pod&lt;/td&gt;&lt;td&gt;Community, channel, thread, and room&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;Knowledge model&lt;/th&gt; &lt;td&gt;Queryable facts and accepted-state history&lt;/td&gt;&lt;td&gt;Versioned memory, decisions, skills, and artifacts&lt;/td&gt;&lt;td&gt;Live connected data plus a context wiki&lt;/td&gt;&lt;td&gt;Synced sources, retrieval, files, and conversation history&lt;/td&gt;&lt;td&gt;Searchable messages, media, workflow events, and Git events&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;Agent execution&lt;/th&gt; &lt;td&gt;Dvergr agents with tools, schedules, budgets, and Spindel contexts&lt;/td&gt;&lt;td&gt;Cloud agents with desktop, filesystem, browser, and computer use&lt;/td&gt;&lt;td&gt;Sandboxed code plus delegated local coding agents&lt;/td&gt;&lt;td&gt;Configurable agents using data and action tools&lt;/td&gt;&lt;td&gt;ACP harnesses, agent CLI, and YAML workflows&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;Isolation boundary&lt;/th&gt; &lt;td&gt;Composite branches across registered data, files, and execution context&lt;/td&gt;&lt;td&gt;Cloud session and Git isolation.  Composite state branching is not documented&lt;/td&gt;&lt;td&gt;Authorization for each user and sandboxed execution.  No branch model is documented&lt;/td&gt;&lt;td&gt;Data boundaries for each space.  No composite branch model is documented&lt;/td&gt;&lt;td&gt;Identity, channel, community, and Git boundaries&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;Change adoption&lt;/th&gt; &lt;td&gt;Semantic proposal, conflict handling, merge or discard&lt;/td&gt;&lt;td&gt;Tool permissions and traces.  No merge model for accepted state is documented&lt;/td&gt;&lt;td&gt;Writes and external calls require approval&lt;/td&gt;&lt;td&gt;Roles, space membership, and tool-specific action controls&lt;/td&gt;&lt;td&gt;Signed actions and Git merge evidence.  Workflow approval gates are in progress&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;th scope=&quot;row&quot;&gt;Interoperability bet&lt;/th&gt; &lt;td&gt;Vertically integrated open stack with replaceable models and tools&lt;/td&gt;&lt;td&gt;One MCP endpoint for many compatible agents and connectors&lt;/td&gt;&lt;td&gt;Connect data where it lives and enforce access below the model&lt;/td&gt;&lt;td&gt;Managed enterprise connectors, APIs, and model choice&lt;/td&gt;&lt;td&gt;A shared event protocol, self hosted relay, CLI, ACP, and Git&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;details class=&quot;architecture-source-ledger&quot;&gt; &lt;summary&gt;first-party sources&lt;/summary&gt; &lt;div&gt; &lt;p&gt; &lt;strong&gt;Simmis&lt;/strong&gt; &lt;a href=&quot;https://simm.is/architecture&quot;&gt;architecture&lt;/a&gt;  · &lt;a href=&quot;https://simm.is/docs/known-limits&quot;&gt;known limits&lt;/a&gt;  &lt;/p&gt;&lt;p&gt; &lt;strong&gt;Wato&lt;/strong&gt; &lt;a href=&quot;https://www.watolabs.com/&quot;&gt;product&lt;/a&gt;  &lt;/p&gt;&lt;p&gt; &lt;strong&gt;PromptQL&lt;/strong&gt; &lt;a href=&quot;https://promptql.io/en/docs&quot;&gt;overview&lt;/a&gt;  · &lt;a href=&quot;https://promptql.io/security&quot;&gt;security&lt;/a&gt;  &lt;/p&gt;&lt;p&gt; &lt;strong&gt;Dust&lt;/strong&gt; &lt;a href=&quot;https://docs.dust.tt/docs/access-controls-and-permissions&quot;&gt;permissions&lt;/a&gt;  · &lt;a href=&quot;https://docs.dust.tt/changelog/pods-a-shared-workspace-for-your-team-and-your-agents&quot;&gt;Pods&lt;/a&gt;  &lt;/p&gt;&lt;p&gt; &lt;strong&gt;Buzz&lt;/strong&gt; &lt;a href=&quot;https://github.com/block/buzz&quot;&gt;repository&lt;/a&gt;  · &lt;a href=&quot;https://github.com/block/buzz/blob/main/ARCHITECTURE.md&quot;&gt;architecture&lt;/a&gt;  &lt;/p&gt; &lt;/div&gt; &lt;/details&gt; &lt;/div&gt;  &lt;/div&gt; &lt;h2&gt;Where the category is converging&lt;/h2&gt; &lt;p&gt;These systems agree on more than they disagree:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Useful organizational memory must outlive one chat and one model.&lt;/li&gt; &lt;li&gt;Agents need explicit identities, tools, and bounded access.&lt;/li&gt; &lt;li&gt;People and agents need a shared place to see and continue work.&lt;/li&gt; &lt;li&gt;History and traces matter once agents perform consequential actions.&lt;/li&gt; &lt;li&gt;The worker should be replaceable without erasing the organization’s context.&lt;/li&gt; &lt;/ul&gt; &lt;h2&gt;Where the category still diverges&lt;/h2&gt; &lt;p&gt;The unresolved question is what “shared state” should mean.  An MCP memory layer makes context portable.  A virtual data plane lets agents act on existing systems under defined access controls.  An enterprise workspace makes conversations and sources reusable.  An event log makes every participant and action legible.  A versioned state graph makes organizational change branchable and mergeable.&lt;/p&gt; &lt;p&gt;Those architectural choices determine what a reviewer can inspect.  Review may mean approving a tool call, reading an artifact, inspecting a Git diff, following an event trail, or reconciling a semantic proposal against an accepted operating record.&lt;/p&gt; </content:encoded></item><item><title>What Bayesian inference does, in pictures</title><link>https://simm.is/blog/bayesian-inference-in-pictures/</link><guid isPermaLink="true">https://simm.is/blog/bayesian-inference-in-pictures/</guid><description>A research foundations guide to how probabilistic models turn evidence into distributions and how governed organizational history could support future learning.</description><pubDate>Mon, 08 Jun 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Imagine deciding whether to hire three engineers in Q3 rather than Q4.  A point forecast may hide how uncertain the result is.  This article uses that decision to explain probabilistic programming foundations implemented in &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt; and how a governed organizational record could later support Simmis learning.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A probabilistic model can return a distribution instead of a single estimate.  The distribution describes the futures that the model considers plausible and the relative probability assigned to each one.  Bayesian inference explains how evidence changes that distribution.&lt;/p&gt;
&lt;h2 id=&quot;start-with-what-you-already-believe&quot;&gt;Start with what you already believe&lt;/h2&gt;
&lt;p&gt;Before the system sees the current data, the model begins with a structured representation of uncertainty called the &lt;strong&gt;prior&lt;/strong&gt;.  A prior may reflect earlier evidence, domain knowledge, or an intentionally weak starting assumption.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 200&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;200&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;170&quot; x2=&quot;540&quot; y2=&quot;170&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;20&quot; x2=&quot;60&quot; y2=&quot;170&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;path d=&quot;M 60,170 C 100,170 130,168 170,155 C 210,142 240,110 300,98 C 360,86 390,110 430,142 C 460,158 490,168 540,170&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot; stroke-dasharray=&quot;6 3&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 60,170 C 100,170 130,168 170,155 C 210,142 240,110 300,98 C 360,86 390,110 430,142 C 460,158 490,168 540,170 Z&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.07&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;300&quot; y=&quot;88&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--text-dim)&quot; opacity=&quot;0.7&quot;&gt;prior&lt;/text&gt;
  &lt;text x=&quot;64&quot; y=&quot;185&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.5&quot;&gt;low&lt;/text&gt;
  &lt;text x=&quot;510&quot; y=&quot;185&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.5&quot;&gt;high&lt;/text&gt;
  &lt;text x=&quot;300&quot; y=&quot;192&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.5&quot;&gt;value of unknown quantity&lt;/text&gt;
  &lt;text x=&quot;40&quot; y=&quot;100&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.5&quot; transform=&quot;rotate(-90 40 100)&quot;&gt;probability&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;The wide prior represents substantial uncertainty before the model considers the current evidence.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A wide prior assigns meaningful probability to many values.  A narrow prior concentrates probability within a smaller range.  Either may be defensible when its assumptions are explicit.  The prior records what the model assumes before it considers the current evidence.&lt;/p&gt;
&lt;p&gt;Some decision support tools leave their starting assumptions implicit.  Bayesian analysis requires the modeller to state those assumptions as a prior and then update them in light of evidence.  That requirement makes the starting point available for inspection and challenge.&lt;/p&gt;
&lt;h2 id=&quot;data-changes-the-distribution&quot;&gt;Data changes the distribution&lt;/h2&gt;
&lt;p&gt;Now observations, measurements, or historical outcomes enter the model.  The model evaluates how well each possible value of the unknown could have produced those observations.  That relationship between the data and the possible values is the &lt;strong&gt;likelihood&lt;/strong&gt;.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 220&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;220&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;175&quot; x2=&quot;540&quot; y2=&quot;175&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;20&quot; x2=&quot;60&quot; y2=&quot;175&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;path d=&quot;M 60,175 C 100,175 130,173 170,160 C 210,147 240,115 300,103 C 360,91 390,115 430,147 C 460,163 490,173 540,175&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.5&quot; fill=&quot;none&quot; stroke-dasharray=&quot;5 3&quot; opacity=&quot;0.35&quot;&gt;&lt;/path&gt;
  &lt;circle cx=&quot;310&quot; cy=&quot;174&quot; r=&quot;4&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;325&quot; cy=&quot;174&quot; r=&quot;4&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;318&quot; cy=&quot;174&quot; r=&quot;4&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;298&quot; cy=&quot;174&quot; r=&quot;4&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;335&quot; cy=&quot;174&quot; r=&quot;4&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;290&quot; cy=&quot;174&quot; r=&quot;4&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.4&quot;&gt;&lt;/circle&gt;
  &lt;circle cx=&quot;342&quot; cy=&quot;174&quot; r=&quot;4&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.4&quot;&gt;&lt;/circle&gt;
  &lt;path d=&quot;M 60,175 C 150,175 230,174 270,168 C 290,162 305,130 318,65 C 330,130 342,162 360,168 C 400,174 480,175 540,175&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 270,168 C 290,162 305,130 318,65 C 330,130 342,162 360,168 Z&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.09&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;318&quot; y=&quot;55&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.8&quot;&gt;likelihood&lt;/text&gt;
  &lt;text x=&quot;200&quot; y=&quot;140&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.4&quot;&gt;prior (unchanged)&lt;/text&gt;
  &lt;text x=&quot;318&quot; y=&quot;196&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.6&quot;&gt;data&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;The data clusters around one region.  The likelihood peaks where the candidate values fit those observations most closely.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The likelihood measures fit rather than belief.  For each possible value of the unknown, it describes how probable the observed data would be under that value.&lt;/p&gt;
&lt;h2 id=&quot;the-update&quot;&gt;The update&lt;/h2&gt;
&lt;p&gt;Multiplying the prior by the likelihood and normalizing the result produces the &lt;strong&gt;posterior&lt;/strong&gt;, which represents the updated distribution after observing the data.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 220&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;220&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;175&quot; x2=&quot;540&quot; y2=&quot;175&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;20&quot; x2=&quot;60&quot; y2=&quot;175&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;path d=&quot;M 60,175 C 100,175 130,173 170,160 C 210,147 240,115 300,103 C 360,91 390,115 430,147 C 460,163 490,173 540,175&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; stroke-dasharray=&quot;5 3&quot; opacity=&quot;0.2&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 60,175 C 150,175 230,174 270,168 C 290,162 305,130 318,65 C 330,130 342,162 360,168 C 400,174 480,175 540,175&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; opacity=&quot;0.2&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 60,175 C 160,175 240,174 278,170 C 296,165 308,138 318,50 C 328,138 340,165 358,170 C 400,174 480,175 540,175&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2.5&quot; fill=&quot;none&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 278,170 C 296,165 308,138 318,50 C 328,138 340,165 358,170 Z&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.12&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;318&quot; y=&quot;40&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;11&quot; fill=&quot;var(--c-learn)&quot;&gt;posterior&lt;/text&gt;
  &lt;line x1=&quot;70&quot; y1=&quot;205&quot; x2=&quot;90&quot; y2=&quot;205&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.5&quot; stroke-dasharray=&quot;5 3&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;94&quot; y=&quot;208&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.5&quot;&gt;prior&lt;/text&gt;
  &lt;line x1=&quot;140&quot; y1=&quot;205&quot; x2=&quot;160&quot; y2=&quot;205&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.5&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;164&quot; y=&quot;208&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.5&quot;&gt;likelihood&lt;/text&gt;
  &lt;line x1=&quot;240&quot; y1=&quot;205&quot; x2=&quot;260&quot; y2=&quot;205&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2.5&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;264&quot; y=&quot;208&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-learn)&quot;&gt;posterior&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;In this example, the posterior is narrower and shifts towards the data cluster.  The prior and likelihood both influence its shape.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Informative evidence can make the posterior narrower than the prior when the model is well specified.  The posterior may also remain wide, shift, or become more complex.  In this example, it is centred near the data cluster but retains some influence from the prior.  Prior knowledge remains in the calculation, with its influence determined by both the prior and the likelihood.&lt;/p&gt;
&lt;h2 id=&quot;why-a-distribution-beats-a-number&quot;&gt;Why a distribution beats a number&lt;/h2&gt;
&lt;p&gt;A point forecast might say, “Q3 velocity will be 82 story points.”  A Bayesian model could instead estimate that Q3 velocity will most likely fall between 78 and 86 story points, with a 12% chance of falling below 65 if onboarding runs long.&lt;/p&gt;
&lt;p&gt;That 12% tail is part of the result.  A decision based only on the point estimate would omit a scenario that the model assigns meaningful probability.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 200&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;200&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;160&quot; x2=&quot;540&quot; y2=&quot;160&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;path d=&quot;M 60,160 C 130,160 180,159 220,154 C 250,148 270,125 295,70 C 308,42 315,32 320,32 C 325,32 332,42 345,70 C 370,125 390,148 420,154 C 460,159 510,160 540,160&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 220,154 C 250,148 270,125 295,70 C 308,42 315,32 320,32 C 325,32 332,42 345,70 C 370,125 390,148 420,154 Z&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.08&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 60,160 C 130,160 180,159 220,154 Z&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.15&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 60,160 C 130,160 180,159 220,154&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.5&quot; fill=&quot;none&quot; opacity=&quot;0.5&quot;&gt;&lt;/path&gt;
  &lt;line x1=&quot;320&quot; y1=&quot;20&quot; x2=&quot;320&quot; y2=&quot;160&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; stroke-dasharray=&quot;4 3&quot; opacity=&quot;0.5&quot;&gt;&lt;/line&gt;
  &lt;circle cx=&quot;320&quot; cy=&quot;32&quot; r=&quot;4&quot; fill=&quot;var(--text)&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;line x1=&quot;200&quot; y1=&quot;30&quot; x2=&quot;200&quot; y2=&quot;160&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1&quot; stroke-dasharray=&quot;2 3&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;320&quot; y=&quot;16&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-dim)&quot; opacity=&quot;0.7&quot;&gt;most likely value&lt;/text&gt;
  &lt;text x=&quot;125&quot; y=&quot;145&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.7&quot;&gt;12% chance&lt;/text&gt;
  &lt;text x=&quot;125&quot; y=&quot;157&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.7&quot;&gt;below threshold&lt;/text&gt;
  &lt;text x=&quot;200&quot; y=&quot;24&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.5&quot;&gt;risk threshold&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;The point estimate omits the left tail, which this model assigns a 12% probability.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div class=&quot;callout&quot;&gt;
&lt;strong&gt;Illustrative future Simmis output&lt;/strong&gt;
A sufficiently specified model could estimate a 73% probability of reaching the October release, given the current data.  It might also identify the compliance review window as a larger modelled risk than engineering throughput.  The estimate would combine prior assumptions about the team with current velocity data and known blockers.
&lt;/div&gt;
&lt;h2 id=&quot;sequential-updating&quot;&gt;Sequential updating&lt;/h2&gt;
&lt;p&gt;Bayesian updating can proceed sequentially.  Today’s posterior becomes tomorrow’s prior.  Each relevant observation may sharpen or shift a well specified model.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 180&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;180&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;40&quot; y1=&quot;150&quot; x2=&quot;560&quot; y2=&quot;150&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;path d=&quot;M 40,150 C 70,150 90,148 110,140 C 130,132 145,118 165,112 C 185,106 195,108 210,112 C 225,118 240,132 260,140 C 280,148 300,150 330,150&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.5&quot; fill=&quot;none&quot; opacity=&quot;0.3&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;185&quot; y=&quot;100&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.4&quot;&gt;start&lt;/text&gt;
  &lt;path d=&quot;M 200,150 C 240,150 265,149 280,143 C 292,137 300,118 315,90 C 325,118 332,137 345,143 C 360,149 385,150 430,150&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.5&quot; fill=&quot;none&quot; opacity=&quot;0.45&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;315&quot; y=&quot;80&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.5&quot;&gt;after week 1&lt;/text&gt;
  &lt;path d=&quot;M 280,150 C 310,150 325,149 332,145 C 338,140 342,122 348,72 C 354,122 358,140 364,145 C 371,149 386,150 420,150&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2&quot; fill=&quot;none&quot; opacity=&quot;0.7&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 332,145 C 338,140 342,122 348,72 C 354,122 358,140 364,145 Z&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.08&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;348&quot; y=&quot;62&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.7&quot;&gt;after week 4&lt;/text&gt;
  &lt;path d=&quot;M 330,150 C 360,150 368,149 372,146 C 376,143 379,132 382,48 C 385,132 388,143 392,146 C 396,149 404,150 440,150&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;2.5&quot; fill=&quot;none&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 372,146 C 376,143 379,132 382,48 C 385,132 388,143 392,146 Z&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.14&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;382&quot; y=&quot;38&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-learn)&quot;&gt;after week 8&lt;/text&gt;
  &lt;path d=&quot;M 90,30 C 180,15 270,10 360,15&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; stroke-dasharray=&quot;3 3&quot; opacity=&quot;0.3&quot; marker-end=&quot;url(#arr)&quot;&gt;&lt;/path&gt;
  &lt;defs&gt;
    &lt;marker id=&quot;arr&quot; markerWidth=&quot;6&quot; markerHeight=&quot;5&quot; refX=&quot;5&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 6,2.5 L 0,5&quot; fill=&quot;none&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;0.8&quot; opacity=&quot;0.3&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
  &lt;/defs&gt;
  &lt;text x=&quot;200&quot; y=&quot;22&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.35&quot;&gt;informative data, narrower posterior&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;In this example, each week of informative observations narrows the posterior while the earlier evidence remains part of the update.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Sequential updating treats new data as evidence about the modelled world.  After eight weeks of sprint data, the model may have a sharper estimate of the team’s velocity distribution than it had at week one, assuming the observations remain relevant and the model remains suitable.&lt;/p&gt;
&lt;p&gt;A wide posterior can also reveal that the model’s conclusion is fragile.  That result may accurately represent limited evidence rather than a failed calculation.  The appropriate answer may be that the available data does not support a confident estimate and that specified new evidence could narrow it.&lt;/p&gt;
&lt;h2 id=&quot;what-this-looks-like-in-code&quot;&gt;What this looks like in code&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/replikativ/foerster&quot;&gt;Foerster&lt;/a&gt; implements these probabilistic programming foundations on top of &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt;, where they began.  A probabilistic model uses two additional effects.  &lt;code&gt;sample&lt;/code&gt; draws from a prior, and &lt;code&gt;observe&lt;/code&gt; conditions on evidence.  Foerster descends from the Anglican line of probabilistic programming.  These primitives inform the future Simmis learning layer.  They do not describe universal behaviour in the current product.&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;require(&apos;[org.replikativ.foerster.core :as infer],
  &apos;[org.replikativ.foerster.effects :refer [sample observe]],
  &apos;[org.replikativ.foerster.dist :refer [beta flip]],
  &apos;[org.replikativ.spindel.core :as sp :refer [spin await]])

;; Programs run in a Spindel world, an execution context.
def world: sp/create-execution-context()

;; A credence we cannot read off directly, such as &quot;the debt came due&quot;,
;; starting from a prior and updated by each item in the record.
defn came-due []:
  spin(let [p sample(beta(2, 2))]:
         observe(flip(p), true)
         observe(flip(p), true)
         observe(flip(p), false)
         p
       end)
end

;; Inference returns a posterior distribution rather than a verdict.
sp/with-context(world,
  @spin(infer/query(await(infer/importance-sampling(came-due(), 5000)),
          identity)))
;; =&gt; {:mean 0.57 :std-dev 0.17 ...}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(require &apos;[org.replikativ.foerster.core :as infer]
         &apos;[org.replikativ.foerster.effects :refer [sample observe]]
         &apos;[org.replikativ.foerster.dist :refer [beta flip]]
         &apos;[org.replikativ.spindel.core :as sp :refer [spin await]])

;; Programs run in a Spindel world, an execution context.
(def world (sp/create-execution-context))

;; A credence we cannot read off directly, such as &quot;the debt came due&quot;,
;; starting from a prior and updated by each item in the record.
(defn came-due []
  (spin
    (let [p (sample (beta 2 2))]   ; prior over the credence
      (observe (flip p) true)      ; invoice dated and delivered
      (observe (flip p) true)      ; the agreed payment window elapsed
      (observe (flip p) false)     ; respondent disputes the due date
      p)))

;; Inference returns a posterior distribution rather than a verdict.
(sp/with-context world
  @(spin (infer/query (await (infer/importance-sampling (came-due) 5000))
                      identity)))
;; =&gt; {:mean 0.57 :std-dev 0.17 ...}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The same &lt;code&gt;sample&lt;/code&gt; and &lt;code&gt;observe&lt;/code&gt; structure supports forward simulation or inference conditioned on real data.  It also informs the &lt;a href=&quot;https://simm.is/law&quot;&gt;legal dispute simulator&lt;/a&gt;, where each disputed element carries a credence like &lt;code&gt;p&lt;/code&gt; above and the verdict is read from the posterior.&lt;/p&gt;
&lt;p&gt;Bayesian inference gives a model a disciplined way to update a distribution when evidence arrives.  A posterior does not make uncertainty automatically trustworthy.  Its usefulness still depends on the model assumptions, the quality of the evidence, and the inference method.&lt;/p&gt;
&lt;p&gt;For Simmis, the nearer term prerequisite is a governed record of the basis, attempt, decision, and outcome.  That history could later support learning about which agents, procedures, assumptions, and decisions work under specified conditions.&lt;/p&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;van de Meent, Paige, Yang &amp;#x26; Wood, &lt;em&gt;An Introduction to Probabilistic Programming&lt;/em&gt; (2018).  &lt;a href=&quot;https://arxiv.org/abs/1809.10756&quot;&gt;arXiv:1809.10756&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The importance sampling, SMC, particle MCMC, MCMC, and BBVI inference algorithms live in &lt;a href=&quot;https://github.com/replikativ/foerster&quot;&gt;Foerster&lt;/a&gt;; &lt;a href=&quot;https://simm.is/blog/write-the-model-once&quot;&gt;Write the model once, choose the inference later&lt;/a&gt; walks through them on one model.&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title>Copy-on-write branching: why isolated attempts can stay cheap</title><link>https://simm.is/blog/copy-on-write-branching/</link><guid isPermaLink="true">https://simm.is/blog/copy-on-write-branching/</guid><description>How structural sharing records only what changed and why that matters when people and agents work in parallel.</description><pubDate>Fri, 08 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Suppose two agents test the same hiring decision from the same company record.  If each attempt copies every unchanged record, isolation becomes expensive before either agent does useful work.  This article explains the copy on write foundation behind cheap, isolated branches through one question.  Should we hire three engineers in Q3 rather than Q4?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When an application forks state managed by Simmis, it need not copy the entire database.  The branch shares unchanged structure with its basis, records what diverges, and can be discarded when the attempt ends.&lt;/p&gt;
&lt;p&gt;The data structure underneath makes this possible and determines what a fork costs.  Understanding that structure also clarifies which costs structural sharing does not remove.&lt;/p&gt;
&lt;h2 id=&quot;why-full-copies-become-expensive&quot;&gt;Why full copies become expensive&lt;/h2&gt;
&lt;p&gt;Many databases optimize their ordinary interface around mutable current state.  A naive branching design then creates a full copy for each isolated scenario, with work proportional to the dataset size.  Branching a table with one million rows would copy one million rows under that design.&lt;/p&gt;
&lt;p&gt;Production databases can also provide snapshots, multiversion concurrency control, or storage level copy on write.  A full copy is therefore not the only alternative.  The relevant comparison is between materializing every unchanged value and sharing unchanged structure deliberately.&lt;/p&gt;
&lt;p&gt;Teams often approximate isolated scenarios by running them in sequence, restoring earlier state, or duplicating spreadsheets and workbooks.  Those approaches may work for small analyses, but the manual reconciliation burden grows as scenarios touch more records and depend on one another.&lt;/p&gt;
&lt;h2 id=&quot;immutability-changes-what-a-fork-stores&quot;&gt;Immutability changes what a fork stores&lt;/h2&gt;
&lt;p&gt;Persistent data structures create new values while retaining the old ones.  Multiple versions can therefore refer to the same unchanged structure.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;hash array mapped trie&lt;/strong&gt; (HAMT) is a common example.  Phil Bagwell introduced the structure in &lt;em&gt;Ideal Hash Trees&lt;/em&gt; (2001), and Clojure uses HAMTs for its persistent collections.  Leaves hold data, while internal nodes route lookups.  The diagram below simplifies that structure.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 260&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;260&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;rect x=&quot;265&quot; y=&quot;20&quot; width=&quot;70&quot; height=&quot;32&quot; rx=&quot;5&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.5&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;300&quot; y=&quot;40&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-dim)&quot;&gt;root&lt;/text&gt;
  &lt;rect x=&quot;140&quot; y=&quot;90&quot; width=&quot;70&quot; height=&quot;32&quot; rx=&quot;5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;175&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;node A&lt;/text&gt;
  &lt;rect x=&quot;390&quot; y=&quot;90&quot; width=&quot;70&quot; height=&quot;32&quot; rx=&quot;5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;425&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--text-faint)&quot;&gt;node B&lt;/text&gt;
  &lt;line x1=&quot;285&quot; y1=&quot;52&quot; x2=&quot;205&quot; y2=&quot;90&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;315&quot; y1=&quot;52&quot; x2=&quot;395&quot; y2=&quot;90&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;rect x=&quot;60&quot; y=&quot;170&quot; width=&quot;70&quot; height=&quot;32&quot; rx=&quot;5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.5&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;95&quot; y=&quot;190&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.7&quot;&gt;val: 12&lt;/text&gt;
  &lt;rect x=&quot;210&quot; y=&quot;170&quot; width=&quot;70&quot; height=&quot;32&quot; rx=&quot;5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.5&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;245&quot; y=&quot;190&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.7&quot;&gt;val: 47&lt;/text&gt;
  &lt;rect x=&quot;315&quot; y=&quot;170&quot; width=&quot;70&quot; height=&quot;32&quot; rx=&quot;5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.5&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;350&quot; y=&quot;190&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.7&quot;&gt;val: 83&lt;/text&gt;
  &lt;rect x=&quot;465&quot; y=&quot;170&quot; width=&quot;70&quot; height=&quot;32&quot; rx=&quot;5&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.5&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.8&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;500&quot; y=&quot;190&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot;&gt;val: 31&lt;/text&gt;
  &lt;line x1=&quot;155&quot; y1=&quot;122&quot; x2=&quot;110&quot; y2=&quot;170&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;195&quot; y1=&quot;122&quot; x2=&quot;230&quot; y2=&quot;170&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;405&quot; y1=&quot;122&quot; x2=&quot;360&quot; y2=&quot;170&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;445&quot; y1=&quot;122&quot; x2=&quot;490&quot; y2=&quot;170&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;500&quot; y=&quot;222&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.7&quot;&gt;target leaf&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;A simplified persistent trie.  Lookups traverse from root to leaf.  Nodes are never modified.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;To update one leaf, the persistent structure creates a &lt;strong&gt;new path&lt;/strong&gt; from the root to that leaf.  It copies only the nodes along the path, while the new and old roots both refer to unchanged nodes.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 300&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;300&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;140&quot; y=&quot;16&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.6&quot;&gt;original&lt;/text&gt;
  &lt;rect x=&quot;105&quot; y=&quot;24&quot; width=&quot;70&quot; height=&quot;28&quot; rx=&quot;5&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.5&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;140&quot; y=&quot;42&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-dim)&quot;&gt;root&lt;/text&gt;
  &lt;rect x=&quot;40&quot; y=&quot;86&quot; width=&quot;60&quot; height=&quot;28&quot; rx=&quot;5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;70&quot; y=&quot;104&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;node A&lt;/text&gt;
  &lt;rect x=&quot;175&quot; y=&quot;86&quot; width=&quot;60&quot; height=&quot;28&quot; rx=&quot;5&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1.2&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;205&quot; y=&quot;104&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;node B&lt;/text&gt;
  &lt;line x1=&quot;130&quot; y1=&quot;52&quot; x2=&quot;85&quot; y2=&quot;86&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;150&quot; y1=&quot;52&quot; x2=&quot;195&quot; y2=&quot;86&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; opacity=&quot;0.4&quot;&gt;&lt;/line&gt;
  &lt;rect x=&quot;18&quot; y=&quot;152&quot; width=&quot;60&quot; height=&quot;26&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.5&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;48&quot; y=&quot;169&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;12&lt;/text&gt;
  &lt;rect x=&quot;95&quot; y=&quot;152&quot; width=&quot;60&quot; height=&quot;26&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.5&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;125&quot; y=&quot;169&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;47&lt;/text&gt;
  &lt;rect x=&quot;155&quot; y=&quot;152&quot; width=&quot;60&quot; height=&quot;26&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.5&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;185&quot; y=&quot;169&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot;&gt;83&lt;/text&gt;
  &lt;rect x=&quot;230&quot; y=&quot;152&quot; width=&quot;60&quot; height=&quot;26&quot; rx=&quot;4&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.5&quot; fill=&quot;var(--bg-card)&quot; opacity=&quot;0.7&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;260&quot; y=&quot;169&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot;&gt;31 ← old&lt;/text&gt;
  &lt;line x1=&quot;55&quot; y1=&quot;114&quot; x2=&quot;42&quot; y2=&quot;152&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;0.8&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;80&quot; y1=&quot;114&quot; x2=&quot;110&quot; y2=&quot;152&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;0.8&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;190&quot; y1=&quot;114&quot; x2=&quot;180&quot; y2=&quot;152&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;0.8&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;220&quot; y1=&quot;114&quot; x2=&quot;250&quot; y2=&quot;152&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;0.8&quot; opacity=&quot;0.3&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;460&quot; y=&quot;16&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.8&quot;&gt;fork (new nodes only)&lt;/text&gt;
  &lt;rect x=&quot;425&quot; y=&quot;24&quot; width=&quot;70&quot; height=&quot;28&quot; rx=&quot;5&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.8&quot; fill=&quot;var(--bg-card)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;460&quot; y=&quot;42&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot;&gt;root&apos;&lt;/text&gt;
  &lt;rect x=&quot;490&quot; y=&quot;86&quot; width=&quot;65&quot; height=&quot;28&quot; rx=&quot;5&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.8&quot; fill=&quot;var(--bg-card)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;522&quot; y=&quot;104&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot;&gt;node B&apos;&lt;/text&gt;
  &lt;rect x=&quot;490&quot; y=&quot;152&quot; width=&quot;65&quot; height=&quot;26&quot; rx=&quot;4&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.8&quot; fill=&quot;var(--bg-card)&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;522&quot; y=&quot;169&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot;&gt;99 ← new&lt;/text&gt;
  &lt;line x1=&quot;470&quot; y1=&quot;52&quot; x2=&quot;510&quot; y2=&quot;86&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.5&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;522&quot; y1=&quot;114&quot; x2=&quot;522&quot; y2=&quot;152&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.5&quot;&gt;&lt;/line&gt;
  &lt;path d=&quot;M 440 52 C 380 70 140 78 95 86&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; stroke-dasharray=&quot;4 3&quot; opacity=&quot;0.4&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 502 114 C 420 130 240 140 200 152&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;1&quot; stroke-dasharray=&quot;4 3&quot; opacity=&quot;0.35&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;300&quot; y=&quot;68&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.45&quot;&gt;shared (pointer)&lt;/text&gt;
  &lt;text x=&quot;360&quot; y=&quot;138&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.4&quot;&gt;shared (pointer)&lt;/text&gt;
  &lt;text x=&quot;460&quot; y=&quot;220&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.8&quot;&gt;3 new nodes.  All other data shared.&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Path copying: only the root, one internal node, and one new leaf are allocated.  Everything else is referenced by pointer from the original tree.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Creating another branch reference can be constant time.  The first update on that branch allocates nodes along a path of depth d rather than copying every row.  The exact depth and cost depend on the implementation, hash width, branching factor, and changed values.&lt;/p&gt;
&lt;h2 id=&quot;what-this-means-for-parallel-controlled-work&quot;&gt;What this means for parallel controlled work&lt;/h2&gt;
&lt;p&gt;In a mutable database, isolated scenarios require copies or another isolation mechanism.  In a persistent database, separate forks can share most of their unchanged structure.  Incremental storage grows with divergent changes and retained paths rather than a full copy of every unchanged value.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 240&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;240&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;line x1=&quot;60&quot; y1=&quot;120&quot; x2=&quot;200&quot; y2=&quot;120&quot; stroke=&quot;var(--text)&quot; stroke-width=&quot;3&quot; stroke-linecap=&quot;round&quot; opacity=&quot;0.5&quot;&gt;&lt;/line&gt;
  &lt;text x=&quot;60&quot; y=&quot;108&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.6&quot;&gt;base model&lt;/text&gt;
  &lt;circle cx=&quot;200&quot; cy=&quot;120&quot; r=&quot;6&quot; fill=&quot;var(--text)&quot; opacity=&quot;0.4&quot;&gt;&lt;/circle&gt;
  &lt;path d=&quot;M 200,120 C 240,120 260,75 310,62 L 530,40&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;
  &lt;circle cx=&quot;530&quot; cy=&quot;40&quot; r=&quot;4&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.8&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;540&quot; y=&quot;44&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot;&gt;Q3 hire&lt;/text&gt;
  &lt;path d=&quot;M 200,120 C 240,120 260,130 310,140 L 530,155&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;2&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/path&gt;
  &lt;circle cx=&quot;530&quot; cy=&quot;155&quot; r=&quot;4&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.8&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;540&quot; y=&quot;159&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot;&gt;Q4 hire&lt;/text&gt;
  &lt;circle cx=&quot;360&quot; cy=&quot;56&quot; r=&quot;4&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;path d=&quot;M 360,56 C 380,56 395,80 420,90 L 530,100&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.5&quot; stroke-dasharray=&quot;4 3&quot; stroke-linecap=&quot;round&quot; opacity=&quot;0.5&quot;&gt;&lt;/path&gt;
  &lt;circle cx=&quot;530&quot; cy=&quot;100&quot; r=&quot;3&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;540&quot; y=&quot;104&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.6&quot;&gt;Q3 + staggered&lt;/text&gt;
  &lt;circle cx=&quot;390&quot; cy=&quot;148&quot; r=&quot;4&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;path d=&quot;M 390,148 C 410,148 420,175 450,185 L 530,195&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.5&quot; stroke-dasharray=&quot;4 3&quot; stroke-linecap=&quot;round&quot; opacity=&quot;0.5&quot;&gt;&lt;/path&gt;
  &lt;circle cx=&quot;530&quot; cy=&quot;195&quot; r=&quot;3&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;540&quot; y=&quot;199&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.6&quot;&gt;Q4 + contractor&lt;/text&gt;
  &lt;rect x=&quot;60&quot; y=&quot;90&quot; width=&quot;145&quot; height=&quot;60&quot; rx=&quot;4&quot; stroke=&quot;var(--text-faint)&quot; stroke-width=&quot;0.8&quot; stroke-dasharray=&quot;3 3&quot; fill=&quot;none&quot; opacity=&quot;0.2&quot;&gt;&lt;/rect&gt;
  &lt;text x=&quot;132&quot; y=&quot;165&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.4&quot;&gt;shared structure&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Four scenarios branch from the same base model.  Creating a branch reference can be constant time, while later updates allocate only their changed paths.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;For Simmis, this property supports multiple human and agent attempts while accepted managed state remains unchanged.  Each branch can be queried independently and shares the structure it has not changed.  The system can therefore support more attempts per decision without duplicating the full managed dataset or allowing each attempt to collide with the accepted record.&lt;/p&gt;
&lt;h2 id=&quot;forking-computation-as-well-as-data&quot;&gt;Forking computation as well as data&lt;/h2&gt;
&lt;p&gt;Data is only one part of a running attempt.  &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt;, the reactive runtime in the stack, applies a related copy on write idea to &lt;em&gt;running computation&lt;/em&gt;.  An execution context containing signals, cached results, and continuations is a value that the runtime can fork in constant time.&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;require(&apos;[org.replikativ.spindel.core :as s :refer [signal spin track]],
  &apos;[org.replikativ.spindel.incremental.interval :as iv])

def root: s/create-execution-context()
s/with-context root:
  def hires: signal(2)
  def velocity: spin:
    13 * iv/get-new(track(hires))
  end
end

def q3: s/fork-context(root)
s/with-context q3:
  swap!(hires, +, 3)
end
;; root still sees 2 hires; q3 sees 5, and both remain live&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(require &apos;[org.replikativ.spindel.core :as s :refer [signal spin track]]
         &apos;[org.replikativ.spindel.incremental.interval :as iv])

(def root (s/create-execution-context))
(s/with-context root
  (def hires    (signal 2))
  (def velocity (spin (* 13 (iv/get-new (track hires))))))  ; 13 pts/engineer

(def q3 (s/fork-context root))          ; fork the live model in O(1)
(s/with-context q3 (swap! hires + 3))   ; only this branch hires in Q3
;; root still sees 2 hires; q3 sees 5, and both remain live&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A scenario can pair a branched dataset with a branched execution context whose reactive computations remain connected and run again only where a dependency changed.  The scope remains limited to registered state managed by Simmis.  It does not include every external system or live process.  &lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt; documents database branching in depth, while Spindel applies the idea to the execution layer.&lt;/p&gt;
&lt;p&gt;The experimental &lt;a href=&quot;https://simm.is/blog/a-repl-you-can-fork&quot;&gt;REPL you can fork&lt;/a&gt; applies a different tradeoff to SCI’s interpreter state.  It copies dense runtime slots at a quiescent fork so ordinary Var and atom access can remain the common optimized path.&lt;/p&gt;
&lt;h2 id=&quot;the-git-analogy-holds&quot;&gt;The git analogy holds&lt;/h2&gt;
&lt;p&gt;Git provides a familiar analogy.  A commit refers to a tree of content addressed objects rather than storing a new full copy of the codebase.  A branch is a named reference to a commit, so creating or moving that reference does not copy every file.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt;, the database at the bottom of the &lt;a href=&quot;https://github.com/replikativ/simmis&quot;&gt;Simmis&lt;/a&gt; stack, applies this idea to data.  Every transaction creates a new root pointer into an immutable tree.  Named heads can refer to different roots, and a historical query reads the tree rooted at the selected snapshot.&lt;/p&gt;
&lt;div class=&quot;callout&quot;&gt;
&lt;strong&gt;Copy-on-write in the stack&lt;/strong&gt;
[Datahike](https://datahike.io/) handles the structured knowledge graph.  [Stratum](https://github.com/replikativ/stratum) handles columnar analytics.  Both use copy on write persistence.  A fork can initially refer to existing structure, while an update allocates its changed path.  The path may remain small compared with the full dataset, but total storage still grows with divergent changes and retained branches.
&lt;/div&gt;
&lt;h2 id=&quot;why-clojure&quot;&gt;Why Clojure&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://github.com/replikativ/simmis&quot;&gt;Simmis&lt;/a&gt; stack is written in Clojure, where standard vectors, maps, and sets are persistent collections by default.  Updating one of those values creates a new value that shares unchanged structure with the old value.  This default makes the model described above part of ordinary application code.&lt;/p&gt;
&lt;p&gt;Other languages also provide immutable or persistent collections.  Haskell makes immutable data fundamental, and Scala includes persistent collections in its standard library.  Clojure is useful here because persistent collections are its ordinary default and its concurrency primitives build on immutable values.  Rich Hickey designed the language around separating identity from value and time from state.  &lt;a href=&quot;https://datahike.io/&quot;&gt;Datahike&lt;/a&gt;, &lt;a href=&quot;https://github.com/replikativ/stratum&quot;&gt;Stratum&lt;/a&gt;, and &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt; apply that distinction to the knowledge graph, columnar analytics, and reactive execution layers.&lt;/p&gt;
&lt;p&gt;The distributed boundary introduces another constraint.  When state spans multiple machines, network partitions force tradeoffs among consistency and availability.  &lt;a href=&quot;https://github.com/replikativ/yggdrasil&quot;&gt;Yggdrasil&lt;/a&gt;, our coordination layer, targets causal consistency so that effects follow their recorded causes across nodes.  Within one node, immutable snapshots support reproducible reads.  Across nodes, results also depend on causal histories and convergence.  We treat this as an explicit architectural seam.&lt;/p&gt;
&lt;h2 id=&quot;the-deeper-organizational-implication&quot;&gt;The deeper organizational implication&lt;/h2&gt;
&lt;p&gt;When forking stays cheap, teams do not need to serialize every attempt through one shared workspace.  People and agents can branch when a new approach is worth testing, including from another branch.&lt;/p&gt;
&lt;p&gt;This changes the cost of controlled exploration.  More alternatives can run in parallel, while only an accepted proposal changes the accepted record.  Unwanted attempts can end without first undoing changes to shared state.&lt;/p&gt;
&lt;p&gt;Persistent data structures can therefore support more attempts per decision while preserving one accepted record.  Their practical value still depends on how the surrounding system handles review, merge, retention, and external state.&lt;/p&gt;</content:encoded></item><item><title>Reading a causal graph: what your model knows</title><link>https://simm.is/blog/reading-a-causal-graph/</link><guid isPermaLink="true">https://simm.is/blog/reading-a-causal-graph/</guid><description>A research foundations guide to how causal graphs represent interventions and how governed organizational history could support future prediction.</description><pubDate>Wed, 08 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;Our research has implemented causal modelling primitives in &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt;.  This article examines how they represent causal assumptions and how prediction could later build on a governed organizational record.  We follow one running decision throughout.  Should we hire three engineers in Q3 rather than Q4?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Two things can be correlated without either causing the other.  Ice cream sales and drowning deaths both rise in summer.  Heat contributes to both patterns, while ice cream sales do not explain the drowning deaths.  A policy that targeted ice cream sales would therefore mistake correlation for cause.&lt;/p&gt;
&lt;p&gt;This distinction matters when a team asks what would happen after a decision.  The historical question asks what tended to happen when hiring rose.  The decision question asks what would happen to velocity if the team hired three engineers in Q3.  The second question requires causal assumptions about the intervention.&lt;/p&gt;
&lt;p&gt;Causal graphs are how this research encodes the difference.&lt;/p&gt;
&lt;h2 id=&quot;what-a-causal-graph-is&quot;&gt;What a causal graph is&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;directed acyclic graph&lt;/strong&gt; (DAG) contains nodes, which represent variables, and directed edges, which represent assumed causal relationships.  The graph contains no directed cycles.  An arrow from A to B states that A directly influences B within the model.  The arrow is an assumption to test and challenge, not proof by itself.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 220&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;220&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;defs&gt;
    &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.5&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arrowhead-g&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-model)&quot; opacity=&quot;0.7&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arrowhead-a&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.7&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arrowhead-b&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.7&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
  &lt;/defs&gt;
  &lt;circle cx=&quot;150&quot; cy=&quot;100&quot; r=&quot;36&quot; fill=&quot;none&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.5&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;150&quot; y=&quot;97&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.9&quot;&gt;season&lt;/text&gt;
  &lt;text x=&quot;150&quot; y=&quot;111&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.6&quot;&gt;(confounder)&lt;/text&gt;
  &lt;circle cx=&quot;340&quot; cy=&quot;50&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.5&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;340&quot; y=&quot;54&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--c-model)&quot; opacity=&quot;0.9&quot;&gt;price&lt;/text&gt;
  &lt;circle cx=&quot;340&quot; cy=&quot;150&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.5&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;340&quot; y=&quot;154&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--c-model)&quot; opacity=&quot;0.9&quot;&gt;demand&lt;/text&gt;
  &lt;circle cx=&quot;510&quot; cy=&quot;100&quot; r=&quot;34&quot; fill=&quot;none&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.5&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;510&quot; y=&quot;96&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.9&quot;&gt;revenue&lt;/text&gt;
  &lt;text x=&quot;510&quot; y=&quot;110&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-learn)&quot; opacity=&quot;0.6&quot;&gt;(outcome)&lt;/text&gt;
  &lt;path d=&quot;M 185,91 L 309,58&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arrowhead-a)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 185,109 L 310,142&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arrowhead-a)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 370,54 L 478,88&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arrowhead-g)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 370,146 L 477,113&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arrowhead-g)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 340,80 L 340,118&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arrowhead-g)&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;247&quot; y=&quot;103&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.5&quot;&gt;causes both&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;A simple DAG.  Season affects both price and demand, so it confounds the effect of price on demand.  Price affects demand, and both affect revenue.  The arrow direction records the model&apos;s causal assumptions.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Observed prices and demand move together partly because season affects both, so their correlation does not measure what price does to demand.  An intervention that sets price to a specific value removes the modelled influence of season on price.  The remaining graph can then support an estimate of the effect of price on demand and revenue, assuming its structure and parameters are adequate.&lt;/p&gt;
&lt;h2 id=&quot;confounders-why-correlation-misleads&quot;&gt;Confounders: why correlation misleads&lt;/h2&gt;
&lt;p&gt;A &lt;strong&gt;confounder&lt;/strong&gt; is a variable that causally influences both an apparent cause and an apparent effect.  X and Y may then move together because both are downstream of Z, even when X does not cause Y.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 200&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;200&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;defs&gt;
    &lt;marker id=&quot;arr2&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.4&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arr2r&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.6&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
  &lt;/defs&gt;
  &lt;circle cx=&quot;300&quot; cy=&quot;50&quot; r=&quot;28&quot; fill=&quot;none&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.5&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;300&quot; y=&quot;54&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;10&quot; fill=&quot;var(--c-collaborate)&quot;&gt;heat&lt;/text&gt;
  &lt;circle cx=&quot;140&quot; cy=&quot;155&quot; r=&quot;32&quot; fill=&quot;none&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;140&quot; y=&quot;150&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-dim)&quot;&gt;ice cream&lt;/text&gt;
  &lt;text x=&quot;140&quot; y=&quot;164&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-dim)&quot;&gt;sales&lt;/text&gt;
  &lt;circle cx=&quot;460&quot; cy=&quot;155&quot; r=&quot;32&quot; fill=&quot;none&quot; stroke=&quot;var(--text-dim)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;460&quot; y=&quot;150&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-dim)&quot;&gt;drowning&lt;/text&gt;
  &lt;text x=&quot;460&quot; y=&quot;164&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-dim)&quot;&gt;rate&lt;/text&gt;
  &lt;path d=&quot;M 275,72 L 168,136&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arr2)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 325,72 L 432,136&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arr2)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 172,152 L 428,152&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.5&quot; stroke-dasharray=&quot;5 3&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arr2r)&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;300&quot; y=&quot;116&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.6&quot;&gt;spurious correlation&lt;/text&gt;
  &lt;text x=&quot;300&quot; y=&quot;128&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.5&quot;&gt;(no causal path)&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;Heat affects both ice cream sales and drowning rates.  In this model, their correlation does not represent a causal effect from ice cream sales to drownings.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Business data often contains the same problem.  Teams that hold more retrospectives may ship faster, but team maturity could influence both.  Marketing spend may correlate with revenue because spending raises revenue, because revenue enables spending, or because another variable affects both.  A causal graph requires the modeller to state which direction each assumed influence runs.&lt;/p&gt;
&lt;h2 id=&quot;intervention-the-do-operator&quot;&gt;Intervention: the do-operator&lt;/h2&gt;
&lt;p&gt;Judea Pearl introduced the &lt;strong&gt;do operator&lt;/strong&gt; to formalize the difference between observing and intervening (Pearl, &lt;em&gt;Causality&lt;/em&gt;, 2009, with an accessible account in &lt;em&gt;The Book of Why&lt;/em&gt;, 2018).  &lt;code&gt;P(Y | X=x)&lt;/code&gt; is the probability of Y given that we &lt;em&gt;observe&lt;/em&gt; X equals x.  &lt;code&gt;P(Y | do(X=x))&lt;/code&gt; is the probability of Y when we &lt;em&gt;set&lt;/em&gt; X to x, regardless of the variables that would otherwise have caused X.&lt;/p&gt;
&lt;p&gt;Within the model, intervening on X cuts its incoming arrows and sets its value.  This operation removes the modelled influence of confounders on X.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 240&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;240&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;defs&gt;
    &lt;marker id=&quot;arr3&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.4&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arr3g&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-model)&quot; opacity=&quot;0.7&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arr3v&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.8&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
  &lt;/defs&gt;
  &lt;text x=&quot;150&quot; y=&quot;20&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.7&quot;&gt;observing price&lt;/text&gt;
  &lt;circle cx=&quot;80&quot; cy=&quot;80&quot; r=&quot;26&quot; fill=&quot;none&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;80&quot; y=&quot;84&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot;&gt;season&lt;/text&gt;
  &lt;circle cx=&quot;200&quot; cy=&quot;80&quot; r=&quot;26&quot; fill=&quot;none&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;200&quot; y=&quot;84&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-model)&quot;&gt;price&lt;/text&gt;
  &lt;circle cx=&quot;200&quot; cy=&quot;170&quot; r=&quot;26&quot; fill=&quot;none&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;200&quot; y=&quot;174&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-learn)&quot;&gt;demand&lt;/text&gt;
  &lt;path d=&quot;M 106,80 L 172,80&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arr3)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 82,106 L 178,158&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arr3)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 200,106 L 200,144&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arr3)&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;450&quot; y=&quot;20&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.9&quot;&gt;do(price = high)&lt;/text&gt;
  &lt;circle cx=&quot;380&quot; cy=&quot;80&quot; r=&quot;26&quot; fill=&quot;none&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.4&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;380&quot; y=&quot;84&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.4&quot;&gt;season&lt;/text&gt;
  &lt;circle cx=&quot;500&quot; cy=&quot;80&quot; r=&quot;26&quot; fill=&quot;none&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;2&quot; opacity=&quot;0.9&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;500&quot; y=&quot;77&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot;&gt;price&lt;/text&gt;
  &lt;text x=&quot;500&quot; y=&quot;91&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.7&quot;&gt;= high&lt;/text&gt;
  &lt;circle cx=&quot;500&quot; cy=&quot;170&quot; r=&quot;26&quot; fill=&quot;none&quot; stroke=&quot;var(--c-learn)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.6&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;500&quot; y=&quot;174&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-learn)&quot;&gt;demand&lt;/text&gt;
  &lt;path d=&quot;M 406,80 L 472,80&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1&quot; stroke-dasharray=&quot;4 3&quot; opacity=&quot;0.3&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;437&quot; y=&quot;73&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;14&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.7&quot;&gt;✕&lt;/text&gt;
  &lt;path d=&quot;M 382,106 L 478,158&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.35&quot; marker-end=&quot;url(#arr3)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 500,106 L 500,144&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.5&quot; opacity=&quot;0.7&quot; marker-end=&quot;url(#arr3v)&quot;&gt;&lt;/path&gt;
  &lt;text x=&quot;500&quot; y=&quot;218&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.7&quot;&gt;season no longer confounds&lt;/text&gt;
  &lt;text x=&quot;500&quot; y=&quot;230&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.5&quot;&gt;the price → demand relationship&lt;/text&gt;
&lt;/svg&gt;
&lt;figcaption&gt;The left graph observes price while season still affects it.  The right graph sets price and removes the edge from season to price, which isolates the modelled causal effect.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The do operator distinguishes an observational prediction from a modelled intervention.  A prediction that revenue will be high when prices are high conditions on an observation.  A claim that revenue will increase if the company raises prices requires an interventional distribution and the causal assumptions that support it.&lt;/p&gt;
&lt;h3 id=&quot;the-do-operator-in-code&quot;&gt;The do-operator, in code&lt;/h3&gt;
&lt;p&gt;In &lt;a href=&quot;https://github.com/replikativ/foerster&quot;&gt;Foerster&lt;/a&gt;, the inference library built on &lt;a href=&quot;https://github.com/replikativ/spindel&quot;&gt;Spindel&lt;/a&gt;, &lt;code&gt;intervene!&lt;/code&gt; implements the do operator as a first class effect.  It pins a node and severs its incoming edges in the model.&lt;/p&gt;
&lt;div class=&quot;code-dual&quot;&gt;
&lt;div class=&quot;code-dual-tabs&quot;&gt;
&lt;button class=&quot;code-dual-tab active&quot; data-lang=&quot;superficie&quot;&gt;Superficie&lt;/button&gt;
&lt;button class=&quot;code-dual-tab&quot; data-lang=&quot;clojure&quot;&gt;Clojure&lt;/button&gt;
&lt;a class=&quot;code-dual-what&quot; href=&quot;https://github.com/replikativ/superficie&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;What is this syntax?&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel active&quot; data-lang=&quot;superficie&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-superficie&quot;&gt;require(&apos;[org.replikativ.foerster.effects :refer [observe intervene!]])

;; Two different questions about the same model:
;;   observe asks, &quot;given the claim succeeded, was the agreement on file?&quot;
;;   do(...) asks, &quot;if we FILE the agreement, does the claim succeed?&quot;
spin(intervene!([:evidence :loan-agreement], true),
  adjudicate(debt-test, record))&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;code-dual-panel&quot; data-lang=&quot;clojure&quot;&gt;
&lt;pre&gt;&lt;code class=&quot;language-clojure&quot;&gt;(require &apos;[org.replikativ.foerster.effects :refer [observe intervene!]])

;; Two different questions about the same model:
;;   observe asks, &quot;given the claim succeeded, was the agreement on file?&quot;
;;   do(...) asks, &quot;if we FILE the agreement, does the claim succeed?&quot;
(spin
  (intervene! [:evidence :loan-agreement] true)  ; do(file the agreement)
  (adjudicate debt-test record))                  ; outcome under the action&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This mechanism also underlies the &lt;a href=&quot;https://simm.is/law&quot;&gt;legal dispute simulator research&lt;/a&gt;.  The “produce the signed loan agreement” button represents a &lt;code&gt;do()&lt;/code&gt; intervention on the evidence, and the displayed win probability comes from the resulting interventional distribution.&lt;/p&gt;
&lt;h2 id=&quot;what-the-model-encodes&quot;&gt;What the model encodes&lt;/h2&gt;
&lt;p&gt;Simmis research represents a modelled domain as a DAG.  Nodes are quantities such as headcount, velocity, burn rate, release dates, and compliance review windows.  Edges are causal assumptions proposed from domain knowledge, historical data, and observed patterns in how an organization works.&lt;/p&gt;
&lt;figure&gt;
&lt;svg viewBox=&quot;0 0 600 260&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
  &lt;rect width=&quot;600&quot; height=&quot;260&quot; fill=&quot;var(--bg)&quot;&gt;&lt;/rect&gt;
  &lt;defs&gt;
    &lt;marker id=&quot;arr4&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--text-faint)&quot; opacity=&quot;0.4&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arr4r&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.7&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
    &lt;marker id=&quot;arr4s&quot; markerWidth=&quot;8&quot; markerHeight=&quot;6&quot; refX=&quot;7&quot; refY=&quot;3&quot; orient=&quot;auto&quot;&gt;
      &lt;path d=&quot;M 0,0 L 8,3 L 0,6 Z&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.7&quot;&gt;&lt;/path&gt;
    &lt;/marker&gt;
  &lt;/defs&gt;
  &lt;circle cx=&quot;90&quot; cy=&quot;135&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.8&quot; opacity=&quot;0.8&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;90&quot; y=&quot;131&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot;&gt;hire&lt;/text&gt;
  &lt;text x=&quot;90&quot; y=&quot;143&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-verify)&quot;&gt;timing&lt;/text&gt;
  &lt;text x=&quot;90&quot; y=&quot;183&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.6&quot;&gt;do(Q3)&lt;/text&gt;
  &lt;text x=&quot;90&quot; y=&quot;25&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-verify)&quot; opacity=&quot;0.6&quot;&gt;intervention&lt;/text&gt;
  &lt;circle cx=&quot;300&quot; cy=&quot;80&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;300&quot; y=&quot;76&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot;&gt;onboarding&lt;/text&gt;
  &lt;text x=&quot;300&quot; y=&quot;88&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot;&gt;load&lt;/text&gt;
  &lt;circle cx=&quot;300&quot; cy=&quot;190&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.7&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;300&quot; y=&quot;186&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-model)&quot;&gt;eng&lt;/text&gt;
  &lt;text x=&quot;300&quot; y=&quot;198&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-model)&quot;&gt;velocity&lt;/text&gt;
  &lt;circle cx=&quot;490&quot; cy=&quot;80&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.3&quot; opacity=&quot;0.5&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;490&quot; y=&quot;76&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.7&quot;&gt;compliance&lt;/text&gt;
  &lt;text x=&quot;490&quot; y=&quot;88&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-collaborate)&quot; opacity=&quot;0.7&quot;&gt;review&lt;/text&gt;
  &lt;circle cx=&quot;490&quot; cy=&quot;190&quot; r=&quot;30&quot; fill=&quot;none&quot; stroke=&quot;var(--c-simulate)&quot; stroke-width=&quot;1.8&quot; opacity=&quot;0.8&quot;&gt;&lt;/circle&gt;
  &lt;text x=&quot;490&quot; y=&quot;186&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot;&gt;release&lt;/text&gt;
  &lt;text x=&quot;490&quot; y=&quot;198&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;9&quot; fill=&quot;var(--c-simulate)&quot;&gt;date&lt;/text&gt;
  &lt;text x=&quot;490&quot; y=&quot;240&quot; text-anchor=&quot;middle&quot; font-family=&quot;&amp;#x27;IBM Plex Mono&amp;#x27;, monospace&quot; font-size=&quot;8&quot; fill=&quot;var(--c-simulate)&quot; opacity=&quot;0.6&quot;&gt;outcome&lt;/text&gt;
  &lt;path d=&quot;M 119,127 L 270,88&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#arr4r)&quot;&gt;&lt;/path&gt;
  &lt;path d=&quot;M 119,143 L 270,182&quot; stroke=&quot;var(--c-verify)&quot; stroke-width=&quot;1.4&quot; opacity=&quot;0.6&quot; marker-end=&quot;url(#arr4r)&quot;&gt;&lt;/path&gt;
  &lt;line x1=&quot;300&quot; y1=&quot;110&quot; x2=&quot;300&quot; y2=&quot;160&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.4&quot; marker-end=&quot;url(#arr4)&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;490&quot; y1=&quot;110&quot; x2=&quot;490&quot; y2=&quot;160&quot; stroke=&quot;var(--c-collaborate)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.4&quot; marker-end=&quot;url(#arr4)&quot;&gt;&lt;/line&gt;
  &lt;line x1=&quot;330&quot; y1=&quot;190&quot; x2=&quot;460&quot; y2=&quot;190&quot; stroke=&quot;var(--c-model)&quot; stroke-width=&quot;1.2&quot; opacity=&quot;0.5&quot; marker-end=&quot;url(#arr4)&quot;&gt;&lt;/line&gt;
&lt;/svg&gt;
&lt;figcaption&gt;A domain model for the hiring question.  Hire timing affects onboarding load and velocity under the model&apos;s assumptions.  Compliance review provides another path to the release date.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;With suitable parameters and evidence, this graph could support an estimate that the compliance review constrains the release more than engineering capacity.  The graph alone cannot establish that conclusion.  It only shows that hire timing affects the release through modelled paths while compliance review provides another path.&lt;/p&gt;
&lt;div class=&quot;callout&quot;&gt;
&lt;strong&gt;What the model doesn&apos;t know&lt;/strong&gt;
A causal model can use only the structure supplied by the modeller or estimated through a supported discovery method.  Missing edges can omit causal paths, while incorrect edges can create false ones.  The graph makes those assumptions inspectable.  A reviewer can challenge edges, add domain knowledge, and examine how the inference changes.  The explicit structure does not guarantee a correct answer, but it shows where causal assumptions enter the result.
&lt;/div&gt;
&lt;h2 id=&quot;why-this-changes-what-if&quot;&gt;Why this changes “what if”&lt;/h2&gt;
&lt;p&gt;Many forecasting tools find patterns in observational data and project them forward.  Those patterns may support predictions when the data generating process remains stable.  They do not by themselves identify what a deliberate intervention will cause.&lt;/p&gt;
&lt;p&gt;Answering an interventional question therefore requires causal assumptions.  A sufficiently specified and identified model can estimate consequences for the interventions represented within it, and a decision support system should make those assumptions inspectable.&lt;/p&gt;
&lt;p&gt;In this research framing, the Q3 hiring question calls for &lt;code&gt;P(release date | do(hire timing = Q3))&lt;/code&gt; rather than &lt;code&gt;P(release date | hire timing = Q3)&lt;/code&gt;.  The interventional quantity corresponds to the modelled decision.&lt;/p&gt;
&lt;p&gt;For Simmis, prediction remains a later use of the governed organizational record.  The nearer term control loop preserves the basis, attempt, decision, and outcome from which organizational models could later be built and challenged.&lt;/p&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Pearl, &lt;em&gt;Causality: Models, Reasoning, and Inference&lt;/em&gt; (2nd ed., 2009).  The formal treatment.&lt;/li&gt;
&lt;li&gt;Pearl &amp;#x26; Mackenzie, &lt;em&gt;The Book of Why&lt;/em&gt; (2018).  The accessible introduction.&lt;/li&gt;
&lt;li&gt;The do operator as a runtime effect.  See &lt;a href=&quot;https://github.com/replikativ/foerster&quot;&gt;&lt;code&gt;intervene!&lt;/code&gt; in Foerster&lt;/a&gt; (&lt;code&gt;src/org/replikativ/foerster/effects.cljc&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Revised in November 2026 for precision.&lt;/em&gt;&lt;/p&gt;</content:encoded></item></channel></rss>