Skip to content

test_refinement: static-pivot IR testset flaky on AMDGPU (1.94e-14 > 1e-14 after the repeated fixed-step solve) #179

Closed

Description

@michel2323

Found while working on: T34 (PR #178), CI run https://github.com/exanauts/SparseDirectSolver.jl/actions/runs/41653474967, amdgpu leg

What: test/test_refinement.jl, testset "refinement with static pivot perturbation (ROCm, Int64)", failed at line 65 with the stock DirectSolver (structure "S", pivot_pairs = "none", KKT generator 150/60):

Expression: relres(K, ir_solve(backend, solver, b; steps, tol = 0.0), b) <= 1.0e-14
 Evaluated: 1.940313717134235e-14 <= 1.0e-14

The same ROCm leg passed on main at c38e013 (runs 41270825226, 41084052320) and the CUDA and CPU legs of the PR pass. PR #178 changes only src/fused.jl, src/dense/capabilities.jl (two new hooks with no-op defaults), the CUDA extension, a bench script and docs; it does not touch the stock numeric path, the solve sweeps, iterative refinement or this test. So the failure is intermittent on the stock path.

The check asserts a hard-coded 1e-14 after re-running the exact number of refinement steps that the early-exit run (tol = 1e-14) took. With deterministic_mode = 0 (the default) the forward solve accumulates with atomics, so the residual after a fixed number of steps varies from run to run at the rounding level; a run that converged just under 1e-14 with the early exit can land just above it when repeated. 1.94e-14 against 1e-14 is that margin, not a wrong solution.

Why it is out of scope: a pre-existing test robustness problem on the stock path, surfaced by an unrelated PR's CI run; T34 may not edit tests outside its scope.

Suggested fix or plan change: make the second assertion relative to the first (<= 2 * relres(K, x, b) or <= 10 * 1e-14), or run that testset with deterministic_mode = 1 so the two solves are bitwise reproducible; alternatively generate the matrix with a margin so the early-exit run lands well below the tolerance.

Activity

  1. added
    found-by-agent
    on Nov 3, 2026
  2. added 2 commits that reference this issue on Nov 3, 2026
    83dc7a0
    452ab2a
  3. michel2323 commented on Nov 3, 2026

    @michel2323
    MemberAuthor

    Fixed on PR #178 by owner decision (commit 83dc7a0): the testset runs with deterministic_mode = 1 and compares the repeated fixed-step solve with the early-exit residual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    found-by-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions