Commit 3686009
Merge pull request #125 from Open-MBEE/feature/scheduling-policy
* feat(runtime): select the scheduling policy a run resolves its choice points under
A run follows a named scheduling policy wherever the library orders nothing:
`reverse` (the default, unchanged: reverse token order, first holding guard,
first enabled transition), `declared` (spawn and declaration order) or
`seed:<n>` (a PCG sequence the seed fixes, reproducible on every platform).
Every choice point is still reported and each `took ...` is what the policy
took. `explore` is reserved and refused by name until it exists.
The same spelling is taken by `sysml -schedule`, `%schedule` in the REPL (a
debugging session under way keeps its own), a `schedule` field on
ExecuteActionRequest, ExecuteStateRequest and RunAnalysisRequest advertised as
the `schedule` capability (a spelling naming no policy is INVALID_ARGUMENT),
the Go and Python clients, and a `schedule` pin on a conformance case.
The conformance suite runs whole under `declared` and `seed:1` as well,
requiring every case that pins no policy and lists no outcomes to produce its
default outputs; policy trace goldens pin every outcomes case. The two cases
whose default result is one linearization of several pin `reverse`.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* docs(proto): describe the schedule capability in ServerInfoResponse
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* chore(runtime): mark the seeded scheduler's generator as deliberately non-cryptographic
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* docs(runtime): state that a calc body has no choice points and that policies may reach different ones
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* test(runtime): admit both pairings of two accepts racing for two sends
Restate action_choice_shared_message_accept as an outcomes case derived in the
semantic oracle, with a .trace.order and declared/seed-1 trace goldens, in
place of its reverse pin. send_identity_same_named_ports stays pinned: the
via-less accept over-matches a port-addressed transfer, fixed separately.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* fix(runtime): read the picked guard for real and keep a driven run's scheduler
A decision branch the policy picks past the first was read only in a probe
the context undoes, so its evaluation left nothing behind. The run now reads
the picked guard once more before taking the branch, as fireTransition reads
a transition's guard again before it fires; the seed:1 trace golden of
action_choice_decision_overlapping_guards gains that reading.
An executor driven call by call (the REPL debuggers) keeps the scheduler its
run started with: another run driven to completion while it is paused no
longer replaces the sequence its remaining choices draw from.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* refactor(runtime): tighten the beginExecutorRun doc comment
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* fix(runtime): ask a shared ancestor state for its transition once per dispatch
selectCandidates remembers per source state which transition it offers, so a composite state reached from every leaf of its orthogonal regions is asked once per event dispatch or change poll: the choice among its enabled transitions draws once, yields one candidate and one choice note, and the run's next choice takes the seed's next draw. Nested transitions keep their priority.
The state_choice_shared_ancestor_regions trace goldens lose the second leaf's redundant re-reading of the first guard.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* fix(runtime): pick a state's transition only once it survives conflict resolution
An enclosing state's enabled transitions were chosen, and the seeded draw spent, before losesToNestedTransition dropped the candidate to a nested transition, so a choice that never fired and was never reported shifted every later seeded choice. Candidate discovery now returns the enabled positions and chooseTransition picks among them after conflict resolution, on both the dispatch and the change-poll path; a shared ancestor still draws once.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* docs(wire): carry the choice-point code in the scheduled ExecuteAction example
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* fix(runtime): preview a machine's decision from its own run's scheduler
Decide read the scheduler the context happened to hold, so after another
run had used the context it could name a transition other than the one
ProcessNextEvent then fired. It now previews under the executor's own
scheduler, drawing nothing from it.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* fix(runtime): draw a seeded token order only among the tokens able to act
A token parked at a join its other branches have not reached, or at an accept
no message in flight answers, keeps its place in the step's order, so steps
taken while tokens wait do not shift the choices the run makes later.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* fix(grpc): read RunAnalysis's schedule before requiring verification
A malformed spelling is INVALID_ARGUMENT whether or not the service offers
verification, as it is on ExecuteAction and ExecuteState.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
* docs(runtime): record that send_identity_same_named_ports runs unpinned
With a via-less state accept routed by the receiver a transfer reaches, the
case has one enabled transition under every policy and needs no schedule pin.
Co-Authored-By: jason.han <hanhuijun@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: jason.han <hanhuijun@gmail.com>92 files changed
Lines changed: 4147 additions & 712 deletions
File tree
- api/proto
- changes/unreleased
- clients
- java/opensysml-client/src
- main/java/org/openmbee/opensysml
- proto
- test/java/org/openmbee/opensysml
- node
- src
- core
- generated
- test
- python
- opensysml
- proto
- tests
- rust
- conformance
- opensysml
- src/proto/sysml
- tests
- client/opensysml
- cmd
- conformance
- sysml
- conformance
- fixtures
- scenarios
- docs
- guide
- project
- reference
- internal
- core/runtime
- testdata/conformance
- grpc
- repl
- man/man1
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| |||
427 | 431 | | |
428 | 432 | | |
429 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
430 | 438 | | |
431 | 439 | | |
432 | 440 | | |
| |||
441 | 449 | | |
442 | 450 | | |
443 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
444 | 456 | | |
445 | 457 | | |
446 | 458 | | |
| |||
916 | 928 | | |
917 | 929 | | |
918 | 930 | | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
919 | 936 | | |
920 | 937 | | |
921 | 938 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| |||
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
| 116 | + | |
105 | 117 | | |
106 | 118 | | |
107 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
30 | 65 | | |
31 | 66 | | |
32 | 67 | | |
33 | 68 | | |
34 | 69 | | |
| 70 | + | |
35 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
36 | 76 | | |
37 | 77 | | |
38 | 78 | | |
39 | 79 | | |
40 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
41 | 84 | | |
42 | 85 | | |
43 | 86 | | |
| |||
67 | 110 | | |
68 | 111 | | |
69 | 112 | | |
| 113 | + | |
70 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
71 | 119 | | |
72 | 120 | | |
73 | 121 | | |
74 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
75 | 126 | | |
76 | 127 | | |
77 | 128 | | |
78 | 129 | | |
| 130 | + | |
79 | 131 | | |
80 | 132 | | |
81 | 133 | | |
| |||
0 commit comments