Repository navigation
state_exec_groups_test: give the oracle's pumps no wall-clock budget - #1418
Merged
Merged
Conversation
GR01 and DT02 compare a group's record (each process's status, steps and outcome) with a steps-only run of the same programs. Under load they failed about once each at CVC_EXEC_SLICE_STEPS=256, because the pumps had a time budget nobody meant them to have: - pump_pooled and check_against_solo's first frame passed the deadline now + 1 h. The pool turns that into a budget of about 3600 s, and with any time budget Stage S cuts a run at state_exec.slice_seconds (1 ms). - bare_world::pump passed kNoTimeLimit (+inf) to sync_run_steps as a present optional, which also counts as a budget. exec_group::pump maps a non-finite budget to none. A thread descheduled mid-run then ends its run early. That reorders a group's processes: a broadcast receiver misses its message and waits forever, or the fork and spawn children swap pids. The solo runs go through exec_group::pump with no budget and are never cut, so the records differ. The pool's pumps now pass time_point::max() (kNoDeadline), which seconds_left reads as infinite, and bare_world::pump maps a non-finite budget to nullopt as exec_group::pump does. GR12's first frame gets the same deadline. GR02 and GR03 share the helpers. Stage S is unchanged.
transfix
added a commit
that referenced
this pull request
Nov 22, 2026
…clock-rate JX2 deleted .github/scripts/pin-wasm-pre-jx1.sh, so this branch's numpy pin goes with it.
transfix
added a commit
that referenced
this pull request
Nov 22, 2026
Brings in master through aa158cc, among it #1395 (the pool's short-changed rule) and #1418 (state_exec_groups_test gives the oracle's pumps no wall-clock budget). Conflicts: - exec_group.h, pump_result: both sides added fields. Kept master's `runnable` and S2a's next_deadline / deadline_precise / best_runnable / awaiting_frame, with one doc comment covering both. - exec_group.cpp, exec_group::pump: `runnable` is read from the scheduler (has_runnable(), O(1)), not from S2a's run report. The report is recomputed only while a wake notifier is installed, and a fork-join group has none, so left.runnable would be stale there, and #1395's short-changed rule reads pump_result::runnable in fork-join pump_entry. The other four fields still come from the report. - exec_pool.h, pool_stats: master's short_changed goes after effective_threads, before S2a's continuous-mode counters. - docs/STATE_EXEC_THREADED.md: the pump_result and pool_stats sketches list both sides' fields. - ci.yml: both sides kept. The clang leg's cxx_tests lists state_exec_coordinator_test and state_exec_stackless_evaluator_test; the env keeps SAN_REQUIRED_S2A and SAN_REQUIRED_NET, and SAN_REQUIRED names both. exec_pool.cpp merged without conflict: #1395's half_span, pumped::short_changed, the pump_entry rule and finish_group's skipped stamp sit beside S2a's give_long_step_default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test-only.
Groups.GR01_EveryGroupEqualsItsSoloRunandGroups.DT02_ThreadsZeroEqualsBareSchedulersfailed about once each atCVC_EXEC_SLICE_STEPS=256on a heavily loaded box. The tests gave their pumps a wall-clock budget by accident, and Stage S did what it is designed to do with one. This PR removes the accidental budget, so the pumps run on steps alone, as the solo runs they are compared with do.The flake predates the threaded S2a work (draft #1404). It reproduces on master, and nothing in S2a is involved.
Cause
state_exec.slice_seconds(1 ms by default) whenever the run loop has any time budget (async_scheduler.cppcontinue_run; the budget is built inrun_loopfor anymax_time, +inf included).pump_pooledandcheck_against_solo's first frame passed the deadlinenow + 1h. The pool'spump_entryturns that into a budget of about 3600 s. That budget is finite, soexec_group::pumppasses it on, and the runs are timed.bare_world::pumppassedkNoTimeLimit(+inf) tosync_run_stepsas a present optional, so those runs were timed too.exec_group::pumpmaps a non-finite budget tonullopt, and the helper's comment says it pumps "as exec_group::pump pumps".exec_group::pump(steps_only(97))directly. They are untimed and never cut.Under load, a thread descheduled mid-run passes 1 ms on its next clock check and ends the run early, which reorders a group's processes:
msg-recvwhen the sender sends waits forever (#6 waiting steps 6: <waiting >). The group never finishes, and the pump loop spins through all 200000 frames.Change (
src/cvc/tests/state_exec_groups_test.cpp)kNoDeadline = clock_type::time_point::max()replacesnow + 1hinpump_pooled, incheck_against_solo's first frame and in GR12's first frame.seconds_leftreadsmax()as infinite, soexec_group::pumpgives the scheduler no budget. This covers GR01, GR02, GR03, GR12 and DT02's group side. The pool's waits already handle amax()deadline: they wait in slices of at most 1 s.bare_world::pumpmaps a non-finitesecondstonullopt, asexec_group::pumpdoes.Nothing outside the test file changes. The file's other
now + 1hdeadlines (GR04, GR09, OC01, GL01, GL02, PA01, GR10, GR11) are left alone, because those tests do not compare a group's process order with an oracle.Evidence (Windows, MSVC Release, built from this branch's base d473c10)
To stand in for load without loading the box, a temporary test-only probe set
state_exec.slice_secondsin eachpool_app's tree to a few microseconds. With a slice that short, runs are cut at points that depend on timing, as descheduling does. The probe is not in this PR. All runs usedCVC_EXEC_SLICE_STEPS=256.With the probe removed, the whole
state_exec_groups_test(28 tests) passes 6 of 6 times at the default slice steps and 6 of 6 atCVC_EXEC_SLICE_STEPS=256. clang-format 19 is clean.Not verified here: the original flake needs real load to show, so this PR can't show it going away under load. The probe shows the mechanism and shows that the fix removes it.