# CUDA Workspace Warning Fix Implementation Plan

> **For agentic workers:** Use superpowers:executing-plans to implement this focused fix inline.

**Goal:** Resolve repeated CuBLAS warnings at startup while retaining complete diagnostics.
**Architecture:** One standard-library bootstrap validates/defaults the workspace before
PyTorch import; shell launch exports it before any child process. GPU preflight
exercises deterministic linear forward/backward, and records the effective workspace.
**Tech Stack:** Python 3.10+, Bash, PyTorch 2.3+, unittest.
**Spec:** `PATCH_NOTES.md`; supplied warning log and pasted excerpt.

## Global Constraints

- Accept `:4096:8` and `:16:8`; default only an absent value.
- No blanket warning suppression or model/objective/protocol changes.
- Preserve completed-result integrity checks; use a new output directory across versions.
- Keep every existing research metric/table and CPU support.

## Review Focus

- Direct Python execution must configure the workspace before torch imports.
- A valid explicit override must reach shell children unchanged.
- Invalid and empty overrides must fail clearly, not flood an entire run.
- GPU preflight must cover backward as well as forward under deterministic mode.
- CUDA setting changes must affect the signature; no mixed-version resume.

### Task 1: Reproduce, fix, verify and package

**Files:** Add `s34_runtime.py`, `tests/test_runtime.py`; modify launcher,
entry points, environment metadata, README, validation evidence and package manifest.
**Interfaces:** `configure_cuda_workspace() -> str` performs idempotent environment
bootstrap without importing torch. Existing training interfaces stay unchanged.

- [ ] Add regressions for absent/valid/invalid workspace values, entry-point import
  order, shell-child environment and effective reproducibility metadata.
- [ ] Run `python -m unittest discover -s tests -p test_runtime.py -v`; observe
  expected failures before changing production code.
- [ ] Implement the bootstrap and wire shell/Python entry points; add deterministic
  CUDA forward/backward to `check_environment.py` with a targeted warning-as-error.
- [ ] Run focused tests, then `python -m unittest discover -s tests -v`.
  Expected: no failures; hardware-only GPU test skipped on CPU.
- [ ] Run a complete synthetic launcher with optional A3, inspect its full log,
  then run the same command with `--resume` and verify complete reporting.
- [ ] Obtain a focused independent review, address substantive findings with
  regressions, update docs/manifest, verify the ZIP and persist the deliverable.

Standalone isolated artifact directory; no Git repository or commit step applies.
