Skip to content

Reject complex observation ensemble controls - #2155

Merged
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-complex-observation-ensemble-controls
Aug 10, 2026
Merged

Reject complex observation ensemble controls#2155
FlorianPfaff merged 2 commits into
mainfrom
agent/reject-complex-observation-ensemble-controls

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Member

Summary

  • reject complex-valued observation-ensemble weights, source temperatures, probability tolerances, and baseline-window endpoints at the public API boundary;
  • cover native NumPy complex scalars and object-array containers;
  • preserve existing real-valued controls and source-baseline-debiasing normalization;
  • add focused regression coverage for every affected control.

Root cause

The observation-ensemble implementation converted several programmatic controls with np.asarray(..., dtype=float) or float(...). NumPy complex scalars are accepted by those conversions with a warning while their imaginary component is discarded. A configuration such as source_temperatures=(np.complex128(1 + 2j), 1.0) therefore ran as (1.0, 1.0) and recorded only the narrowed real values.

The same silent narrowing affected ensemble weights, probability-row tolerance, and baseline-window endpoints. This could execute a scientifically different configuration without a deterministic input error.

Impact

Malformed complex controls now fail before probability alignment or baseline computation. Ordinary Python/NumPy real scalars, arrays, tuples, and existing Boolean normalization retain their behavior.

Validation

  • independently reproduced NumPy's complex-to-real narrowing for the affected conversions;
  • syntax-checked the modified runtime patch and new regression module;
  • exercised the validation wrapper in an isolated harness for all four controls plus valid real-valued controls;
  • branch comparison: 2 files changed, 128 additions / 2 deletions, 2 commits ahead and 0 behind main;
  • full repository validation is delegated to GitHub Actions because the execution environment has no GitHub CLI and cannot clone github.com through DNS.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 29 0 0 1.59s
✅ COPYPASTE jscpd yes no no 4.14s
✅ MARKDOWN markdownlint 141 0 0 0 3.34s
✅ PYTHON ruff 1559 0 0 0 0.87s
✅ REPOSITORY git_diff yes no no 0.25s
✅ YAML prettier 70 0 0 0 3.06s
✅ YAML v8r 70 0 0 11.03s
✅ YAML yamllint 70 0 0 1.82s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Test Results

     4 files  ± 0       4 suites  ±0   5m 11s ⏱️ +28s
 6 870 tests + 5   6 832 ✅ +20   38 💤 ±0  0 ❌  - 15 
27 488 runs  +20  27 336 ✅ +80  152 💤 ±0  0 ❌  - 60 

Results for commit 5c910e2. ± Comparison against base commit 67e9a68.

♻️ This comment has been updated with latest results.

@FlorianPfaff
FlorianPfaff marked this pull request as ready for review August 7, 2026 16:52
@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 7, 2026 16:52
auto-merge was automatically disabled August 9, 2026 16:00

Pull request was closed

@FlorianPfaff FlorianPfaff reopened this Aug 9, 2026
@FlorianPfaff
FlorianPfaff enabled auto-merge (squash) August 9, 2026 16:01
@FlorianPfaff
FlorianPfaff merged commit f4b8f0b into main Aug 10, 2026
24 of 32 checks passed
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