Skip to content

[MBEP] Ateleris Python Backend - #371

Merged
usr3-1415 merged 884 commits into
esa:masterfrom
ateleris:master
Sep 5, 2026
Merged

[MBEP] Ateleris Python Backend#371
usr3-1415 merged 884 commits into
esa:masterfrom
ateleris:master

Conversation

@UeliDeSchwert

Copy link
Copy Markdown
Contributor

WIP-PR for the Python Backend developed by Ateleris as outlined in MBEP-ATS-AC-TN-001
conforming to MBEP-ATS-AC-SRS.

This is a work in progress. There will be many changes on our side and before finalizing the work the code will be cleaned thoroughly.

UeliDeSchwert and others added 18 commits July 16, 2026 10:11
Acn_Enc_String_CharIndex_FixSize called <GetCharIndex>(...) instead of
GetCharIndex(...), so the embedded C runtime — copied into every generated
C project — failed to compile.
The isObjectOriented branch of GenerateFiles.printUnit (deep-field-access
resolution, dedup passes, __init__.py handling) was Python-only logic living
in the generic code-generation driver. Move the type-selection/dedup into
ILangGeneric.selectProgramUnitRenderTypes, overridden in LangGeneric_python;
the generic driver keeps the shared printUnitInternal rendering and emits the
package import via the new programUnitImportStatement hook. Debug printfns
dropped. Non-object-oriented languages get no-op defaults and are unaffected.
…eratefiles

Move Python program-unit type selection behind ILangGeneric
Revert stray STG-macro escape in ACN string charset encoder
Update Dotnet Test Framework, Fix GetCharInfo & Extract python program-unit types behind ILangGeneric
- acn_c.stg: restore the lost <if(arrsAcnPrms)> clause on the
  EmitTypeAssignment_primitive encode definition, so --acn-v2 specialized
  encoders keep their AcnInsertedFieldRef parameters (fixes the gcc
  "conflicting types" error; declaration and definition now match).
- github-build.sh: run the Ada ws8 suite with -s false (it was a no-op under
  slim mode, so Ada ws8 was effectively untested), and add C --acn-v2
  regression runs at both word sizes.
- Revert the CCSDS test inputs to the correct 1-bit secondary header flag
  (SecondaryHeaderFlag INTEGER(0..1), size 1, TC-Packet present-when ==0).
- Fix the python_name copy-paste slip (was old.scala_name) in CloneTree.fs and
  MapParamAstToNonParamAst.fs.
- Reject -python together with --acn-v2, since the Python deferred-patching
  macros are still TODO stubs.
- Add a unioned WITH COMPONENTS CHOICE regression input (09-CHOICE/014).
- Revert the ToC '#'->"elem" rename back to "elm" everywhere; the rename will
  be done separately as its own announced change.
- Gate the AcnDependencies depResolvable empty-string return behind a new
  ILangGeneric.allowUnresolvedAcnDependency: Python skips the update, C/Ada/Scala
  raise instead of silently dropping a determinant update.
- Replace the Codec.suffix global-state lookup (ActiveLanguages.Head) with an
  ILangGeneric.codecSuffix member; C/Ada/Scala output is unchanged.
- Drop personal working files (debug_acn.sh, generate-local-tests.sh, and the
  tracked .superpowers report) from the PR.
The asn1python runtime library and the generated asn1pylib pyproject
(StgPython/aux_python.stg template) declared requires-python >=3.8.
Bump both to >=3.11 and drop the 3.8-3.10 classifiers so the declared
floor matches the supported baseline.
- Rename generated Python count field from nCount to n_count
- Automate type check and lint check in CI

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decode_boolean() treats any child other than <true/> as false, so malformed XER such as <b><maybe/></b> is silently accepted. Explicitly require true or false in both wrapped and naked forms and raise Asn1InvalidValueException otherwise; add an invalid-child regression.

@usr3-1415
usr3-1415 merged commit 7b3aa01 into esa:master Sep 5, 2026
4 checks passed
usr3-1415 added a commit that referenced this pull request Sep 5, 2026
The PR #371 merge kept both the branch's cleaned five-run ACN v2 block
and master's original six-run block, so every acn-v2 leg executed twice
(and the obsolete Ada ws8 slim leg, a no-op now that slim mode is
C-only, came back). Keep the five-run block only.
usr3-1415 added a commit that referenced this pull request Sep 5, 2026
The regression suite regenerates and recompiles everything from
scratch, so identifier renames, API changes and silent semantic changes
in the generated code are invisible to it by design. This tool closes
that gap for PR reviews: it enumerates the same test-case directives as
runTests.py, runs a baseline compiler (master) and a candidate compiler
(the PR) with the regression runner's flags, and diffs the generated
C/Ada output file by file, grouping identical changes into unique
signatures with a Markdown report.

First use: the final review gate of PR #371 (master vs 3cc274e, 418
cases x 9 configs = 3762 comparisons); every difference mapped to a
known, discussed change. Exit codes (0 = identical, 1 = differences,
2 = tool error) are CI-friendly so the tool can later run as a job on
pull requests.
usr3-1415 added a commit that referenced this pull request Sep 5, 2026
Agreed with Ateleris during the PR #371 review: the Python target ships
experimental in its first release.
usr3-1415 added a commit that referenced this pull request Sep 5, 2026
Both came in with the PR #371 merge and fired on every push:
- Python Unit Tests invokes generate-local-tests.sh, which was removed
  from the repository during the review, so it failed on every push to
  master (it has no pull_request trigger, which is why the PR checks
  never showed it).
- Local Tests needs a self-hosted runner that esa/asn1scc does not
  have, so its runs sat queued indefinitely.

Switch both to workflow_dispatch until Ateleris fixes the generation
step and gates the self-hosted job on their repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants