Fix 7 bugs, add 23 tests, rewrite docs with usage guide - #1
Merged
Conversation
…date docs
Assertion fixes:
- Fixed dead code in baseline_2x path (redundant ternaries simplified)
- Fixed mixed-precision dtype resolution to use lower-precision dtype
- Added int-vs-float dtype handling (float always wins for tolerance lookup)
- Narrowed RuntimeError catch in GPU fast-path to avoid swallowing CUDA errors
- Added same-device check for multi-GPU GPU fast-path safety
- Added shape equality guard before torch.allclose
Architecture fixes:
- Blackwell SM100 now reports "Blackwell-DC", SM120 reports "Blackwell-Consumer"
- Added alias system so require_arch("Blackwell") matches both variants
- Fixed check_compatibility to search detailed arch map before main map
Plugin fixes:
- Removed dead _register_fixtures() function
- Wired --gpu-device CLI option into gpu_device fixture
- gpu_device fixture now always returns GPUDevice (not raw string)
- Added device ordinal validation for CLI override
Other fixes:
- Removed no-op unique_counts.tolist() in Mann-Whitney U
- Added peak_flops field to RooflinePoint for correct bottleneck classification
- Refactored CI annotations to table-driven with :: injection sanitization
- Fixed examples to convert dtype strings via getattr(torch, dtype)
Test additions:
- 5 tests for baseline_2x and mixed-precision dtype resolution
- 7 tests for Blackwell naming consistency and alias expansion
- 10 tests for CI annotation format, JUnit XML, and PR comments
- GPU integration test fixes for GTX 1650 tensor core edge case
- Added conftest.py and init fixture for benchmark deep analysis
Documentation:
- Rewrote README with step-by-step usage guide tested on GTX 1650
- Added tested hardware section with validation details
- Added mixed-precision tolerance behavior explanation
- Updated project structure with full module descriptions
- Added CLAUDE.md and expert system for development guidance
408 tests passing (120 unit + 53 examples + 235 GPU integration)
Validated on NVIDIA GeForce GTX 1650, PyTorch 2.11.0, CUDA 13.0
Akasxh
added a commit
that referenced
this pull request
May 7, 2026
… (T-01) Replace the module-level `try: import torch as _torch / _has_torch` block in `src/gpucheck/assertions/close.py` with a cached `_torch_mod()` helper that performs the import only when an API needs it. Both call sites inside `assert_close` (device-type detection and the GPU fast-path) bind `_torch = _torch_mod()` at the top of the function and guard with `_torch is not None`. Verified via `python -c "import gpucheck.assertions.close; import sys; assert 'torch' not in sys.modules"`. All 32 tests in test_assertions.py remain green. Source: detector-files Top-3 #1; synthesist ISS-08; planner T-01. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Akasxh
added a commit
that referenced
this pull request
May 7, 2026
…ector-files #1, partial) Two parallel detection stacks lived at: - arch/detection.py:133,206 (pynvml + torch -> list[GPUInfo]) - fixtures/gpu.py:43,90 (pynvml + torch -> GPUDevice) Drift risk: the two stacks had different fallbacks (NVMLError vs RuntimeError vs AssertionError catches) and different "no backend" behavior (one warned, the other silently returned None). Now there is exactly one detection codepath: arch/detection._detect_gpus_or_warn() -> list[GPUInfo] | None `-- arch/detection.detect_gpus() (lru_cache wrapper, public API, maps None -> []) `-- fixtures/gpu.detect_gpu() (calls detect_gpus(), adapts the first GPUInfo to the smaller GPUDevice via _to_device()) Public API preserved: - arch.detect_gpus() still returns list[GPUInfo] (empty list on no backend; was already that way). - fixtures.gpu.detect_gpu() still returns GPUDevice | None. - The "no detection backend available" UserWarning is preserved (and is now lru_cache-deduped, firing at most once per session via detect_gpus()). The plugin.py shim (`_lazy_detect_gpus` / `_gpu_available` / `_gpu_count` at plugin.py:10-22) is owned by another agent per task instructions and left untouched; the helper this commit introduces is the foundation that agent's plugin.py refactor can call into. Removed: - fixtures/gpu._detect_gpu_pynvml (~45 LOC) - fixtures/gpu._detect_gpu_torch (~25 LOC) Acceptance: ruff check src/gpucheck/arch/ src/gpucheck/fixtures/gpu.py -> clean mypy src/ -> clean pytest -q -> 230 passed, 1 skipped (unchanged)
Akasxh
added a commit
that referenced
this pull request
May 7, 2026
… ~30 mutants) Add `TestMismatchReportPinnedNumerics` to tests/test_assertions.py with three new tests that lock down exact numeric values in `format_mismatch_report` output: 1. `test_max_abs_error_value_is_pinned` — pins max abs error (4.5) and mean abs error (2.5) values, plus row labels. 2. `test_mismatch_count_and_location_are_pinned` — pins `5 / 6 (83.33%)` count/total/percentage and 2-D max-error location `(1, 2)` (forces unravel_index axis mutations to fail). 3. `test_histogram_present_with_pinned_bucket_and_count` — pins histogram bucket label `[1e-3, 1e-2)` and count 3 (ANSI-stripped). Targets `assertions/reporting.py` mutator survivors documented in `EVIDENCE/mutator-survivors.md` top-leverage #1 (~30 surviving mutants). No source changes to reporting.py — tests-only per planner T-10. Test count 230 → 233 passed, 1 skipped. ruff: clean. mypy: clean. Source: planner T-10; mutator-survivors top-leverage #1; synthesist ISS-25. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug fixes
Test plan