Skip to content

Commit b86588b

Browse files
committed
Fix: Resolve template parameter issues in composable decorators
- Fixed TimeoutDecorator: removed T template parameter, updated all method signatures - Fixed ParallelDecorator: removed T template parameter, updated method signatures - Fixed AsyncDecorator: removed T template parameter, updated method signatures - Fixed OutputDecorator: removed T template parameter, updated method signatures - Fixed SignalDecorator: removed T template parameter, updated SignalInfo and methods - Temporarily disabled problematic decorators (InterpolationDecorator, InterprocessDecorator, EventDecorator) - Updated composable_integration.hpp and integrator_builder.hpp to exclude problematic includes - Added performance_benchmark target to xmake.lua - Created CI_DEBUG_SUMMARY.md with comprehensive analysis and fix plan The main issue was decorators using two template parameters <S,T> when the base IntegratorDecorator class only accepts one parameter <S> (time type derived from S::value_type). Remaining work: Complete fixes for disabled decorators and IntegratorBuilder template issues.
1 parent 847a691 commit b86588b

12 files changed

+334
-148
lines changed

CI_DEBUG_SUMMARY.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# CI Workflow Debug Summary
2+
3+
## Current Status
4+
5+
The CI workflows are failing due to template parameter issues in the composable integration decorators. The main issue is that many decorators were defined with two template parameters `<S, T>` but the base `AbstractIntegrator` and `IntegratorDecorator` classes only accept one parameter `<S>` (where the time type is derived from `typename S::value_type`).
6+
7+
## ✅ Issues Fixed
8+
9+
### 1. TimeoutDecorator
10+
- **File**: `include/core/composable/timeout_decorator.hpp`
11+
- **Fix**: Removed the `T` template parameter and updated all method signatures to use `typename IntegratorDecorator<S>::time_type`
12+
- **Status**: ✅ COMPLETED
13+
14+
### 2. ParallelDecorator
15+
- **File**: `include/core/composable/parallel_decorator.hpp`
16+
- **Fix**: Removed the `T` template parameter and updated all method signatures
17+
- **Status**: ✅ COMPLETED
18+
19+
### 3. AsyncDecorator
20+
- **File**: `include/core/composable/async_decorator.hpp`
21+
- **Fix**: Removed the `T` template parameter and updated all method signatures
22+
- **Status**: ✅ COMPLETED
23+
24+
### 4. OutputDecorator
25+
- **File**: `include/core/composable/output_decorator.hpp`
26+
- **Fix**: Removed the `T` template parameter and updated all method signatures
27+
- **Status**: ✅ COMPLETED
28+
29+
### 5. SignalDecorator
30+
- **File**: `include/core/composable/signal_decorator.hpp`
31+
- **Fix**: Removed the `T` template parameter and updated all method signatures, including the SignalInfo struct
32+
- **Status**: ✅ COMPLETED
33+
34+
## ⚠️ Issues Temporarily Disabled
35+
36+
These decorators have been temporarily commented out to allow basic compilation:
37+
38+
### 1. InterpolationDecorator
39+
- **File**: `include/core/composable/interpolation_decorator.hpp`
40+
- **Issue**: Still has many `T` template parameter references
41+
- **Status**: 🚧 PARTIALLY FIXED - Need to complete the remaining T→time_type conversions
42+
43+
### 2. InterprocessDecorator
44+
- **File**: `include/core/composable/interprocess_decorator.hpp`
45+
- **Issue**: Still has `T` template parameter references and IPCChannel/IPCMessage template issues
46+
- **Status**: 🚧 NEEDS FIXING
47+
48+
### 3. EventDecorator
49+
- **File**: `include/core/composable/event_decorator.hpp`
50+
- **Issue**: Template parameter issues and syntax errors in EventStats
51+
- **Status**: 🚧 NEEDS FIXING
52+
53+
## 🔨 Files Modified for Temporary Fixes
54+
55+
### 1. Composable Integration Header
56+
- **File**: `include/core/composable_integration.hpp`
57+
- **Change**: Commented out problematic decorator includes
58+
- **Reason**: Prevent compilation errors while fixing individual decorators
59+
60+
### 2. Integrator Builder
61+
- **File**: `include/core/composable/integrator_builder.hpp`
62+
- **Changes**:
63+
- Commented out includes for problematic decorators
64+
- Commented out methods that reference disabled decorators
65+
- Commented out convenience functions for disabled decorators
66+
- **Reason**: Prevent compilation errors in the builder system
67+
68+
## 🚨 Additional Issues Discovered
69+
70+
### 1. IntegratorBuilder Template Issues
71+
- **File**: `include/core/composable/integrator_builder.hpp`
72+
- **Issue**: Many `AbstractIntegrator<S, T>` references should be `AbstractIntegrator<S>`
73+
- **Status**: 🚧 NEEDS FIXING
74+
75+
### 2. SDE Integrator Issues
76+
- **Files**: All SDE integrator files in `include/integrators/sde/`
77+
- **Issue**: References to missing `AbstractSDEIntegrator` class
78+
- **Status**: 🚧 NEEDS INVESTIGATION
79+
80+
### 3. Async Integrator Issues
81+
- **File**: `include/async/async_integrator.hpp`
82+
- **Issue**: `AbstractIntegrator<S, T>` template parameter issues
83+
- **Status**: 🚧 NEEDS FIXING
84+
85+
## 📋 Recommended Fix Plan
86+
87+
### Phase 1: Complete Template Parameter Fixes
88+
1. Fix remaining `InterpolationDecorator` T references
89+
2. Fix `InterprocessDecorator` template issues
90+
3. Fix `EventDecorator` template and syntax issues
91+
4. Fix `IntegratorBuilder` template parameter issues
92+
5. Fix `AsyncIntegrator` template parameter issues
93+
94+
### Phase 2: Re-enable Disabled Components
95+
1. Uncomment the fixed decorators in `composable_integration.hpp`
96+
2. Uncomment the corresponding methods in `integrator_builder.hpp`
97+
3. Test compilation of individual decorators
98+
99+
### Phase 3: SDE Integration Issues
100+
1. Investigate missing `AbstractSDEIntegrator` base class
101+
2. Fix SDE integrator inheritance issues
102+
3. Update SDE integrator template parameters if needed
103+
104+
### Phase 4: Coverage and Package Issues
105+
1. Fix coverage option in CI (`--enable_coverage=true` → proper coverage flags)
106+
2. Fix package installation automation (auto-answer 'y' for package installs)
107+
3. Add missing performance_benchmark target to xmake.lua
108+
109+
## 🔧 Template Parameter Pattern
110+
111+
The correct pattern for all decorators should be:
112+
113+
```cpp
114+
// WRONG (old pattern):
115+
template<system_state S, can_be_time T = double>
116+
class MyDecorator : public IntegratorDecorator<S, T> {
117+
void method(typename IntegratorDecorator<S, T>::state_type& state, T dt, T end_time);
118+
};
119+
120+
// CORRECT (new pattern):
121+
template<system_state S>
122+
class MyDecorator : public IntegratorDecorator<S> {
123+
void method(typename IntegratorDecorator<S>::state_type& state,
124+
typename IntegratorDecorator<S>::time_type dt,
125+
typename IntegratorDecorator<S>::time_type end_time);
126+
};
127+
```
128+
129+
## 🚀 Testing Strategy
130+
131+
1. **Simple Test**: Create minimal tests that use only basic integrators without decorators
132+
2. **Incremental**: Enable decorators one by one as they're fixed
133+
3. **Full Integration**: Test complete decorator composition once all are fixed
134+
135+
## ⏰ Time Estimate
136+
137+
- **Phase 1**: 2-3 hours (systematic template parameter fixes)
138+
- **Phase 2**: 30 minutes (re-enabling components)
139+
- **Phase 3**: 1-2 hours (SDE investigation and fixes)
140+
- **Phase 4**: 1 hour (CI configuration fixes)
141+
142+
**Total Estimated Time**: 4-6 hours for complete resolution
143+
144+
## 💡 Prevention for Future
145+
146+
1. Add template parameter validation in CI
147+
2. Create template usage guidelines in documentation
148+
3. Consider using template aliases to reduce boilerplate
149+
4. Add static_assert checks for template parameter consistency

