Skip to content

[P7] OpenSCENARIO DSL Frontend - tracking #8

Open
5 of 5 issues completed
Open

Description

@JArmandoAnaya

[P7] OpenSCENARIO DSL Frontend — tracking

Tracking issue for pillar P7. See docs/roadmap/roadmap.md.

Objective

A grammar-based parser (ANTLR4 C++ runtime, BSD), AST, symbol resolution and type system for ASAM OpenSCENARIO DSL 2.x, able to load and check the finalized standard library and concrete scenario files with actionable diagnostics — shipping scena-check for DSL files (DSL §7; coverage: docs/roadmap/coverage/osc-dsl-coverage.md). Constraint (keep) and coverage constructs are parsed and checked but not solved. Out of scope: external-method binding to host code (diagnosed as unsupported when invoked), constraint solving (F4), any execution (P8).

Sprints

Pillar exit criteria

  • The DSL standard library type-checks with zero errors
  • Spec-annex-derived example files parse and check with precise diagnostics (section-number citations — the DSL spec defines no rule IDs)
  • scena-check exits nonzero with actionable messages on seeded error corpora

Status (2026-08-02 continuous-improvement audit): all P7 sprints merged; the standard library type-checks clean; scena-check corpus green. Residual: #110 (overloaded enum literals not resolved by expected type, §7.3.3) means a scenario copied verbatim from the spec (at: start) fails to check — the "spec-annex-derived examples check" exit criterion is not honestly met until it lands.

Activity

  1. JArmandoAnaya commented on Aug 2, 2026

    @JArmandoAnaya
    ContributorAuthor

    P7 — OpenSCENARIO DSL Frontend: complete

    All five sprints are merged and their issues closed. Scena parses, resolves and
    type-checks ASAM OpenSCENARIO DSL 2.x against the full bundled §8 standard
    library, and reports what it finds through four surfaces.

    Sprint Issue PR Merged as
    p7-s1 — grammar & lexer #39 #92 3e80312
    p7-s2 — parser & AST #40 #93 b3382ac
    p7-s3 — symbols & type system #41 #94 e17ebc2
    p7-s4 — expressions, constraints & coverage #42 #95 7bc8673
    p7-s5 — standard library & scena-check #43 #96–#99, #101–#105 01263bc → 84f993f

    p7-s5 landed in nine slices, because §8 is printed as ~160 parameter tables and
    each chapter needed 800–2000 lines of specification read before a line of DSL
    could be written:

    Slice Content PR
    43a import mechanism (§7.7.5) + osc.standard.types #96
    43b §8.7 physical-object actors #97
    43c §8.12 road abstraction #98
    43d §8.8.1 action hierarchy + §8.10/§8.11 environment #99
    43e + 43h §8.12.2 the map actor + §8.15 traffic lights #101
    43f §8.8.2–§8.8.4 movement actions #102
    43g §8.9 movement modifiers #103
    43i-1 the scena-check CLI #104
    43i-2 C ABI scn_check_dsl_* + Python check_dsl_* #105

    Exit criteria

    • Standard library checks clean. The whole of §8 loads with zero
      diagnostics, pinned declaration by declaration in dsl_stdlib_test.cpp.
    • scena-check corpus green. 18 subprocess tests over the CLI, with
      exit codes split along the Status model's line: 0 ok, 2 usage, 3 the
      source did not check, 4 the input could not be read.
    • Bindings updated in the same PR. feat(dsl): C ABI and Python DSL checking, closing p7-s5 (#43) #105 carries the C ABI, the Python
      bindings, an example run in CI and the parity audit together, as
      CONTRIBUTING.md requires. The audit now covers the frontend entry
      points, not just Engine methods, so a future frontend function cannot
      reach one surface and quietly miss the others.
    • CI green on every platform for all nine PRs — macOS, Linux, Windows,
      ASan+UBSan, clang-format, the determinism trace and the golden suite.

    Deliberate exclusions, each recorded

    • Constraint solving is post-v0.0.1 (ADR-0004). Constraints that do not fold
      to fixed values are accepted with an UnsupportedFeature warning rather than
      approximated — reporting beats guessing where determinism is at stake. Same
      treatment for coverage collection, sample() and every.
    • §8.7.26 (traffic-participant groups) is explicitly non-normative and is
      excluded.
    • The library is authored from the normative §8 text, not copied from any
      file (ADR-0029), and embedded as chunked raw literals — MSVC caps a single
      string literal at 16380 bytes, and this keeps the library independent of any
      install prefix.
    • The standard's printed conversion factors are carried verbatim. §8.14.1.3
      prints the kph factor as 0.277777778, so 36kph == 10mps is false.
      Conformance beats tidiness; pinned by test.
    • DSL diagnostics cite section numbers and leave rule_id empty, because
      the DSL standard defines no asam.net: rule identifiers. Asserted, not
      assumed.

    Three defects found in ASAM OpenSCENARIO DSL 2.2.0

    Each resolved by asking which surface the rest of the chapter corroborates, and
    each pinned by a test so the resolution stays visible:

    1. §8.15.4.2.1 prints the wrong receiver — the group's state_equal
      prototype says extend traffic_light: while the heading, the prose and
      Table 319 all say traffic_light_group.
    2. Table 337 names the wrong parameter — set_group_bulb_state's first
      parameter is typed traffic_light while its own description says "group".
      The parameter table is what a conforming scenario is written against, so it
      is carried verbatim and the inconsistency recorded.
    3. §8.8 and §8.9 collide with each other — §8.8 declares actions
      movable_object.change_speed, movable_object.keep_speed and
      vehicle.change_lane; §8.9 declares modifiers of exactly those names for
      exactly those actors, and a qualified behavior name identifies one
      declaration. Those three take §7.3.12.3's unassociated form, the only
      spelling that exists and does not collide.

    Known gap carried into P8

    #100 — an actor-associated modifier cannot be applied, in either position
    §7.3.12.4.1 defines. The declarations are well-formed and checked; the
    application side is not. It predates these chapters and p8-s3 (#46) depends on
    it, so it is the next thing to land.

    ADRs: 0027 (hand-written lexer/parser), 0028 (the type model), 0029 (the bundled
    library). Leaving this issue open per repo convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions