Skip to content

fix: shorten the slowest validation tests; one SV11 prediction per report - #75

Merged
SMI-Lab-Inha merged 2 commits into
devfrom
fix/slow-validation-tests
Dec 1, 2026
Merged

SMI-Lab-Inha merged 2 commits into
devfrom
fix/slow-validation-tests

Conversation

@SMI-Lab-Inha

@SMI-Lab-Inha SMI-Lab-Inha commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

The dev run after the 0.2.2 sync (#73) finished its Windows 3.11 job in 117 of its 120 minutes. One test took 74 minutes on that runner.

This PR removes the reason. The validation report and every row value are unchanged.

Cause

Test CI time before What it built
test_changed_wire_bending_fails_reported_comparison 28-50 min (74 min on the slow runner) the whole report, for the σ_B row
test_bending_work_report_compares_identical_measured_paths_and_units 20 min the whole report, for BM1-loop and BM1-ID
test_registered_targets_and_results_are_pinned (fixture) 14-45 min the SV11 rows, with every prediction computed twice

The double computation was a cache bug in check_saevik2011:

  • gate_values was lru_cache'd on its arguments, so gate_values() and gate_values(MU_DECLARED) were two cache entries;
  • the report's SV11 rows call the first and audit_values calls the second.

So every report build, the "report is current" job included, ran the 14 SV11 load cases twice.

Changes

  • run_validation.py: the σ_B block and the BM1-loop / BM1-ID block move unchanged into _sigma_b_row(menard) and _bm1_rows(menard). _rows() calls them where the blocks were, so the row order and values are the same.
  • test_validation_report.py:
    • the two tests call these builders instead of _rows();
    • the check that the retired rows BM1-loop-uniform and CH-GJ stay out of the report reads the recorded validation_report.md, which the CI job "Validation report is current" keeps equal to _rows().
  • check_saevik2011.py: gate_values and split_values now pass float(mu) to cached _gate_values / _split_values, so the cache is keyed on the value of μ. _clear_results clears the new caches.
  • test_saevik2011_benchmark.py:
    • the cache-clearing spy follows the rename;
    • a new test checks that gate_values(), gate_values(MU_DECLARED) and gate_values(mu=0.2) reach one cached result.

Local results

Single process, one thread, while other jobs used the machine.

Test Before After
σ_B row test whole report 0.02 s
BM1 row test whole report 27 s
SV11 rows (gate_values + lukassen_values + audit_values) 276 + 16 + 288 s 286 s
SV11 split rows (shared gate_values cached) 243 s 244 s

tests/test_validation_report.py and tests/test_saevik2011_benchmark.py: 25 passed. Ruff check and format are clean.

Not changed

  • No row, target, threshold or status. The report's test taxonomy line changes from full_scale: 62 passed to 63 passed, because the new cache test carries the module's full_scale marker; the CI "report is current" check found no other change beyond round-off.
  • No package code (src/cablexsec), so coverage is unaffected.

…port

Two tests built the whole validation report for one or two rows:
test_changed_wire_bending_fails_reported_comparison (sigma_B) and
test_bending_work_report_compares_identical_measured_paths_and_units
(BM1-loop, BM1-ID). The first was the longest test of the suite, 28-50
minutes on a CI runner and 74 minutes on a slow one, which left the
Windows 3.11 job three minutes inside its 120-minute limit on dev.

- run_validation: the sigma_B block and the BM1-loop/BM1-ID block move
  unchanged into _sigma_b_row and _bm1_rows; _rows calls them where the
  blocks were, so the report and its row order do not change.
- The two tests call these builders. The check that the retired rows
  BM1-loop-uniform and CH-GJ stay out of the report reads the recorded
  report, which CI keeps equal to _rows().
- check_saevik2011: gate_values and split_values were lru_cache'd on
  their arguments, so gate_values() (the report's SV11 rows) and
  gate_values(MU_DECLARED) (audit_values) were two entries and every
  report computed the SV11 predictions twice. The caches are now keyed
  on the value of mu (_gate_values, _split_values); a new test pins it.

Locally, single thread: sigma_B test 0.02 s, BM1 test 27 s, SV11 rows
286 s (gate_values 276 s plus audit_values 288 s before).

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 Dec 1, 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-12-01T02:40:49.640523Z e42d2a4 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 Dec 1, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CableXSec | 🛠️ Build #36284082 | 📁 Comparing e42d2a4 against latest (8f9befc)

  🔍 Preview build  

1 file changed
± changelog.html

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 7e63dc09f8

ℹ️ 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 cache test in tests/test_saevik2011_benchmark.py carries the
module's full_scale marker, so the taxonomy count of the report goes from
62 to 63. The CI check found no other change beyond round-off.

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. Hooray!

Reviewed commit: e42d2a4021

ℹ️ 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 3aa92d8 into dev Dec 1, 2026
14 checks passed
@SMI-Lab-Inha
SMI-Lab-Inha deleted the fix/slow-validation-tests branch December 2, 2026 06:37
SMI-Lab-Inha added a commit that referenced this pull request Dec 2, 2026
CableXSec 0.2.3: the global-analysis provenance record and the wave-grid
policy for the analysed line (#76), FAST.Farm table reading, and the
shortened slow validation tests (#75). Release record:
validation/RELEASE_0_2_3.md.

Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
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