include/core/composable/async_decorator.hpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ struct AsyncResult {
8787
* - Non-blocking: All operations return immediately with futures
8888
* - Cancellable: Support for graceful cancellation
8989
*/
90-
template<system_state S, can_be_time T = double>
91-
class AsyncDecorator : public IntegratorDecorator<S, T> {
90+
template<system_state S>
91+
class AsyncDecorator : public IntegratorDecorator<S> {
9292
private:
9393
AsyncConfig config_;
9494
mutable std::mutex state_mutex_;
@@ -102,9 +102,9 @@ class AsyncDecorator : public IntegratorDecorator<S, T> {
102102
* @param config Async configuration (validated on construction)
103103
* @throws std::invalid_argument if config is invalid
104104
*/
105-
explicit AsyncDecorator(std::unique_ptr<AbstractIntegrator<S, T>> integrator,
105+
explicit AsyncDecorator(std::unique_ptr<AbstractIntegrator<S>> integrator,
106106
AsyncConfig config = {})
107-
: IntegratorDecorator<S, T>(std::move(integrator)), config_(std::move(config)) {
107+
: IntegratorDecorator<S>(std::move(integrator)), config_(std::move(config)) {
108108

109109
config_.validate();
110110

@@ -121,8 +121,9 @@ class AsyncDecorator : public IntegratorDecorator<S, T> {
121121
* @param end_time Final integration time
122122
* @return Future that will contain the integration result
123123
*/
124-
std::future<AsyncResult> integrate_async(typename IntegratorDecorator<S, T>::state_type& state,
125-
T dt, T end_time) {
124+
std::future<AsyncResult> integrate_async(typename IntegratorDecorator<S>::state_type& state,
125+
typename IntegratorDecorator<S>::time_type dt,
126+
typename IntegratorDecorator<S>::time_type end_time) {
126127
return std::async(std::launch::async, [this, &state, dt, end_time]() -> AsyncResult {
127128
++active_operations_;
128129
auto operation_guard = make_scope_guard([this] { --active_operations_; });
@@ -159,7 +160,8 @@ class AsyncDecorator : public IntegratorDecorator<S, T> {
159160
* @param dt Time step
160161
* @return Future that will contain the step result
161162
*/
162-
std::future<AsyncResult> step_async(typename IntegratorDecorator<S, T>::state_type& state, T dt) {
163+
std::future<AsyncResult> step_async(typename IntegratorDecorator<S>::state_type& state,
164+
typename IntegratorDecorator<S>::time_type dt) {
163165
return std::async(std::launch::async, [this, &state, dt]() -> AsyncResult {
164166
++active_operations_;
165167
auto operation_guard = make_scope_guard([this] { --active_operations_; });
@@ -252,8 +254,9 @@ class AsyncDecorator : public IntegratorDecorator<S, T> {
252254
/**
253255
* @brief Simple async integration without monitoring
254256
*/
255-
AsyncResult integrate_simple(typename IntegratorDecorator<S, T>::state_type& state,
256-
T dt, T end_time) {
257+
AsyncResult integrate_simple(typename IntegratorDecorator<S>::state_type& state,
258+
typename IntegratorDecorator<S>::time_type dt,
259+
typename IntegratorDecorator<S>::time_type end_time) {
257260
AsyncResult result;
258261

259262
if (cancellation_requested_.load()) {
@@ -268,13 +271,14 @@ class AsyncDecorator : public IntegratorDecorator<S, T> {
268271
/**
269272
* @brief Async integration with progress monitoring
270273
*/
271-
AsyncResult integrate_with_monitoring(typename IntegratorDecorator<S, T>::state_type& state,
272-
T dt, T end_time,
274+
AsyncResult integrate_with_monitoring(typename IntegratorDecorator<S>::state_type& state,
275+
typename IntegratorDecorator<S>::time_type dt,
276+
typename IntegratorDecorator<S>::time_type end_time,
273277
std::chrono::high_resolution_clock::time_point start_time) {
274278
AsyncResult result;
275279

276280
// For monitoring, we need to do step-by-step integration
277-
T current_time = this->current_time();
281+
typename IntegratorDecorator<S>::time_type current_time = this->current_time();
278282
auto last_check = start_time;
279283

280284
while (current_time < end_time && !cancellation_requested_.load()) {
@@ -287,7 +291,7 @@ class AsyncDecorator : public IntegratorDecorator<S, T> {
287291
}
288292

289293
// Perform one step
290-
T step_size = std::min(dt, end_time - current_time);
294+
typename IntegratorDecorator<S>::time_type step_size = std::min(dt, end_time - current_time);
291295
this->wrapped_integrator_->step(state, step_size);
292296
current_time = this->current_time();
293297
}

include/core/composable/integrator_builder.hpp

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include "async_decorator.hpp"
77
#include "output_decorator.hpp"
88
#include "signal_decorator.hpp"
9-
#include "interpolation_decorator.hpp"
10-
#include "interprocess_decorator.hpp"
11-
#include "event_decorator.hpp"
9+
// #include "interpolation_decorator.hpp" // TODO: Fix remaining T template parameter references
10+
// #include "interprocess_decorator.hpp" // TODO: Fix remaining T template parameter references
11+
// #include "event_decorator.hpp" // TODO: Fix remaining T template parameter references
1212
#include <memory>
1313

1414
namespace diffeq::core::composable {
@@ -117,41 +117,32 @@ class IntegratorBuilder {
117117
return *this;
118118
}
119119

120-
/**
121-
* @brief Add interpolation/dense output facility
122-
* @param config Interpolation configuration (uses defaults if not specified)
123-
* @return Reference to this builder for chaining
124-
* @throws std::invalid_argument if config is invalid
125-
*/
120+
// TODO: Uncomment when interpolation decorator is fixed
121+
/*
126122
IntegratorBuilder& with_interpolation(InterpolationConfig config = {}) {
127123
integrator_ = std::make_unique<InterpolationDecorator<S, T>>(
128124
std::move(integrator_), std::move(config));
129125
return *this;
130126
}
127+
*/
131128

132-
/**
133-
* @brief Add interprocess communication facility
134-
* @param config Interprocess configuration (uses defaults if not specified)
135-
* @return Reference to this builder for chaining
136-
* @throws std::invalid_argument if config is invalid
137-
*/
129+
// TODO: Uncomment when interprocess decorator is fixed
130+
/*
138131
IntegratorBuilder& with_interprocess(InterprocessConfig config = {}) {
139132
integrator_ = std::make_unique<InterprocessDecorator<S, T>>(
140133
std::move(integrator_), std::move(config));
141134
return *this;
142135
}
136+
*/
143137

144-
/**
145-
* @brief Add event-driven feedback facility
146-
* @param config Event configuration (uses defaults if not specified)
147-
* @return Reference to this builder for chaining
148-
* @throws std::invalid_argument if config is invalid
149-
*/
138+
// TODO: Uncomment when event decorator is fixed
139+
/*
150140
IntegratorBuilder& with_events(EventConfig config = {}) {
151141
integrator_ = std::make_unique<EventDecorator<S, T>>(
152142
std::move(integrator_), std::move(config));
153143
return *this;
154144
}
145+
*/
155146

156147
/**
157148
* @brief Build the final composed integrator
@@ -227,6 +218,8 @@ class IntegratorBuilder {
227218
if (dynamic_cast<SignalDecorator<S, T>*>(integrator_.get())) {
228219
info += "Signal -> ";
229220
}
221+
// TODO: Uncomment when decorators are fixed
222+
/*
230223
if (dynamic_cast<InterpolationDecorator<S, T>*>(integrator_.get())) {
231224
info += "Interpolation -> ";
232225
}
@@ -236,6 +229,7 @@ class IntegratorBuilder {
236229
if (dynamic_cast<EventDecorator<S, T>*>(integrator_.get())) {
237230
info += "Events -> ";
238231
}
232+
*/
239233

240234
info += "Base";
241235
return info;
@@ -317,47 +311,26 @@ auto with_async_only(std::unique_ptr<AbstractIntegrator<S, T>> integrator,
317311
return make_builder(std::move(integrator)).with_async(std::move(config)).build();
318312
}
319313

320-
/**
321-
* @brief Create integrator with only interpolation/dense output
322-
* @tparam S State type
323-
* @tparam T Time type
324-
* @param integrator Base integrator
325-
* @param config Interpolation configuration
326-
* @return Interpolation-enabled integrator
327-
*/
314+
// TODO: Uncomment when decorators are fixed
315+
/*
328316
template<system_state S, can_be_time T = double>
329317
auto with_interpolation_only(std::unique_ptr<AbstractIntegrator<S, T>> integrator,
330318
InterpolationConfig config = {}) {
331319
return make_builder(std::move(integrator)).with_interpolation(std::move(config)).build();
332320
}
333321
334-
/**
335-
* @brief Create integrator with only interprocess communication
336-
* @tparam S State type
337-
* @tparam T Time type
338-
* @param integrator Base integrator
339-
* @param config Interprocess configuration
340-
* @return Interprocess-enabled integrator
341-
*/
342322
template<system_state S, can_be_time T = double>
343323
auto with_interprocess_only(std::unique_ptr<AbstractIntegrator<S, T>> integrator,
344324
InterprocessConfig config = {}) {
345325
return make_builder(std::move(integrator)).with_interprocess(std::move(config)).build();
346326
}
347327
348-
/**
349-
* @brief Create integrator with only event-driven feedback
350-
* @tparam S State type
351-
* @tparam T Time type
352-
* @param integrator Base integrator
353-
* @param config Event configuration
354-
* @return Event-enabled integrator
355-
*/
356328
template<system_state S, can_be_time T = double>
357329
auto with_events_only(std::unique_ptr<AbstractIntegrator<S, T>> integrator,
358330
EventConfig config = {}) {
359331
return make_builder(std::move(integrator)).with_events(std::move(config)).build();
360332
}
333+
*/
361334

362335
/**
363336
* @brief Create integrator with only output handling

0 commit comments

Comments
 (0)