Repository navigation
feat: action conflicts, override by event & bulk actions (§7.5) (#51) - #85
Merged
Merged
Conversation
Completes what ADR-0005 deferred and p5-s4 only partly delivered. Which actions conflict is now Annex A Table 10 written down once, in ir::ActionDomain + control_domains(). It takes an Action, not a kind, because §7.4.1.2 makes the classification settings-dependent: an action 'used with the step dynamic option ... does not assign a control strategy as the changes are enacted instantaneously'. So a Step-shaped SpeedAction no longer overrides a running ramp — it writes the speed and completes, and the ramp resumes on the next step. That is a behavior change; it is reported when it happens mid-run, because a value something else erases a step later is rarely the authored intent, and §7.5.2.2 asks implementations to warn rather than reject. Two tests that asserted the old rule were rewritten, one of them onto a shaped action — the real conflict case. Override by event (§7.5.2.1) was missing entirely: a stopped event marked its element Complete and left the engine driving the entity from an action the storyboard had forgotten. The scheduler now reports every action a stopTransition ends, in document order, and the engine releases exactly the domains that action held. Never-ending actions end this way too (§7.5.3). Bulk actions (§7.5.4, §8.3.3.3): instances of one authored private action share an ir::Action::bulk_group. Completion needed no code — the instances share an Event, and an Event already ends only when all its actions have, which is §8.3.3.3's join. The id is load-bearing for one rule: a conflict on any actor retires every instance, so they fall back together. Scheduler::step gains a StopCallback overload; the existing ones pass a no-op. No C ABI or bindings change. 11 new gtest cases (910) in action_conflict_test.cpp and xml_storyboard_test.cpp, ADR-0025, the storyboard guide and the coverage row. Closes #51
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.
Completes what ADR-0005 deferred and p5-s4 only partly delivered.
Which actions conflict
ir::ActionDomain+control_domains()are Annex A Table 10 and §7.4.1.1written down once.
control_domainstakes anAction, not a kind string,because §7.4.1.2 makes the classification settings-dependent:
Behavior change: a Step-shaped
SpeedActionfired while a ramp is runningno longer overrides it. It writes the speed and completes; the ramp — never in
conflict with it — resumes from its own schedule on the next step. The engine
reports this the first time it happens on an entity, citing §7.4.1.2: writing a
value a control strategy erases one step later is rarely the authored intent,
and §7.5.2.2 asks implementations to warn about unintended behavior rather than
reject a valid file. In
Init, where nothing else runs, nothing is reported.Two tests asserted the old rule and were rewritten. One now uses a shaped
action — the actual conflict case — so supersession stays covered; the other
asserts the new Step behavior and the diagnostic.
Override by event (§7.5.2.1)
This was missing entirely: a stopped event marked its element Complete and left
the engine still driving the entity from an action the storyboard had forgotten.
Scheduler::stepgains an optionalStopCallback.stop_cascadecalls it forevery action still in an event's running set, in document order, before marking
the element Complete. The scheduler owns element state and knows nothing about
entities; only the engine knows a given action held a longitudinal controller or
a trajectory follower, so
Engine::stop_actionreleases exactly the domainsthat action owned and leaves the entity where the release found it.
Never-ending actions end this way too — §7.5.3 says every ending but the regular
one applies to them, and now that is true in practice.
The existing
stepoverloads are unchanged and pass a no-op.Bulk actions (§7.5.4, §8.3.3.3)
ir::Actiongainsbulk_group(). The XML frontend already lowers a privateaction once per actor of its ManeuverGroup; it now stamps those instances with a
shared id from a per-document counter, so the ids depend on document order alone.
One instance per actor means completion needed no new code: the instances
share an Event, and an Event already ends only when all of its actions have
(§8.3.3.1) — exactly §8.3.3.3's join. The id is load-bearing for one rule:
retire_bulk_siblingswalks the entity table (astd::map, so entity-id orderon every platform) and retires every owner in the group. Retiring is itself a
supersession and superseding propagates to the group, so one guard breaks the
recursion.
Surface
No C ABI or bindings change —
scheduler.his a core header, not a stabilitycommitment.
ir::Actiongrows onestd::size_t, set while a scenario is builtand never during execution.
Tests and docs
11 new gtest cases (899 → 910) in
action_conflict_test.cpp(domainclassification, override-by-event including a never-ending action, bulk override
/ bulk stop / bit-identity) and
xml_storyboard_test.cpp(shared group ids).ADR-0025; the storyboard guide gains an action-conflict section with the domain
table; the
§7.5coverage row flips to landed.Local: 910/910 gtest, 164/164 pytest, detmath guard, coverage-matrix checker and
clang-format green.
Closes #51