Skip to content

test: convert legacy GPU diagnostic scripts into maintained pytest coverage #83

Description

@TheHiddenObserver

Context

PR #79 completed its maintained physical-GPU acceptance suite on a Tesla P100 with 33 passed, 2 skipped, 0 failed. During the same remote run, several ignored or script-style files under dev/tests/ were also executed manually. They are not part of the maintained pytest Gate and currently produce collection/runtime failures or zero collected tests.

This issue tracks cleanup and promotion of any still-useful checks into maintained, deterministic pytest coverage. It is a follow-up and does not block PR #79.

Affected legacy scripts

  • dev/tests/test_coxph_3backends.py
    • executes work at module import time;
    • currently reaches a CuPy CoxPH runtime error on the P100 environment.
  • dev/tests/test_irls_gpu.py
    • requires a missing loss_name fixture;
    • currently ignored by .gitignore.
  • dev/tests/test_lasso_cv_torch_quick.py
    • script-style execution at import time;
    • pytest collects zero tests.
  • dev/tests/test_ridge_cv_torch_backend.py
    • script-style execution at import time;
    • pytest collects zero tests.
  • dev/tests/test_torch_comprehensive.py
    • script-style execution at import time;
    • pytest collects zero tests.
  • dev/tests/test_lassocv_inference_simple.py
    • uses an older inference API contract and is rejected by current validation.

Goals

  1. Decide for each file whether to:
    • convert it into maintained pytest tests;
    • replace it with existing PR79/backend regression coverage;
    • move it to an explicitly named manual/diagnostic directory; or
    • delete it as obsolete.
  2. Remove all module-import side effects from tests.
  3. Add explicit CUDA/CuPy/Torch capability markers and deterministic skip reasons.
  4. Eliminate undeclared fixture dependencies.
  5. Align inference tests with the current public API and strict unsupported-combination contracts.
  6. Ensure maintained GPU tests run from a clean checkout rather than relying on ignored local files.

Required base/head triage

For runtime failures that exercise production code—especially CoxPH and LassoCV inference—run the minimized reproducer on both:

  • PR79 base: a4879fb4d9fb183efc01f147cd2cc501691f28c4
  • current post-PR79 code

Classify each result as:

  • verified pre-existing production issue;
  • obsolete test expectation;
  • test harness defect; or
  • new regression.

Do not label a production-path failure as pre-existing without this base/head comparison.

Acceptance criteria

  • No retained test performs substantial computation at import time.
  • Every retained file contains discoverable pytest test functions/classes.
  • GPU requirements use explicit markers/skip conditions.
  • Missing fixtures are defined or the dependency is removed.
  • Current inference contracts are asserted explicitly.
  • Base/head classification is recorded for production-path failures.
  • Maintained CPU test suite remains green.
  • Maintained physical-GPU suite remains green.
  • .gitignore rules are simplified so maintained tests are tracked and manual scripts are clearly separated.

Suggested structure

dev/tests/
  test_*_gpu.py              # maintained pytest coverage

dev/manual/
  gpu_diagnostics/           # intentionally manual scripts

Environment observed during PR79 follow-up

  • Python 3.9.16
  • CuPy 13.6.0
  • Torch 2.0.0+cu117
  • Tesla P100-SXM2-16GB
  • pytest 8.4.2

Related: PR #79.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions