Skip to content

Fix restricted-pointer cooperative handoffs and expand regressions - #45

Merged
plancherb1 merged 2 commits into
mainfrom
fix-restricted-handoffs
Oct 29, 2026
Merged

plancherb1 merged 2 commits into
mainfrom
fix-restricted-handoffs

Conversation

@plancherb1

Copy link
Copy Markdown
Member

Optimized kernels that pass __restrict__ pointers into GLASS can reuse stale values across cooperative handoffs despite existing barriers. The original 3×3 triangular solve returns an incorrect component; related softmax/logsumexp, pivoted inverse, LDLT, eigensolver and LU-pivot paths can return wrong results, access invalid memory or diverge.

Reload the affected handoffs explicitly, keeping the existing synchronization. The helper uses volatile loads for cooperating scopes and normal loads for the thread-only path. No dispatch defaults or hardware barriers are added. This covers issue #44 and related reproduced patterns.

The new regressions preserve the minimal failing kernel context alongside broader independent NumPy/SciPy checks. Generalizing the kernel initially masked all baseline failures, so both contexts remain. Coverage includes float/double, runtime and compile-time dimensions, shared/global buffers, ragged and multidimensional launches, triangle/transpose/unit flags, actual pivoting, and caller-owned trailing barriers. Banded solve, PCG and box-QP drivers now also test restricted callers at -O3.

Validation:

  • 5,538 exploratory cases passed; 78 focused final cases passed; 21 targeted CUDA sanitizer runs passed.
  • Strict docs, 669/669 overload contracts, 22 behavioral obligations, and shard-scope checks passed.
  • sm_120 resource canaries are unchanged. sm_90 triangular solve uses two additional registers (19 vs 17), with no stack/spills. sm_86 compile probe passed; runtime validation is on RTX 5090/sm_120, CUDA 13.2.
  • Narrow fresh-input timing checks stayed within roughly 4.3% of the correct baseline in the measured cells; limits and raw captures are in docs/audits/2026-10-28-restrict/.
  • All 5,126 tests passed in a fresh eight-shard GPU run, with no skips or carried shards. The signed receipt verifies with both the current pinned plugin and the prepared 0.5.0 CLI.
  • 240 additional random nonsymmetric/indefinite cases passed independent residual, inverse and eigensystem checks.

The audit records the corrected pivoted-inverse harness defect, rejected compiler-fence experiment, and remaining coverage gaps. Includes the reviewed dependency updates from #41 (theme 0.22.0) and #42 (deploy-pages 5.0.1). Holds #43 because Breathe 5 produced 84 warnings in an isolated strict docs build. The refreshed open queues contained no additional issues or PRs to integrate. No release tag is included.

Fixes #44.

@plancherb1
plancherb1 merged commit e7cc984 into main Oct 29, 2026
6 checks passed
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.

Block trsv / potrs return wrong results when x is passed through a caller's __restrict__ pointer

1 participant