Skip to content

Canonical 19/19 KMeans parity gate is nondeterministic: identical SHAs produce disagreeing runs #373

Closed

Description

@godofecht

Distinct from #351. That issue is about the runtime_log2_ratio rule being symmetric, so genuine speedups fail it. This one is that the same job disagrees with itself on identical code.

Proof

Commit 33ec149, workflow Remaining issue implementation, job Canonical 19/19 KMeans parity:

Same SHA. Same job. Opposite results.

Corroborating evidence gathered across this campaign:

Why it matters

Every PR in the current optimization campaign carries this red mark, so the signal is now pure noise. Contributors are being trained to ignore the one gate that would catch a real parity regression, and reviewers cannot tell a genuine failure from the background rate.

Likely causes worth checking

The 4.77e-07 Ridge delta is at the edge of f32 resolution, and absolute_noise_floor in disparity_regression_policy.json is 1e-07, so a noise floor an order of magnitude too tight would explain the score half. The runtime half is wall-clock on a shared runner with no repeat-and-median, unlike run_headline.py which does repeat and take medians.

The push/pull_request split also means the job runs twice per commit, doubling the chance that at least one red mark appears on any given PR.

Related: #351 (symmetric rule), and the freeze-results dependency noted there means a failure on main prevents the baseline refreezing, so drift accumulates.

Activity

  1. godofecht commented on Aug 18, 2026

    @godofecht
    OwnerAuthor

    Second independent confirmation, from a different agent on a different file (ensemble.flow, the Bagging stack).

    Commit 2016062a, same workflow, two minutes apart:

    • run 32130402194, event push, 11:10:20Z — success
    • run 32130594097, event pull_request, 11:12:38Z — failure

    Identical SHA, opposite results, same push/pull_request split as the 33ec149 pair in the issue body.

    The failing run cites ('LogisticRegression','digits','accuracy') runtime log2 ratio 1.0785 -> -2.1404. Two things make that clearly spurious: LogisticRegression lives in linear.flow and is unreachable from anything in the Bagging stack, and the field being compared is wall-clock despite the tuple naming accuracy.

    Note the direction here is a drop of 3.2 in log2, i.e. Flow appearing to get dramatically slower on a row nobody touched, which is the runner being noisy rather than any real measurement.

    Also worth recording: the same gate is green on PR #387, which carries a genuine 577x change to bagging_regressor_predict. So the gate passed the one PR in that stack that actually moved a large amount of work, and failed the one that measured flat. That is the opposite of what a working regression detector would do.

    This is #373, not #351. The two are easy to confuse because they surface as the same red mark, and at least one agent in this campaign attributed this instance to the symmetric-rule bug. Worth keeping them distinct: #351 needs a policy change, this one needs the measurement to stop being wall-clock on a shared runner without repeat-and-median.

  2. godofecht commented on Aug 18, 2026

    @godofecht
    OwnerAuthor

    Root cause found, and both hypotheses in my issue body were wrong. Correcting the record.

    It is OpenBLAS thread count, left to runtime detection. Not the noise floor, and not the absence of repeat-and-median.

    Proven by a CI experiment pinning OPENBLAS_NUM_THREADS:

    row frozen 40-run median 1 thread 4 threads
    LogisticRegression/digits +1.08 +1.20 -1.88 +1.30
    KernelRidge_RBF/diabetes -2.98 -2.83 -4.20 -2.83

    -1.88 sits inside the -1.73..-2.48 band that every failing run reported, and at 1 thread the headline drops to 8 Flow wins, exactly as those runs logged. Flow's LogisticRegression calls cblas_sgemv twice per LBFGS iteration on a 1437x65 matrix and gains roughly 8x from threads; sklearn gains less, so the ratio swings about 3 log2 units whenever the library changes its mind about thread count.

    The same experiment moved KernelRidge_RBF's score_abs_diff from 1.79e-07 to 1.20e-07 on identical code, two float32 ulps. That is the same phenomenon as the 1.79e-07 -> 4.77e-07 moves the gate kept rejecting, so the score half and the runtime half have one cause, not two.

    My noise-floor hypothesis was directionally useful but wrong about the mechanism: 1e-07 IS below the float32 ulp scale of the metric it guards (scores near 0.5, one ulp = 3e-8), so it needed raising regardless. But raising it alone would not have fixed this.

    Two further findings that matter more than the ones I filed:

    environment_id hashes only the software stack, so it read c6f5f30d77c794d7 on passing and failing runs alike and same_environment_only: true never protected anything. The 40 sampled passing runs split into two hardware classes differing systematically by up to 0.51 log2; two runs of the same branch landed on an EPYC 9V74 and an EPYC 7763.

    The three main failures I cited in the issue body were not this gate at all. All three were freeze-results losing a concurrent git push race. I confirmed this in the run logs: ! [rejected] HEAD -> main (fetch first) in the Freeze validated evidence on main step. That is why the baseline went stale, and it is a different defect from the one this issue describes.

    Fix is in PR #401, which closes this and #351 together since they land in the same rule and code path.

  3. added a commit that references this issue on Aug 18, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions