fix: address spm-lab-repository-audit-bot issues #237-#243 - #244
Merged
Conversation
- #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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the six open issues from
spm-lab-repository-audit-bot:DiscreteLehmannRepresentation::new/with_polesreturn a typedDlrErrorinstead of panicking on insufficient default poles or kernel/statistics mismatch.spir_dlr_new/spir_dlr_new_with_polesmap it toSPIR_INVALID_ARGUMENT/SPIR_NOT_SUPPORTEDinstead of collapsing toSPIR_INTERNAL_ERROR.lambda/epsilonno longer passes the<= 0.0guards inspir_logistic_kernel_new,spir_reg_bose_kernel_new,spir_sve_result_new(!is_finite()added); same hardening for the coreRegularizedBoseKernel::newand thespir_basis_new*parameter guards.spir_basis_get_default_matsus_extnever writes past the caller'sn_pointsbuffer. Withmitigate=true, fencing output is clamped to the buffer (explicit partial-output semantics documented); truncation is observable viaspir_basis_get_n_default_matsus_ext. Rust + C++ regression tests updated.RegularizedBoseKernel+ fermionic statistics rejected at the C ABI boundary (spir_basis_new,spir_basis_new_from_sve_and_regularizer) withSPIR_NOT_SUPPORTED, instead of deferring a downstream panic.SPARSEIR_DEBUG-gateddebug_warn!macro (thedlr.rswarning was removed — superseded by the #237 typed error).sparse-ir-capi/assets/sparse_ir_capi.hfrom the cbindgen output (c_complex/int *statusABI drift eliminated) and added aheader-syncCI job that fails when the generated and checked-in headers diverge (cbindgen pinned to 0.29.2).Notes
mitigate=truepath unusable — fencing output always exceeds the request, so an error could never succeed.Verification
cargo test --workspace --release: 349 passed, 0 failedcbindgenoutput == committed generated header == assets copy