-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: stdcm: conflict detection integration #6171
Merged
Merged
Conversation
This file contains 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
879f6b0
to
5498ea9
Compare
d63f81b
to
887b6f8
Compare
Erashin
requested changes
Jan 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm up to this point :)
core/kt-osrd-sim-infra/src/main/kotlin/fr/sncf/osrd/sim_infra/utils/PathPropertiesView.kt
Show resolved
Hide resolved
core/kt-osrd-sim-infra/src/main/kotlin/fr/sncf/osrd/sim_infra/utils/InfraUtils.kt
Outdated
Show resolved
Hide resolved
9686abb
to
2bd951e
Compare
8da82fe
to
8697fdc
Compare
f1475e9
to
121a444
Compare
We used to not consider the blocks on the routes before the start one, but as a result the conversions to/from travelled path offsets were wrong
The map returned from the signaling simulator is sparse, which IdxMap can *not* handle in an efficient way
The value is arbitrary but seems to fit for BAL, I tried to increase it one by one until no exception is thrown.
core: spacing-generator: fix accidental n^2 complexity on repeated calls core: signaling simulator: avoid redundant block list copy The previous version inputed the whole path to each call of the signaling simulation, resulting on a very poor scaling on long paths in stdcm
Repeated edges at different locations of the same block were considered identical
We could sometimes enter infinite loops on stop times
We used to copy every data about the past elements of the path when we explore diverging paths, we now keep linked list that don't duplicate data
When both are equal we enter into the "epsilon error" ranges of float operations in `callbacks.arrivalTimeInRange`
79b210c
to
55d0d6a
Compare
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.
Fix #4484
The reason for such a massive PR is that we needed to have a stable testable product to be confident in the implementation. There has been several points where we thought "this part can be merged into dev" and yet we still had to make deep changes later on.
Change summary:
InfraExplorer
) that represent the different possible paths.SpacingRequirementAutomaton
and compare the results usingconflicts.kt
toolsconflicts.kt
to get the data we need. Because resource uses are supposed to be opaque, we needed to add a new method any time we needed to get something like minimum delay to add.BlockAvailabilityInterface
level: we don't check how the conflicts are avoided (that's done in the tests mentioned above), but we check that the conflicting times are properly identified.About the git history: I did my best to clean it up, but there's only so much that can be done. Commit-by-commit review is not recommended for STDCM files. There has been whole classes that have been split and re-merged and tweaked, and too much stuff happened in the meantime for proper fixups/squashs. Changes that are outside of STDCM scope have clear atomic commits (generally bugfixes), but new files and methods should be reviewed in one go. I've kept most of the history because it may still help a little with the review, but I'll do a more agressive squash towards the end of the process. The plan is to squash everything up to the point where we transition to bugfixes / optimizations only. Once reviews start coming, we'll stick to fixup commits and avoid rebases.
This has been tested with extensive fuzzing on both small_infra and France, including a new assertion that the new train isn't conflicting with the timetable. The bugs that aren't already present on dev have been fixed. There's also a fairly large amount of unit tests in core (IIRC more than half of the line diff is located in test files). I also tested manually on small_infra and on France, but not in depth. We need to test once again because of the optimization changes, but we can still start the reviews
Additional notes: