Compiling OpenSCENARIO 2.1 for Scenario-Based Testing in CARLA
Pith reviewed 2026-05-10 18:23 UTC · model grok-4.3
The pith
A compiler pipeline converts OpenSCENARIO 2.1 scenarios into executable CARLA behavior trees by mapping the standard ontology through a custom registry.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
The paper claims that OpenSCENARIO 2.1 scenarios can be translated directly into CARLA-executable py_trees behavior trees through a custom method registry that maps the standardized domain ontology to CARLA's procedural API, eliminating external logic solvers, as validated by a multi-actor cut-in and evasive maneuver that exercises concurrent actions, dynamic mathematical expressions, and asynchronous signaling.
What carries the argument
Multi-pass compiler architecture with ANTLR4 frontend for AST generation, semantic middle-end, and runtime backend that synthesizes py_trees behavior trees from a custom method registry mapping the OpenSCENARIO 2.1 ontology to CARLA functions.
If this is right
- Standardized OpenSCENARIO 2.1 scenarios become directly runnable in CARLA for reproducible testing.
- Concurrent actions and asynchronous signaling in multi-actor scenarios can be expressed without additional solvers.
- The generated behavior trees provide deterministic execution that supports large-scale scenario suites.
- Python-based implementation creates a baseline that can later be ported to C++ for lower overhead.
Where Pith is reading between the lines
- The registry-based mapping could be reused or extended to connect OpenSCENARIO 2.1 with other open simulators that expose procedural APIs.
- Automated checks during the semantic middle-end could be expanded to catch timing or safety violations before runtime.
- Scaling the approach to thousands of scenarios would depend on reducing Python overhead through the suggested C++ path.
Load-bearing premise
A custom method registry can map the full OpenSCENARIO 2.1 ontology to CARLA's procedural API without external logic solvers or loss of expressiveness for concurrent and dynamic behaviors.
What would settle it
Execution of the compiled cut-in scenario in CARLA that produces mismatched actor timings, failed concurrent actions, or incorrect handling of dynamic expressions would show the mapping is incomplete.
Figures
read the original abstract
While the ASAM OpenSCENARIO 2.1 Domain-Specific Language (DSL) enables declarative, intent-driven authoring for Scenario-Based Testing (SBT), its integration into open-source simulators like CARLA remains limited by legacy parsers. We propose a multi-pass modern compiler architecture that translates the OpenSCENARIO 2.1 DSL directly into executable CARLA behaviors. The pipeline features an ANTLR4 frontend for Abstract Syntax Tree (AST) generation, a semantic middle-end, and a runtime backend that synthesizes deterministic py_trees behavior trees. Mapping the standardized domain ontology directly to CARLA's procedural API via a custom method registry eliminates the need for external logic solvers. A demonstrative multi-actor cut-in and evasive maneuver, selected from a wider suite of validated scenarios, confirms the compiler's ability to process concurrent actions, dynamic mathematical expressions, and asynchronous signaling. This framework establishes a functional baseline for reproducible, large-scale SBT, paving the way for future C++ optimizations to mitigate current Python-based computational overhead.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes a multi-pass compiler pipeline using ANTLR4 for AST generation, a semantic middle-end, and a py_trees backend to translate OpenSCENARIO 2.1 DSL scenarios directly into executable behaviors for the CARLA simulator. A custom method registry maps the DSL ontology to CARLA's procedural API without external logic solvers. Validation is provided via a single demonstrative multi-actor cut-in and evasive maneuver scenario that exercises concurrent actions, dynamic expressions, and asynchronous signaling, positioning the work as a functional baseline for reproducible scenario-based testing.
Significance. If the mapping generalizes beyond the single example, the architecture could establish a reproducible baseline for integrating the standardized OpenSCENARIO 2.1 DSL with open-source simulators like CARLA, enabling large-scale SBT without reliance on legacy parsers or external solvers. The direct translation to deterministic behavior trees and avoidance of logic solvers are notable strengths for determinism and simplicity.
major comments (3)
- [Abstract and evaluation] Abstract and evaluation section: The central claim that the compiler processes concurrent actions, dynamic mathematical expressions, and asynchronous signaling (and thus establishes a functional baseline for the full DSL) rests on a single multi-actor demonstrator selected from an unspecified wider suite. No coverage metrics, error analysis, or additional scenarios are provided to substantiate that the custom method registry and middle-end preserve semantics for the complete OpenSCENARIO 2.1 ontology.
- [Compiler architecture (middle-end and registry)] Description of the semantic middle-end and custom method registry: The paper asserts that the registry enables direct mapping to CARLA's API without external solvers or loss of expressiveness for concurrent/dynamic behaviors, but provides no registry contents, semantic rules, or translation examples. This makes it impossible to verify the no-loss claim or assess whether external logic is implicitly required for general cases.
- [Evaluation and results] No quantitative evaluation: The manuscript offers no metrics on translation success rate, runtime overhead of the Python-based py_trees backend, or comparison against prior OpenSCENARIO parsers, which weakens the claim of a viable baseline for large-scale SBT.
minor comments (2)
- [Abstract] Clarify the scope of the 'wider suite of validated scenarios' and whether the demonstrated cut-in maneuver is representative or exhaustive.
- [Conclusion] The paper mentions future C++ optimizations but does not discuss current performance bottlenecks or profiling data from the Python implementation.
Simulated Author's Rebuttal
We thank the referee for the thoughtful and constructive review. We address each major comment point by point below, providing clarifications where the manuscript may have been unclear and indicating revisions that will be incorporated to strengthen the paper.
read point-by-point responses
-
Referee: [Abstract and evaluation] Abstract and evaluation section: The central claim that the compiler processes concurrent actions, dynamic mathematical expressions, and asynchronous signaling (and thus establishes a functional baseline for the full DSL) rests on a single multi-actor demonstrator selected from an unspecified wider suite. No coverage metrics, error analysis, or additional scenarios are provided to substantiate that the custom method registry and middle-end preserve semantics for the complete OpenSCENARIO 2.1 ontology.
Authors: The referee correctly notes that the evaluation centers on a single demonstrative scenario. This scenario was deliberately chosen as it exercises the key DSL features cited (concurrent actions via parallel behavior-tree composites, dynamic expressions via runtime Python evaluation, and asynchronous signaling via event nodes). The manuscript states that the example is drawn from a wider suite of validated scenarios; however, space limitations prevented full enumeration. We will revise the evaluation section to include concise descriptions of two additional scenarios from the suite and a qualitative discussion of how the middle-end and registry handle their constructs. We agree that coverage metrics and systematic error analysis would further substantiate the baseline claim, but these were outside the scope of the current functional demonstration; we will explicitly note this limitation and identify it as future work. revision: partial
-
Referee: [Compiler architecture (middle-end and registry)] Description of the semantic middle-end and custom method registry: The paper asserts that the registry enables direct mapping to CARLA's API without external solvers or loss of expressiveness for concurrent/dynamic behaviors, but provides no registry contents, semantic rules, or translation examples. This makes it impossible to verify the no-loss claim or assess whether external logic is implicitly required for general cases.
Authors: We accept that the absence of explicit registry contents and translation examples limits verifiability. The method registry provides direct one-to-one mappings from OpenSCENARIO 2.1 domain elements to CARLA procedural API calls, while the middle-end performs semantic checks (type consistency, expression simplification) without invoking external solvers. Concurrency and dynamic behavior are realized entirely within deterministic py_trees trees. To address the concern, we will add an appendix containing (i) a representative subset of registry mappings and (ii) concrete translation examples for concurrent actions (Parallel nodes), dynamic expressions (runtime-evaluated leaves), and asynchronous signaling. This will allow readers to inspect the claimed direct mapping and absence of implicit external logic. revision: yes
-
Referee: [Evaluation and results] No quantitative evaluation: The manuscript offers no metrics on translation success rate, runtime overhead of the Python-based py_trees backend, or comparison against prior OpenSCENARIO parsers, which weakens the claim of a viable baseline for large-scale SBT.
Authors: The referee is right that quantitative metrics are missing. The manuscript prioritizes architectural description and functional demonstration over benchmarking. We will augment the results section with measured compilation times (ANTLR frontend, middle-end, py_trees synthesis) and CARLA execution overhead for the presented scenario. Translation success is 100 % on the validated suite; we will state this explicitly. Direct runtime comparisons with prior parsers are difficult because many are proprietary or simulator-specific, but we will expand the related-work discussion to highlight qualitative distinctions. These additions will better support the baseline claim while acknowledging the current Python implementation's overhead as motivation for the planned C++ backend. revision: partial
Circularity Check
No circularity detected in compiler architecture description
full rationale
The paper describes a multi-pass compiler pipeline (ANTLR4 frontend for AST, semantic middle-end, py_trees backend) that maps OpenSCENARIO 2.1 ontology to CARLA via a custom method registry. No equations, fitted parameters, self-definitional constructs, or load-bearing self-citations appear in the provided text. The central claim of a functional baseline for SBT is presented as an engineering translation without reduction to inputs by construction or prior author results. The single demonstrative scenario is offered as confirmation of processing capabilities rather than a statistical prediction or renamed known result. The derivation chain is self-contained as an architectural proposal.
Axiom & Free-Parameter Ledger
axioms (2)
- domain assumption ANTLR4 grammar for OpenSCENARIO 2.1 produces a complete and unambiguous AST
- domain assumption CARLA procedural API plus custom registry covers all OpenSCENARIO 2.1 actions without external solvers
invented entities (1)
-
Custom method registry
no independent evidence
Reference graph
Works this paper leans on
- [1]
- [2]
-
[3]
Declarative Scenario-based Testing with RoadLogic,
Ezio Bartocci, Alessio Gambi, Felix Gigler, and Dejan Nick- ovic. Declarative Scenario-based Testing with RoadLogic. arXiv preprint arXiv:2603.09455, 2026. 2
-
[4]
The Y ASE Framework: Holistic Scenario Modeling with Behav- ior Trees
Max Paul Bauer, Anthony Ngo, and Michael Resch. The Y ASE Framework: Holistic Scenario Modeling with Behav- ior Trees. In2021 IEEE 94th Vehicular Technology Confer- ence (VTC2021-Fall), pages 1–7, 2021. 2
work page 2021
-
[5]
Text2Scenario: Text-driven scenario generation for autonomous driving test
Xuan Cai, X Bai, Zhiyong Cui, D Xie, D Fu, H Yu, and Y Ren. Text2Scenario: Text-Driven Scenario Gen- eration for Autonomous Driving Test.arXiv preprint arXiv:2503.02911, 2025. 2
- [6]
-
[7]
CARLA: An Open Urban Driv- ing Simulator
Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun. CARLA: An Open Urban Driv- ing Simulator. InProceedings of the 1st Annual Conference on Robot Learning, pages 1–16, 2017. 1, 4
work page 2017
-
[8]
Scenic: A Language for Scenario Specification and Scene Generation
Daniel J Fremont, Tommaso Dreossi, Shromona Ghosh, Xi- angyu Yue, Alberto L Sangiovanni-Vincentelli, and Sanjit A Seshia. Scenic: A Language for Scenario Specification and Scene Generation. InProceedings of the 40th ACM SIG- PLAN Conference on Programming Language Design and Implementation, pages 63–78, 2019. 2
work page 2019
-
[9]
Srajan Goyal, Alberto Griggio, and Stefano Tonetta. System- level Simulation-based Verification of Autonomous Driving Systems with the VIV AS Framework and CARLA Simula- tor.Science of Computer Programming, 242:103253, 2025. 2
work page 2025
-
[10]
Nidhi Kalra and Susan M Paddock. Driving to Safety: How Many Miles of Driving Would it take to Demonstrate Au- tonomous Vehicle Reliability?Transportation Research Part A: Policy and Practice, 94:182–193, 2016. 1
work page 2016
-
[11]
Pierre R. Mai. Pmsf py-osc2 framework, 2024. 2
work page 2024
-
[12]
Rupak Majumdar, Aman Mathur, Marcus Pirron, Laura Stegner, and Damien Zufferey. Paracosm: A language and tool for testing autonomous driving systems.arXiv preprint arXiv:1902.01084, 2019. 2
-
[13]
The Prag- matic Bookshelf, Raleigh, North Carolina, 2013
Terence Parr.The Definitive ANTLR 4 Reference. The Prag- matic Bookshelf, Raleigh, North Carolina, 2013. Torrossa Resource ID: 5241753. 1
work page 2013
-
[14]
GeoScenario: An open DSL for Autonomous Driving Scenario Representation
Rodrigo Queiroz, Christian Berger, and Krzysztof Czar- necki. GeoScenario: An open DSL for Autonomous Driving Scenario Representation. In2019 IEEE Intelligent Vehicles Symposium (IV), pages 287–294. IEEE, 2019. 2
work page 2019
-
[15]
Shuncheng Tang, Zhenya Zhang, Jixiang Zhou, Lei Lei, Yuan Zhou, and Yinxing Xue. LeGEND: A Top-Down Ap- proach to Scenario Generation of Autonomous Driving Sys- tems Assisted by Large Language Models. InProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 1497–1508, 2024. 2
work page 2024
-
[16]
BeSimulator: A Large Language Model Powered Text-based Behavior Simulator,
Jianan Wang, Bin Li, Jingtao Qi, Xueying Wang, Fu Li, and Hanxun Li. BeSimulator: A Large Language Model Powered Text-based Behavior Simulator.arXiv preprint arXiv:2409.15865, 2024. 2
-
[17]
Chat2scenario: Scenario Extraction from Dataset through Utilization of Large Language Model
Yongqi Zhao, Wenbo Xiao, Tomislav Mihalj, Jia Hu, and Arno Eichberger. Chat2scenario: Scenario Extraction from Dataset through Utilization of Large Language Model. In 2024 IEEE intelligent vehicles symposium (IV), pages 559–
work page 2024
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.