Skip to content

state_exec: threaded execution Stage S, several steps a pick (slices) - #1192

Merged
transfix merged 26 commits into
masterfrom
perf/threaded-ss
Nov 14, 2026
Merged

transfix merged 26 commits into
masterfrom
perf/threaded-ss

Conversation

@transfix

@transfix transfix commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Threaded execution Stage S (docs/STATE_EXEC_THREADED.md 4.4; plan state-exec-perf/threaded-impl/S2.md, decisions S2-Q1..S2-Q17, approved 2026-11-12): a pick in the async scheduler runs up to slice_steps steps of its process, a run, on one step's guards, clock reading and accounting. 1, the default, is today's loop exactly. Hosts opt in (Q10).

Status: implemented, reviewed, review findings fixed (each with a failing-first test), and tested on Windows. A skeptic pass checked the fixes; its one new finding is fixed too. The A/B needs a quiet window made by hand.

What changes

  • Settings.
    • async_scheduler::set_slice(steps, seconds), slice_steps() and slice_seconds().
    • The tree's state_exec.slice_steps and state_exec.slice_seconds, read at a run's start when a setting may have changed, unless set_slice was called.
    • CVC_EXEC_SLICE_STEPS, read whenever a scheduler is made, with no process-wide copy.
    • exec_group::options::slice_steps and slice_seconds.
  • Runs. At 1, run_loop takes step_once as before. Above 1, step_run runs up to slice_steps steps, counted in charged steps and clipped to the run's step budget. The run lives in execute_process_step behind max_run > 1, so the step body is shared.
    • Every step ends the run on: a park or other status change, max_steps, a post from another thread (message, completion, control, lock post), a stop, a reap, a better priority level made ready (process_table::begin_run/preempted), or a pending signal or watch event.
    • Every 16th step, one clock reading ends it past slice_seconds (only when the run loop has a time budget, so runs on steps alone stay deterministic), the run's budget, the process's time, a due timer, or an async call in flight.
    • One step a pick, always, for a process with max_step_time (its per-step guard) or max_memory (its heap is measured step by step; a run let a short action allocate past its budget before any measurement began). Ariadne's residents and actions therefore gain nothing yet. A heap accounting per run is a follow-up.
    • Accounting. A run charges CPU with each step's cap scaled by its steps. It splits its seconds over step kinds by count, and its steps count in total_steps_ and the 64-step cycle check.
  • Tests:
    • Slices.SL01-SL10, written from the plan by a separate test writer;
    • state_exec_async_test_slice256, the whole async suite again at CVC_EXEC_SLICE_STEPS=256;
    • Groups.OC01 pins slice_steps 1, since it asserts round robin's completion order.
  • Bench:
    • slice_steps on sched.single.* and limits.*;
    • sched.slice_fair (fairness, and step_time=on showing a max_step_time process keeps one step a pick);
    • limits.ariadne;
    • compare --geomean-better PCT;
    • a CTest pin that steps_total at 256 equals 1.
  • Docs: STATE_EXEC_THREADED.md 4.4, 4.10, 4.19, 5 (item 16, opt-in), 6.2, 6.3, 7 and 8.10; the developer guide's section on runs; STATE_EXEC_BENCH.md.

Measured

The spike (SS.0, a loaded box, not a quiet window) took 46% fewer ns/step at 256 than at 1. That is a geomean over 17 sched.single points, with ratios from 0.37 to 0.82, against the plan's 20% go gate. steps_total was identical on every point.

Tests (Windows, MSVC Release), each at the default and at CVC_EXEC_SLICE_STEPS=256

Suite Passed
state_exec_async 125
ariadne_runtime 262
intrinsics 181
async_calls 72
locks 209
priority 40
exceptions 26
data_steps 54
hazards 12
exec_pool 33
integration 104
lifetime stress 16
scheduler (sync, unchanged) 199
groups 28

CTest also passes state_exec_bench_gates, state_exec_bench_smoke, state_exec_bench_tool_test (49), state_exec_async_test_slice256 and ariadne_runtime_test_slice256.

