MACE Kokkos source layout¶
The MACE Kokkos evaluator is split into semantic translation units. Each
translation unit owns a disjoint family of MACEKokkos method definitions and
explicitly instantiates both supported precisions. This keeps implementation
edits local and lets expensive CPU and accelerator template work compile in
parallel.
Owners¶
Source |
Responsibility |
|---|---|
|
Construction, destruction, backend and plugin policy, workspace admission, diagnostics, observers, and parameter-gradient setup |
|
Streamed modes and schedules, prepared graph state, Cartesian/fractional geometry lifecycle and device mapping, active types, and factorized model preparation |
|
Factorized R1 forward execution and direct and non-compiled reverse execution |
|
Factorized operator benchmarking and parameter-gradient kernels |
|
Force reductions and ordinary and field evaluator entry points |
|
Analytic field response; includes |
|
R0, R1, spherical harmonics, A0 variants, and M0 |
|
H1, field H1, and Phi1 forward and reverse paths |
|
A1 variants, M1, H2, and readouts |
|
JSON model loading and model-contract validation |
The authoritative build list is the SYMMETRIX_KOKKOS source block in
libsymmetrix/CMakeLists.txt. The layout contract is enforced by
symmetrix/test/test_mace_kokkos_source_partitioning.py. Its order is a build
scheduling contract: with the current equal-priority Ninja graph, longer CUDA
owners are listed first so they enter the ready queue before shorter owners.
Placement rules¶
Declare public and cross-owner members in
mace_kokkos.hpp; define each member in exactly one semantic owner.Place a new method with the state or kernel family it changes. Calls between owners use class declarations rather than source inclusion.
End every owner with exactly one
template class MACEKokkos<float>;and onetemplate class MACEKokkos<double>;. Do not add per-method orexterninstantiation as part of an unrelated change.Keep
mace_kokkos_response.tppincluded only bymace_kokkos_response.cpp. It is an implementation body, not a shared header.Add a private detail header only when multiple owners require the same complete type or inline helper. Keep its consumer set explicit and acyclic.
Keep the standard M0/R0 module bodies and launch profiles under
libsymmetrix/source/. Runtime-generated R1 code belongs to the JIT compiler and cache rather than a checked-in generated-source directory.
Rebuild expectations¶
Editing one .cpp owner should recompile that owner and relink its targets, but
must not recompile the other nine owners. Editing a private detail header should
recompile only the consumers listed above. Changes to mace_kokkos.hpp remain
class-wide and are expected to rebuild every owner.
After changing ownership or shared dependencies, run the source-partitioning
test, build at least one supported backend, and compare the normalized
MACEKokkos<float> and MACEKokkos<double> symbol inventory with the previous
layout. Backend-specific build and runtime coverage must be reported
separately.