Skip to content

fix: address spm-lab-repository-audit-bot issues #237-#243 - #244

Merged
shinaoka merged 1 commit into
mainfrom
fix/audit-bot-issues
Aug 13, 2026
Merged

fix: address spm-lab-repository-audit-bot issues #237-#243#244
shinaoka merged 1 commit into
mainfrom
fix/audit-bot-issues

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Addresses the six open issues from spm-lab-repository-audit-bot:

Issue Fix
#237 DiscreteLehmannRepresentation::new/with_poles return a typed DlrError instead of panicking on insufficient default poles or kernel/statistics mismatch. spir_dlr_new/spir_dlr_new_with_poles map it to SPIR_INVALID_ARGUMENT/SPIR_NOT_SUPPORTED instead of collapsing to SPIR_INTERNAL_ERROR.
#238 NaN lambda/epsilon no longer passes the <= 0.0 guards in spir_logistic_kernel_new, spir_reg_bose_kernel_new, spir_sve_result_new (!is_finite() added); same hardening for the core RegularizedBoseKernel::new and the spir_basis_new* parameter guards.
#239 spir_basis_get_default_matsus_ext never writes past the caller's n_points buffer. With mitigate=true, fencing output is clamped to the buffer (explicit partial-output semantics documented); truncation is observable via spir_basis_get_n_default_matsus_ext. Rust + C++ regression tests updated.
#241 RegularizedBoseKernel + fermionic statistics rejected at the C ABI boundary (spir_basis_new, spir_basis_new_from_sve_and_regularizer) with SPIR_NOT_SUPPORTED, instead of deferring a downstream panic.
#242 Library code no longer writes to stderr unconditionally: warnings routed through a new SPARSEIR_DEBUG-gated debug_warn! macro (the dlr.rs warning was removed — superseded by the #237 typed error).
#243 Regenerated sparse-ir-capi/assets/sparse_ir_capi.h from the cbindgen output (c_complex/int *status ABI drift eliminated) and added a header-sync CI job that fails when the generated and checked-in headers diverge (cbindgen pinned to 0.29.2).

Notes

Verification

  • cargo test --workspace --release: 349 passed, 0 failed
  • C++ cinterface tests: 274 assertions, all passed
  • Header sync: cbindgen output == committed generated header == assets copy

- #237: DiscreteLehmannRepresentation::new/with_poles return typed
  DlrError instead of panicking on insufficient default poles or
  kernel/statistics mismatch; spir_dlr_new(_with_poles) maps the error
  to SPIR_INVALID_ARGUMENT / SPIR_NOT_SUPPORTED instead of collapsing
  it to SPIR_INTERNAL_ERROR
- #238: reject NaN lambda/epsilon in C ABI kernel/SVE constructors and
  core RegularizedBoseKernel::new (bare <= 0.0 guards accept NaN); also
  harden spir_basis_new / spir_basis_new_from_sve_and_regularizer
  beta/omega_max/epsilon/lambda guards with !is_finite()
- #239: spir_basis_get_default_matsus_ext never writes past the caller's
  n_points buffer; with mitigate=true fencing output is truncated to the
  buffer and the partial-output semantics are documented; C++ and Rust
  tests updated to assert the truncation contract
- #241: reject RegularizedBoseKernel + fermionic statistics at the C ABI
  boundary (spir_basis_new, spir_basis_new_from_sve_and_regularizer)
  with SPIR_NOT_SUPPORTED instead of deferring a downstream panic
- #242: library warnings no longer go to stderr unconditionally; routed
  through SPARSEIR_DEBUG-gated debug_warn! macro (dlr.rs warning removed,
  superseded by the #237 typed error)
- #243: regenerate sparse-ir-capi/assets/sparse_ir_capi.h from the
  cbindgen output (c_complex/int*status drift) and add a header-sync
  CI job that fails when generated and checked-in headers diverge

Tests: workspace suite (349 passed, 0 failed), C++ cinterface tests
(274 assertions), header diff check green.
@shinaoka
shinaoka merged commit ed22ee9 into main Aug 13, 2026
27 checks passed
@shinaoka
shinaoka deleted the fix/audit-bot-issues branch August 13, 2026 09:17
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