Review round 1

One adversarial agent reviewed the branch with both lenses. Each fix below comes with a test that failed against the unfixed library (Slices.SL11-SL17, and additions to SL-10):

  • M1: runs of a multiple of 4 skipped the 64-step cycle check. A leaking loop at 256 tracked 48762 objects; it now stays under 4000, as at 1.
  • M2: a run whose first step readied a better process was not preempted: 255 more steps were taken. Fixed by begin_run before the first step.
  • M3: a runner whose own level worsened mid-run (a lock release that drops an inherited boost, a self set-priority) ran on. process_table now remembers the runner and ends the run on such a relevel.
  • M4: max_memory processes now take one step a pick (fixed in 2e2bab9, before the review's report).
  • M5: max_time's CPU half was not checked mid-run, so a steps-only pump at set_slice(1000000, inf) was killed at exactly 2,000,000 steps. CPU is now read at the run's clock checks.
  • M6: costly steps overran slice_seconds and stretched the pump's budget. The clock is now read at run steps 2, 4, 8 and 16, then every 16, and time_budget::spent(now, checks) credits the unchecked steps.
  • Minors:
    • a run counts the step that throws;
    • a call in flight ends a run only when its charge is due;
    • set_slice_steps and set_slice_seconds each lock out only their own tree setting;
    • the tree settings revert when deleted, are parsed strictly, and 0 means 1 ms;
    • the docs say "the best priority level is run within one step", not "strict";
    • ariadne_runtime_test_slice256 joins CTest;
    • SL-1 pins step counts and completion order;
    • SL-5 counts a posted kill from when it becomes visible.

Skeptic pass

A fresh agent re-read the 13 review fixes and found every one sound and pinned by its test. It found one more gap that had been there since the first commit:

  • max_messages and max_message_bytes were never checked mid-run, so a sender in a 256-step run sent 28 messages against a limit of 5. A run now checks both before each step (SL-18 failed first).
  • Also fixed: a run that throws keeps its earlier steps' time in the stats.
  • Now documented: the per-step CPU cap applies to a run's total, and a process's own call in flight is charged only at the 1 ms beat.

Still to do before merge

  • CI on Linux, macOS and wasm.
  • The A/B in a quiet window: the paired --geomean-better 20 gate, and the default path within 3% of master.

docs/STATE_EXEC_THREADED.md 4.4's slices, as threaded-impl/S2.md S2-Q12
plans them (SS.1-SS.3).

- async_scheduler::set_slice(steps, seconds), slice_steps(),
  slice_seconds(). The tree's state_exec.slice_steps and slice_seconds are
  read at a run's start when a setting may have changed, unless set_slice
  was called. CVC_EXEC_SLICE_STEPS gives the default, read whenever a
  scheduler is made, with no process-wide copy. exec_group::options gains
  slice_steps and slice_seconds.
- At slice_steps 1, the default, run_loop takes step_once: today's loop.
  Above it, a pick (step_run) runs up to slice_steps steps of its process,
  counted in charged steps and clipped to the run's step budget, on one
  step's guards, clock reading and accounting. The run lives in
  execute_process_step behind max_run > 1, so the step body is shared.
  - It ends early at a park or other status change, max_steps, a post from
    another thread, a stop, a reap, a better priority level made ready, or a
    pending signal or watch event.
  - Every 16th step it reads the clock once and ends past slice_seconds
    (only when the run loop has a time budget, so runs on steps alone stay
    deterministic), the run's budget, the process's time, a due timer, an
    async call in flight, or max_memory.
  - A process with max_step_time keeps one step a pick.
- A run charges its CPU time with each step's cap scaled by its steps, and
  splits its seconds over its steps' kinds by count. Its steps count in
  total_steps_ and toward the 64-step cycle check.
- process_table::begin_run/end_run/preempted: a process enqueued at a
  strictly better level than the runner's ends the run.

The spike (SS.0) measured 46% fewer ns/step at 256 against 1 on
sched.single.
Groups.OC01 asserts round robin's completion order, which a 256-step run (CVC_EXEC_SLICE_STEPS) changes, so its groups set slice_steps 1. sched.single.* gains slice_steps (1 by default; smoke 1 and 256), set on the world's async scheduler.
STATE_EXEC_THREADED.md 4.4, 4.10, 4.19, 5 (item 16), 6.2, 6.3, 7 and 8.10 describe runs as built: the settings and their precedence, what ends a run, the accounting, the opt-in semantics changes, the paired gate, and SL-1..SL-10. The developer guide gains a section on runs and the four meanings of slice. set_slice's comment names what the code checks: an async call in flight, and seconds only with a time budget.
…-better (SS.5)

Threaded execution Stage S's bench (state-exec-perf/threaded-impl/S2.md, SS.5): the
measurements and the gate for runs of several steps a pick on the async scheduler. Needs
SS.1's async_scheduler::set_slice(steps, seconds) to build.

- slice_steps on sched.single.*'s async points: the steps one pick may run of the process.
  1 by default (set_slice is called only above 1, so the default points are today's), 1 and
  256 in the smoke run, swept with --size slice_steps=1,16,64,256,1024. Also on limits.*'s
  async points, where limits.max_step_time at 256 is the max_step_time point (one step a pick
  at any slice_steps). Values that are not a step count of 1 or more are skipped.
- sched.slice_fair: three equal endless loops under round robin, sched.scaling's measurement
  (now a shared helper), at slice_steps 1 and 256, recording extra.fairness and
  extra.process_steps_spread; step_time=on arms max_step_time on each loop, where the spread
  should stay at 1 or less at 256 too.
- limits.ariadne: the arith_loop process under Ariadne's action limits as ariadne.cpp arms
  them (max_steps 5000, max_time 0.1 s, max_memory 4 MiB), n 150 (4070 steps) so it finishes
  under them.
- compare --geomean-better PCT: per metric, the geomean over the matched points (with --pair,
  the pairs) of the candidate's median over the base's, printed with the pair count; exit 0
  at or under 1 - PCT/100, 1 above it or when a point failed on either side, is missing, or a
  scenario is unpaired, 2 when --max-noise finds a pair too noisy. Tests on synthetic records.
- slice_steps=1 is an implicit default, so records from binaries without the key match.
- state_exec_bench_gates pins sched.single.arith_loop's and tail_rec's steps_total at
  slice_steps 256 to the numbers at 1.
- docs/STATE_EXEC_BENCH.md: the key, the points, the rule, and the Stage S gates
  (compare POOLED POOLED --pair slice_steps=1:256 --geomean-better 20).
Slices.* in state_exec_async_test.cpp, written from S2's section 4 and
SS.1's interface: one-step runs equal to today's loop (results, step
counts, completion order, a pump-grain trace), exact max_steps, max_time
and max_step_time at 256 (the latter one step a pick), self, slot and
posted kills, a watch firing at the next run, preemption at a better
level (a send and a due sleeper), runs counting charged steps, runs ending
at slice_seconds, and the settings' precedence (env, tree, set_slice,
exec_group options). Step and tick counts only; nothing is timed.

A CTest entry, state_exec_async_test_slice256, runs the suite with
CVC_EXEC_SLICE_STEPS=256, leaving out the nine cases that step a short
program one sync_step() at a time (each tagged "Stage S").
sync_step() stays one step (runs are run_loop's), so no case of state_exec_async_test needs leaving out of the CVC_EXEC_SLICE_STEPS=256 run: all 117 pass at 1 and at 256.
Its heap is measured and charged step by step (heap_after_step: steps and allocations counted per step, a measurement started when due, its result applied). A run called it once, at its end, so a short action that allocates fast finished before any measurement began: AriadneHeap.AnActionsLiveValuesCountAgainstItsBudget failed at CVC_EXEC_SLICE_STEPS=256. Such a process now runs one step a pick, as one with max_step_time does, and the run's 16-step max_memory check goes. Ariadne's actions and residents therefore gain nothing from runs yet; a heap accounting per run is a follow-up.
execute_process_step checked (++cycle_check_ & 63) once a pick, and step_run added the run's other steps after it, so with runs of 256 the count moved by a multiple of 64 a pick and the check never fired while a process ran on: a loop leaking a cycle an iteration grew its registry without bound. When the count passes a multiple of 64 after a run's first step, step_run now makes the check (and the collection, when due) between picks, after a normal return.

Slices.SL11_RunsReachTheCycleCheck: an endless leaking loop alone at 256 on steps alone, 40 pumps of 25600 steps; the registry tracked 48762 objects before the fix, and stays under 4000 (as at 1).
procs_.begin_run was called in continue_run, after the run's first step_now, so a first step that readied a better process (a msg-send to a parked better one) raised the flag before the run began, and begin_run then cleared it: the runner ran on for the rest of its run. execute_process_step now calls begin_run before the first step when max_run is above 1, with end_run in a guard over however the step ends, and continue_run no longer does.

Slices.SL12_ARunsFirstStepPreempts: SL-7's message case with the send as the first step of a pick (the worse process stepped one step a pick up to the step before it). Before the fix the worse process ran on 255 steps, 50 ticks, before the better one ran; now the better one runs right after the send.
run_level_ was fixed at begin_run, so a runner whose effective priority got worse mid-run ran on past processes now better than it: (set-priority 10) on itself while another was ready at 5, and a lock release that dropped an inherited boost (the same-home relevel applies at once, while the woken waiter enqueues at the runner's old level, which is not strictly better). process_table now remembers the runner (begin_run sets it, end_run clears it); update() re-levelling it to a worse key raises preempted_, and to a better one moves run_level_ there.

Slices.SL13_TheRunnersOwnLevelGettingWorsePreempts, under the priority policy at 256 against 1: the self set-priority case (34 runner ticks before the better process ran, before the fix) and the inherited-boost release (41 holder ticks before the waiter ran); now none, as at 1.
At a run's 16-step reads, over_time_limit(t) compared cpu_time_charged, which a run updates only at its end, and charge_cpu was fixed at the run's start; the deadline guard does not cut a run of plain eval steps either, since step_now checks no deadline between steps. So a run went on past max_time to its end, and a process whose first half ran out mid-run was charged no CPU for that run at all. continue_run now takes charge_cpu and cpu0, and at each read with max_time set: a process that did not charge CPU at the run's start but would now ends the run (the next pick charges it); one that charges reads thread_cpu_seconds() and ends the run once cpu_time_charged plus the run's CPU so far, capped at run_steps * max_time / 32 as the end's charge is, reaches half of max_time.

The docs no longer say the deadline guard bounds a run: STATE_EXEC_THREADED.md 4.4 and 4.10, and the developer guide's Stage S counting.

Slices.SL14_MaxTimesCpuHalfEndsARun: set_slice(1000000) on steps alone, sync_run() with no time budget, an endless loop with max_time 0.005 s. Killed with time_limit_exceeded at 2000000 steps before the fix (two whole runs); now well under 1000000.
…e pump's budget

A run read the clock first at its step 16, so data steps of 0.05-0.4 ms made runs of 0.8-6.4 ms at slice_seconds 1 ms. And time_budget::spent credits at most half/16 of steady time per call in its CPU half, which a run called once per 16 steps, so a pump's time budget stretched about tenfold. Now:
- continue_run reads the clock after the run's steps 2, 4, 8 and 16, then every 16th;
- time_budget gets spent(now, checks), which counts the gaps of the checks it stands for as that many gaps (gap(now, gaps), as stop(checks) does); spent(now) is spent(now, 1), unchanged for every other caller;
- each reading passes the steps since the last check, and the steps a run took after its last reading go to the run loop's next check (run_unchecked_, 1 at one step a pick, so slice_steps 1 is unchanged).

The docs say where the readings are and how the budget is charged (td 4.4 and 4.10, the developer guide, set_slice's comment), and no longer list max_memory among the readings' checks (such a process runs one step a pick since 2e2bab9).

Slices.SL15_CostlyStepsEndRunsOnTime, with SL-9's deep compares, counted not timed: at set_slice(1000000, 1e-9) in pumps of 8 steps with a time budget, both of two processes advance in every pump (before: one took all 8 each pump); at set_slice(1000000) on steps alone, a pump of 2e-9 s takes under 128 steps (before: 256 or 272).
continue_run added one to run_steps_ after step_now returned, so a step that threw in the middle of a run was left out of the scheduler's step total and the 64-step cycle count, where step_once counts it. It now counts each step before running it.

Slices.SL16_AThrowingStepIsCounted: a loop, then a call of an unbound name that throws mid-run at 256; get_stats().total_steps was 1614 against 1615 at 1 before the fix, and is now equal.
The comment said each step's share of a run's CPU time is capped as one step's is. The cap is steps * max_time / 32 on the run's total, so one long step in a run may charge more than it could alone. The comment, and the one at its call, say so. No code change.
Any async call in flight ended a run at its clock reading, whether or not a drain had anything to do for it, so a process that left an unlimited call running (a future it never awaited) cut every run of the scheduler short. The reading now compares next_call_charge, counted from the run's pick (when the drain charged the calls), with the reading: a call's timeout, or the 1 ms charge beat of a process with a step or time limit; it passes over the calls of ended processes. The comments and docs that said "an async call in flight" say "a due charge" (set_slice, continue_run, td 4.4, the developer guide).

Slices.SL17_ACallInFlightEndsARunOnlyWhenDue: a process with a call in flight (no timeout, no limit) that ticks forever, beside another loop, at 256 on steps alone; in pumps of 64 steps both advanced before the fix (each run ended at its first reading), and now one does.
…nly its tree setting

An exec_group given only slice_seconds called set_slice with the scheduler's steps, and set_slice's one flag stopped the tree's state_exec.slice_steps from ever applying. async_scheduler gets set_slice_steps and set_slice_seconds, each with its own flag, and set_slice calls both; refresh_slice reads each tree setting whose flag is clear, and exec_group calls only what it was given. Header comments and docs (td 4.4, its files list and SL-10's row, the developer guide) follow.

Slices.SL10_SliceSettingsPrecedence: a group given only slice_seconds takes the tree's slice_steps (64, then 48 after a change), and one given only slice_steps the tree's slice_seconds; before the fix they kept 1 and 0.001. set_slice_steps and set_slice_seconds alone likewise.
…strictly, 0 or less is 1 ms

refresh_slice left a deleted tree key's last value in force, read slice_seconds with stod (so "2ms" was 2 seconds, and "0.002s" 0.002), and refused 0 or less where set_slice takes it as 1 ms. Now a key that is missing (never set, or deleted) or empty gives the default: CVC_EXEC_SLICE_STEPS as the scheduler was made (kept in slice_steps_default_), else 1, and 1 ms. slice_seconds must be a number with nothing around it, not NaN (strtod over the whole value; infinite is allowed and means steps alone); 0 or less means 1 ms. A value refused leaves the one in force, as before. Docs: td 4.4 and SL-10's row, the developer guide.

Slices.SL10_SliceSettingsPrecedence, with CVC_EXEC_SLICE_STEPS 32 and unset: invalid steps ("abc", "0", "-5", "1.5", "12x", " 16") and seconds ("2ms", "abc", "0.002s", " 0.002", "nan") are refused; seconds "0" and "-1" give 1 ms; "inf" gives steps alone; deleting or emptying each key gives the default. Before the fix "2ms" read as 2, "0" and "-1" were refused, and a deleted key kept 64 and 0.004.
The docs said a priority policy stays "strict to within one step" at slice_steps above 1. What holds is that the best level is run within one step (a process readied at a better level, or the runner re-levelled to a worse one, ends the run); the priority policy's lowest-pid tie-break within a level is not kept, since a run goes on while a lower pid at its own level becomes ready. td 4.4, 4.19's Slices and section 5's opt-in list, and the developer guide's run endings and priority policies say so. No code change.
ariadne_runtime_test_slice256 runs the Ariadne runtime suite with CVC_EXEC_SLICE_STEPS=256, beside state_exec_async_test_slice256, so its actions and residents run on schedulers whose runs are 256 steps (those with max_memory or max_step_time still one step a pick). It passes.
…nted from when it is visible

SL-1 compared slice_steps 1 with the default only, so a change to both would pass. It now pins, at 1, each process's step count (12967, 9530, 272), the order they end in (the recursion, the loop, the receiver) and the 235 pumps of 97 steps, recorded on the one-step path (step_once, untouched since a5fbd47).

SL-5's posted kill read the ticks on the poster's thread after post_control returned and allowed 16, a bound a descheduled poster loosened further. Now, at its 1000th tick, the process waits inside that step until the poster's post_control has returned, so the post is visible from there on: the kill is applied with no tick after that one and at most one step more, five times over.
A sender with max_messages 5 must stop at its fifth message at slice 256 as at 1. It fails before the next commit: a run sent 28.
…eps its step time

The skeptic's pass over the review fixes found two more things.

- max_messages and max_message_bytes were never checked mid-run.
  check_limits kills at them after every step at slice 1, and msg-send only
  counts, so a sender in a 256-step run sent 28 messages against a limit of 5
  (SL-18). A run now checks both before each step, as it checks max_steps.
- A run whose step throws (the process is failed or killed) dropped its
  earlier steps' time from the process's stats. It now charges them before
  it ends the process; at slice 1 nothing changes.

The comments on set_slice (the runner's own level getting worse, the
message limits) and refresh_slice (each half's own setter) are brought up
to date.
4.4, 4.10 and 5 item 16 (and the developer guide): the message limits stay exact in a run; the per-step CPU cap applies to a run's total, so one long native step is charged in full; a process's own call in flight is charged at the 1 ms beat, so its max_steps and max_time can overshoot by up to a run while it runs.
@transfix

Copy link
Copy Markdown
Owner Author

Stage S A/B, quiet window (2026-11-12, 16:03 to 16:27 CST)

Per S2.md section 6 and docs/STATE_EXEC_BENCH.md, "Threaded execution's Stage S gates". MSVC Release with --pin auto. Base and candidate were interleaved over 2 rounds of 5 reps. Every kept run passed the quiet check before and after it.

Gate Result
steps_total unchanged (eval.*, sched.single.*, native.*, data.*, limits.*, flood.small sync) PASS
Timing within 3% at the same pin (sched.single.*, flood.*, limits.*) INCONCLUSIVE: all 94 points have rep noise above 3% (median 10 to 14%)
Runs: slice_steps=256 vs 1 on sched.single.* async, both orders pooled, geomean at least 20% better PASS: 0.555 (−44.5%); all 17 pairs are better, each beyond its noise
sched.slice_fair with step_time=on: process_steps_spread ≤ 1 PASS (0)

The timing gate by family

Each cell is the geomean of the candidate/base medians.

Family Round 1 Round 2 Pooled
sched.single −1.0% +6.2% +2.5%
flood −1.1% +3.5% +1.2%
limits +1.9% −0.1% +0.9%

No family is slower beyond 3% in both rounds. The recorded families (msg, native, data, eval, and most of async) pool within ±2.5%. A few small async families swing between rounds, for example async.compute_fanout (3 points, +2.7% then +20.5%) and async.futures (+0.4% then −26.3%).

Recorded: candidate only, slice_steps against 1

Geomean ns_per_step over the 17 sched.single.* async points:

slice_steps 16 64 256 1024
vs 1 −37.0% −42.5% −44.6% −45.0%

At 256 against 1:

Point Change
sched.slice_fair, step_time=off −58.9%
sched.slice_fair, step_time=on −1.7%
limits.max_step_time −1.5%
limits.ariadne −0.1%

steps_total is identical at both settings in every runs and points record.

Verdict

The 3% timing gate is inconclusive, which is not a pass. Taking it as recorded needs a decision, as it did for Stage 0. Every other gate passes.

@transfix

Copy link
Copy Markdown
Owner Author

Decision (2026-11-12): the inconclusive 3% timing gate above is accepted as recorded, as Stage 0's was. With every other gate passing, Stage S's A/B is done. The remaining steps are master (after #1181) and green CI, then the merge.

An Ariadne action's time cap (ariadne.limits.action_max_time, 0.1 s) counts its first half on
the wall clock, so parallel ctest jobs preempting the suite use it up. In the Linux Debug job
the slice256 run started next to state_exec_async_test_slice256 (76 s) and failed all three
attempts: ActionCapsAreTreeSettingsAndChargeAsyncCalls's 200-step loop was killed with
time_limit_exceeded, and NavStepAsAnAsyncFunctionReturnsItsResult's action never resumed.
Debug-grpc and macOS Debug passed it, and the Release suite takes the same time at slice 1
and 256 (ActionCaps 3.05-3.07 s, the suite 20.4-20.6 s, Windows). RUN_SERIAL, as
tf_overlay_tasks_test has for its pump bound.
@transfix
transfix marked this pull request as ready for review November 14, 2026 08:01
@transfix
transfix merged commit 69c7091 into master Nov 14, 2026
26 of 30 checks passed
@transfix
transfix deleted the perf/threaded-ss branch November 14, 2026 08:01
transfix added a commit that referenced this pull request Nov 14, 2026
…ted-gas

#1197 is in master as its squash, so the conflicts were #1197's own lines
against this branch's changes to them: this branch's are kept.

Two compile breaks on master, fixed here as #1203 fixed its own callers:
- ariadne_wasm_browser_test.cpp (#1197) called register_script_engine(engine)
  and unregister_script_engine("wasm"), which #1203 removed: the fixture
  registers nothing, as each test's AppRuntime calls use_script_engine.
- ariadne_runtime_test.cpp (#1180) called load_string(yaml), which #1203
  made load_string(app, yaml): the three calls pass the test's app.
transfix added a commit that referenced this pull request Nov 14, 2026
Master gained #1203 (this branch's base), #1192 (state_exec Stage S,
several steps a pick) and ten others.

Conflicts, both #1192's run code against this branch's registry work:
- async_scheduler.cpp: the slice setters from #1192, set_cycle_registry
  from here (it also gives the evaluator the registry). The cycle check
  takes the registry in the evaluation context (the one given, else its
  evaluator's own) where #1192 fell back to the thread's own, which this
  branch removes; collect_cycles_if_due now takes a registry. A run's
  steps go through the same context as its first; step_run's drain check
  is check_not_in_kernel, as step_once's is.
- state_exec_groups_test.cpp: OC01's caller-pumped case keeps #1192's one
  step a pick and this branch's watched group. The file's note on leaks no
  longer speaks of a thread's own registry.

Semantic, not textual:
- #1192's Slices tests: SL04's spin-step and SL08's heavy take call_args
  and reach their context through it (eval_deadline_check(a.context()),
  a.context()->data), as this branch's other natives do.
- cvc-cli's trace command (#1168) takes its app, and #1180's three
  rich-text tests pass theirs to load_string. Both landed after #1203's
  last master merge and still used what #1203 removed, so master does not
  build at 7ead20e or 69c7091; #1225 makes the same change there.

Checked on Windows (MSVC Release): full build; groups 28/28; Slices and
run-budget tests 19/19; rich text and heap 10/10; the cycle collector and
registry tests, pycvc_ariadne, CvcCliTest.TraceInfoAndVerifyReplayASession
and state_exec_async_test_slice256, 20/20.
transfix added a commit that referenced this pull request Nov 14, 2026
The code merged without conflicts. Stage S's step_run, set_slice and process_table's
begin_run/preempted are as on master. This branch's one change on that path is the ingress post
counter (ingress_posts_for_test), taken in post_message and post_async_completion under the
ingress lock, beside the ingress_pending_ flag that ends a run. A post from another thread still
ends a run within one step.

Two doc conflicts. STATE_EXEC_THREADED.md takes master's Stage S section. STATE_EXEC_BENCH.md
takes master's Stage S gates, without its one-line placeholder for S1b, whose gates this branch
describes just above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant