Skip to content

Gate engine explicit instantiations by PGen compatibility#3

Closed
haykh wants to merge 5 commits intodev/emissionfrom
codex/fix-compile-time-error-with-pgen
Closed

Gate engine explicit instantiations by PGen compatibility#3
haykh wants to merge 5 commits intodev/emissionfrom
codex/fix-compile-time-error-with-pgen

Conversation

@haykh
Copy link
Owner

@haykh haykh commented Jan 25, 2026

Motivation

  • Prevent explicit template instantiations from being generated for engine/metric/dimension combinations that are not supported by the selected problem generator, which caused compile-time template constraint failures when building with some PGENs (e.g. shock).

Description

  • Add a new concept IsCompatibleWithPGen<S, M> in src/engines/engine.hpp that checks metric presence and the user::PGen compatibility lists engines, metrics, and dimensions.
  • Replace direct explicit instantiations of Engine<S, M<D>>::init, ::run, and ::print_report with small instantiator structs that are only defined when IsCompatibleWithPGen<S, M<D>> holds in src/engines/engine_init.cpp, src/engines/engine_run.cpp, and src/engines/engine_printer.cpp.
  • This change gates instantiation of engine methods to only the specializations that are compatible with the problem generator and avoids emitting invalid instantiations for unsupported engine/metric/dimension tuples.

Testing

  • No automated tests were run as part of this change.

Codex Task

@haykh haykh closed this Jan 25, 2026
@haykh haykh deleted the codex/fix-compile-time-error-with-pgen branch January 25, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant