Skip to content

fix: fallbacks and skipped checks are an error or a warning, never silent - #46

Merged
SMI-Lab-Inha merged 6 commits into
devfrom
fix/silent-fallbacks
Nov 19, 2026
Merged

SMI-Lab-Inha merged 6 commits into
devfrom
fix/silent-fallbacks

Conversation

@SMI-Lab-Inha

@SMI-Lab-Inha SMI-Lab-Inha commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

A sweep of the package for silent fallbacks: solvers that switch method or clamp, iterations whose convergence is not checked, broad except clauses, singular solves and suppressed warnings. Each case below returned a value without saying so; each is now an error or a warning, with a test (tests/test_silent_fallbacks.py).

Where Before Now
fretting_regime.range_at_cycles bisection on [1e-6, 1e6] MPa returned its bound when the life lay outside it: 1e12 Pa for a life shorter than the curve's at 1e6 MPa, 1 Pa for a NaN life CableInputError for a life that is not finite and positive, or outside the bracket; inside it unchanged
compute_mkappa wire-yield guard except (ValueError, KeyError): pass — any CableInputError or PhysicalRangeError of the guard was swallowed and the check skipped without trace a cable without a yield-stressed armour layer (no bound) is skipped as before; a bound that cannot be evaluated warns (ExtrapolationWarning, with the reason); a solver failure still raises
beam_test monotone inversion with no new point to try, returned the closest cached point as converged (u = 0 for a target of 1 on a flat response) bisects the open brackets first; CableSolverError naming the missed targets and the miss only when no point is left
compute_sheave, rig-test M-κ loops internal compute_mkappa/compute_stress/compute_capacity calls under warnings.simplefilter("ignore"): a wire-yield or clamping warning about the caller's own curvature was dropped each distinct warning relayed once (provenance.relayed_warnings)
kinematic_history with laid cores any error of the core friction law silently held the cores to the cable axis the same fallback, with an ExtrapolationWarning and a provenance limitation; unlaid cores are held as before, silently (documented)

Reviewed and left as they are

  • distributed_friction: the Newton → fixed-point fallback is counted in the result statistics (capstan_newton_fallbacks) and the fixed point raises when it does not converge.
  • radial_solution.solve_lcp: the NNLS residual is not used, but complementarity is checked after the polish and failure raises CableSolverError.
  • rig_test with contact_model="auto": falls back to the bounded chain and records it in the result notes (documented behaviour of "auto"); "solved" raises.
  • components.compute_component_response: the frictional core state falls back to the stuck state with the reason in the component's basis (documented).
  • capacity_check interpolation clamps: governed by the documented out_of_range option (raise by default).
  • bend_restrictor, contact_pressure, along_wire, strain_life, mean_stress iterations: raise on non-convergence or are bracketed bisections that cannot leave their root.

Gates

On 7e98099 (dev 12be20f merged in: #40, #42, #43, #48, #49):

  • pytest (full suite, venv with the CI wheels, NUMBA_NUM_THREADS=1): 4768 passed, 4 skipped.
  • With CABLEXSEC_DISABLE_NUMBA=1: 4652 passed, 120 skipped.
  • python -m mypy: no issues in 119 source files. ruff check and ruff format --check on src tests examples validation release doc: clean.
  • Taxonomy: no marked test added; counts unchanged.

Stall on a step a few ulps wide (6342104)

After dev 7e14481, test_beam_test.py::test_leg_property_and_energy[kw3] (distributed friction, three-point bending, 24 stations per segment) raised the new stall error: one target missed by 6.26e-8 against a tolerance of 1.92e-9. The inverted quantity steps by 2.3e-7 over a few ulps of the curvature there and the target lies inside the step. Both interpolants rounded onto cached points, and bisection had not been tried at that iteration, so the bracket was closable but no point was added.

On a stall the open brackets are now bisected. A bracket with no float inside it is already closed by the existing width rule (4e-16 relative), so the error is raised only when no point is left. On a step 2.3e-7 high, 1600 targets inside it gave 429 stalls before the change and none after, each resolved to the step within 4e-16 relative. test_inversion_resolves_a_target_inside_a_round_off_step covers it and fails without the change.

…lent

- fretting_regime.range_at_cycles bisected on [1e-6, 1e6] MPa and returned
  the bound when the life lay outside it (1e12 Pa for a life shorter than the
  curve's at 1e6 MPa, 1 Pa for a NaN life). It refuses a life that is not
  finite and positive, or outside its bracket.
- The wire-yield guard of compute_mkappa swallowed every ValueError, so a
  bound that could not be evaluated left no trace. It warns; a cable without
  a yield-stressed armour layer, which has no bound, is skipped as before.
- The bending-test inversion returned its closest cached point as converged
  when it had no new point to try. It raises CableSolverError with the miss.
- A kinematic history whose laid cores have no friction law held them to
  the cable axis silently. It warns and records it in the provenance.
- compute_sheave and the rig-test M-kappa loops ran their internal calls
  under simplefilter("ignore"), dropping a wire-yield or clamping warning
  about the caller's own curvature. Each distinct warning is relayed once
  (provenance.relayed_warnings).

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T21:07:08.478124Z 7e98099 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@read-the-docs-community

read-the-docs-community Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #36024965 | 📁 Comparing 7e98099 against latest (240bf9c)

  🔍 Preview build  

24 files changed · ± 24 modified

± Modified

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e148d18e03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The new bracket check evaluated the life at 1e-6 MPa, which overflows for a
steep curve (m 40, log C 80) whose root at 1e6 cycles is representable, and
refused the curve. The bisection and its bracket now compare log10 lives
(SNcurve.log10_life), which stay representable.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: ab81e37a30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c05e3a702

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A life equal to the curve's life at 1e-6 MPa (to 1e-12 in log10) has its
root on the bracket's lower end; it was refused as outside it.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 6944fc01b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

After dev 7e14481, test_leg_property_and_energy[kw3] (distributed friction,
three-point, 24 stations per segment) raised "bending-test inversion
stalled: 1 target(s) missed by up to 6.26e-08 (tolerance 1.92e-09)". The
inverted quantity steps by 2.3e-7 over a few ulps of the curvature there,
the target lies inside the step, and both interpolants rounded onto cached
points, so no new point was added; bisection had not been tried at that
iteration. On a stall the open brackets are now bisected; a bracket with no
float inside is already closed as tiny, so a stall is raised only when no
point is left. On a step 2.3e-7 high, 1600 targets inside it: 429 stalls
before, none now, each resolved to the step within 4e-16 relative.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 6342104977

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 7e98099d01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SMI-Lab-Inha
SMI-Lab-Inha merged commit caca014 into dev Nov 19, 2026
14 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/silent-fallbacks branch November 19, 2026 22:26
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