Skip to content

refactor: drop the HFactor comparison arm from basis replay - #2009

Merged
rasros merged 3 commits into
mainfrom
refactor/drop-hfactor
Sep 15, 2026
Merged

rasros merged 3 commits into
mainfrom
refactor/drop-hfactor

Conversation

@rasros

@rasros rasros commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Drop the com.eignex:koblas-hfactor jvmTest dependency and the HfactorBasisSolver adapter.
  • Collapse basis-trace replay to one arm: BasisTraceReplay.replay returns a single report, and the peer-stop and cross-backend divergence paths are gone.
  • Rebuild every accepted update by a from-scratch Markowitz factorization of the same columns and solve through the rebuild. It runs after the residual check has accepted the basis and probes the same right-hand side, so it is a drift measurement rather than a third oracle: freshRelativeResidual is the accuracy a from-scratch build reaches on that probe, and freshDeclines is a conditioning signal.
  • Count a declining rebuild instead of failing it: the rebuild applies threshold partial pivoting under a bounded Markowitz search while an update accepts on an absolute pivot test alone, so the two disagree on badly scaled bases by construction, and LuBuildRejection is a floating-point decline rather than a rank claim.
  • Keep the rebuild's residual out of the measured arm's residual maxima and validity flag.
  • Widen persisted real corpus traces load and replay to cover mps-afiro as well, taking gate coverage of the rebuild from 2 accepted updates to 19.
  • Drop the backend, hfactorArtifactSha256, adapterInclusive, adapterCopyIsolation and not_comparable fields from the benchmark record schema.
  • Drop the hfactor arm from ForrestTomlinFactorsBenchmark, leaving the Forrest-Tomlin engine against the in-repo BasisEtaReference.
  • Remove the lp-wave2-hfactor campaign runner and document the retired comparison in klause-bench/README.md.

Why

Land this before Eignex/koblas#553, so klause stops consuming koblas-hfactor before koblas stops publishing it.

koblas removes the koblas-hfactor artifact. The comparison arm was test-only; production owns its basis factors on every target.

The replay already carried three oracles independent of the basis under test: the stored CSC source matrix, the captured factorization outcome, and the captured update acceptance. Most replay tests already passed KotlinBasisSolver as the reference arm, so the second arm was comparing the implementation with itself. The one check the HFactor arm did contribute, cross-checking update acceptance, was unreachable, because both arms failed against the captured outcome before the comparison ran. The fresh-basis oracle replaces it with a check that reaches the same basis by a different path.

Testing

mps-adlittle replays 47 of 47 accepted updates with freshDeclines 0, arm relativeResidual 3.0e-17 against rebuild freshRelativeResidual 2.8e-19.

./gradlew :klause:basisTrace --args="verify" replays all six real traces with replayErrors: 0, so the fresh-basis oracle agrees with every accepted update in the corpus. Added replay rejects an accepted update that leaves the basis unsolvable, which drives an update to a repeated basis column past a solver that reports it applied.

@rasros
rasros merged commit 445d1bd into main Sep 15, 2026
3 checks passed
@rasros
rasros deleted the refactor/drop-hfactor branch September 15, 2026 08:13
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.

1 participant