Skip to content

fix(continual-learning): declare IParameterizable on EWC/SI test mock model - #1569

Closed
ooples wants to merge 1 commit into
masterfrom
fix/continual-learning-ewc-si
Closed

ooples wants to merge 1 commit into
masterfrom
fix/continual-learning-ewc-si

Conversation

@ooples

@ooples ooples commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the continual-learning cluster in the Integration C shard from the PR #1563 failing-CI list — 14 ElasticWeightConsolidation / SynapticIntelligence deep-math integration tests (in my hand-off lane from #1562; does not touch any files #1562 owns).

Root cause (one shared bug): the interface-segregation refactor moved GetParameters / SetParameters / ParameterCount / WithParameters off IFullModel onto the separate IParameterizable interface. EWC and SI guard-require it via InterfaceGuard.Parameterizable — correctly, since EWC's Fisher information matrix and SI's per-parameter importance are both computed over the model's parameters, so a model with no trainable parameters cannot participate. The CLMockModel test fixture still declared only IFullModel, so the runtime model is IParameterizable<...> check failed:

System.InvalidOperationException : CLMockModel does not implement IParameterizable<Double, Tensor, Tensor>.
This operation requires a model with trainable parameters.
   at AiDotNet.ContinualLearning.Strategies.SynapticIntelligence.PrepareForTask(...)

Fix: declare IParameterizable<double, Tensor<double>, Tensor<double>> on CLMockModel. The mock already implements every member of that interface (GetParameters, SetParameters, ParameterCount, SupportsParameterInitialization, WithParameters, SanitizeParameters) — it just needed to declare it so the cast succeeds.

This is a fixture completing an interface it already implements. No production code is changed, and no assertion or expected value is weakened — the production requirement (EWC/SI need IParameterizable) is correct and stays.

Verification

All 36 ContinualLearningDeepMathIntegrationTests pass locally (net10.0, Release) — the 14 previously-failing EWC/SI tests plus the 22 that already passed.

🤖 Generated with Claude Code

… model

The interface-segregation refactor moved GetParameters / SetParameters /
ParameterCount / WithParameters off IFullModel and onto the separate
IParameterizable interface. EWC and Synaptic Intelligence guard-require it via
InterfaceGuard.Parameterizable (correctly — EWC's Fisher information matrix and
SI's per-parameter importance are both computed OVER the model's parameters, so
a model without trainable parameters cannot participate).

The CLMockModel test fixture still declared only IFullModel, so the runtime
`model is IParameterizable<...>` check failed and threw
"CLMockModel does not implement IParameterizable<...>" from PrepareForTask —
failing all 14 EWC/SI deep-math integration tests. The mock already implements
every IParameterizable member (GetParameters, SetParameters, ParameterCount,
SupportsParameterInitialization, WithParameters, SanitizeParameters); it just
needed to declare the interface so the cast succeeds.

No assertion or expected value changed. All 36 ContinualLearningDeepMath tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aidotnet-playground-api Ready Ready Preview, Comment Jun 11, 2026 3:25pm

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1830c586-215a-4196-978e-20887d7af34a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/continual-learning-ewc-si

Comment @coderabbitai help to get the list of available commands and usage tips.

@ooples

ooples commented Jun 11, 2026

Copy link
Copy Markdown
Owner Author

Consolidated into #1565 (single PR for the PR #1563 CI-failure lane, per request). Branch retained but superseded.

@ooples ooples closed this Jun 11, 2026

This branch was successfully deployed

1 active deployment
Preview – aidotnet-playground-api — c9352e42 Deployed Jun 11, 2026 by vercel[bot]
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.

1 participant