Skip to content

perf: selected-position fatigue evaluation - #20

Merged
SMI-Lab-Inha merged 1 commit into
devfrom
perf/selected-wire-positions
Nov 17, 2026
Merged

SMI-Lab-Inha merged 1 commit into
devfrom
perf/selected-wire-positions

Conversation

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner

Summary

compute_fatigue(..., wire_positions=...) evaluates selected wires instead of every wire of each armour layer:

cx.compute_fatigue(cable, kx, ky, tension_N=T, wire_positions=12)            # 12 equally spaced positions per layer
cx.compute_fatigue(cable, kx, ky, tension_N=T, wire_positions=[0, 90, 180])  # the wire nearest to each azimuth [deg]
cx.compute_fatigue(cable, kx, ky, tension_N=T, wire_positions={"inner_armour": 12, "outer_armour": [45.0]})

Wire $k$ of a layer of $n$ wires lies at the azimuth $360,k/n$ degrees, the convention of phi_critical_deg. The per-wire arrays hold the selected wires in ascending order; FatigueResult.wire_index and wire_azimuth_deg name them. The critical wire and the damage sums are over the selected wires only.

Identity. A wire's friction recursion, stress field and rainflow count do not depend on the other wires, so every per-wire and per-fibre array of a selection equals the same rows of the full evaluation bit for bit (np.testing.assert_array_equal), in every route the selection reaches:

Route How the selection is evaluated
direction-tied, compiled (default) the kernel solves only the selected wires; the layer's wire count still sets each wire's tributary width (new n_total kernel argument)
direction-tied with friction law same, law kernel
direction-tied reference (numba off), progressive, distributed, section-state histories the layer is solved and the selected rows are kept
termination clamp increment solved for the layer, selected rows kept
copper SWT slip-cycle, legacy copper and steel slip-amplitude contact branches per selected wire

transverse slip (wire_stress_field only) couples neighbouring wires and is refused with a selection. SeaStateBatchOptions(wire_positions=...) passes the selection to every run (absent from the assessment digest when unset, so existing digests are unchanged), and compute_long_term_fatigue requires the same wires in every case and reports the critical wire by its number.

Timings

66 kV template, one hour at 10 Hz (36 000 samples, $T = 100 \pm 10$ kN, $\kappa_x, \kappa_y$ irregular, standard deviations 0.004 and 0.002 1/m), both armour layers (139 + 145 wires), compute_fatigue, one thread, warm:

Model Fibres Every wire, before (dev) Every wire, after 12 positions per layer
direction-tied 4 1.26 s 1.24 s 0.11 s
direction-tied 32 3.70 s 3.72 s 0.31 s
distributed 4 25.4 s 24.0 s 23.3 s
distributed 32 27.7 s 26.3 s 23.3 s

The every-wire columns differ by run-to-run variation only (the every-wire path is unchanged apart from passing the wire count to the kernel).

Distributed model profile. 23.1 s of the 24.0 s are in the compiled increment solver (distributed_friction_history); the Python side (field, local bending, rainflow) is 0.9 s. The solver does 0.72 million substeps on the inner layer and 2.24 million on the outer, 1.30 and 1.14 Newton solves per substep, about 14 ns per helix node and substep (556 and 580 nodes). The substep count is set by the substep rule (0.1 of the slip-onset curvature) and the template's small slip-onset curvatures with tension-only contact ($\kappa_{on}$ = 1.6e-4 and 5.1e-5 1/m against curvature standard deviations of 0.004 and 0.002 1/m). No avoidable overhead was found outside the solver, and the solver itself was not changed here: fewer substeps would change results beyond round-off. A selection saves the counting only, since the helix of the whole layer must be solved.

Tests

tests/test_selected_wire_positions.py (5 s): select_wires rules; identity of every per-wire and per-fibre array against the full evaluation for direction-tied, distributed and progressive friction, the numba-free reference kernels, a friction law, Goodman mean stress, the termination clamp with SCF, copper slip-cycle and legacy contact life and the steel slip-amplitude branch; the critical wire's azimuth and above-core flag; input checks; long-term accumulation; a project round trip of the new fields.

Gates: ruff, mypy (0 errors), full suite with numba and with CABLEXSEC_DISABLE_NUMBA=1, run_validation.py --check (no row moves).

@SMI-Lab-Inha

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 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-17T18:26:08.390445Z 6c98552 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 17, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #35964454 | 📁 Comparing 6c98552 against latest (240bf9c)

  🔍 Preview build  

18 files changed · ± 18 modified

± Modified

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: ba55e75193

ℹ️ 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".

compute_fatigue(wire_positions=...) evaluates chosen wires instead of
every wire: N equally spaced positions per armour layer, explicit
azimuths (the nearest wire to each) or a mapping per layer. Each wire's
friction recursion, stress field and rainflow count are independent of
the other wires, so every per-wire and per-fibre result of a selected
wire equals the full evaluation bit for bit. The direction-tied kernel
solves only the selected wires (the layer's wire count is passed for
the tributary width); the other friction models, the termination
increment and the reference kernels solve the layer and keep the
selected rows. FatigueResult.wire_index and wire_azimuth_deg name the
rows; the batch options pass the selection and the long-term
accumulation requires the same wires in every case.

On the 66 kV template, one hour at 10 Hz, both armour layers, one
thread: 12 positions per layer take 0.11 s instead of 1.24 s (4 fibres)
and 0.31 s instead of 3.72 s (32 fibres). The distributed model's time
is all in its compiled increment solver (substep count set by the
slip-onset curvature); no avoidable overhead was found outside it.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
@SMI-Lab-Inha
SMI-Lab-Inha force-pushed the perf/selected-wire-positions branch from ba55e75 to 6c98552 Compare November 17, 2026 18:24
@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. Chef's kiss.

Reviewed commit: 6c985525e5

ℹ️ 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 6f7b73b into dev Nov 17, 2026
12 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the perf/selected-wire-positions branch November 17, 2026 19:06
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