Skip to content

refactor: ComponentEngineBase, unified S-param API, enforced registry/drawer consistency - #63

Merged
striderZA merged 3 commits into
masterfrom
refactor/engine-unification
Aug 10, 2026
Merged

refactor: ComponentEngineBase, unified S-param API, enforced registry/drawer consistency#63
striderZA merged 3 commits into
masterfrom
refactor/engine-unification

Conversation

@striderZA

@striderZA striderZA commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

Engine/registry unification from a comprehensive codebase review (findings M5, M6, M7).

  • M6 — ComponentEngineBase (common/component_engine_base.h). Owns the id/graph-node/SignalNode/dirty-flag/cached-input boilerplate every engine repeated verbatim (members in mixer/adc/splitter headers, the dirty-check prologue in 15 update()s, the graph.addNode ctor). Migrated: amplifier, equalizer, mixer, splitter, adc, signal_generator, attenuator, combiner, coax. pfb_channelizer + ideal_filter migrated in fix/dsp-accuracy (their fixes landed there). spectrum_analyzer/iq_plot/touchstone are not IComponentEngine-style engines — left out deliberately.
  • M5 — unified S-param API. Attenuator/combiner renamed from setSParamFile/sParamFile/m_sparam to the canonical setSParamFilepath/sparamFilepath/sparamLoaded/sparamData/m_sparam_data (amplifier/equalizer/ideal_filter convention). Serialization key unified to sparam_filepath with a sparam_path fallback on deserialize, so old project files still load.
  • M7 — enforced registry/drawer consistency. registerDrawers' 11-branch if/else chain replaced with a drawer map built once; a registry row with no drawer now LOG_ERRORs instead of silently rendering an empty panel. InspectorPanel::hasDrawer() powers a new consistency test: every registry type has a drawer, maps to a real NodeKind, and supports_sparam_file matches the 5 engines that actually implement S-param. Fixed the supports_sparam_file drift (equalizer/filter/attenuator/combiner were false).
  • Carries the coax preset-index clamp (moved with the coax file to keep it whole).

Verification

  • Full build green; tests.exe 217 cases / 65538 assertions (216 + coax clamp test); test_signal_domain 32 cases / 66 assertions (+ the S-param-mode fs_Hz test, which is coupled to this branch's API rename); test_component_dispatch 6 cases / 129 assertions (new consistency test); test_ui 27/27.
  • Old-project compatibility: deserialize falls back to sparam_path for pre-existing .rfsim files.

Notes for merging (verified by test-merging all 6 branches in order)

This branch's cross-cutting API rename collides with two branches that edit the same regions against the old names. Both conflicts are purely additive:

  • vs ci/run-tests-on-prtests/test_project_file.cpp (the 4 S-param lines in the Fix S-param mode not reloading on project deserialize #56 test) and tests/test_signal_domain.cpp (test-block insertion overlap). Resolution: keep this branch's setSParamFilepath(s2p)/sparamMode() (the old names no longer compile once this branch lands) and keep both test sets (ci's 4 pass-through fs_Hz tests + this branch's S-param-mode fs_Hz test).
  • vs fix/ui-stateapp/src/inspector_panel.cpp, two blocks (attenuator + combiner drawers): engine.setSParamFile(path_buf); m_param_edited = true; vs engine.setSParamFilepath(path_buf);. Resolution: keep both — engine.setSParamFilepath(path_buf); m_param_edited = true;.

Recommended merge order (verified green): fix/crash-and-containmentci/run-tests-on-prthis branch (resolve the two conflicts above) → fix/dsp-accuracyfix/ui-state (clean) → refactor/cleanup (clean). common/component_engine_base.h is identical in fix/dsp-accuracy (same blob, no conflict).

RF Simulator Bot and others added 3 commits August 10, 2026 08:23
…/drawer consistency

M6: add ComponentEngineBase (common/component_engine_base.h) owning the id/graph-node/SignalNode/dirty-flag/cached-input boilerplate every engine repeated; migrate amplifier, equalizer, mixer, splitter, adc, signal_generator, attenuator, combiner, coax. (pfb_channelizer + ideal_filter migrated in the DSP-accuracy branch where their fixes landed.)
M5: attenuator/combiner S-param API renamed to the canonical setSParamFilepath/sparamFilepath/sparamLoaded/sparamData (was setSParamFile/sParamFile/m_sparam); serialization key unified to sparam_filepath with a sparam_path fallback on deserialize so old project files still load.
M7: registerDrawers' 11-branch if/else chain replaced with a drawer map built once; a registry row with no drawer now LOG_ERRORs instead of silently rendering an empty panel, and InspectorPanel::hasDrawer() powers a new consistency test (every registry type has a drawer, maps to a real NodeKind, and supports_sparam_file matches the 5 engines that actually implement S-param). Fix the supports_sparam_file drift (equalizer/filter/attenuator/combiner were false).
Also carries the coax preset-index clamp (moved with the coax file to keep it whole).
… must use the local staged fixture (S1 containment neutralizes absolute out-of-project paths on load)
@striderZA
striderZA merged commit 4acd601 into master Aug 10, 2026
striderZA added a commit that referenced this pull request Aug 10, 2026
fix: restore the 4 fs_Hz regression tests dropped in the #63 merge resolution
@striderZA
striderZA deleted the refactor/engine-unification branch August 10, 2026 08:28
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