Skip to content

refactor: Make detray reuse ACTS' codegen facilities#5597

Draft
paulgessinger wants to merge 5 commits into
acts-project:mainfrom
paulgessinger:refactor/detray-codegen
Draft

refactor: Make detray reuse ACTS' codegen facilities#5597
paulgessinger wants to merge 5 commits into
acts-project:mainfrom
paulgessinger:refactor/detray-codegen

Conversation

@paulgessinger

Copy link
Copy Markdown
Member

No description provided.

paulgessinger and others added 2 commits June 16, 2026 14:37
Introduce element-access strategies (flat_index for ACTS, getter_element
for detray) so the one genuine point of divergence between the ACTS and
detray sympy backends is injectable. Default stays flat-index, leaving the
three ACTS generators' output byte-for-byte unchanged (verified). Also add
the MyCXXCodePrinterWithoutKnownAssignment variant detray needs. Bump the
codegen package to 0.3.0. Groundwork for unifying detray's codegen onto
this shared core.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a detray emission backend (codegen.detray_backend: getter::element
dialect, DETRAY_HOST_DEVICE/concept signatures, sparsity asserts) to the
shared ACTS codegen package, and repoint detray's generators at it. Delete
detray_sympy's common.py/codegen.py, which were a byte-for-byte fork of the
ACTS core; detray_sympy now keeps only its domain modules (matrices, checks,
output). generate_all.sh runs the generators via uv against the in-tree
shared package. Output of all four generated headers is byte-for-byte
unchanged (verified); detray codegen pytest suite still passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added this to the next milestone Jun 16, 2026
@github-actions github-actions Bot added Infrastructure Changes to build tools, continous integration, ... Component - Detray Affects the Detray project labels Jun 16, 2026
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

📊: Physics performance monitoring for d72df76

Full contents

physmon summary

paulgessinger and others added 2 commits June 16, 2026 17:54
Converge detray onto ACTS's build-time codegen model: the four propagator
codegen headers are now generated into the build tree by the shared ACTS
codegen package via acts_code_generation(), instead of being committed.

- Make acts_code_generation() INTERFACE-aware: header-only targets (detray::
  core) get the generated include dir on their INTERFACE; compiled targets keep
  PRIVATE as before. Add an optional RESULT_INCLUDE_DIR out-param used to
  install the generated headers.
- Wire generation in Detray/core/CMakeLists.txt by reusing the in-tree ACTS
  infra via relative path (../../cmake, ../../codegen) — no published package.
- Change the four `#include "./codegen/..."` to full-path includes so they
  resolve against the build-tree include dir, and delete the committed headers.

Verified: configure succeeds; all four detray headers (and the three ACTS
headers) generate byte-for-byte identically to the previous output; a consumer
TU (ActsExamplesDetray DetrayPropagator.hpp) compiles against them; and the
codegen step is correctly ordered before consumers compile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@paulgessinger paulgessinger force-pushed the refactor/detray-codegen branch from 2c008fd to 66454f0 Compare June 16, 2026 17:22
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

Component - Detray Affects the Detray project Infrastructure Changes to build tools, continous integration, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant